Orthanc Plugin SDK  1.7.4
Documentation of the plugin interface of Orthanc
OrthancCPlugin.h
1 
104 #pragma once
105 
106 
107 #include <stdio.h>
108 #include <string.h>
109 
110 #ifdef WIN32
111 # define ORTHANC_PLUGINS_API __declspec(dllexport)
112 #elif __GNUC__ >= 4
113 # define ORTHANC_PLUGINS_API __attribute__ ((visibility ("default")))
114 #else
115 # define ORTHANC_PLUGINS_API
116 #endif
117 
118 #define ORTHANC_PLUGINS_MINIMAL_MAJOR_NUMBER 1
119 #define ORTHANC_PLUGINS_MINIMAL_MINOR_NUMBER 7
120 #define ORTHANC_PLUGINS_MINIMAL_REVISION_NUMBER 2
121 
122 
123 #if !defined(ORTHANC_PLUGINS_VERSION_IS_ABOVE)
124 #define ORTHANC_PLUGINS_VERSION_IS_ABOVE(major, minor, revision) \
125  (ORTHANC_PLUGINS_MINIMAL_MAJOR_NUMBER > major || \
126  (ORTHANC_PLUGINS_MINIMAL_MAJOR_NUMBER == major && \
127  (ORTHANC_PLUGINS_MINIMAL_MINOR_NUMBER > minor || \
128  (ORTHANC_PLUGINS_MINIMAL_MINOR_NUMBER == minor && \
129  ORTHANC_PLUGINS_MINIMAL_REVISION_NUMBER >= revision))))
130 #endif
131 
132 
133 
134 /********************************************************************
135  ** Check that function inlining is properly supported. The use of
136  ** inlining is required, to avoid the duplication of object code
137  ** between two compilation modules that would use the Orthanc Plugin
138  ** API.
139  ********************************************************************/
140 
141 /* If the auto-detection of the "inline" keyword below does not work
142  automatically and that your compiler is known to properly support
143  inlining, uncomment the following #define and adapt the definition
144  of "static inline". */
145 
146 /* #define ORTHANC_PLUGIN_INLINE static inline */
147 
148 #ifndef ORTHANC_PLUGIN_INLINE
149 # if __STDC_VERSION__ >= 199901L
150 /* This is C99 or above: http://predef.sourceforge.net/prestd.html */
151 # define ORTHANC_PLUGIN_INLINE static inline
152 # elif defined(__cplusplus)
153 /* This is C++ */
154 # define ORTHANC_PLUGIN_INLINE static inline
155 # elif defined(__GNUC__)
156 /* This is GCC running in C89 mode */
157 # define ORTHANC_PLUGIN_INLINE static __inline
158 # elif defined(_MSC_VER)
159 /* This is Visual Studio running in C89 mode */
160 # define ORTHANC_PLUGIN_INLINE static __inline
161 # else
162 # error Your compiler is not known to support the "inline" keyword
163 # endif
164 #endif
165 
166 
167 
168 /********************************************************************
169  ** Inclusion of standard libraries.
170  ********************************************************************/
171 
177 #include <stdint.h>
178 
179 #include <stdlib.h>
180 
181 
182 
183 /********************************************************************
184  ** Definition of the Orthanc Plugin API.
185  ********************************************************************/
186 
189 #ifdef __cplusplus
190 extern "C"
191 {
192 #endif
193 
197  typedef enum
198  {
302 
303  _OrthancPluginErrorCode_INTERNAL = 0x7fffffff
305 
306 
311  ORTHANC_PLUGINS_API const char* OrthancPluginGetName();
312 
313 
317  typedef enum
318  {
324  _OrthancPluginHttpMethod_INTERNAL = 0x7fffffff
326 
327 
332  typedef struct
333  {
338 
342  uint32_t groupsCount;
343 
347  const char* const* groups;
348 
352  uint32_t getCount;
353 
357  const char* const* getKeys;
358 
362  const char* const* getValues;
363 
367  const void* body;
368 
372  uint32_t bodySize;
373 
374 
375  /* --------------------------------------------------
376  New in version 0.8.1
377  -------------------------------------------------- */
378 
382  uint32_t headersCount;
383 
387  const char* const* headersKeys;
388 
392  const char* const* headersValues;
393 
395 
396 
397  typedef enum
398  {
399  /* Generic services */
400  _OrthancPluginService_LogInfo = 1,
401  _OrthancPluginService_LogWarning = 2,
402  _OrthancPluginService_LogError = 3,
403  _OrthancPluginService_GetOrthancPath = 4,
404  _OrthancPluginService_GetOrthancDirectory = 5,
405  _OrthancPluginService_GetConfigurationPath = 6,
406  _OrthancPluginService_SetPluginProperty = 7,
407  _OrthancPluginService_GetGlobalProperty = 8,
408  _OrthancPluginService_SetGlobalProperty = 9,
409  _OrthancPluginService_GetCommandLineArgumentsCount = 10,
410  _OrthancPluginService_GetCommandLineArgument = 11,
411  _OrthancPluginService_GetExpectedDatabaseVersion = 12,
412  _OrthancPluginService_GetConfiguration = 13,
413  _OrthancPluginService_BufferCompression = 14,
414  _OrthancPluginService_ReadFile = 15,
415  _OrthancPluginService_WriteFile = 16,
416  _OrthancPluginService_GetErrorDescription = 17,
417  _OrthancPluginService_CallHttpClient = 18,
418  _OrthancPluginService_RegisterErrorCode = 19,
419  _OrthancPluginService_RegisterDictionaryTag = 20,
420  _OrthancPluginService_DicomBufferToJson = 21,
421  _OrthancPluginService_DicomInstanceToJson = 22,
422  _OrthancPluginService_CreateDicom = 23,
423  _OrthancPluginService_ComputeMd5 = 24,
424  _OrthancPluginService_ComputeSha1 = 25,
425  _OrthancPluginService_LookupDictionary = 26,
426  _OrthancPluginService_CallHttpClient2 = 27,
427  _OrthancPluginService_GenerateUuid = 28,
428  _OrthancPluginService_RegisterPrivateDictionaryTag = 29,
429  _OrthancPluginService_AutodetectMimeType = 30,
430  _OrthancPluginService_SetMetricsValue = 31,
431  _OrthancPluginService_EncodeDicomWebJson = 32,
432  _OrthancPluginService_EncodeDicomWebXml = 33,
433  _OrthancPluginService_ChunkedHttpClient = 34, /* New in Orthanc 1.5.7 */
434  _OrthancPluginService_GetTagName = 35, /* New in Orthanc 1.5.7 */
435  _OrthancPluginService_EncodeDicomWebJson2 = 36, /* New in Orthanc 1.7.0 */
436  _OrthancPluginService_EncodeDicomWebXml2 = 37, /* New in Orthanc 1.7.0 */
437  _OrthancPluginService_CreateMemoryBuffer = 38, /* New in Orthanc 1.7.0 */
438 
439  /* Registration of callbacks */
440  _OrthancPluginService_RegisterRestCallback = 1000,
441  _OrthancPluginService_RegisterOnStoredInstanceCallback = 1001,
442  _OrthancPluginService_RegisterStorageArea = 1002,
443  _OrthancPluginService_RegisterOnChangeCallback = 1003,
444  _OrthancPluginService_RegisterRestCallbackNoLock = 1004,
445  _OrthancPluginService_RegisterWorklistCallback = 1005,
446  _OrthancPluginService_RegisterDecodeImageCallback = 1006,
447  _OrthancPluginService_RegisterIncomingHttpRequestFilter = 1007,
448  _OrthancPluginService_RegisterFindCallback = 1008,
449  _OrthancPluginService_RegisterMoveCallback = 1009,
450  _OrthancPluginService_RegisterIncomingHttpRequestFilter2 = 1010,
451  _OrthancPluginService_RegisterRefreshMetricsCallback = 1011,
452  _OrthancPluginService_RegisterChunkedRestCallback = 1012, /* New in Orthanc 1.5.7 */
453  _OrthancPluginService_RegisterStorageCommitmentScpCallback = 1013,
454  _OrthancPluginService_RegisterIncomingDicomInstanceFilter = 1014,
455  _OrthancPluginService_RegisterTranscoderCallback = 1015, /* New in Orthanc 1.7.0 */
456 
457  /* Sending answers to REST calls */
458  _OrthancPluginService_AnswerBuffer = 2000,
459  _OrthancPluginService_CompressAndAnswerPngImage = 2001, /* Unused as of Orthanc 0.9.4 */
460  _OrthancPluginService_Redirect = 2002,
461  _OrthancPluginService_SendHttpStatusCode = 2003,
462  _OrthancPluginService_SendUnauthorized = 2004,
463  _OrthancPluginService_SendMethodNotAllowed = 2005,
464  _OrthancPluginService_SetCookie = 2006,
465  _OrthancPluginService_SetHttpHeader = 2007,
466  _OrthancPluginService_StartMultipartAnswer = 2008,
467  _OrthancPluginService_SendMultipartItem = 2009,
468  _OrthancPluginService_SendHttpStatus = 2010,
469  _OrthancPluginService_CompressAndAnswerImage = 2011,
470  _OrthancPluginService_SendMultipartItem2 = 2012,
471  _OrthancPluginService_SetHttpErrorDetails = 2013,
472 
473  /* Access to the Orthanc database and API */
474  _OrthancPluginService_GetDicomForInstance = 3000,
475  _OrthancPluginService_RestApiGet = 3001,
476  _OrthancPluginService_RestApiPost = 3002,
477  _OrthancPluginService_RestApiDelete = 3003,
478  _OrthancPluginService_RestApiPut = 3004,
479  _OrthancPluginService_LookupPatient = 3005,
480  _OrthancPluginService_LookupStudy = 3006,
481  _OrthancPluginService_LookupSeries = 3007,
482  _OrthancPluginService_LookupInstance = 3008,
483  _OrthancPluginService_LookupStudyWithAccessionNumber = 3009,
484  _OrthancPluginService_RestApiGetAfterPlugins = 3010,
485  _OrthancPluginService_RestApiPostAfterPlugins = 3011,
486  _OrthancPluginService_RestApiDeleteAfterPlugins = 3012,
487  _OrthancPluginService_RestApiPutAfterPlugins = 3013,
488  _OrthancPluginService_ReconstructMainDicomTags = 3014,
489  _OrthancPluginService_RestApiGet2 = 3015,
490 
491  /* Access to DICOM instances */
492  _OrthancPluginService_GetInstanceRemoteAet = 4000,
493  _OrthancPluginService_GetInstanceSize = 4001,
494  _OrthancPluginService_GetInstanceData = 4002,
495  _OrthancPluginService_GetInstanceJson = 4003,
496  _OrthancPluginService_GetInstanceSimplifiedJson = 4004,
497  _OrthancPluginService_HasInstanceMetadata = 4005,
498  _OrthancPluginService_GetInstanceMetadata = 4006,
499  _OrthancPluginService_GetInstanceOrigin = 4007,
500  _OrthancPluginService_GetInstanceTransferSyntaxUid = 4008,
501  _OrthancPluginService_HasInstancePixelData = 4009,
502  _OrthancPluginService_CreateDicomInstance = 4010, /* New in Orthanc 1.7.0 */
503  _OrthancPluginService_FreeDicomInstance = 4011, /* New in Orthanc 1.7.0 */
504  _OrthancPluginService_GetInstanceFramesCount = 4012, /* New in Orthanc 1.7.0 */
505  _OrthancPluginService_GetInstanceRawFrame = 4013, /* New in Orthanc 1.7.0 */
506  _OrthancPluginService_GetInstanceDecodedFrame = 4014, /* New in Orthanc 1.7.0 */
507  _OrthancPluginService_TranscodeDicomInstance = 4015, /* New in Orthanc 1.7.0 */
508  _OrthancPluginService_SerializeDicomInstance = 4016, /* New in Orthanc 1.7.0 */
509  _OrthancPluginService_GetInstanceAdvancedJson = 4017, /* New in Orthanc 1.7.0 */
510  _OrthancPluginService_GetInstanceDicomWebJson = 4018, /* New in Orthanc 1.7.0 */
511  _OrthancPluginService_GetInstanceDicomWebXml = 4019, /* New in Orthanc 1.7.0 */
512 
513  /* Services for plugins implementing a database back-end */
514  _OrthancPluginService_RegisterDatabaseBackend = 5000,
515  _OrthancPluginService_DatabaseAnswer = 5001,
516  _OrthancPluginService_RegisterDatabaseBackendV2 = 5002,
517  _OrthancPluginService_StorageAreaCreate = 5003,
518  _OrthancPluginService_StorageAreaRead = 5004,
519  _OrthancPluginService_StorageAreaRemove = 5005,
520 
521  /* Primitives for handling images */
522  _OrthancPluginService_GetImagePixelFormat = 6000,
523  _OrthancPluginService_GetImageWidth = 6001,
524  _OrthancPluginService_GetImageHeight = 6002,
525  _OrthancPluginService_GetImagePitch = 6003,
526  _OrthancPluginService_GetImageBuffer = 6004,
527  _OrthancPluginService_UncompressImage = 6005,
528  _OrthancPluginService_FreeImage = 6006,
529  _OrthancPluginService_CompressImage = 6007,
530  _OrthancPluginService_ConvertPixelFormat = 6008,
531  _OrthancPluginService_GetFontsCount = 6009,
532  _OrthancPluginService_GetFontInfo = 6010,
533  _OrthancPluginService_DrawText = 6011,
534  _OrthancPluginService_CreateImage = 6012,
535  _OrthancPluginService_CreateImageAccessor = 6013,
536  _OrthancPluginService_DecodeDicomImage = 6014,
537 
538  /* Primitives for handling C-Find, C-Move and worklists */
539  _OrthancPluginService_WorklistAddAnswer = 7000,
540  _OrthancPluginService_WorklistMarkIncomplete = 7001,
541  _OrthancPluginService_WorklistIsMatch = 7002,
542  _OrthancPluginService_WorklistGetDicomQuery = 7003,
543  _OrthancPluginService_FindAddAnswer = 7004,
544  _OrthancPluginService_FindMarkIncomplete = 7005,
545  _OrthancPluginService_GetFindQuerySize = 7006,
546  _OrthancPluginService_GetFindQueryTag = 7007,
547  _OrthancPluginService_GetFindQueryTagName = 7008,
548  _OrthancPluginService_GetFindQueryValue = 7009,
549  _OrthancPluginService_CreateFindMatcher = 7010,
550  _OrthancPluginService_FreeFindMatcher = 7011,
551  _OrthancPluginService_FindMatcherIsMatch = 7012,
552 
553  /* Primitives for accessing Orthanc Peers (new in 1.4.2) */
554  _OrthancPluginService_GetPeers = 8000,
555  _OrthancPluginService_FreePeers = 8001,
556  _OrthancPluginService_GetPeersCount = 8003,
557  _OrthancPluginService_GetPeerName = 8004,
558  _OrthancPluginService_GetPeerUrl = 8005,
559  _OrthancPluginService_CallPeerApi = 8006,
560  _OrthancPluginService_GetPeerUserProperty = 8007,
561 
562  /* Primitives for handling jobs (new in 1.4.2) */
563  _OrthancPluginService_CreateJob = 9000,
564  _OrthancPluginService_FreeJob = 9001,
565  _OrthancPluginService_SubmitJob = 9002,
566  _OrthancPluginService_RegisterJobsUnserializer = 9003,
567 
568  _OrthancPluginService_INTERNAL = 0x7fffffff
569  } _OrthancPluginService;
570 
571 
572  typedef enum
573  {
574  _OrthancPluginProperty_Description = 1,
575  _OrthancPluginProperty_RootUri = 2,
576  _OrthancPluginProperty_OrthancExplorer = 3,
577 
578  _OrthancPluginProperty_INTERNAL = 0x7fffffff
579  } _OrthancPluginProperty;
580 
581 
582 
587  typedef enum
588  {
596 
604 
612 
620 
628 
638 
646 
654 
662 
670 
671  _OrthancPluginPixelFormat_INTERNAL = 0x7fffffff
673 
674 
675 
679  typedef enum
680  {
685  _OrthancPluginContentType_INTERNAL = 0x7fffffff
687 
688 
689 
693  typedef enum
694  {
701  _OrthancPluginResourceType_INTERNAL = 0x7fffffff
703 
704 
705 
710  typedef enum
711  {
732  _OrthancPluginChangeType_INTERNAL = 0x7fffffff
734 
735 
740  typedef enum
741  {
747  _OrthancPluginCompressionType_INTERNAL = 0x7fffffff
749 
750 
755  typedef enum
756  {
761  _OrthancPluginImageFormat_INTERNAL = 0x7fffffff
763 
764 
769  typedef enum
770  {
799  _OrthancPluginValueRepresentation_INTERNAL = 0x7fffffff
801 
802 
808  typedef enum
809  {
814  _OrthancPluginDicomToJsonFormat_INTERNAL = 0x7fffffff
816 
817 
823  typedef enum
824  {
825  OrthancPluginDicomToJsonFlags_None = 0,
833  _OrthancPluginDicomToJsonFlags_INTERNAL = 0x7fffffff
835 
836 
842  typedef enum
843  {
844  OrthancPluginCreateDicomFlags_None = 0,
848  _OrthancPluginCreateDicomFlags_INTERNAL = 0x7fffffff
850 
851 
857  typedef enum
858  {
864  _OrthancPluginIdentifierConstraint_INTERNAL = 0x7fffffff
866 
867 
872  typedef enum
873  {
880  _OrthancPluginConstraintType_INTERNAL = 0x7fffffff
882 
883 
887  typedef enum
888  {
895  _OrthancPluginInstanceOrigin_INTERNAL = 0x7fffffff
897 
898 
902  typedef enum
903  {
908 
909 
916  typedef enum
917  {
923 
924 
928  typedef enum
929  {
939 
940 
945  typedef enum
946  {
951 
952 
958  typedef enum
959  {
987 
988 
989 
997  typedef struct
998  {
1002  void* data;
1003 
1007  uint32_t size;
1009 
1010 
1011 
1012 
1017  typedef struct _OrthancPluginRestOutput_t OrthancPluginRestOutput;
1018 
1019 
1020 
1025  typedef struct _OrthancPluginDicomInstance_t OrthancPluginDicomInstance;
1026 
1027 
1028 
1033  typedef struct _OrthancPluginImage_t OrthancPluginImage;
1034 
1035 
1036 
1041  typedef struct _OrthancPluginStorageArea_t OrthancPluginStorageArea;
1042 
1043 
1044 
1049  typedef struct _OrthancPluginWorklistQuery_t OrthancPluginWorklistQuery;
1050 
1051 
1052 
1057  typedef struct _OrthancPluginWorklistAnswers_t OrthancPluginWorklistAnswers;
1058 
1059 
1060 
1065  typedef struct _OrthancPluginFindQuery_t OrthancPluginFindQuery;
1066 
1067 
1068 
1073  typedef struct _OrthancPluginFindAnswers_t OrthancPluginFindAnswers;
1074 
1075 
1076 
1081  typedef struct _OrthancPluginFindMatcher_t OrthancPluginFindMatcher;
1082 
1083 
1084 
1089  typedef struct _OrthancPluginPeers_t OrthancPluginPeers;
1090 
1091 
1092 
1097  typedef struct _OrthancPluginJob_t OrthancPluginJob;
1098 
1099 
1100 
1106  typedef struct _OrthancPluginDicomWebNode_t OrthancPluginDicomWebNode;
1107 
1108 
1109 
1115  OrthancPluginRestOutput* output,
1116  const char* url,
1117  const OrthancPluginHttpRequest* request);
1118 
1119 
1120 
1126  const OrthancPluginDicomInstance* instance,
1127  const char* instanceId);
1128 
1129 
1130 
1136  OrthancPluginChangeType changeType,
1137  OrthancPluginResourceType resourceType,
1138  const char* resourceId);
1139 
1140 
1141 
1147  OrthancPluginImage** target,
1148  const void* dicom,
1149  const uint32_t size,
1150  uint32_t frameIndex);
1151 
1152 
1153 
1158  typedef void (*OrthancPluginFree) (void* buffer);
1159 
1160 
1161 
1171  const char* bulkDataUri);
1172 
1173 
1174 
1188  const char* uuid,
1189  const void* content,
1190  int64_t size,
1192 
1193 
1194 
1214  void** content,
1215  int64_t* size,
1216  const char* uuid,
1218 
1219 
1220 
1232  const char* uuid,
1234 
1235 
1236 
1252  const OrthancPluginWorklistQuery* query,
1253  const char* issuerAet,
1254  const char* calledAet);
1255 
1256 
1257 
1278  OrthancPluginHttpMethod method,
1279  const char* uri,
1280  const char* ip,
1281  uint32_t headersCount,
1282  const char* const* headersKeys,
1283  const char* const* headersValues);
1284 
1285 
1286 
1309  OrthancPluginHttpMethod method,
1310  const char* uri,
1311  const char* ip,
1312  uint32_t headersCount,
1313  const char* const* headersKeys,
1314  const char* const* headersValues,
1315  uint32_t getArgumentsCount,
1316  const char* const* getArgumentsKeys,
1317  const char* const* getArgumentsValues);
1318 
1319 
1320 
1336  OrthancPluginFindAnswers* answers,
1337  const OrthancPluginFindQuery* query,
1338  const char* issuerAet,
1339  const char* calledAet);
1340 
1341 
1342 
1378  typedef void* (*OrthancPluginMoveCallback) (
1379  OrthancPluginResourceType resourceType,
1380  const char* patientId,
1381  const char* accessionNumber,
1382  const char* studyInstanceUid,
1383  const char* seriesInstanceUid,
1384  const char* sopInstanceUid,
1385  const char* originatorAet,
1386  const char* sourceAet,
1387  const char* targetAet,
1388  uint16_t originatorId);
1389 
1390 
1403  typedef uint32_t (*OrthancPluginGetMoveSize) (void* moveDriver);
1404 
1405 
1418  typedef OrthancPluginErrorCode (*OrthancPluginApplyMove) (void* moveDriver);
1419 
1420 
1432  typedef void (*OrthancPluginFreeMove) (void* moveDriver);
1433 
1434 
1445  typedef void (*OrthancPluginJobFinalize) (void* job);
1446 
1447 
1458  typedef float (*OrthancPluginJobGetProgress) (void* job);
1459 
1460 
1473  typedef const char* (*OrthancPluginJobGetContent) (void* job);
1474 
1475 
1491  typedef const char* (*OrthancPluginJobGetSerialized) (void* job);
1492 
1493 
1507 
1508 
1532 
1533 
1548 
1549 
1563  typedef OrthancPluginJob* (*OrthancPluginJobsUnserializer) (const char* jobType,
1564  const char* serialized);
1565 
1566 
1567 
1582 
1583 
1584 
1612  uint32_t levelDepth,
1613  const uint16_t* levelTagGroup,
1614  const uint16_t* levelTagElement,
1615  const uint32_t* levelIndex,
1616  uint16_t tagGroup,
1617  uint16_t tagElement,
1619 
1620 
1621 
1650  uint32_t levelDepth,
1651  const uint16_t* levelTagGroup,
1652  const uint16_t* levelTagElement,
1653  const uint32_t* levelIndex,
1654  uint16_t tagGroup,
1655  uint16_t tagElement,
1657  void* payload);
1658 
1659 
1660 
1664  typedef struct _OrthancPluginContext_t
1665  {
1666  void* pluginsManager;
1667  const char* orthancVersion;
1668  OrthancPluginFree Free;
1669  OrthancPluginErrorCode (*InvokeService) (struct _OrthancPluginContext_t* context,
1670  _OrthancPluginService service,
1671  const void* params);
1673 
1674 
1675 
1679  typedef struct
1680  {
1681  uint16_t group;
1682  uint16_t element;
1684  uint32_t minMultiplicity;
1685  uint32_t maxMultiplicity;
1687 
1688 
1689 
1698  ORTHANC_PLUGIN_INLINE void OrthancPluginFreeString(
1699  OrthancPluginContext* context,
1700  char* str)
1701  {
1702  if (str != NULL)
1703  {
1704  context->Free(str);
1705  }
1706  }
1707 
1708 
1728  ORTHANC_PLUGIN_INLINE int OrthancPluginCheckVersionAdvanced(
1729  OrthancPluginContext* context,
1730  int expectedMajor,
1731  int expectedMinor,
1732  int expectedRevision)
1733  {
1734  int major, minor, revision;
1735 
1736  if (sizeof(int32_t) != sizeof(OrthancPluginErrorCode) ||
1737  sizeof(int32_t) != sizeof(OrthancPluginHttpMethod) ||
1738  sizeof(int32_t) != sizeof(_OrthancPluginService) ||
1739  sizeof(int32_t) != sizeof(_OrthancPluginProperty) ||
1740  sizeof(int32_t) != sizeof(OrthancPluginPixelFormat) ||
1741  sizeof(int32_t) != sizeof(OrthancPluginContentType) ||
1742  sizeof(int32_t) != sizeof(OrthancPluginResourceType) ||
1743  sizeof(int32_t) != sizeof(OrthancPluginChangeType) ||
1744  sizeof(int32_t) != sizeof(OrthancPluginCompressionType) ||
1745  sizeof(int32_t) != sizeof(OrthancPluginImageFormat) ||
1746  sizeof(int32_t) != sizeof(OrthancPluginValueRepresentation) ||
1747  sizeof(int32_t) != sizeof(OrthancPluginDicomToJsonFormat) ||
1748  sizeof(int32_t) != sizeof(OrthancPluginDicomToJsonFlags) ||
1749  sizeof(int32_t) != sizeof(OrthancPluginCreateDicomFlags) ||
1750  sizeof(int32_t) != sizeof(OrthancPluginIdentifierConstraint) ||
1751  sizeof(int32_t) != sizeof(OrthancPluginInstanceOrigin) ||
1752  sizeof(int32_t) != sizeof(OrthancPluginJobStepStatus) ||
1753  sizeof(int32_t) != sizeof(OrthancPluginConstraintType) ||
1754  sizeof(int32_t) != sizeof(OrthancPluginMetricsType) ||
1755  sizeof(int32_t) != sizeof(OrthancPluginDicomWebBinaryMode) ||
1756  sizeof(int32_t) != sizeof(OrthancPluginStorageCommitmentFailureReason))
1757  {
1758  /* Mismatch in the size of the enumerations */
1759  return 0;
1760  }
1761 
1762  /* Assume compatibility with the mainline */
1763  if (!strcmp(context->orthancVersion, "mainline"))
1764  {
1765  return 1;
1766  }
1767 
1768  /* Parse the version of the Orthanc core */
1769  if (
1770 #ifdef _MSC_VER
1771  sscanf_s
1772 #else
1773  sscanf
1774 #endif
1775  (context->orthancVersion, "%4d.%4d.%4d", &major, &minor, &revision) != 3)
1776  {
1777  return 0;
1778  }
1779 
1780  /* Check the major number of the version */
1781 
1782  if (major > expectedMajor)
1783  {
1784  return 1;
1785  }
1786 
1787  if (major < expectedMajor)
1788  {
1789  return 0;
1790  }
1791 
1792  /* Check the minor number of the version */
1793 
1794  if (minor > expectedMinor)
1795  {
1796  return 1;
1797  }
1798 
1799  if (minor < expectedMinor)
1800  {
1801  return 0;
1802  }
1803 
1804  /* Check the revision number of the version */
1805 
1806  if (revision >= expectedRevision)
1807  {
1808  return 1;
1809  }
1810  else
1811  {
1812  return 0;
1813  }
1814  }
1815 
1816 
1833  ORTHANC_PLUGIN_INLINE int OrthancPluginCheckVersion(
1834  OrthancPluginContext* context)
1835  {
1837  context,
1838  ORTHANC_PLUGINS_MINIMAL_MAJOR_NUMBER,
1839  ORTHANC_PLUGINS_MINIMAL_MINOR_NUMBER,
1840  ORTHANC_PLUGINS_MINIMAL_REVISION_NUMBER);
1841  }
1842 
1843 
1852  ORTHANC_PLUGIN_INLINE void OrthancPluginFreeMemoryBuffer(
1853  OrthancPluginContext* context,
1854  OrthancPluginMemoryBuffer* buffer)
1855  {
1856  context->Free(buffer->data);
1857  }
1858 
1859 
1868  ORTHANC_PLUGIN_INLINE void OrthancPluginLogError(
1869  OrthancPluginContext* context,
1870  const char* message)
1871  {
1872  context->InvokeService(context, _OrthancPluginService_LogError, message);
1873  }
1874 
1875 
1884  ORTHANC_PLUGIN_INLINE void OrthancPluginLogWarning(
1885  OrthancPluginContext* context,
1886  const char* message)
1887  {
1888  context->InvokeService(context, _OrthancPluginService_LogWarning, message);
1889  }
1890 
1891 
1900  ORTHANC_PLUGIN_INLINE void OrthancPluginLogInfo(
1901  OrthancPluginContext* context,
1902  const char* message)
1903  {
1904  context->InvokeService(context, _OrthancPluginService_LogInfo, message);
1905  }
1906 
1907 
1908 
1909  typedef struct
1910  {
1911  const char* pathRegularExpression;
1912  OrthancPluginRestCallback callback;
1913  } _OrthancPluginRestCallback;
1914 
1936  ORTHANC_PLUGIN_INLINE void OrthancPluginRegisterRestCallback(
1937  OrthancPluginContext* context,
1938  const char* pathRegularExpression,
1939  OrthancPluginRestCallback callback)
1940  {
1941  _OrthancPluginRestCallback params;
1942  params.pathRegularExpression = pathRegularExpression;
1943  params.callback = callback;
1944  context->InvokeService(context, _OrthancPluginService_RegisterRestCallback, &params);
1945  }
1946 
1947 
1948 
1976  ORTHANC_PLUGIN_INLINE void OrthancPluginRegisterRestCallbackNoLock(
1977  OrthancPluginContext* context,
1978  const char* pathRegularExpression,
1979  OrthancPluginRestCallback callback)
1980  {
1981  _OrthancPluginRestCallback params;
1982  params.pathRegularExpression = pathRegularExpression;
1983  params.callback = callback;
1984  context->InvokeService(context, _OrthancPluginService_RegisterRestCallbackNoLock, &params);
1985  }
1986 
1987 
1988 
1989  typedef struct
1990  {
1992  } _OrthancPluginOnStoredInstanceCallback;
1993 
2015  OrthancPluginContext* context,
2017  {
2018  _OrthancPluginOnStoredInstanceCallback params;
2019  params.callback = callback;
2020 
2021  context->InvokeService(context, _OrthancPluginService_RegisterOnStoredInstanceCallback, &params);
2022  }
2023 
2024 
2025 
2026  typedef struct
2027  {
2028  OrthancPluginRestOutput* output;
2029  const void* answer;
2030  uint32_t answerSize;
2031  const char* mimeType;
2032  } _OrthancPluginAnswerBuffer;
2033 
2046  ORTHANC_PLUGIN_INLINE void OrthancPluginAnswerBuffer(
2047  OrthancPluginContext* context,
2048  OrthancPluginRestOutput* output,
2049  const void* answer,
2050  uint32_t answerSize,
2051  const char* mimeType)
2052  {
2053  _OrthancPluginAnswerBuffer params;
2054  params.output = output;
2055  params.answer = answer;
2056  params.answerSize = answerSize;
2057  params.mimeType = mimeType;
2058  context->InvokeService(context, _OrthancPluginService_AnswerBuffer, &params);
2059  }
2060 
2061 
2062  typedef struct
2063  {
2064  OrthancPluginRestOutput* output;
2065  OrthancPluginPixelFormat format;
2066  uint32_t width;
2067  uint32_t height;
2068  uint32_t pitch;
2069  const void* buffer;
2070  } _OrthancPluginCompressAndAnswerPngImage;
2071 
2072  typedef struct
2073  {
2074  OrthancPluginRestOutput* output;
2075  OrthancPluginImageFormat imageFormat;
2076  OrthancPluginPixelFormat pixelFormat;
2077  uint32_t width;
2078  uint32_t height;
2079  uint32_t pitch;
2080  const void* buffer;
2081  uint8_t quality;
2082  } _OrthancPluginCompressAndAnswerImage;
2083 
2084 
2103  ORTHANC_PLUGIN_INLINE void OrthancPluginCompressAndAnswerPngImage(
2104  OrthancPluginContext* context,
2105  OrthancPluginRestOutput* output,
2106  OrthancPluginPixelFormat format,
2107  uint32_t width,
2108  uint32_t height,
2109  uint32_t pitch,
2110  const void* buffer)
2111  {
2112  _OrthancPluginCompressAndAnswerImage params;
2113  params.output = output;
2114  params.imageFormat = OrthancPluginImageFormat_Png;
2115  params.pixelFormat = format;
2116  params.width = width;
2117  params.height = height;
2118  params.pitch = pitch;
2119  params.buffer = buffer;
2120  params.quality = 0; /* No quality for PNG */
2121  context->InvokeService(context, _OrthancPluginService_CompressAndAnswerImage, &params);
2122  }
2123 
2124 
2125 
2126  typedef struct
2127  {
2128  OrthancPluginMemoryBuffer* target;
2129  const char* instanceId;
2130  } _OrthancPluginGetDicomForInstance;
2131 
2145  OrthancPluginContext* context,
2146  OrthancPluginMemoryBuffer* target,
2147  const char* instanceId)
2148  {
2149  _OrthancPluginGetDicomForInstance params;
2150  params.target = target;
2151  params.instanceId = instanceId;
2152  return context->InvokeService(context, _OrthancPluginService_GetDicomForInstance, &params);
2153  }
2154 
2155 
2156 
2157  typedef struct
2158  {
2159  OrthancPluginMemoryBuffer* target;
2160  const char* uri;
2161  } _OrthancPluginRestApiGet;
2162 
2178  OrthancPluginContext* context,
2179  OrthancPluginMemoryBuffer* target,
2180  const char* uri)
2181  {
2182  _OrthancPluginRestApiGet params;
2183  params.target = target;
2184  params.uri = uri;
2185  return context->InvokeService(context, _OrthancPluginService_RestApiGet, &params);
2186  }
2187 
2188 
2189 
2208  OrthancPluginContext* context,
2209  OrthancPluginMemoryBuffer* target,
2210  const char* uri)
2211  {
2212  _OrthancPluginRestApiGet params;
2213  params.target = target;
2214  params.uri = uri;
2215  return context->InvokeService(context, _OrthancPluginService_RestApiGetAfterPlugins, &params);
2216  }
2217 
2218 
2219 
2220  typedef struct
2221  {
2222  OrthancPluginMemoryBuffer* target;
2223  const char* uri;
2224  const void* body;
2225  uint32_t bodySize;
2226  } _OrthancPluginRestApiPostPut;
2227 
2245  OrthancPluginContext* context,
2246  OrthancPluginMemoryBuffer* target,
2247  const char* uri,
2248  const void* body,
2249  uint32_t bodySize)
2250  {
2251  _OrthancPluginRestApiPostPut params;
2252  params.target = target;
2253  params.uri = uri;
2254  params.body = body;
2255  params.bodySize = bodySize;
2256  return context->InvokeService(context, _OrthancPluginService_RestApiPost, &params);
2257  }
2258 
2259 
2280  OrthancPluginContext* context,
2281  OrthancPluginMemoryBuffer* target,
2282  const char* uri,
2283  const void* body,
2284  uint32_t bodySize)
2285  {
2286  _OrthancPluginRestApiPostPut params;
2287  params.target = target;
2288  params.uri = uri;
2289  params.body = body;
2290  params.bodySize = bodySize;
2291  return context->InvokeService(context, _OrthancPluginService_RestApiPostAfterPlugins, &params);
2292  }
2293 
2294 
2295 
2309  OrthancPluginContext* context,
2310  const char* uri)
2311  {
2312  return context->InvokeService(context, _OrthancPluginService_RestApiDelete, uri);
2313  }
2314 
2315 
2332  OrthancPluginContext* context,
2333  const char* uri)
2334  {
2335  return context->InvokeService(context, _OrthancPluginService_RestApiDeleteAfterPlugins, uri);
2336  }
2337 
2338 
2339 
2357  OrthancPluginContext* context,
2358  OrthancPluginMemoryBuffer* target,
2359  const char* uri,
2360  const void* body,
2361  uint32_t bodySize)
2362  {
2363  _OrthancPluginRestApiPostPut params;
2364  params.target = target;
2365  params.uri = uri;
2366  params.body = body;
2367  params.bodySize = bodySize;
2368  return context->InvokeService(context, _OrthancPluginService_RestApiPut, &params);
2369  }
2370 
2371 
2372 
2393  OrthancPluginContext* context,
2394  OrthancPluginMemoryBuffer* target,
2395  const char* uri,
2396  const void* body,
2397  uint32_t bodySize)
2398  {
2399  _OrthancPluginRestApiPostPut params;
2400  params.target = target;
2401  params.uri = uri;
2402  params.body = body;
2403  params.bodySize = bodySize;
2404  return context->InvokeService(context, _OrthancPluginService_RestApiPutAfterPlugins, &params);
2405  }
2406 
2407 
2408 
2409  typedef struct
2410  {
2411  OrthancPluginRestOutput* output;
2412  const char* argument;
2413  } _OrthancPluginOutputPlusArgument;
2414 
2426  ORTHANC_PLUGIN_INLINE void OrthancPluginRedirect(
2427  OrthancPluginContext* context,
2428  OrthancPluginRestOutput* output,
2429  const char* redirection)
2430  {
2431  _OrthancPluginOutputPlusArgument params;
2432  params.output = output;
2433  params.argument = redirection;
2434  context->InvokeService(context, _OrthancPluginService_Redirect, &params);
2435  }
2436 
2437 
2438 
2439  typedef struct
2440  {
2441  char** result;
2442  const char* argument;
2443  } _OrthancPluginRetrieveDynamicString;
2444 
2458  ORTHANC_PLUGIN_INLINE char* OrthancPluginLookupPatient(
2459  OrthancPluginContext* context,
2460  const char* patientID)
2461  {
2462  char* result;
2463 
2464  _OrthancPluginRetrieveDynamicString params;
2465  params.result = &result;
2466  params.argument = patientID;
2467 
2468  if (context->InvokeService(context, _OrthancPluginService_LookupPatient, &params) != OrthancPluginErrorCode_Success)
2469  {
2470  /* Error */
2471  return NULL;
2472  }
2473  else
2474  {
2475  return result;
2476  }
2477  }
2478 
2479 
2493  ORTHANC_PLUGIN_INLINE char* OrthancPluginLookupStudy(
2494  OrthancPluginContext* context,
2495  const char* studyUID)
2496  {
2497  char* result;
2498 
2499  _OrthancPluginRetrieveDynamicString params;
2500  params.result = &result;
2501  params.argument = studyUID;
2502 
2503  if (context->InvokeService(context, _OrthancPluginService_LookupStudy, &params) != OrthancPluginErrorCode_Success)
2504  {
2505  /* Error */
2506  return NULL;
2507  }
2508  else
2509  {
2510  return result;
2511  }
2512  }
2513 
2514 
2528  ORTHANC_PLUGIN_INLINE char* OrthancPluginLookupStudyWithAccessionNumber(
2529  OrthancPluginContext* context,
2530  const char* accessionNumber)
2531  {
2532  char* result;
2533 
2534  _OrthancPluginRetrieveDynamicString params;
2535  params.result = &result;
2536  params.argument = accessionNumber;
2537 
2538  if (context->InvokeService(context, _OrthancPluginService_LookupStudyWithAccessionNumber, &params) != OrthancPluginErrorCode_Success)
2539  {
2540  /* Error */
2541  return NULL;
2542  }
2543  else
2544  {
2545  return result;
2546  }
2547  }
2548 
2549 
2563  ORTHANC_PLUGIN_INLINE char* OrthancPluginLookupSeries(
2564  OrthancPluginContext* context,
2565  const char* seriesUID)
2566  {
2567  char* result;
2568 
2569  _OrthancPluginRetrieveDynamicString params;
2570  params.result = &result;
2571  params.argument = seriesUID;
2572 
2573  if (context->InvokeService(context, _OrthancPluginService_LookupSeries, &params) != OrthancPluginErrorCode_Success)
2574  {
2575  /* Error */
2576  return NULL;
2577  }
2578  else
2579  {
2580  return result;
2581  }
2582  }
2583 
2584 
2598  ORTHANC_PLUGIN_INLINE char* OrthancPluginLookupInstance(
2599  OrthancPluginContext* context,
2600  const char* sopInstanceUID)
2601  {
2602  char* result;
2603 
2604  _OrthancPluginRetrieveDynamicString params;
2605  params.result = &result;
2606  params.argument = sopInstanceUID;
2607 
2608  if (context->InvokeService(context, _OrthancPluginService_LookupInstance, &params) != OrthancPluginErrorCode_Success)
2609  {
2610  /* Error */
2611  return NULL;
2612  }
2613  else
2614  {
2615  return result;
2616  }
2617  }
2618 
2619 
2620 
2621  typedef struct
2622  {
2623  OrthancPluginRestOutput* output;
2624  uint16_t status;
2625  } _OrthancPluginSendHttpStatusCode;
2626 
2643  ORTHANC_PLUGIN_INLINE void OrthancPluginSendHttpStatusCode(
2644  OrthancPluginContext* context,
2645  OrthancPluginRestOutput* output,
2646  uint16_t status)
2647  {
2648  _OrthancPluginSendHttpStatusCode params;
2649  params.output = output;
2650  params.status = status;
2651  context->InvokeService(context, _OrthancPluginService_SendHttpStatusCode, &params);
2652  }
2653 
2654 
2666  ORTHANC_PLUGIN_INLINE void OrthancPluginSendUnauthorized(
2667  OrthancPluginContext* context,
2668  OrthancPluginRestOutput* output,
2669  const char* realm)
2670  {
2671  _OrthancPluginOutputPlusArgument params;
2672  params.output = output;
2673  params.argument = realm;
2674  context->InvokeService(context, _OrthancPluginService_SendUnauthorized, &params);
2675  }
2676 
2677 
2689  ORTHANC_PLUGIN_INLINE void OrthancPluginSendMethodNotAllowed(
2690  OrthancPluginContext* context,
2691  OrthancPluginRestOutput* output,
2692  const char* allowedMethods)
2693  {
2694  _OrthancPluginOutputPlusArgument params;
2695  params.output = output;
2696  params.argument = allowedMethods;
2697  context->InvokeService(context, _OrthancPluginService_SendMethodNotAllowed, &params);
2698  }
2699 
2700 
2701  typedef struct
2702  {
2703  OrthancPluginRestOutput* output;
2704  const char* key;
2705  const char* value;
2706  } _OrthancPluginSetHttpHeader;
2707 
2719  ORTHANC_PLUGIN_INLINE void OrthancPluginSetCookie(
2720  OrthancPluginContext* context,
2721  OrthancPluginRestOutput* output,
2722  const char* cookie,
2723  const char* value)
2724  {
2725  _OrthancPluginSetHttpHeader params;
2726  params.output = output;
2727  params.key = cookie;
2728  params.value = value;
2729  context->InvokeService(context, _OrthancPluginService_SetCookie, &params);
2730  }
2731 
2732 
2744  ORTHANC_PLUGIN_INLINE void OrthancPluginSetHttpHeader(
2745  OrthancPluginContext* context,
2746  OrthancPluginRestOutput* output,
2747  const char* key,
2748  const char* value)
2749  {
2750  _OrthancPluginSetHttpHeader params;
2751  params.output = output;
2752  params.key = key;
2753  params.value = value;
2754  context->InvokeService(context, _OrthancPluginService_SetHttpHeader, &params);
2755  }
2756 
2757 
2758  typedef struct
2759  {
2760  char** resultStringToFree;
2761  const char** resultString;
2762  int64_t* resultInt64;
2763  const char* key;
2764  const OrthancPluginDicomInstance* instance;
2765  OrthancPluginInstanceOrigin* resultOrigin; /* New in Orthanc 0.9.5 SDK */
2766  } _OrthancPluginAccessDicomInstance;
2767 
2768 
2780  ORTHANC_PLUGIN_INLINE const char* OrthancPluginGetInstanceRemoteAet(
2781  OrthancPluginContext* context,
2782  const OrthancPluginDicomInstance* instance)
2783  {
2784  const char* result;
2785 
2786  _OrthancPluginAccessDicomInstance params;
2787  memset(&params, 0, sizeof(params));
2788  params.resultString = &result;
2789  params.instance = instance;
2790 
2791  if (context->InvokeService(context, _OrthancPluginService_GetInstanceRemoteAet, &params) != OrthancPluginErrorCode_Success)
2792  {
2793  /* Error */
2794  return NULL;
2795  }
2796  else
2797  {
2798  return result;
2799  }
2800  }
2801 
2802 
2813  ORTHANC_PLUGIN_INLINE int64_t OrthancPluginGetInstanceSize(
2814  OrthancPluginContext* context,
2815  const OrthancPluginDicomInstance* instance)
2816  {
2817  int64_t size;
2818 
2819  _OrthancPluginAccessDicomInstance params;
2820  memset(&params, 0, sizeof(params));
2821  params.resultInt64 = &size;
2822  params.instance = instance;
2823 
2824  if (context->InvokeService(context, _OrthancPluginService_GetInstanceSize, &params) != OrthancPluginErrorCode_Success)
2825  {
2826  /* Error */
2827  return -1;
2828  }
2829  else
2830  {
2831  return size;
2832  }
2833  }
2834 
2835 
2846  ORTHANC_PLUGIN_INLINE const void* OrthancPluginGetInstanceData(
2847  OrthancPluginContext* context,
2848  const OrthancPluginDicomInstance* instance)
2849  {
2850  const char* result;
2851 
2852  _OrthancPluginAccessDicomInstance params;
2853  memset(&params, 0, sizeof(params));
2854  params.resultString = &result;
2855  params.instance = instance;
2856 
2857  if (context->InvokeService(context, _OrthancPluginService_GetInstanceData, &params) != OrthancPluginErrorCode_Success)
2858  {
2859  /* Error */
2860  return NULL;
2861  }
2862  else
2863  {
2864  return result;
2865  }
2866  }
2867 
2868 
2882  ORTHANC_PLUGIN_INLINE char* OrthancPluginGetInstanceJson(
2883  OrthancPluginContext* context,
2884  const OrthancPluginDicomInstance* instance)
2885  {
2886  char* result;
2887 
2888  _OrthancPluginAccessDicomInstance params;
2889  memset(&params, 0, sizeof(params));
2890  params.resultStringToFree = &result;
2891  params.instance = instance;
2892 
2893  if (context->InvokeService(context, _OrthancPluginService_GetInstanceJson, &params) != OrthancPluginErrorCode_Success)
2894  {
2895  /* Error */
2896  return NULL;
2897  }
2898  else
2899  {
2900  return result;
2901  }
2902  }
2903 
2904 
2920  ORTHANC_PLUGIN_INLINE char* OrthancPluginGetInstanceSimplifiedJson(
2921  OrthancPluginContext* context,
2922  const OrthancPluginDicomInstance* instance)
2923  {
2924  char* result;
2925 
2926  _OrthancPluginAccessDicomInstance params;
2927  memset(&params, 0, sizeof(params));
2928  params.resultStringToFree = &result;
2929  params.instance = instance;
2930 
2931  if (context->InvokeService(context, _OrthancPluginService_GetInstanceSimplifiedJson, &params) != OrthancPluginErrorCode_Success)
2932  {
2933  /* Error */
2934  return NULL;
2935  }
2936  else
2937  {
2938  return result;
2939  }
2940  }
2941 
2942 
2959  ORTHANC_PLUGIN_INLINE int OrthancPluginHasInstanceMetadata(
2960  OrthancPluginContext* context,
2961  const OrthancPluginDicomInstance* instance,
2962  const char* metadata)
2963  {
2964  int64_t result;
2965 
2966  _OrthancPluginAccessDicomInstance params;
2967  memset(&params, 0, sizeof(params));
2968  params.resultInt64 = &result;
2969  params.instance = instance;
2970  params.key = metadata;
2971 
2972  if (context->InvokeService(context, _OrthancPluginService_HasInstanceMetadata, &params) != OrthancPluginErrorCode_Success)
2973  {
2974  /* Error */
2975  return -1;
2976  }
2977  else
2978  {
2979  return (result != 0);
2980  }
2981  }
2982 
2983 
3000  ORTHANC_PLUGIN_INLINE const char* OrthancPluginGetInstanceMetadata(
3001  OrthancPluginContext* context,
3002  const OrthancPluginDicomInstance* instance,
3003  const char* metadata)
3004  {
3005  const char* result;
3006 
3007  _OrthancPluginAccessDicomInstance params;
3008  memset(&params, 0, sizeof(params));
3009  params.resultString = &result;
3010  params.instance = instance;
3011  params.key = metadata;
3012 
3013  if (context->InvokeService(context, _OrthancPluginService_GetInstanceMetadata, &params) != OrthancPluginErrorCode_Success)
3014  {
3015  /* Error */
3016  return NULL;
3017  }
3018  else
3019  {
3020  return result;
3021  }
3022  }
3023 
3024 
3025 
3026  typedef struct
3027  {
3031  OrthancPluginFree free;
3032  } _OrthancPluginRegisterStorageArea;
3033 
3048  ORTHANC_PLUGIN_INLINE void OrthancPluginRegisterStorageArea(
3049  OrthancPluginContext* context,
3053  {
3054  _OrthancPluginRegisterStorageArea params;
3055  params.create = create;
3056  params.read = read;
3057  params.remove = remove;
3058 
3059 #ifdef __cplusplus
3060  params.free = ::free;
3061 #else
3062  params.free = free;
3063 #endif
3064 
3065  context->InvokeService(context, _OrthancPluginService_RegisterStorageArea, &params);
3066  }
3067 
3068 
3069 
3080  ORTHANC_PLUGIN_INLINE char *OrthancPluginGetOrthancPath(OrthancPluginContext* context)
3081  {
3082  char* result;
3083 
3084  _OrthancPluginRetrieveDynamicString params;
3085  params.result = &result;
3086  params.argument = NULL;
3087 
3088  if (context->InvokeService(context, _OrthancPluginService_GetOrthancPath, &params) != OrthancPluginErrorCode_Success)
3089  {
3090  /* Error */
3091  return NULL;
3092  }
3093  else
3094  {
3095  return result;
3096  }
3097  }
3098 
3099 
3110  ORTHANC_PLUGIN_INLINE char *OrthancPluginGetOrthancDirectory(OrthancPluginContext* context)
3111  {
3112  char* result;
3113 
3114  _OrthancPluginRetrieveDynamicString params;
3115  params.result = &result;
3116  params.argument = NULL;
3117 
3118  if (context->InvokeService(context, _OrthancPluginService_GetOrthancDirectory, &params) != OrthancPluginErrorCode_Success)
3119  {
3120  /* Error */
3121  return NULL;
3122  }
3123  else
3124  {
3125  return result;
3126  }
3127  }
3128 
3129 
3145  ORTHANC_PLUGIN_INLINE char *OrthancPluginGetConfigurationPath(OrthancPluginContext* context)
3146  {
3147  char* result;
3148 
3149  _OrthancPluginRetrieveDynamicString params;
3150  params.result = &result;
3151  params.argument = NULL;
3152 
3153  if (context->InvokeService(context, _OrthancPluginService_GetConfigurationPath, &params) != OrthancPluginErrorCode_Success)
3154  {
3155  /* Error */
3156  return NULL;
3157  }
3158  else
3159  {
3160  return result;
3161  }
3162  }
3163 
3164 
3165 
3166  typedef struct
3167  {
3169  } _OrthancPluginOnChangeCallback;
3170 
3191  ORTHANC_PLUGIN_INLINE void OrthancPluginRegisterOnChangeCallback(
3192  OrthancPluginContext* context,
3194  {
3195  _OrthancPluginOnChangeCallback params;
3196  params.callback = callback;
3197 
3198  context->InvokeService(context, _OrthancPluginService_RegisterOnChangeCallback, &params);
3199  }
3200 
3201 
3202 
3203  typedef struct
3204  {
3205  const char* plugin;
3206  _OrthancPluginProperty property;
3207  const char* value;
3208  } _OrthancPluginSetPluginProperty;
3209 
3210 
3222  ORTHANC_PLUGIN_INLINE void OrthancPluginSetRootUri(
3223  OrthancPluginContext* context,
3224  const char* uri)
3225  {
3226  _OrthancPluginSetPluginProperty params;
3227  params.plugin = OrthancPluginGetName();
3228  params.property = _OrthancPluginProperty_RootUri;
3229  params.value = uri;
3230 
3231  context->InvokeService(context, _OrthancPluginService_SetPluginProperty, &params);
3232  }
3233 
3234 
3244  ORTHANC_PLUGIN_INLINE void OrthancPluginSetDescription(
3245  OrthancPluginContext* context,
3246  const char* description)
3247  {
3248  _OrthancPluginSetPluginProperty params;
3249  params.plugin = OrthancPluginGetName();
3250  params.property = _OrthancPluginProperty_Description;
3251  params.value = description;
3252 
3253  context->InvokeService(context, _OrthancPluginService_SetPluginProperty, &params);
3254  }
3255 
3256 
3266  ORTHANC_PLUGIN_INLINE void OrthancPluginExtendOrthancExplorer(
3267  OrthancPluginContext* context,
3268  const char* javascript)
3269  {
3270  _OrthancPluginSetPluginProperty params;
3271  params.plugin = OrthancPluginGetName();
3272  params.property = _OrthancPluginProperty_OrthancExplorer;
3273  params.value = javascript;
3274 
3275  context->InvokeService(context, _OrthancPluginService_SetPluginProperty, &params);
3276  }
3277 
3278 
3279  typedef struct
3280  {
3281  char** result;
3282  int32_t property;
3283  const char* value;
3284  } _OrthancPluginGlobalProperty;
3285 
3286 
3300  ORTHANC_PLUGIN_INLINE char* OrthancPluginGetGlobalProperty(
3301  OrthancPluginContext* context,
3302  int32_t property,
3303  const char* defaultValue)
3304  {
3305  char* result;
3306 
3307  _OrthancPluginGlobalProperty params;
3308  params.result = &result;
3309  params.property = property;
3310  params.value = defaultValue;
3311 
3312  if (context->InvokeService(context, _OrthancPluginService_GetGlobalProperty, &params) != OrthancPluginErrorCode_Success)
3313  {
3314  /* Error */
3315  return NULL;
3316  }
3317  else
3318  {
3319  return result;
3320  }
3321  }
3322 
3323 
3340  OrthancPluginContext* context,
3341  int32_t property,
3342  const char* value)
3343  {
3344  _OrthancPluginGlobalProperty params;
3345  params.result = NULL;
3346  params.property = property;
3347  params.value = value;
3348 
3349  return context->InvokeService(context, _OrthancPluginService_SetGlobalProperty, &params);
3350  }
3351 
3352 
3353 
3354  typedef struct
3355  {
3356  int32_t *resultInt32;
3357  uint32_t *resultUint32;
3358  int64_t *resultInt64;
3359  uint64_t *resultUint64;
3360  } _OrthancPluginReturnSingleValue;
3361 
3370  ORTHANC_PLUGIN_INLINE uint32_t OrthancPluginGetCommandLineArgumentsCount(
3371  OrthancPluginContext* context)
3372  {
3373  uint32_t count = 0;
3374 
3375  _OrthancPluginReturnSingleValue params;
3376  memset(&params, 0, sizeof(params));
3377  params.resultUint32 = &count;
3378 
3379  if (context->InvokeService(context, _OrthancPluginService_GetCommandLineArgumentsCount, &params) != OrthancPluginErrorCode_Success)
3380  {
3381  /* Error */
3382  return 0;
3383  }
3384  else
3385  {
3386  return count;
3387  }
3388  }
3389 
3390 
3391 
3404  ORTHANC_PLUGIN_INLINE char* OrthancPluginGetCommandLineArgument(
3405  OrthancPluginContext* context,
3406  uint32_t argument)
3407  {
3408  char* result;
3409 
3410  _OrthancPluginGlobalProperty params;
3411  params.result = &result;
3412  params.property = (int32_t) argument;
3413  params.value = NULL;
3414 
3415  if (context->InvokeService(context, _OrthancPluginService_GetCommandLineArgument, &params) != OrthancPluginErrorCode_Success)
3416  {
3417  /* Error */
3418  return NULL;
3419  }
3420  else
3421  {
3422  return result;
3423  }
3424  }
3425 
3426 
3436  ORTHANC_PLUGIN_INLINE uint32_t OrthancPluginGetExpectedDatabaseVersion(
3437  OrthancPluginContext* context)
3438  {
3439  uint32_t count = 0;
3440 
3441  _OrthancPluginReturnSingleValue params;
3442  memset(&params, 0, sizeof(params));
3443  params.resultUint32 = &count;
3444 
3445  if (context->InvokeService(context, _OrthancPluginService_GetExpectedDatabaseVersion, &params) != OrthancPluginErrorCode_Success)
3446  {
3447  /* Error */
3448  return 0;
3449  }
3450  else
3451  {
3452  return count;
3453  }
3454  }
3455 
3456 
3457 
3469  ORTHANC_PLUGIN_INLINE char *OrthancPluginGetConfiguration(OrthancPluginContext* context)
3470  {
3471  char* result;
3472 
3473  _OrthancPluginRetrieveDynamicString params;
3474  params.result = &result;
3475  params.argument = NULL;
3476 
3477  if (context->InvokeService(context, _OrthancPluginService_GetConfiguration, &params) != OrthancPluginErrorCode_Success)
3478  {
3479  /* Error */
3480  return NULL;
3481  }
3482  else
3483  {
3484  return result;
3485  }
3486  }
3487 
3488 
3489 
3490  typedef struct
3491  {
3492  OrthancPluginRestOutput* output;
3493  const char* subType;
3494  const char* contentType;
3495  } _OrthancPluginStartMultipartAnswer;
3496 
3511  OrthancPluginContext* context,
3512  OrthancPluginRestOutput* output,
3513  const char* subType,
3514  const char* contentType)
3515  {
3516  _OrthancPluginStartMultipartAnswer params;
3517  params.output = output;
3518  params.subType = subType;
3519  params.contentType = contentType;
3520  return context->InvokeService(context, _OrthancPluginService_StartMultipartAnswer, &params);
3521  }
3522 
3523 
3540  OrthancPluginContext* context,
3541  OrthancPluginRestOutput* output,
3542  const void* answer,
3543  uint32_t answerSize)
3544  {
3545  _OrthancPluginAnswerBuffer params;
3546  params.output = output;
3547  params.answer = answer;
3548  params.answerSize = answerSize;
3549  params.mimeType = NULL;
3550  return context->InvokeService(context, _OrthancPluginService_SendMultipartItem, &params);
3551  }
3552 
3553 
3554 
3555  typedef struct
3556  {
3557  OrthancPluginMemoryBuffer* target;
3558  const void* source;
3559  uint32_t size;
3560  OrthancPluginCompressionType compression;
3561  uint8_t uncompress;
3562  } _OrthancPluginBufferCompression;
3563 
3564 
3582  OrthancPluginContext* context,
3583  OrthancPluginMemoryBuffer* target,
3584  const void* source,
3585  uint32_t size,
3586  OrthancPluginCompressionType compression,
3587  uint8_t uncompress)
3588  {
3589  _OrthancPluginBufferCompression params;
3590  params.target = target;
3591  params.source = source;
3592  params.size = size;
3593  params.compression = compression;
3594  params.uncompress = uncompress;
3595 
3596  return context->InvokeService(context, _OrthancPluginService_BufferCompression, &params);
3597  }
3598 
3599 
3600 
3601  typedef struct
3602  {
3603  OrthancPluginMemoryBuffer* target;
3604  const char* path;
3605  } _OrthancPluginReadFile;
3606 
3619  OrthancPluginContext* context,
3620  OrthancPluginMemoryBuffer* target,
3621  const char* path)
3622  {
3623  _OrthancPluginReadFile params;
3624  params.target = target;
3625  params.path = path;
3626  return context->InvokeService(context, _OrthancPluginService_ReadFile, &params);
3627  }
3628 
3629 
3630 
3631  typedef struct
3632  {
3633  const char* path;
3634  const void* data;
3635  uint32_t size;
3636  } _OrthancPluginWriteFile;
3637 
3650  OrthancPluginContext* context,
3651  const char* path,
3652  const void* data,
3653  uint32_t size)
3654  {
3655  _OrthancPluginWriteFile params;
3656  params.path = path;
3657  params.data = data;
3658  params.size = size;
3659  return context->InvokeService(context, _OrthancPluginService_WriteFile, &params);
3660  }
3661 
3662 
3663 
3664  typedef struct
3665  {
3666  const char** target;
3667  OrthancPluginErrorCode error;
3668  } _OrthancPluginGetErrorDescription;
3669 
3680  ORTHANC_PLUGIN_INLINE const char* OrthancPluginGetErrorDescription(
3681  OrthancPluginContext* context,
3682  OrthancPluginErrorCode error)
3683  {
3684  const char* result = NULL;
3685 
3686  _OrthancPluginGetErrorDescription params;
3687  params.target = &result;
3688  params.error = error;
3689 
3690  if (context->InvokeService(context, _OrthancPluginService_GetErrorDescription, &params) != OrthancPluginErrorCode_Success ||
3691  result == NULL)
3692  {
3693  return "Unknown error code";
3694  }
3695  else
3696  {
3697  return result;
3698  }
3699  }
3700 
3701 
3702 
3703  typedef struct
3704  {
3705  OrthancPluginRestOutput* output;
3706  uint16_t status;
3707  const char* body;
3708  uint32_t bodySize;
3709  } _OrthancPluginSendHttpStatus;
3710 
3733  ORTHANC_PLUGIN_INLINE void OrthancPluginSendHttpStatus(
3734  OrthancPluginContext* context,
3735  OrthancPluginRestOutput* output,
3736  uint16_t status,
3737  const char* body,
3738  uint32_t bodySize)
3739  {
3740  _OrthancPluginSendHttpStatus params;
3741  params.output = output;
3742  params.status = status;
3743  params.body = body;
3744  params.bodySize = bodySize;
3745  context->InvokeService(context, _OrthancPluginService_SendHttpStatus, &params);
3746  }
3747 
3748 
3749 
3750  typedef struct
3751  {
3752  const OrthancPluginImage* image;
3753  uint32_t* resultUint32;
3754  OrthancPluginPixelFormat* resultPixelFormat;
3755  void** resultBuffer;
3756  } _OrthancPluginGetImageInfo;
3757 
3758 
3770  OrthancPluginContext* context,
3771  const OrthancPluginImage* image)
3772  {
3773  OrthancPluginPixelFormat target;
3774 
3775  _OrthancPluginGetImageInfo params;
3776  memset(&params, 0, sizeof(params));
3777  params.image = image;
3778  params.resultPixelFormat = &target;
3779 
3780  if (context->InvokeService(context, _OrthancPluginService_GetImagePixelFormat, &params) != OrthancPluginErrorCode_Success)
3781  {
3783  }
3784  else
3785  {
3786  return (OrthancPluginPixelFormat) target;
3787  }
3788  }
3789 
3790 
3791 
3802  ORTHANC_PLUGIN_INLINE uint32_t OrthancPluginGetImageWidth(
3803  OrthancPluginContext* context,
3804  const OrthancPluginImage* image)
3805  {
3806  uint32_t width;
3807 
3808  _OrthancPluginGetImageInfo params;
3809  memset(&params, 0, sizeof(params));
3810  params.image = image;
3811  params.resultUint32 = &width;
3812 
3813  if (context->InvokeService(context, _OrthancPluginService_GetImageWidth, &params) != OrthancPluginErrorCode_Success)
3814  {
3815  return 0;
3816  }
3817  else
3818  {
3819  return width;
3820  }
3821  }
3822 
3823 
3824 
3835  ORTHANC_PLUGIN_INLINE uint32_t OrthancPluginGetImageHeight(
3836  OrthancPluginContext* context,
3837  const OrthancPluginImage* image)
3838  {
3839  uint32_t height;
3840 
3841  _OrthancPluginGetImageInfo params;
3842  memset(&params, 0, sizeof(params));
3843  params.image = image;
3844  params.resultUint32 = &height;
3845 
3846  if (context->InvokeService(context, _OrthancPluginService_GetImageHeight, &params) != OrthancPluginErrorCode_Success)
3847  {
3848  return 0;
3849  }
3850  else
3851  {
3852  return height;
3853  }
3854  }
3855 
3856 
3857 
3870  ORTHANC_PLUGIN_INLINE uint32_t OrthancPluginGetImagePitch(
3871  OrthancPluginContext* context,
3872  const OrthancPluginImage* image)
3873  {
3874  uint32_t pitch;
3875 
3876  _OrthancPluginGetImageInfo params;
3877  memset(&params, 0, sizeof(params));
3878  params.image = image;
3879  params.resultUint32 = &pitch;
3880 
3881  if (context->InvokeService(context, _OrthancPluginService_GetImagePitch, &params) != OrthancPluginErrorCode_Success)
3882  {
3883  return 0;
3884  }
3885  else
3886  {
3887  return pitch;
3888  }
3889  }
3890 
3891 
3892 
3904  ORTHANC_PLUGIN_INLINE void* OrthancPluginGetImageBuffer(
3905  OrthancPluginContext* context,
3906  const OrthancPluginImage* image)
3907  {
3908  void* target = NULL;
3909 
3910  _OrthancPluginGetImageInfo params;
3911  memset(&params, 0, sizeof(params));
3912  params.resultBuffer = &target;
3913  params.image = image;
3914 
3915  if (context->InvokeService(context, _OrthancPluginService_GetImageBuffer, &params) != OrthancPluginErrorCode_Success)
3916  {
3917  return NULL;
3918  }
3919  else
3920  {
3921  return target;
3922  }
3923  }
3924 
3925 
3926  typedef struct
3927  {
3928  OrthancPluginImage** target;
3929  const void* data;
3930  uint32_t size;
3931  OrthancPluginImageFormat format;
3932  } _OrthancPluginUncompressImage;
3933 
3934 
3948  OrthancPluginContext* context,
3949  const void* data,
3950  uint32_t size,
3951  OrthancPluginImageFormat format)
3952  {
3953  OrthancPluginImage* target = NULL;
3954 
3955  _OrthancPluginUncompressImage params;
3956  memset(&params, 0, sizeof(params));
3957  params.target = &target;
3958  params.data = data;
3959  params.size = size;
3960  params.format = format;
3961 
3962  if (context->InvokeService(context, _OrthancPluginService_UncompressImage, &params) != OrthancPluginErrorCode_Success)
3963  {
3964  return NULL;
3965  }
3966  else
3967  {
3968  return target;
3969  }
3970  }
3971 
3972 
3973 
3974 
3975  typedef struct
3976  {
3977  OrthancPluginImage* image;
3978  } _OrthancPluginFreeImage;
3979 
3989  ORTHANC_PLUGIN_INLINE void OrthancPluginFreeImage(
3990  OrthancPluginContext* context,
3991  OrthancPluginImage* image)
3992  {
3993  _OrthancPluginFreeImage params;
3994  params.image = image;
3995 
3996  context->InvokeService(context, _OrthancPluginService_FreeImage, &params);
3997  }
3998 
3999 
4000 
4001 
4002  typedef struct
4003  {
4004  OrthancPluginMemoryBuffer* target;
4005  OrthancPluginImageFormat imageFormat;
4006  OrthancPluginPixelFormat pixelFormat;
4007  uint32_t width;
4008  uint32_t height;
4009  uint32_t pitch;
4010  const void* buffer;
4011  uint8_t quality;
4012  } _OrthancPluginCompressImage;
4013 
4014 
4035  OrthancPluginContext* context,
4036  OrthancPluginMemoryBuffer* target,
4037  OrthancPluginPixelFormat format,
4038  uint32_t width,
4039  uint32_t height,
4040  uint32_t pitch,
4041  const void* buffer)
4042  {
4043  _OrthancPluginCompressImage params;
4044  memset(&params, 0, sizeof(params));
4045  params.target = target;
4046  params.imageFormat = OrthancPluginImageFormat_Png;
4047  params.pixelFormat = format;
4048  params.width = width;
4049  params.height = height;
4050  params.pitch = pitch;
4051  params.buffer = buffer;
4052  params.quality = 0; /* Unused for PNG */
4053 
4054  return context->InvokeService(context, _OrthancPluginService_CompressImage, &params);
4055  }
4056 
4057 
4080  OrthancPluginContext* context,
4081  OrthancPluginMemoryBuffer* target,
4082  OrthancPluginPixelFormat format,
4083  uint32_t width,
4084  uint32_t height,
4085  uint32_t pitch,
4086  const void* buffer,
4087  uint8_t quality)
4088  {
4089  _OrthancPluginCompressImage params;
4090  memset(&params, 0, sizeof(params));
4091  params.target = target;
4092  params.imageFormat = OrthancPluginImageFormat_Jpeg;
4093  params.pixelFormat = format;
4094  params.width = width;
4095  params.height = height;
4096  params.pitch = pitch;
4097  params.buffer = buffer;
4098  params.quality = quality;
4099 
4100  return context->InvokeService(context, _OrthancPluginService_CompressImage, &params);
4101  }
4102 
4103 
4104 
4126  ORTHANC_PLUGIN_INLINE void OrthancPluginCompressAndAnswerJpegImage(
4127  OrthancPluginContext* context,
4128  OrthancPluginRestOutput* output,
4129  OrthancPluginPixelFormat format,
4130  uint32_t width,
4131  uint32_t height,
4132  uint32_t pitch,
4133  const void* buffer,
4134  uint8_t quality)
4135  {
4136  _OrthancPluginCompressAndAnswerImage params;
4137  params.output = output;
4138  params.imageFormat = OrthancPluginImageFormat_Jpeg;
4139  params.pixelFormat = format;
4140  params.width = width;
4141  params.height = height;
4142  params.pitch = pitch;
4143  params.buffer = buffer;
4144  params.quality = quality;
4145  context->InvokeService(context, _OrthancPluginService_CompressAndAnswerImage, &params);
4146  }
4147 
4148 
4149 
4150 
4151  typedef struct
4152  {
4153  OrthancPluginMemoryBuffer* target;
4154  OrthancPluginHttpMethod method;
4155  const char* url;
4156  const char* username;
4157  const char* password;
4158  const void* body;
4159  uint32_t bodySize;
4160  } _OrthancPluginCallHttpClient;
4161 
4162 
4180  OrthancPluginContext* context,
4181  OrthancPluginMemoryBuffer* target,
4182  const char* url,
4183  const char* username,
4184  const char* password)
4185  {
4186  _OrthancPluginCallHttpClient params;
4187  memset(&params, 0, sizeof(params));
4188 
4189  params.target = target;
4190  params.method = OrthancPluginHttpMethod_Get;
4191  params.url = url;
4192  params.username = username;
4193  params.password = password;
4194 
4195  return context->InvokeService(context, _OrthancPluginService_CallHttpClient, &params);
4196  }
4197 
4198 
4218  OrthancPluginContext* context,
4219  OrthancPluginMemoryBuffer* target,
4220  const char* url,
4221  const void* body,
4222  uint32_t bodySize,
4223  const char* username,
4224  const char* password)
4225  {
4226  _OrthancPluginCallHttpClient params;
4227  memset(&params, 0, sizeof(params));
4228 
4229  params.target = target;
4230  params.method = OrthancPluginHttpMethod_Post;
4231  params.url = url;
4232  params.body = body;
4233  params.bodySize = bodySize;
4234  params.username = username;
4235  params.password = password;
4236 
4237  return context->InvokeService(context, _OrthancPluginService_CallHttpClient, &params);
4238  }
4239 
4240 
4260  OrthancPluginContext* context,
4261  OrthancPluginMemoryBuffer* target,
4262  const char* url,
4263  const void* body,
4264  uint32_t bodySize,
4265  const char* username,
4266  const char* password)
4267  {
4268  _OrthancPluginCallHttpClient params;
4269  memset(&params, 0, sizeof(params));
4270 
4271  params.target = target;
4272  params.method = OrthancPluginHttpMethod_Put;
4273  params.url = url;
4274  params.body = body;
4275  params.bodySize = bodySize;
4276  params.username = username;
4277  params.password = password;
4278 
4279  return context->InvokeService(context, _OrthancPluginService_CallHttpClient, &params);
4280  }
4281 
4282 
4298  OrthancPluginContext* context,
4299  const char* url,
4300  const char* username,
4301  const char* password)
4302  {
4303  _OrthancPluginCallHttpClient params;
4304  memset(&params, 0, sizeof(params));
4305 
4306  params.method = OrthancPluginHttpMethod_Delete;
4307  params.url = url;
4308  params.username = username;
4309  params.password = password;
4310 
4311  return context->InvokeService(context, _OrthancPluginService_CallHttpClient, &params);
4312  }
4313 
4314 
4315 
4316  typedef struct
4317  {
4318  OrthancPluginImage** target;
4319  const OrthancPluginImage* source;
4320  OrthancPluginPixelFormat targetFormat;
4321  } _OrthancPluginConvertPixelFormat;
4322 
4323 
4336  OrthancPluginContext* context,
4337  const OrthancPluginImage* source,
4338  OrthancPluginPixelFormat targetFormat)
4339  {
4340  OrthancPluginImage* target = NULL;
4341 
4342  _OrthancPluginConvertPixelFormat params;
4343  params.target = &target;
4344  params.source = source;
4345  params.targetFormat = targetFormat;
4346 
4347  if (context->InvokeService(context, _OrthancPluginService_ConvertPixelFormat, &params) != OrthancPluginErrorCode_Success)
4348  {
4349  return NULL;
4350  }
4351  else
4352  {
4353  return target;
4354  }
4355  }
4356 
4357 
4358 
4370  ORTHANC_PLUGIN_INLINE uint32_t OrthancPluginGetFontsCount(
4371  OrthancPluginContext* context)
4372  {
4373  uint32_t count = 0;
4374 
4375  _OrthancPluginReturnSingleValue params;
4376  memset(&params, 0, sizeof(params));
4377  params.resultUint32 = &count;
4378 
4379  if (context->InvokeService(context, _OrthancPluginService_GetFontsCount, &params) != OrthancPluginErrorCode_Success)
4380  {
4381  /* Error */
4382  return 0;
4383  }
4384  else
4385  {
4386  return count;
4387  }
4388  }
4389 
4390 
4391 
4392 
4393  typedef struct
4394  {
4395  uint32_t fontIndex; /* in */
4396  const char** name; /* out */
4397  uint32_t* size; /* out */
4398  } _OrthancPluginGetFontInfo;
4399 
4410  ORTHANC_PLUGIN_INLINE const char* OrthancPluginGetFontName(
4411  OrthancPluginContext* context,
4412  uint32_t fontIndex)
4413  {
4414  const char* result = NULL;
4415 
4416  _OrthancPluginGetFontInfo params;
4417  memset(&params, 0, sizeof(params));
4418  params.name = &result;
4419  params.fontIndex = fontIndex;
4420 
4421  if (context->InvokeService(context, _OrthancPluginService_GetFontInfo, &params) != OrthancPluginErrorCode_Success)
4422  {
4423  return NULL;
4424  }
4425  else
4426  {
4427  return result;
4428  }
4429  }
4430 
4431 
4442  ORTHANC_PLUGIN_INLINE uint32_t OrthancPluginGetFontSize(
4443  OrthancPluginContext* context,
4444  uint32_t fontIndex)
4445  {
4446  uint32_t result;
4447 
4448  _OrthancPluginGetFontInfo params;
4449  memset(&params, 0, sizeof(params));
4450  params.size = &result;
4451  params.fontIndex = fontIndex;
4452 
4453  if (context->InvokeService(context, _OrthancPluginService_GetFontInfo, &params) != OrthancPluginErrorCode_Success)
4454  {
4455  return 0;
4456  }
4457  else
4458  {
4459  return result;
4460  }
4461  }
4462 
4463 
4464 
4465  typedef struct
4466  {
4467  OrthancPluginImage* image;
4468  uint32_t fontIndex;
4469  const char* utf8Text;
4470  int32_t x;
4471  int32_t y;
4472  uint8_t r;
4473  uint8_t g;
4474  uint8_t b;
4475  } _OrthancPluginDrawText;
4476 
4477 
4496  OrthancPluginContext* context,
4497  OrthancPluginImage* image,
4498  uint32_t fontIndex,
4499  const char* utf8Text,
4500  int32_t x,
4501  int32_t y,
4502  uint8_t r,
4503  uint8_t g,
4504  uint8_t b)
4505  {
4506  _OrthancPluginDrawText params;
4507  memset(&params, 0, sizeof(params));
4508  params.image = image;
4509  params.fontIndex = fontIndex;
4510  params.utf8Text = utf8Text;
4511  params.x = x;
4512  params.y = y;
4513  params.r = r;
4514  params.g = g;
4515  params.b = b;
4516 
4517  return context->InvokeService(context, _OrthancPluginService_DrawText, &params);
4518  }
4519 
4520 
4521 
4522  typedef struct
4523  {
4524  OrthancPluginStorageArea* storageArea;
4525  const char* uuid;
4526  const void* content;
4527  uint64_t size;
4529  } _OrthancPluginStorageAreaCreate;
4530 
4531 
4548  OrthancPluginContext* context,
4549  OrthancPluginStorageArea* storageArea,
4550  const char* uuid,
4551  const void* content,
4552  uint64_t size,
4554  {
4555  _OrthancPluginStorageAreaCreate params;
4556  params.storageArea = storageArea;
4557  params.uuid = uuid;
4558  params.content = content;
4559  params.size = size;
4560  params.type = type;
4561 
4562  return context->InvokeService(context, _OrthancPluginService_StorageAreaCreate, &params);
4563  }
4564 
4565 
4566  typedef struct
4567  {
4568  OrthancPluginMemoryBuffer* target;
4569  OrthancPluginStorageArea* storageArea;
4570  const char* uuid;
4572  } _OrthancPluginStorageAreaRead;
4573 
4574 
4590  OrthancPluginContext* context,
4591  OrthancPluginMemoryBuffer* target,
4592  OrthancPluginStorageArea* storageArea,
4593  const char* uuid,
4595  {
4596  _OrthancPluginStorageAreaRead params;
4597  params.target = target;
4598  params.storageArea = storageArea;
4599  params.uuid = uuid;
4600  params.type = type;
4601 
4602  return context->InvokeService(context, _OrthancPluginService_StorageAreaRead, &params);
4603  }
4604 
4605 
4606  typedef struct
4607  {
4608  OrthancPluginStorageArea* storageArea;
4609  const char* uuid;
4611  } _OrthancPluginStorageAreaRemove;
4612 
4627  OrthancPluginContext* context,
4628  OrthancPluginStorageArea* storageArea,
4629  const char* uuid,
4631  {
4632  _OrthancPluginStorageAreaRemove params;
4633  params.storageArea = storageArea;
4634  params.uuid = uuid;
4635  params.type = type;
4636 
4637  return context->InvokeService(context, _OrthancPluginService_StorageAreaRemove, &params);
4638  }
4639 
4640 
4641 
4642  typedef struct
4643  {
4644  OrthancPluginErrorCode* target;
4645  int32_t code;
4646  uint16_t httpStatus;
4647  const char* message;
4648  } _OrthancPluginRegisterErrorCode;
4649 
4666  OrthancPluginContext* context,
4667  int32_t code,
4668  uint16_t httpStatus,
4669  const char* message)
4670  {
4671  OrthancPluginErrorCode target;
4672 
4673  _OrthancPluginRegisterErrorCode params;
4674  params.target = &target;
4675  params.code = code;
4676  params.httpStatus = httpStatus;
4677  params.message = message;
4678 
4679  if (context->InvokeService(context, _OrthancPluginService_RegisterErrorCode, &params) == OrthancPluginErrorCode_Success)
4680  {
4681  return target;
4682  }
4683  else
4684  {
4685  /* There was an error while assigned the error. Use a generic code. */
4687  }
4688  }
4689 
4690 
4691 
4692  typedef struct
4693  {
4694  uint16_t group;
4695  uint16_t element;
4697  const char* name;
4698  uint32_t minMultiplicity;
4699  uint32_t maxMultiplicity;
4700  } _OrthancPluginRegisterDictionaryTag;
4701 
4722  OrthancPluginContext* context,
4723  uint16_t group,
4724  uint16_t element,
4726  const char* name,
4727  uint32_t minMultiplicity,
4728  uint32_t maxMultiplicity)
4729  {
4730  _OrthancPluginRegisterDictionaryTag params;
4731  params.group = group;
4732  params.element = element;
4733  params.vr = vr;
4734  params.name = name;
4735  params.minMultiplicity = minMultiplicity;
4736  params.maxMultiplicity = maxMultiplicity;
4737 
4738  return context->InvokeService(context, _OrthancPluginService_RegisterDictionaryTag, &params);
4739  }
4740 
4741 
4742 
4743  typedef struct
4744  {
4745  uint16_t group;
4746  uint16_t element;
4748  const char* name;
4749  uint32_t minMultiplicity;
4750  uint32_t maxMultiplicity;
4751  const char* privateCreator;
4752  } _OrthancPluginRegisterPrivateDictionaryTag;
4753 
4775  OrthancPluginContext* context,
4776  uint16_t group,
4777  uint16_t element,
4779  const char* name,
4780  uint32_t minMultiplicity,
4781  uint32_t maxMultiplicity,
4782  const char* privateCreator)
4783  {
4784  _OrthancPluginRegisterPrivateDictionaryTag params;
4785  params.group = group;
4786  params.element = element;
4787  params.vr = vr;
4788  params.name = name;
4789  params.minMultiplicity = minMultiplicity;
4790  params.maxMultiplicity = maxMultiplicity;
4791  params.privateCreator = privateCreator;
4792 
4793  return context->InvokeService(context, _OrthancPluginService_RegisterPrivateDictionaryTag, &params);
4794  }
4795 
4796 
4797 
4798  typedef struct
4799  {
4800  OrthancPluginStorageArea* storageArea;
4802  } _OrthancPluginReconstructMainDicomTags;
4803 
4819  OrthancPluginContext* context,
4820  OrthancPluginStorageArea* storageArea,
4822  {
4823  _OrthancPluginReconstructMainDicomTags params;
4824  params.level = level;
4825  params.storageArea = storageArea;
4826 
4827  return context->InvokeService(context, _OrthancPluginService_ReconstructMainDicomTags, &params);
4828  }
4829 
4830 
4831  typedef struct
4832  {
4833  char** result;
4834  const char* instanceId;
4835  const void* buffer;
4836  uint32_t size;
4839  uint32_t maxStringLength;
4840  } _OrthancPluginDicomToJson;
4841 
4842 
4862  ORTHANC_PLUGIN_INLINE char* OrthancPluginDicomBufferToJson(
4863  OrthancPluginContext* context,
4864  const void* buffer,
4865  uint32_t size,
4868  uint32_t maxStringLength)
4869  {
4870  char* result;
4871 
4872  _OrthancPluginDicomToJson params;
4873  memset(&params, 0, sizeof(params));
4874  params.result = &result;
4875  params.buffer = buffer;
4876  params.size = size;
4877  params.format = format;
4878  params.flags = flags;
4879  params.maxStringLength = maxStringLength;
4880 
4881  if (context->InvokeService(context, _OrthancPluginService_DicomBufferToJson, &params) != OrthancPluginErrorCode_Success)
4882  {
4883  /* Error */
4884  return NULL;
4885  }
4886  else
4887  {
4888  return result;
4889  }
4890  }
4891 
4892 
4911  ORTHANC_PLUGIN_INLINE char* OrthancPluginDicomInstanceToJson(
4912  OrthancPluginContext* context,
4913  const char* instanceId,
4916  uint32_t maxStringLength)
4917  {
4918  char* result;
4919 
4920  _OrthancPluginDicomToJson params;
4921  memset(&params, 0, sizeof(params));
4922  params.result = &result;
4923  params.instanceId = instanceId;
4924  params.format = format;
4925  params.flags = flags;
4926  params.maxStringLength = maxStringLength;
4927 
4928  if (context->InvokeService(context, _OrthancPluginService_DicomInstanceToJson, &params) != OrthancPluginErrorCode_Success)
4929  {
4930  /* Error */
4931  return NULL;
4932  }
4933  else
4934  {
4935  return result;
4936  }
4937  }
4938 
4939 
4940  typedef struct
4941  {
4942  OrthancPluginMemoryBuffer* target;
4943  const char* uri;
4944  uint32_t headersCount;
4945  const char* const* headersKeys;
4946  const char* const* headersValues;
4947  int32_t afterPlugins;
4948  } _OrthancPluginRestApiGet2;
4949 
4970  OrthancPluginContext* context,
4971  OrthancPluginMemoryBuffer* target,
4972  const char* uri,
4973  uint32_t headersCount,
4974  const char* const* headersKeys,
4975  const char* const* headersValues,
4976  int32_t afterPlugins)
4977  {
4978  _OrthancPluginRestApiGet2 params;
4979  params.target = target;
4980  params.uri = uri;
4981  params.headersCount = headersCount;
4982  params.headersKeys = headersKeys;
4983  params.headersValues = headersValues;
4984  params.afterPlugins = afterPlugins;
4985 
4986  return context->InvokeService(context, _OrthancPluginService_RestApiGet2, &params);
4987  }
4988 
4989 
4990 
4991  typedef struct
4992  {
4994  } _OrthancPluginWorklistCallback;
4995 
5008  OrthancPluginContext* context,
5010  {
5011  _OrthancPluginWorklistCallback params;
5012  params.callback = callback;
5013 
5014  return context->InvokeService(context, _OrthancPluginService_RegisterWorklistCallback, &params);
5015  }
5016 
5017 
5018 
5019  typedef struct
5020  {
5022  const OrthancPluginWorklistQuery* query;
5023  const void* dicom;
5024  uint32_t size;
5025  } _OrthancPluginWorklistAnswersOperation;
5026 
5044  OrthancPluginContext* context,
5046  const OrthancPluginWorklistQuery* query,
5047  const void* dicom,
5048  uint32_t size)
5049  {
5050  _OrthancPluginWorklistAnswersOperation params;
5051  params.answers = answers;
5052  params.query = query;
5053  params.dicom = dicom;
5054  params.size = size;
5055 
5056  return context->InvokeService(context, _OrthancPluginService_WorklistAddAnswer, &params);
5057  }
5058 
5059 
5074  OrthancPluginContext* context,
5076  {
5077  _OrthancPluginWorklistAnswersOperation params;
5078  params.answers = answers;
5079  params.query = NULL;
5080  params.dicom = NULL;
5081  params.size = 0;
5082 
5083  return context->InvokeService(context, _OrthancPluginService_WorklistMarkIncomplete, &params);
5084  }
5085 
5086 
5087  typedef struct
5088  {
5089  const OrthancPluginWorklistQuery* query;
5090  const void* dicom;
5091  uint32_t size;
5092  int32_t* isMatch;
5093  OrthancPluginMemoryBuffer* target;
5094  } _OrthancPluginWorklistQueryOperation;
5095 
5111  ORTHANC_PLUGIN_INLINE int32_t OrthancPluginWorklistIsMatch(
5112  OrthancPluginContext* context,
5113  const OrthancPluginWorklistQuery* query,
5114  const void* dicom,
5115  uint32_t size)
5116  {
5117  int32_t isMatch = 0;
5118 
5119  _OrthancPluginWorklistQueryOperation params;
5120  params.query = query;
5121  params.dicom = dicom;
5122  params.size = size;
5123  params.isMatch = &isMatch;
5124  params.target = NULL;
5125 
5126  if (context->InvokeService(context, _OrthancPluginService_WorklistIsMatch, &params) == OrthancPluginErrorCode_Success)
5127  {
5128  return isMatch;
5129  }
5130  else
5131  {
5132  /* Error: Assume non-match */
5133  return 0;
5134  }
5135  }
5136 
5137 
5151  OrthancPluginContext* context,
5152  OrthancPluginMemoryBuffer* target,
5153  const OrthancPluginWorklistQuery* query)
5154  {
5155  _OrthancPluginWorklistQueryOperation params;
5156  params.query = query;
5157  params.dicom = NULL;
5158  params.size = 0;
5159  params.isMatch = NULL;
5160  params.target = target;
5161 
5162  return context->InvokeService(context, _OrthancPluginService_WorklistGetDicomQuery, &params);
5163  }
5164 
5165 
5177  OrthancPluginContext* context,
5178  const OrthancPluginDicomInstance* instance)
5179  {
5181 
5182  _OrthancPluginAccessDicomInstance params;
5183  memset(&params, 0, sizeof(params));
5184  params.resultOrigin = &origin;
5185  params.instance = instance;
5186 
5187  if (context->InvokeService(context, _OrthancPluginService_GetInstanceOrigin, &params) != OrthancPluginErrorCode_Success)
5188  {
5189  /* Error */
5191  }
5192  else
5193  {
5194  return origin;
5195  }
5196  }
5197 
5198 
5199  typedef struct
5200  {
5201  OrthancPluginMemoryBuffer* target;
5202  const char* json;
5203  const OrthancPluginImage* pixelData;
5205  } _OrthancPluginCreateDicom;
5206 
5226  OrthancPluginContext* context,
5227  OrthancPluginMemoryBuffer* target,
5228  const char* json,
5229  const OrthancPluginImage* pixelData,
5231  {
5232  _OrthancPluginCreateDicom params;
5233  params.target = target;
5234  params.json = json;
5235  params.pixelData = pixelData;
5236  params.flags = flags;
5237 
5238  return context->InvokeService(context, _OrthancPluginService_CreateDicom, &params);
5239  }
5240 
5241 
5242  typedef struct
5243  {
5245  } _OrthancPluginDecodeImageCallback;
5246 
5262  OrthancPluginContext* context,
5264  {
5265  _OrthancPluginDecodeImageCallback params;
5266  params.callback = callback;
5267 
5268  return context->InvokeService(context, _OrthancPluginService_RegisterDecodeImageCallback, &params);
5269  }
5270 
5271 
5272 
5273  typedef struct
5274  {
5275  OrthancPluginImage** target;
5276  OrthancPluginPixelFormat format;
5277  uint32_t width;
5278  uint32_t height;
5279  uint32_t pitch;
5280  void* buffer;
5281  const void* constBuffer;
5282  uint32_t bufferSize;
5283  uint32_t frameIndex;
5284  } _OrthancPluginCreateImage;
5285 
5286 
5300  OrthancPluginContext* context,
5301  OrthancPluginPixelFormat format,
5302  uint32_t width,
5303  uint32_t height)
5304  {
5305  OrthancPluginImage* target = NULL;
5306 
5307  _OrthancPluginCreateImage params;
5308  memset(&params, 0, sizeof(params));
5309  params.target = &target;
5310  params.format = format;
5311  params.width = width;
5312  params.height = height;
5313 
5314  if (context->InvokeService(context, _OrthancPluginService_CreateImage, &params) != OrthancPluginErrorCode_Success)
5315  {
5316  return NULL;
5317  }
5318  else
5319  {
5320  return target;
5321  }
5322  }
5323 
5324 
5343  OrthancPluginContext* context,
5344  OrthancPluginPixelFormat format,
5345  uint32_t width,
5346  uint32_t height,
5347  uint32_t pitch,
5348  void* buffer)
5349  {
5350  OrthancPluginImage* target = NULL;
5351 
5352  _OrthancPluginCreateImage params;
5353  memset(&params, 0, sizeof(params));
5354  params.target = &target;
5355  params.format = format;
5356  params.width = width;
5357  params.height = height;
5358  params.pitch = pitch;
5359  params.buffer = buffer;
5360 
5361  if (context->InvokeService(context, _OrthancPluginService_CreateImageAccessor, &params) != OrthancPluginErrorCode_Success)
5362  {
5363  return NULL;
5364  }
5365  else
5366  {
5367  return target;
5368  }
5369  }
5370 
5371 
5372 
5389  OrthancPluginContext* context,
5390  const void* buffer,
5391  uint32_t bufferSize,
5392  uint32_t frameIndex)
5393  {
5394  OrthancPluginImage* target = NULL;
5395 
5396  _OrthancPluginCreateImage params;
5397  memset(&params, 0, sizeof(params));
5398  params.target = &target;
5399  params.constBuffer = buffer;
5400  params.bufferSize = bufferSize;
5401  params.frameIndex = frameIndex;
5402 
5403  if (context->InvokeService(context, _OrthancPluginService_DecodeDicomImage, &params) != OrthancPluginErrorCode_Success)
5404  {
5405  return NULL;
5406  }
5407  else
5408  {
5409  return target;
5410  }
5411  }
5412 
5413 
5414 
5415  typedef struct
5416  {
5417  char** result;
5418  const void* buffer;
5419  uint32_t size;
5420  } _OrthancPluginComputeHash;
5421 
5434  ORTHANC_PLUGIN_INLINE char* OrthancPluginComputeMd5(
5435  OrthancPluginContext* context,
5436  const void* buffer,
5437  uint32_t size)
5438  {
5439  char* result;
5440 
5441  _OrthancPluginComputeHash params;
5442  params.result = &result;
5443  params.buffer = buffer;
5444  params.size = size;
5445 
5446  if (context->InvokeService(context, _OrthancPluginService_ComputeMd5, &params) != OrthancPluginErrorCode_Success)
5447  {
5448  /* Error */
5449  return NULL;
5450  }
5451  else
5452  {
5453  return result;
5454  }
5455  }
5456 
5457 
5470  ORTHANC_PLUGIN_INLINE char* OrthancPluginComputeSha1(
5471  OrthancPluginContext* context,
5472  const void* buffer,
5473  uint32_t size)
5474  {
5475  char* result;
5476 
5477  _OrthancPluginComputeHash params;
5478  params.result = &result;
5479  params.buffer = buffer;
5480  params.size = size;
5481 
5482  if (context->InvokeService(context, _OrthancPluginService_ComputeSha1, &params) != OrthancPluginErrorCode_Success)
5483  {
5484  /* Error */
5485  return NULL;
5486  }
5487  else
5488  {
5489  return result;
5490  }
5491  }
5492 
5493 
5494 
5495  typedef struct
5496  {
5498  const char* name;
5499  } _OrthancPluginLookupDictionary;
5500 
5517  OrthancPluginContext* context,
5519  const char* name)
5520  {
5521  _OrthancPluginLookupDictionary params;
5522  params.target = target;
5523  params.name = name;
5524  return context->InvokeService(context, _OrthancPluginService_LookupDictionary, &params);
5525  }
5526 
5527 
5528 
5529  typedef struct
5530  {
5531  OrthancPluginRestOutput* output;
5532  const void* answer;
5533  uint32_t answerSize;
5534  uint32_t headersCount;
5535  const char* const* headersKeys;
5536  const char* const* headersValues;
5537  } _OrthancPluginSendMultipartItem2;
5538 
5560  OrthancPluginContext* context,
5561  OrthancPluginRestOutput* output,
5562  const void* answer,
5563  uint32_t answerSize,
5564  uint32_t headersCount,
5565  const char* const* headersKeys,
5566  const char* const* headersValues)
5567  {
5568  _OrthancPluginSendMultipartItem2 params;
5569  params.output = output;
5570  params.answer = answer;
5571  params.answerSize = answerSize;
5572  params.headersCount = headersCount;
5573  params.headersKeys = headersKeys;
5574  params.headersValues = headersValues;
5575 
5576  return context->InvokeService(context, _OrthancPluginService_SendMultipartItem2, &params);
5577  }
5578 
5579 
5580  typedef struct
5581  {
5583  } _OrthancPluginIncomingHttpRequestFilter;
5584 
5598  OrthancPluginContext* context,
5600  {
5601  _OrthancPluginIncomingHttpRequestFilter params;
5602  params.callback = callback;
5603 
5604  return context->InvokeService(context, _OrthancPluginService_RegisterIncomingHttpRequestFilter, &params);
5605  }
5606 
5607 
5608 
5609  typedef struct
5610  {
5611  OrthancPluginMemoryBuffer* answerBody;
5612  OrthancPluginMemoryBuffer* answerHeaders;
5613  uint16_t* httpStatus;
5614  OrthancPluginHttpMethod method;
5615  const char* url;
5616  uint32_t headersCount;
5617  const char* const* headersKeys;
5618  const char* const* headersValues;
5619  const void* body;
5620  uint32_t bodySize;
5621  const char* username;
5622  const char* password;
5623  uint32_t timeout;
5624  const char* certificateFile;
5625  const char* certificateKeyFile;
5626  const char* certificateKeyPassword;
5627  uint8_t pkcs11;
5628  } _OrthancPluginCallHttpClient2;
5629 
5630 
5631 
5672  OrthancPluginContext* context,
5673  OrthancPluginMemoryBuffer* answerBody,
5674  OrthancPluginMemoryBuffer* answerHeaders,
5675  uint16_t* httpStatus,
5676  OrthancPluginHttpMethod method,
5677  const char* url,
5678  uint32_t headersCount,
5679  const char* const* headersKeys,
5680  const char* const* headersValues,
5681  const void* body,
5682  uint32_t bodySize,
5683  const char* username,
5684  const char* password,
5685  uint32_t timeout,
5686  const char* certificateFile,
5687  const char* certificateKeyFile,
5688  const char* certificateKeyPassword,
5689  uint8_t pkcs11)
5690  {
5691  _OrthancPluginCallHttpClient2 params;
5692  memset(&params, 0, sizeof(params));
5693 
5694  params.answerBody = answerBody;
5695  params.answerHeaders = answerHeaders;
5696  params.httpStatus = httpStatus;
5697  params.method = method;
5698  params.url = url;
5699  params.headersCount = headersCount;
5700  params.headersKeys = headersKeys;
5701  params.headersValues = headersValues;
5702  params.body = body;
5703  params.bodySize = bodySize;
5704  params.username = username;
5705  params.password = password;
5706  params.timeout = timeout;
5707  params.certificateFile = certificateFile;
5708  params.certificateKeyFile = certificateKeyFile;
5709  params.certificateKeyPassword = certificateKeyPassword;
5710  params.pkcs11 = pkcs11;
5711 
5712  return context->InvokeService(context, _OrthancPluginService_CallHttpClient2, &params);
5713  }
5714 
5715 
5726  ORTHANC_PLUGIN_INLINE char* OrthancPluginGenerateUuid(
5727  OrthancPluginContext* context)
5728  {
5729  char* result;
5730 
5731  _OrthancPluginRetrieveDynamicString params;
5732  params.result = &result;
5733  params.argument = NULL;
5734 
5735  if (context->InvokeService(context, _OrthancPluginService_GenerateUuid, &params) != OrthancPluginErrorCode_Success)
5736  {
5737  /* Error */
5738  return NULL;
5739  }
5740  else
5741  {
5742  return result;
5743  }
5744  }
5745 
5746 
5747 
5748 
5749  typedef struct
5750  {
5751  OrthancPluginFindCallback callback;
5752  } _OrthancPluginFindCallback;
5753 
5766  OrthancPluginContext* context,
5767  OrthancPluginFindCallback callback)
5768  {
5769  _OrthancPluginFindCallback params;
5770  params.callback = callback;
5771 
5772  return context->InvokeService(context, _OrthancPluginService_RegisterFindCallback, &params);
5773  }
5774 
5775 
5776  typedef struct
5777  {
5778  OrthancPluginFindAnswers *answers;
5779  const OrthancPluginFindQuery *query;
5780  const void *dicom;
5781  uint32_t size;
5782  uint32_t index;
5783  uint32_t *resultUint32;
5784  uint16_t *resultGroup;
5785  uint16_t *resultElement;
5786  char **resultString;
5787  } _OrthancPluginFindOperation;
5788 
5805  OrthancPluginContext* context,
5806  OrthancPluginFindAnswers* answers,
5807  const void* dicom,
5808  uint32_t size)
5809  {
5810  _OrthancPluginFindOperation params;
5811  memset(&params, 0, sizeof(params));
5812  params.answers = answers;
5813  params.dicom = dicom;
5814  params.size = size;
5815 
5816  return context->InvokeService(context, _OrthancPluginService_FindAddAnswer, &params);
5817  }
5818 
5819 
5834  OrthancPluginContext* context,
5835  OrthancPluginFindAnswers* answers)
5836  {
5837  _OrthancPluginFindOperation params;
5838  memset(&params, 0, sizeof(params));
5839  params.answers = answers;
5840 
5841  return context->InvokeService(context, _OrthancPluginService_FindMarkIncomplete, &params);
5842  }
5843 
5844 
5845 
5857  ORTHANC_PLUGIN_INLINE uint32_t OrthancPluginGetFindQuerySize(
5858  OrthancPluginContext* context,
5859  const OrthancPluginFindQuery* query)
5860  {
5861  uint32_t count = 0;
5862 
5863  _OrthancPluginFindOperation params;
5864  memset(&params, 0, sizeof(params));
5865  params.query = query;
5866  params.resultUint32 = &count;
5867 
5868  if (context->InvokeService(context, _OrthancPluginService_GetFindQuerySize, &params) != OrthancPluginErrorCode_Success)
5869  {
5870  /* Error */
5871  return 0;
5872  }
5873  else
5874  {
5875  return count;
5876  }
5877  }
5878 
5879 
5895  OrthancPluginContext* context,
5896  uint16_t* group,
5897  uint16_t* element,
5898  const OrthancPluginFindQuery* query,
5899  uint32_t index)
5900  {
5901  _OrthancPluginFindOperation params;
5902  memset(&params, 0, sizeof(params));
5903  params.query = query;
5904  params.index = index;
5905  params.resultGroup = group;
5906  params.resultElement = element;
5907 
5908  return context->InvokeService(context, _OrthancPluginService_GetFindQueryTag, &params);
5909  }
5910 
5911 
5925  ORTHANC_PLUGIN_INLINE char* OrthancPluginGetFindQueryTagName(
5926  OrthancPluginContext* context,
5927  const OrthancPluginFindQuery* query,
5928  uint32_t index)
5929  {
5930  char* result;
5931 
5932  _OrthancPluginFindOperation params;
5933  memset(&params, 0, sizeof(params));
5934  params.query = query;
5935  params.index = index;
5936  params.resultString = &result;
5937 
5938  if (context->InvokeService(context, _OrthancPluginService_GetFindQueryTagName, &params) != OrthancPluginErrorCode_Success)
5939  {
5940  /* Error */
5941  return NULL;
5942  }
5943  else
5944  {
5945  return result;
5946  }
5947  }
5948 
5949 
5963  ORTHANC_PLUGIN_INLINE char* OrthancPluginGetFindQueryValue(
5964  OrthancPluginContext* context,
5965  const OrthancPluginFindQuery* query,
5966  uint32_t index)
5967  {
5968  char* result;
5969 
5970  _OrthancPluginFindOperation params;
5971  memset(&params, 0, sizeof(params));
5972  params.query = query;
5973  params.index = index;
5974  params.resultString = &result;
5975 
5976  if (context->InvokeService(context, _OrthancPluginService_GetFindQueryValue, &params) != OrthancPluginErrorCode_Success)
5977  {
5978  /* Error */
5979  return NULL;
5980  }
5981  else
5982  {
5983  return result;
5984  }
5985  }
5986 
5987 
5988 
5989 
5990  typedef struct
5991  {
5992  OrthancPluginMoveCallback callback;
5993  OrthancPluginGetMoveSize getMoveSize;
5994  OrthancPluginApplyMove applyMove;
5995  OrthancPluginFreeMove freeMove;
5996  } _OrthancPluginMoveCallback;
5997 
6012  OrthancPluginContext* context,
6013  OrthancPluginMoveCallback callback,
6014  OrthancPluginGetMoveSize getMoveSize,
6015  OrthancPluginApplyMove applyMove,
6016  OrthancPluginFreeMove freeMove)
6017  {
6018  _OrthancPluginMoveCallback params;
6019  params.callback = callback;
6020  params.getMoveSize = getMoveSize;
6021  params.applyMove = applyMove;
6022  params.freeMove = freeMove;
6023 
6024  return context->InvokeService(context, _OrthancPluginService_RegisterMoveCallback, &params);
6025  }
6026 
6027 
6028 
6029  typedef struct
6030  {
6031  OrthancPluginFindMatcher** target;
6032  const void* query;
6033  uint32_t size;
6034  } _OrthancPluginCreateFindMatcher;
6035 
6036 
6051  OrthancPluginContext* context,
6052  const void* query,
6053  uint32_t size)
6054  {
6055  OrthancPluginFindMatcher* target = NULL;
6056 
6057  _OrthancPluginCreateFindMatcher params;
6058  memset(&params, 0, sizeof(params));
6059  params.target = &target;
6060  params.query = query;
6061  params.size = size;
6062 
6063  if (context->InvokeService(context, _OrthancPluginService_CreateFindMatcher, &params) != OrthancPluginErrorCode_Success)
6064  {
6065  return NULL;
6066  }
6067  else
6068  {
6069  return target;
6070  }
6071  }
6072 
6073 
6074  typedef struct
6075  {
6076  OrthancPluginFindMatcher* matcher;
6077  } _OrthancPluginFreeFindMatcher;
6078 
6088  ORTHANC_PLUGIN_INLINE void OrthancPluginFreeFindMatcher(
6089  OrthancPluginContext* context,
6090  OrthancPluginFindMatcher* matcher)
6091  {
6092  _OrthancPluginFreeFindMatcher params;
6093  params.matcher = matcher;
6094 
6095  context->InvokeService(context, _OrthancPluginService_FreeFindMatcher, &params);
6096  }
6097 
6098 
6099  typedef struct
6100  {
6101  const OrthancPluginFindMatcher* matcher;
6102  const void* dicom;
6103  uint32_t size;
6104  int32_t* isMatch;
6105  } _OrthancPluginFindMatcherIsMatch;
6106 
6121  ORTHANC_PLUGIN_INLINE int32_t OrthancPluginFindMatcherIsMatch(
6122  OrthancPluginContext* context,
6123  const OrthancPluginFindMatcher* matcher,
6124  const void* dicom,
6125  uint32_t size)
6126  {
6127  int32_t isMatch = 0;
6128 
6129  _OrthancPluginFindMatcherIsMatch params;
6130  params.matcher = matcher;
6131  params.dicom = dicom;
6132  params.size = size;
6133  params.isMatch = &isMatch;
6134 
6135  if (context->InvokeService(context, _OrthancPluginService_FindMatcherIsMatch, &params) == OrthancPluginErrorCode_Success)
6136  {
6137  return isMatch;
6138  }
6139  else
6140  {
6141  /* Error: Assume non-match */
6142  return 0;
6143  }
6144  }
6145 
6146 
6147  typedef struct
6148  {
6150  } _OrthancPluginIncomingHttpRequestFilter2;
6151 
6164  OrthancPluginContext* context,
6166  {
6167  _OrthancPluginIncomingHttpRequestFilter2 params;
6168  params.callback = callback;
6169 
6170  return context->InvokeService(context, _OrthancPluginService_RegisterIncomingHttpRequestFilter2, &params);
6171  }
6172 
6173 
6174 
6175  typedef struct
6176  {
6177  OrthancPluginPeers** peers;
6178  } _OrthancPluginGetPeers;
6179 
6192  OrthancPluginContext* context)
6193  {
6194  OrthancPluginPeers* peers = NULL;
6195 
6196  _OrthancPluginGetPeers params;
6197  memset(&params, 0, sizeof(params));
6198  params.peers = &peers;
6199 
6200  if (context->InvokeService(context, _OrthancPluginService_GetPeers, &params) != OrthancPluginErrorCode_Success)
6201  {
6202  return NULL;
6203  }
6204  else
6205  {
6206  return peers;
6207  }
6208  }
6209 
6210 
6211  typedef struct
6212  {
6213  OrthancPluginPeers* peers;
6214  } _OrthancPluginFreePeers;
6215 
6225  ORTHANC_PLUGIN_INLINE void OrthancPluginFreePeers(
6226  OrthancPluginContext* context,
6227  OrthancPluginPeers* peers)
6228  {
6229  _OrthancPluginFreePeers params;
6230  params.peers = peers;
6231 
6232  context->InvokeService(context, _OrthancPluginService_FreePeers, &params);
6233  }
6234 
6235 
6236  typedef struct
6237  {
6238  uint32_t* target;
6239  const OrthancPluginPeers* peers;
6240  } _OrthancPluginGetPeersCount;
6241 
6255  ORTHANC_PLUGIN_INLINE uint32_t OrthancPluginGetPeersCount(
6256  OrthancPluginContext* context,
6257  const OrthancPluginPeers* peers)
6258  {
6259  uint32_t target = 0;
6260 
6261  _OrthancPluginGetPeersCount params;
6262  memset(&params, 0, sizeof(params));
6263  params.target = &target;
6264  params.peers = peers;
6265 
6266  if (context->InvokeService(context, _OrthancPluginService_GetPeersCount, &params) != OrthancPluginErrorCode_Success)
6267  {
6268  /* Error */
6269  return 0;
6270  }
6271  else
6272  {
6273  return target;
6274  }
6275  }
6276 
6277 
6278  typedef struct
6279  {
6280  const char** target;
6281  const OrthancPluginPeers* peers;
6282  uint32_t peerIndex;
6283  const char* userProperty;
6284  } _OrthancPluginGetPeerProperty;
6285 
6303  ORTHANC_PLUGIN_INLINE const char* OrthancPluginGetPeerName(
6304  OrthancPluginContext* context,
6305  const OrthancPluginPeers* peers,
6306  uint32_t peerIndex)
6307  {
6308  const char* target = NULL;
6309 
6310  _OrthancPluginGetPeerProperty params;
6311  memset(&params, 0, sizeof(params));
6312  params.target = &target;
6313  params.peers = peers;
6314  params.peerIndex = peerIndex;
6315  params.userProperty = NULL;
6316 
6317  if (context->InvokeService(context, _OrthancPluginService_GetPeerName, &params) != OrthancPluginErrorCode_Success)
6318  {
6319  /* Error */
6320  return NULL;
6321  }
6322  else
6323  {
6324  return target;
6325  }
6326  }
6327 
6328 
6344  ORTHANC_PLUGIN_INLINE const char* OrthancPluginGetPeerUrl(
6345  OrthancPluginContext* context,
6346  const OrthancPluginPeers* peers,
6347  uint32_t peerIndex)
6348  {
6349  const char* target = NULL;
6350 
6351  _OrthancPluginGetPeerProperty params;
6352  memset(&params, 0, sizeof(params));
6353  params.target = &target;
6354  params.peers = peers;
6355  params.peerIndex = peerIndex;
6356  params.userProperty = NULL;
6357 
6358  if (context->InvokeService(context, _OrthancPluginService_GetPeerUrl, &params) != OrthancPluginErrorCode_Success)
6359  {
6360  /* Error */
6361  return NULL;
6362  }
6363  else
6364  {
6365  return target;
6366  }
6367  }
6368 
6369 
6370 
6390  ORTHANC_PLUGIN_INLINE const char* OrthancPluginGetPeerUserProperty(
6391  OrthancPluginContext* context,
6392  const OrthancPluginPeers* peers,
6393  uint32_t peerIndex,
6394  const char* userProperty)
6395  {
6396  const char* target = NULL;
6397 
6398  _OrthancPluginGetPeerProperty params;
6399  memset(&params, 0, sizeof(params));
6400  params.target = &target;
6401  params.peers = peers;
6402  params.peerIndex = peerIndex;
6403  params.userProperty = userProperty;
6404 
6405  if (context->InvokeService(context, _OrthancPluginService_GetPeerUserProperty, &params) != OrthancPluginErrorCode_Success)
6406  {
6407  /* No such user property */
6408  return NULL;
6409  }
6410  else
6411  {
6412  return target;
6413  }
6414  }
6415 
6416 
6417 
6418  typedef struct
6419  {
6420  OrthancPluginMemoryBuffer* answerBody;
6421  OrthancPluginMemoryBuffer* answerHeaders;
6422  uint16_t* httpStatus;
6423  const OrthancPluginPeers* peers;
6424  uint32_t peerIndex;
6425  OrthancPluginHttpMethod method;
6426  const char* uri;
6427  uint32_t additionalHeadersCount;
6428  const char* const* additionalHeadersKeys;
6429  const char* const* additionalHeadersValues;
6430  const void* body;
6431  uint32_t bodySize;
6432  uint32_t timeout;
6433  } _OrthancPluginCallPeerApi;
6434 
6471  OrthancPluginContext* context,
6472  OrthancPluginMemoryBuffer* answerBody,
6473  OrthancPluginMemoryBuffer* answerHeaders,
6474  uint16_t* httpStatus,
6475  const OrthancPluginPeers* peers,
6476  uint32_t peerIndex,
6477  OrthancPluginHttpMethod method,
6478  const char* uri,
6479  uint32_t additionalHeadersCount,
6480  const char* const* additionalHeadersKeys,
6481  const char* const* additionalHeadersValues,
6482  const void* body,
6483  uint32_t bodySize,
6484  uint32_t timeout)
6485  {
6486  _OrthancPluginCallPeerApi params;
6487  memset(&params, 0, sizeof(params));
6488 
6489  params.answerBody = answerBody;
6490  params.answerHeaders = answerHeaders;
6491  params.httpStatus = httpStatus;
6492  params.peers = peers;
6493  params.peerIndex = peerIndex;
6494  params.method = method;
6495  params.uri = uri;
6496  params.additionalHeadersCount = additionalHeadersCount;
6497  params.additionalHeadersKeys = additionalHeadersKeys;
6498  params.additionalHeadersValues = additionalHeadersValues;
6499  params.body = body;
6500  params.bodySize = bodySize;
6501  params.timeout = timeout;
6502 
6503  return context->InvokeService(context, _OrthancPluginService_CallPeerApi, &params);
6504  }
6505 
6506 
6507 
6508 
6509 
6510  typedef struct
6511  {
6512  OrthancPluginJob** target;
6513  void *job;
6514  OrthancPluginJobFinalize finalize;
6515  const char *type;
6516  OrthancPluginJobGetProgress getProgress;
6517  OrthancPluginJobGetContent getContent;
6518  OrthancPluginJobGetSerialized getSerialized;
6519  OrthancPluginJobStep step;
6520  OrthancPluginJobStop stop;
6521  OrthancPluginJobReset reset;
6522  } _OrthancPluginCreateJob;
6523 
6556  OrthancPluginContext *context,
6557  void *job,
6558  OrthancPluginJobFinalize finalize,
6559  const char *type,
6560  OrthancPluginJobGetProgress getProgress,
6561  OrthancPluginJobGetContent getContent,
6562  OrthancPluginJobGetSerialized getSerialized,
6563  OrthancPluginJobStep step,
6564  OrthancPluginJobStop stop,
6565  OrthancPluginJobReset reset)
6566  {
6567  OrthancPluginJob* target = NULL;
6568 
6569  _OrthancPluginCreateJob params;
6570  memset(&params, 0, sizeof(params));
6571 
6572  params.target = &target;
6573  params.job = job;
6574  params.finalize = finalize;
6575  params.type = type;
6576  params.getProgress = getProgress;
6577  params.getContent = getContent;
6578  params.getSerialized = getSerialized;
6579  params.step = step;
6580  params.stop = stop;
6581  params.reset = reset;
6582 
6583  if (context->InvokeService(context, _OrthancPluginService_CreateJob, &params) != OrthancPluginErrorCode_Success ||
6584  target == NULL)
6585  {
6586  /* Error */
6587  return NULL;
6588  }
6589  else
6590  {
6591  return target;
6592  }
6593  }
6594 
6595 
6596  typedef struct
6597  {
6598  OrthancPluginJob* job;
6599  } _OrthancPluginFreeJob;
6600 
6610  ORTHANC_PLUGIN_INLINE void OrthancPluginFreeJob(
6611  OrthancPluginContext* context,
6612  OrthancPluginJob* job)
6613  {
6614  _OrthancPluginFreeJob params;
6615  params.job = job;
6616 
6617  context->InvokeService(context, _OrthancPluginService_FreeJob, &params);
6618  }
6619 
6620 
6621 
6622  typedef struct
6623  {
6624  char** resultId;
6625  OrthancPluginJob *job;
6626  int priority;
6627  } _OrthancPluginSubmitJob;
6628 
6642  ORTHANC_PLUGIN_INLINE char *OrthancPluginSubmitJob(
6643  OrthancPluginContext *context,
6644  OrthancPluginJob *job,
6645  int priority)
6646  {
6647  char* resultId = NULL;
6648 
6649  _OrthancPluginSubmitJob params;
6650  memset(&params, 0, sizeof(params));
6651 
6652  params.resultId = &resultId;
6653  params.job = job;
6654  params.priority = priority;
6655 
6656  if (context->InvokeService(context, _OrthancPluginService_SubmitJob, &params) != OrthancPluginErrorCode_Success ||
6657  resultId == NULL)
6658  {
6659  /* Error */
6660  return NULL;
6661  }
6662  else
6663  {
6664  return resultId;
6665  }
6666  }
6667 
6668 
6669 
6670  typedef struct
6671  {
6672  OrthancPluginJobsUnserializer unserializer;
6673  } _OrthancPluginJobsUnserializer;
6674 
6687  ORTHANC_PLUGIN_INLINE void OrthancPluginRegisterJobsUnserializer(
6688  OrthancPluginContext* context,
6689  OrthancPluginJobsUnserializer unserializer)
6690  {
6691  _OrthancPluginJobsUnserializer params;
6692  params.unserializer = unserializer;
6693 
6694  context->InvokeService(context, _OrthancPluginService_RegisterJobsUnserializer, &params);
6695  }
6696 
6697 
6698 
6699  typedef struct
6700  {
6701  OrthancPluginRestOutput* output;
6702  const char* details;
6703  uint8_t log;
6704  } _OrthancPluginSetHttpErrorDetails;
6705 
6723  ORTHANC_PLUGIN_INLINE void OrthancPluginSetHttpErrorDetails(
6724  OrthancPluginContext* context,
6725  OrthancPluginRestOutput* output,
6726  const char* details,
6727  uint8_t log)
6728  {
6729  _OrthancPluginSetHttpErrorDetails params;
6730  params.output = output;
6731  params.details = details;
6732  params.log = log;
6733  context->InvokeService(context, _OrthancPluginService_SetHttpErrorDetails, &params);
6734  }
6735 
6736 
6737 
6738  typedef struct
6739  {
6740  const char** result;
6741  const char* argument;
6742  } _OrthancPluginRetrieveStaticString;
6743 
6755  ORTHANC_PLUGIN_INLINE const char* OrthancPluginAutodetectMimeType(
6756  OrthancPluginContext* context,
6757  const char* path)
6758  {
6759  const char* result = NULL;
6760 
6761  _OrthancPluginRetrieveStaticString params;
6762  params.result = &result;
6763  params.argument = path;
6764 
6765  if (context->InvokeService(context, _OrthancPluginService_AutodetectMimeType, &params) != OrthancPluginErrorCode_Success)
6766  {
6767  /* Error */
6768  return NULL;
6769  }
6770  else
6771  {
6772  return result;
6773  }
6774  }
6775 
6776 
6777 
6778  typedef struct
6779  {
6780  const char* name;
6781  float value;
6783  } _OrthancPluginSetMetricsValue;
6784 
6799  ORTHANC_PLUGIN_INLINE void OrthancPluginSetMetricsValue(
6800  OrthancPluginContext* context,
6801  const char* name,
6802  float value,
6804  {
6805  _OrthancPluginSetMetricsValue params;
6806  params.name = name;
6807  params.value = value;
6808  params.type = type;
6809  context->InvokeService(context, _OrthancPluginService_SetMetricsValue, &params);
6810  }
6811 
6812 
6813 
6814  typedef struct
6815  {
6817  } _OrthancPluginRegisterRefreshMetricsCallback;
6818 
6830  OrthancPluginContext* context,
6832  {
6833  _OrthancPluginRegisterRefreshMetricsCallback params;
6834  params.callback = callback;
6835  context->InvokeService(context, _OrthancPluginService_RegisterRefreshMetricsCallback, &params);
6836  }
6837 
6838 
6839 
6840 
6841  typedef struct
6842  {
6843  char** target;
6844  const void* dicom;
6845  uint32_t dicomSize;
6847  } _OrthancPluginEncodeDicomWeb;
6848 
6865  ORTHANC_PLUGIN_INLINE char* OrthancPluginEncodeDicomWebJson(
6866  OrthancPluginContext* context,
6867  const void* dicom,
6868  uint32_t dicomSize,
6870  {
6871  char* target = NULL;
6872 
6873  _OrthancPluginEncodeDicomWeb params;
6874  params.target = &target;
6875  params.dicom = dicom;
6876  params.dicomSize = dicomSize;
6877  params.callback = callback;
6878 
6879  if (context->InvokeService(context, _OrthancPluginService_EncodeDicomWebJson, &params) != OrthancPluginErrorCode_Success)
6880  {
6881  /* Error */
6882  return NULL;
6883  }
6884  else
6885  {
6886  return target;
6887  }
6888  }
6889 
6890 
6907  ORTHANC_PLUGIN_INLINE char* OrthancPluginEncodeDicomWebXml(
6908  OrthancPluginContext* context,
6909  const void* dicom,
6910  uint32_t dicomSize,
6912  {
6913  char* target = NULL;
6914 
6915  _OrthancPluginEncodeDicomWeb params;
6916  params.target = &target;
6917  params.dicom = dicom;
6918  params.dicomSize = dicomSize;
6919  params.callback = callback;
6920 
6921  if (context->InvokeService(context, _OrthancPluginService_EncodeDicomWebXml, &params) != OrthancPluginErrorCode_Success)
6922  {
6923  /* Error */
6924  return NULL;
6925  }
6926  else
6927  {
6928  return target;
6929  }
6930  }
6931 
6932 
6933 
6934  typedef struct
6935  {
6936  char** target;
6937  const void* dicom;
6938  uint32_t dicomSize;
6940  void* payload;
6941  } _OrthancPluginEncodeDicomWeb2;
6942 
6959  ORTHANC_PLUGIN_INLINE char* OrthancPluginEncodeDicomWebJson2(
6960  OrthancPluginContext* context,
6961  const void* dicom,
6962  uint32_t dicomSize,
6964  void* payload)
6965  {
6966  char* target = NULL;
6967 
6968  _OrthancPluginEncodeDicomWeb2 params;
6969  params.target = &target;
6970  params.dicom = dicom;
6971  params.dicomSize = dicomSize;
6972  params.callback = callback;
6973  params.payload = payload;
6974 
6975  if (context->InvokeService(context, _OrthancPluginService_EncodeDicomWebJson2, &params) != OrthancPluginErrorCode_Success)
6976  {
6977  /* Error */
6978  return NULL;
6979  }
6980  else
6981  {
6982  return target;
6983  }
6984  }
6985 
6986 
7003  ORTHANC_PLUGIN_INLINE char* OrthancPluginEncodeDicomWebXml2(
7004  OrthancPluginContext* context,
7005  const void* dicom,
7006  uint32_t dicomSize,
7008  void* payload)
7009  {
7010  char* target = NULL;
7011 
7012  _OrthancPluginEncodeDicomWeb2 params;
7013  params.target = &target;
7014  params.dicom = dicom;
7015  params.dicomSize = dicomSize;
7016  params.callback = callback;
7017  params.payload = payload;
7018 
7019  if (context->InvokeService(context, _OrthancPluginService_EncodeDicomWebXml2, &params) != OrthancPluginErrorCode_Success)
7020  {
7021  /* Error */
7022  return NULL;
7023  }
7024  else
7025  {
7026  return target;
7027  }
7028  }
7029 
7030 
7031 
7048  void* answer,
7049  const char* key,
7050  const char* value);
7051 
7052 
7069  void* answer,
7070  const void* data,
7071  uint32_t size);
7072 
7073 
7088  typedef uint8_t (*OrthancPluginChunkedClientRequestIsDone) (void* request);
7089 
7090 
7106 
7107 
7121  typedef const void* (*OrthancPluginChunkedClientRequestGetChunkData) (void* request);
7122 
7123 
7137  typedef uint32_t (*OrthancPluginChunkedClientRequestGetChunkSize) (void* request);
7138 
7139 
7140  typedef struct
7141  {
7142  void* answer;
7145  uint16_t* httpStatus;
7146  OrthancPluginHttpMethod method;
7147  const char* url;
7148  uint32_t headersCount;
7149  const char* const* headersKeys;
7150  const char* const* headersValues;
7151  void* request;
7156  const char* username;
7157  const char* password;
7158  uint32_t timeout;
7159  const char* certificateFile;
7160  const char* certificateKeyFile;
7161  const char* certificateKeyPassword;
7162  uint8_t pkcs11;
7163  } _OrthancPluginChunkedHttpClient;
7164 
7165 
7217  OrthancPluginContext* context,
7218  void* answer,
7221  uint16_t* httpStatus,
7222  OrthancPluginHttpMethod method,
7223  const char* url,
7224  uint32_t headersCount,
7225  const char* const* headersKeys,
7226  const char* const* headersValues,
7227  void* request,
7232  const char* username,
7233  const char* password,
7234  uint32_t timeout,
7235  const char* certificateFile,
7236  const char* certificateKeyFile,
7237  const char* certificateKeyPassword,
7238  uint8_t pkcs11)
7239  {
7240  _OrthancPluginChunkedHttpClient params;
7241  memset(&params, 0, sizeof(params));
7242 
7243  /* In common with OrthancPluginHttpClient() */
7244  params.httpStatus = httpStatus;
7245  params.method = method;
7246  params.url = url;
7247  params.headersCount = headersCount;
7248  params.headersKeys = headersKeys;
7249  params.headersValues = headersValues;
7250  params.username = username;
7251  params.password = password;
7252  params.timeout = timeout;
7253  params.certificateFile = certificateFile;
7254  params.certificateKeyFile = certificateKeyFile;
7255  params.certificateKeyPassword = certificateKeyPassword;
7256  params.pkcs11 = pkcs11;
7257 
7258  /* For chunked body/answer */
7259  params.answer = answer;
7260  params.answerAddChunk = answerAddChunk;
7261  params.answerAddHeader = answerAddHeader;
7262  params.request = request;
7263  params.requestIsDone = requestIsDone;
7264  params.requestChunkData = requestChunkData;
7265  params.requestChunkSize = requestChunkSize;
7266  params.requestNext = requestNext;
7267 
7268  return context->InvokeService(context, _OrthancPluginService_ChunkedHttpClient, &params);
7269  }
7270 
7271 
7272 
7277  typedef struct _OrthancPluginServerChunkedRequestReader_t OrthancPluginServerChunkedRequestReader;
7278 
7279 
7280 
7298  const char* url,
7299  const OrthancPluginHttpRequest* request);
7300 
7301 
7317  const void* data,
7318  uint32_t size);
7319 
7320 
7337  OrthancPluginRestOutput* output);
7338 
7339 
7355 
7356  typedef struct
7357  {
7358  const char* pathRegularExpression;
7359  OrthancPluginRestCallback getHandler;
7361  OrthancPluginRestCallback deleteHandler;
7366  } _OrthancPluginChunkedRestCallback;
7367 
7368 
7398  ORTHANC_PLUGIN_INLINE void OrthancPluginRegisterChunkedRestCallback(
7399  OrthancPluginContext* context,
7400  const char* pathRegularExpression,
7401  OrthancPluginRestCallback getHandler,
7403  OrthancPluginRestCallback deleteHandler,
7408  {
7409  _OrthancPluginChunkedRestCallback params;
7410  params.pathRegularExpression = pathRegularExpression;
7411  params.getHandler = getHandler;
7412  params.postHandler = postHandler;
7413  params.deleteHandler = deleteHandler;
7414  params.putHandler = putHandler;
7415  params.addChunk = addChunk;
7416  params.execute = execute;
7417  params.finalize = finalize;
7418 
7419  context->InvokeService(context, _OrthancPluginService_RegisterChunkedRestCallback, &params);
7420  }
7421 
7422 
7423 
7424 
7425 
7426  typedef struct
7427  {
7428  char** result;
7429  uint16_t group;
7430  uint16_t element;
7431  const char* privateCreator;
7432  } _OrthancPluginGetTagName;
7433 
7449  ORTHANC_PLUGIN_INLINE char* OrthancPluginGetTagName(
7450  OrthancPluginContext* context,
7451  uint16_t group,
7452  uint16_t element,
7453  const char* privateCreator)
7454  {
7455  char* result;
7456 
7457  _OrthancPluginGetTagName params;
7458  params.result = &result;
7459  params.group = group;
7460  params.element = element;
7461  params.privateCreator = privateCreator;
7462 
7463  if (context->InvokeService(context, _OrthancPluginService_GetTagName, &params) != OrthancPluginErrorCode_Success)
7464  {
7465  /* Error */
7466  return NULL;
7467  }
7468  else
7469  {
7470  return result;
7471  }
7472  }
7473 
7474 
7475 
7505  void** handler /* out */,
7506  const char* jobId,
7507  const char* transactionUid,
7508  const char* const* sopClassUids,
7509  const char* const* sopInstanceUids,
7510  uint32_t countInstances,
7511  const char* remoteAet,
7512  const char* calledAet);
7513 
7514 
7526  typedef void (*OrthancPluginStorageCommitmentDestructor) (void* handler);
7527 
7528 
7549  void* handler,
7550  const char* sopClassUid,
7551  const char* sopInstanceUid);
7552 
7553 
7554  typedef struct
7555  {
7559  } _OrthancPluginRegisterStorageCommitmentScpCallback;
7560 
7575  OrthancPluginContext* context,
7579  {
7580  _OrthancPluginRegisterStorageCommitmentScpCallback params;
7581  params.factory = factory;
7582  params.destructor = destructor;
7583  params.lookup = lookup;
7584  return context->InvokeService(context, _OrthancPluginService_RegisterStorageCommitmentScpCallback, &params);
7585  }
7586 
7587 
7588 
7605  const OrthancPluginDicomInstance* instance);
7606 
7607 
7608  typedef struct
7609  {
7611  } _OrthancPluginIncomingDicomInstanceFilter;
7612 
7636  OrthancPluginContext* context,
7638  {
7639  _OrthancPluginIncomingDicomInstanceFilter params;
7640  params.callback = callback;
7641 
7642  return context->InvokeService(context, _OrthancPluginService_RegisterIncomingDicomInstanceFilter, &params);
7643  }
7644 
7645 
7659  ORTHANC_PLUGIN_INLINE char* OrthancPluginGetInstanceTransferSyntaxUid(
7660  OrthancPluginContext* context,
7661  const OrthancPluginDicomInstance* instance)
7662  {
7663  char* result;
7664 
7665  _OrthancPluginAccessDicomInstance params;
7666  memset(&params, 0, sizeof(params));
7667  params.resultStringToFree = &result;
7668  params.instance = instance;
7669 
7670  if (context->InvokeService(context, _OrthancPluginService_GetInstanceTransferSyntaxUid, &params) != OrthancPluginErrorCode_Success)
7671  {
7672  /* Error */
7673  return NULL;
7674  }
7675  else
7676  {
7677  return result;
7678  }
7679  }
7680 
7681 
7694  ORTHANC_PLUGIN_INLINE int32_t OrthancPluginHasInstancePixelData(
7695  OrthancPluginContext* context,
7696  const OrthancPluginDicomInstance* instance)
7697  {
7698  int64_t hasPixelData;
7699 
7700  _OrthancPluginAccessDicomInstance params;
7701  memset(&params, 0, sizeof(params));
7702  params.resultInt64 = &hasPixelData;
7703  params.instance = instance;
7704 
7705  if (context->InvokeService(context, _OrthancPluginService_HasInstancePixelData, &params) != OrthancPluginErrorCode_Success ||
7706  hasPixelData < 0 ||
7707  hasPixelData > 1)
7708  {
7709  /* Error */
7710  return -1;
7711  }
7712  else
7713  {
7714  return (hasPixelData != 0);
7715  }
7716  }
7717 
7718 
7719 
7720 
7721 
7722 
7723  typedef struct
7724  {
7725  OrthancPluginDicomInstance** target;
7726  const void* buffer;
7727  uint32_t size;
7728  const char* transferSyntax;
7729  } _OrthancPluginCreateDicomInstance;
7730 
7745  OrthancPluginContext* context,
7746  const void* buffer,
7747  uint32_t size)
7748  {
7749  OrthancPluginDicomInstance* target = NULL;
7750 
7751  _OrthancPluginCreateDicomInstance params;
7752  params.target = &target;
7753  params.buffer = buffer;
7754  params.size = size;
7755 
7756  if (context->InvokeService(context, _OrthancPluginService_CreateDicomInstance, &params) != OrthancPluginErrorCode_Success)
7757  {
7758  /* Error */
7759  return NULL;
7760  }
7761  else
7762  {
7763  return target;
7764  }
7765  }
7766 
7767  typedef struct
7768  {
7770  } _OrthancPluginFreeDicomInstance;
7771 
7782  ORTHANC_PLUGIN_INLINE void OrthancPluginFreeDicomInstance(
7783  OrthancPluginContext* context,
7785  {
7786  _OrthancPluginFreeDicomInstance params;
7787  params.dicom = dicom;
7788 
7789  context->InvokeService(context, _OrthancPluginService_FreeDicomInstance, &params);
7790  }
7791 
7792 
7793  typedef struct
7794  {
7795  uint32_t* targetUint32;
7796  OrthancPluginMemoryBuffer* targetBuffer;
7797  OrthancPluginImage** targetImage;
7798  char** targetStringToFree;
7799  const OrthancPluginDicomInstance* instance;
7800  uint32_t frameIndex;
7803  uint32_t maxStringLength;
7804  OrthancPluginDicomWebBinaryCallback2 dicomWebCallback;
7805  void* dicomWebPayload;
7806  } _OrthancPluginAccessDicomInstance2;
7807 
7819  ORTHANC_PLUGIN_INLINE uint32_t OrthancPluginGetInstanceFramesCount(
7820  OrthancPluginContext* context,
7821  const OrthancPluginDicomInstance* instance)
7822  {
7823  uint32_t count;
7824 
7825  _OrthancPluginAccessDicomInstance2 params;
7826  memset(&params, 0, sizeof(params));
7827  params.targetUint32 = &count;
7828  params.instance = instance;
7829 
7830  if (context->InvokeService(context, _OrthancPluginService_GetInstanceFramesCount, &params) != OrthancPluginErrorCode_Success)
7831  {
7832  /* Error */
7833  return 0;
7834  }
7835  else
7836  {
7837  return count;
7838  }
7839  }
7840 
7841 
7860  OrthancPluginContext* context,
7861  OrthancPluginMemoryBuffer* target,
7862  const OrthancPluginDicomInstance* instance,
7863  uint32_t frameIndex)
7864  {
7865  _OrthancPluginAccessDicomInstance2 params;
7866  memset(&params, 0, sizeof(params));
7867  params.targetBuffer = target;
7868  params.instance = instance;
7869  params.frameIndex = frameIndex;
7870 
7871  return context->InvokeService(context, _OrthancPluginService_GetInstanceRawFrame, &params);
7872  }
7873 
7874 
7888  OrthancPluginContext* context,
7889  const OrthancPluginDicomInstance* instance,
7890  uint32_t frameIndex)
7891  {
7892  OrthancPluginImage* target = NULL;
7893 
7894  _OrthancPluginAccessDicomInstance2 params;
7895  memset(&params, 0, sizeof(params));
7896  params.targetImage = &target;
7897  params.instance = instance;
7898  params.frameIndex = frameIndex;
7899 
7900  if (context->InvokeService(context, _OrthancPluginService_GetInstanceDecodedFrame, &params) != OrthancPluginErrorCode_Success)
7901  {
7902  return NULL;
7903  }
7904  else
7905  {
7906  return target;
7907  }
7908  }
7909 
7910 
7927  OrthancPluginContext* context,
7928  const void* buffer,
7929  uint32_t size,
7930  const char* transferSyntax)
7931  {
7932  OrthancPluginDicomInstance* target = NULL;
7933 
7934  _OrthancPluginCreateDicomInstance params;
7935  params.target = &target;
7936  params.buffer = buffer;
7937  params.size = size;
7938  params.transferSyntax = transferSyntax;
7939 
7940  if (context->InvokeService(context, _OrthancPluginService_TranscodeDicomInstance, &params) != OrthancPluginErrorCode_Success)
7941  {
7942  /* Error */
7943  return NULL;
7944  }
7945  else
7946  {
7947  return target;
7948  }
7949  }
7950 
7965  OrthancPluginContext* context,
7966  OrthancPluginMemoryBuffer* target,
7967  const OrthancPluginDicomInstance* instance)
7968  {
7969  _OrthancPluginAccessDicomInstance2 params;
7970  memset(&params, 0, sizeof(params));
7971  params.targetBuffer = target;
7972  params.instance = instance;
7973 
7974  return context->InvokeService(context, _OrthancPluginService_SerializeDicomInstance, &params);
7975  }
7976 
7977 
7996  ORTHANC_PLUGIN_INLINE char* OrthancPluginGetInstanceAdvancedJson(
7997  OrthancPluginContext* context,
7998  const OrthancPluginDicomInstance* instance,
8001  uint32_t maxStringLength)
8002  {
8003  char* result = NULL;
8004 
8005  _OrthancPluginAccessDicomInstance2 params;
8006  memset(&params, 0, sizeof(params));
8007  params.targetStringToFree = &result;
8008  params.instance = instance;
8009  params.format = format;
8010  params.flags = flags;
8011  params.maxStringLength = maxStringLength;
8012 
8013  if (context->InvokeService(context, _OrthancPluginService_GetInstanceAdvancedJson, &params) != OrthancPluginErrorCode_Success)
8014  {
8015  /* Error */
8016  return NULL;
8017  }
8018  else
8019  {
8020  return result;
8021  }
8022  }
8023 
8024 
8039  ORTHANC_PLUGIN_INLINE char* OrthancPluginGetInstanceDicomWebJson(
8040  OrthancPluginContext* context,
8041  const OrthancPluginDicomInstance* instance,
8043  void* payload)
8044  {
8045  char* target = NULL;
8046 
8047  _OrthancPluginAccessDicomInstance2 params;
8048  params.targetStringToFree = &target;
8049  params.instance = instance;
8050  params.dicomWebCallback = callback;
8051  params.dicomWebPayload = payload;
8052 
8053  if (context->InvokeService(context, _OrthancPluginService_GetInstanceDicomWebJson, &params) != OrthancPluginErrorCode_Success)
8054  {
8055  /* Error */
8056  return NULL;
8057  }
8058  else
8059  {
8060  return target;
8061  }
8062  }
8063 
8064 
8079  ORTHANC_PLUGIN_INLINE char* OrthancPluginGetInstanceDicomWebXml(
8080  OrthancPluginContext* context,
8081  const OrthancPluginDicomInstance* instance,
8083  void* payload)
8084  {
8085  char* target = NULL;
8086 
8087  _OrthancPluginAccessDicomInstance2 params;
8088  params.targetStringToFree = &target;
8089  params.instance = instance;
8090  params.dicomWebCallback = callback;
8091  params.dicomWebPayload = payload;
8092 
8093  if (context->InvokeService(context, _OrthancPluginService_GetInstanceDicomWebXml, &params) != OrthancPluginErrorCode_Success)
8094  {
8095  /* Error */
8096  return NULL;
8097  }
8098  else
8099  {
8100  return target;
8101  }
8102  }
8103 
8104 
8105 
8125  OrthancPluginMemoryBuffer* transcoded /* out */,
8126  const void* buffer,
8127  uint64_t size,
8128  const char* const* allowedSyntaxes,
8129  uint32_t countSyntaxes,
8130  uint8_t allowNewSopInstanceUid);
8131 
8132 
8133  typedef struct
8134  {
8136  } _OrthancPluginTranscoderCallback;
8137 
8152  OrthancPluginContext* context,
8154  {
8155  _OrthancPluginTranscoderCallback params;
8156  params.callback = callback;
8157 
8158  return context->InvokeService(context, _OrthancPluginService_RegisterTranscoderCallback, &params);
8159  }
8160 
8161 
8162 
8163  typedef struct
8164  {
8165  OrthancPluginMemoryBuffer* target;
8166  uint32_t size;
8167  } _OrthancPluginCreateMemoryBuffer;
8168 
8187  OrthancPluginContext* context,
8188  OrthancPluginMemoryBuffer* target,
8189  uint32_t size)
8190  {
8191  _OrthancPluginCreateMemoryBuffer params;
8192  params.target = target;
8193  params.size = size;
8194 
8195  return context->InvokeService(context, _OrthancPluginService_CreateMemoryBuffer, &params);
8196  }
8197 
8198 
8199 #ifdef __cplusplus
8200 }
8201 #endif
8202 
8203 
char * OrthancPluginGetInstanceTransferSyntaxUid(OrthancPluginContext *context, const OrthancPluginDicomInstance *instance)
Get the transfer syntax of a DICOM file.
Definition: OrthancCPlugin.h:7659
Definition: OrthancCPlugin.h:758
Definition: OrthancCPlugin.h:860
OrthancPluginChangeType
Definition: OrthancCPlugin.h:710
Definition: OrthancCPlugin.h:233
void OrthancPluginSendHttpStatusCode(OrthancPluginContext *context, OrthancPluginRestOutput *output, uint16_t status)
Send a HTTP status code.
Definition: OrthancCPlugin.h:2643
void OrthancPluginFreePeers(OrthancPluginContext *context, OrthancPluginPeers *peers)
Free the list of available Orthanc peers.
Definition: OrthancCPlugin.h:6225
struct _OrthancPluginRestOutput_t OrthancPluginRestOutput
Opaque structure that represents the HTTP connection to the client application.
Definition: OrthancCPlugin.h:1017
OrthancPluginErrorCode OrthancPluginFindAddAnswer(OrthancPluginContext *context, OrthancPluginFindAnswers *answers, const void *dicom, uint32_t size)
Add one answer to some C-Find request.
Definition: OrthancCPlugin.h:5804
void OrthancPluginSetHttpHeader(OrthancPluginContext *context, OrthancPluginRestOutput *output, const char *key, const char *value)
Set some HTTP header.
Definition: OrthancCPlugin.h:2744
Definition: OrthancCPlugin.h:781
Definition: OrthancCPlugin.h:949
OrthancPluginImage * OrthancPluginGetInstanceDecodedFrame(OrthancPluginContext *context, const OrthancPluginDicomInstance *instance, uint32_t frameIndex)
Decode one frame from a DICOM instance.
Definition: OrthancCPlugin.h:7887
Definition: OrthancCPlugin.h:270
void OrthancPluginLogInfo(OrthancPluginContext *context, const char *message)
Log an information.
Definition: OrthancCPlugin.h:1900
OrthancPluginErrorCode OrthancPluginRegisterDecodeImageCallback(OrthancPluginContext *context, OrthancPluginDecodeImageCallback callback)
Register a callback to handle the decoding of DICOM images.
Definition: OrthancCPlugin.h:5261
OrthancPluginErrorCode OrthancPluginHttpClient(OrthancPluginContext *context, OrthancPluginMemoryBuffer *answerBody, OrthancPluginMemoryBuffer *answerHeaders, uint16_t *httpStatus, OrthancPluginHttpMethod method, const char *url, uint32_t headersCount, const char *const *headersKeys, const char *const *headersValues, const void *body, uint32_t bodySize, const char *username, const char *password, uint32_t timeout, const char *certificateFile, const char *certificateKeyFile, const char *certificateKeyPassword, uint8_t pkcs11)
Issue a HTTP call with full flexibility.
Definition: OrthancCPlugin.h:5671
Definition: OrthancCPlugin.h:861
The parameters of a REST request.
Definition: OrthancCPlugin.h:332
void OrthancPluginRedirect(OrthancPluginContext *context, OrthancPluginRestOutput *output, const char *redirection)
Redirect a REST request.
Definition: OrthancCPlugin.h:2426
OrthancPluginContentType
Definition: OrthancCPlugin.h:679
OrthancPluginErrorCode OrthancPluginRestApiDeleteAfterPlugins(OrthancPluginContext *context, const char *uri)
Make a DELETE call to the REST API, as tainted by the plugins.
Definition: OrthancCPlugin.h:2331
Definition: OrthancCPlugin.h:696
char * OrthancPluginGetInstanceDicomWebXml(OrthancPluginContext *context, const OrthancPluginDicomInstance *instance, OrthancPluginDicomWebBinaryCallback2 callback, void *payload)
Convert a DICOM instance to DICOMweb XML.
Definition: OrthancCPlugin.h:8079
OrthancPluginErrorCode(* OrthancPluginChunkedClientRequestNext)(void *request)
Callback to advance in the request body during a chunked transfer.
Definition: OrthancCPlugin.h:7105
Definition: OrthancCPlugin.h:780
struct _OrthancPluginDicomWebNode_t OrthancPluginDicomWebNode
Opaque structure that represents a node in a JSON or XML document used in DICOMweb.
Definition: OrthancCPlugin.h:1106
Definition: OrthancCPlugin.h:892
OrthancPluginErrorCode OrthancPluginCompressPngImage(OrthancPluginContext *context, OrthancPluginMemoryBuffer *target, OrthancPluginPixelFormat format, uint32_t width, uint32_t height, uint32_t pitch, const void *buffer)
Encode a PNG image.
Definition: OrthancCPlugin.h:4034
void OrthancPluginCompressAndAnswerJpegImage(OrthancPluginContext *context, OrthancPluginRestOutput *output, OrthancPluginPixelFormat format, uint32_t width, uint32_t height, uint32_t pitch, const void *buffer, uint8_t quality)
Answer to a REST request with a JPEG image.
Definition: OrthancCPlugin.h:4126
OrthancPluginJobStepStatus
Definition: OrthancCPlugin.h:902
int OrthancPluginCheckVersion(OrthancPluginContext *context)
Check the compatibility of the plugin wrt. the version of its hosting Orthanc.
Definition: OrthancCPlugin.h:1833
void OrthancPluginSetHttpErrorDetails(OrthancPluginContext *context, OrthancPluginRestOutput *output, const char *details, uint8_t log)
Provide a detailed description for an HTTP error.
Definition: OrthancCPlugin.h:6723
OrthancPluginErrorCode OrthancPluginSerializeDicomInstance(OrthancPluginContext *context, OrthancPluginMemoryBuffer *target, const OrthancPluginDicomInstance *instance)
Writes a DICOM instance to a memory buffer.
Definition: OrthancCPlugin.h:7964
Definition: OrthancCPlugin.h:262
Definition: OrthancCPlugin.h:203
Definition: OrthancCPlugin.h:260
OrthancPluginInstanceOrigin
Definition: OrthancCPlugin.h:887
const char *(* OrthancPluginJobGetContent)(void *job)
Callback to retrieve the content of one custom job.
Definition: OrthancCPlugin.h:1473
OrthancPluginDicomInstance * OrthancPluginTranscodeDicomInstance(OrthancPluginContext *context, const void *buffer, uint32_t size, const char *transferSyntax)
Parse and transcode a DICOM instance.
Definition: OrthancCPlugin.h:7926
Definition: OrthancCPlugin.h:778
Definition: OrthancCPlugin.h:920
char * OrthancPluginGetInstanceAdvancedJson(OrthancPluginContext *context, const OrthancPluginDicomInstance *instance, OrthancPluginDicomToJsonFormat format, OrthancPluginDicomToJsonFlags flags, uint32_t maxStringLength)
Format a DICOM memory buffer as a JSON string.
Definition: OrthancCPlugin.h:7996
OrthancPluginErrorCode OrthancPluginRegisterPrivateDictionaryTag(OrthancPluginContext *context, uint16_t group, uint16_t element, OrthancPluginValueRepresentation vr, const char *name, uint32_t minMultiplicity, uint32_t maxMultiplicity, const char *privateCreator)
Register a new private tag into the DICOM dictionary.
Definition: OrthancCPlugin.h:4774
char * OrthancPluginGetInstanceSimplifiedJson(OrthancPluginContext *context, const OrthancPluginDicomInstance *instance)
Get the DICOM tag hierarchy as a JSON file (with simplification).
Definition: OrthancCPlugin.h:2920
OrthancPluginErrorCode OrthancPluginRestApiPostAfterPlugins(OrthancPluginContext *context, OrthancPluginMemoryBuffer *target, const char *uri, const void *body, uint32_t bodySize)
Make a POST call to the REST API, as tainted by the plugins.
Definition: OrthancCPlugin.h:2279
Definition: OrthancCPlugin.h:285
Graylevel, unsigned 16bpp image.
Definition: OrthancCPlugin.h:603
Definition: OrthancCPlugin.h:725
Definition: OrthancCPlugin.h:225
const char *const * headersValues
The values of the HTTP headers.
Definition: OrthancCPlugin.h:392
Definition: OrthancCPlugin.h:272
Definition: OrthancCPlugin.h:274
const char *const * headersKeys
The keys of the HTTP headers (always converted to low-case).
Definition: OrthancCPlugin.h:387
Definition: OrthancCPlugin.h:258
OrthancPluginCreateDicomFlags
Definition: OrthancCPlugin.h:842
char * OrthancPluginComputeSha1(OrthancPluginContext *context, const void *buffer, uint32_t size)
Compute a SHA-1 hash.
Definition: OrthancCPlugin.h:5470
OrthancPluginJob * OrthancPluginCreateJob(OrthancPluginContext *context, void *job, OrthancPluginJobFinalize finalize, const char *type, OrthancPluginJobGetProgress getProgress, OrthancPluginJobGetContent getContent, OrthancPluginJobGetSerialized getSerialized, OrthancPluginJobStep step, OrthancPluginJobStop stop, OrthancPluginJobReset reset)
Create a custom job.
Definition: OrthancCPlugin.h:6555
Definition: OrthancCPlugin.h:276
OrthancPluginPixelFormat
Definition: OrthancCPlugin.h:587
Definition: OrthancCPlugin.h:893
uint32_t getCount
For a GET request, the number of GET parameters.
Definition: OrthancCPlugin.h:352
char * OrthancPluginSubmitJob(OrthancPluginContext *context, OrthancPluginJob *job, int priority)
Submit a new job to the jobs engine of Orthanc.
Definition: OrthancCPlugin.h:6642
Definition: OrthancCPlugin.h:629
void OrthancPluginRegisterStorageArea(OrthancPluginContext *context, OrthancPluginStorageCreate create, OrthancPluginStorageRead read, OrthancPluginStorageRemove remove)
Register a custom storage area.
Definition: OrthancCPlugin.h:3048
const char * OrthancPluginAutodetectMimeType(OrthancPluginContext *context, const char *path)
Detect the MIME type of a file.
Definition: OrthancCPlugin.h:6755
Definition: OrthancCPlugin.h:876
OrthancPluginErrorCode OrthancPluginGetDicomForInstance(OrthancPluginContext *context, OrthancPluginMemoryBuffer *target, const char *instanceId)
Retrieve a DICOM instance using its Orthanc identifier.
Definition: OrthancCPlugin.h:2144
struct _OrthancPluginServerChunkedRequestReader_t OrthancPluginServerChunkedRequestReader
Opaque structure that reads the content of a HTTP request body during a chunked HTTP transfer...
Definition: OrthancCPlugin.h:7277
OrthancPluginImageFormat
Definition: OrthancCPlugin.h:755
Definition: OrthancCPlugin.h:211
Definition: OrthancCPlugin.h:298
void OrthancPluginFreeString(OrthancPluginContext *context, char *str)
Free a string.
Definition: OrthancCPlugin.h:1698
Definition: OrthancCPlugin.h:282
OrthancPluginErrorCode OrthancPluginRegisterStorageCommitmentScpCallback(OrthancPluginContext *context, OrthancPluginStorageCommitmentFactory factory, OrthancPluginStorageCommitmentDestructor destructor, OrthancPluginStorageCommitmentLookup lookup)
Register a callback to handle incoming requests to the storage commitment SCP.
Definition: OrthancCPlugin.h:7574
const char * OrthancPluginGetFontName(OrthancPluginContext *context, uint32_t fontIndex)
Return the name of a font.
Definition: OrthancCPlugin.h:4410
Definition: OrthancCPlugin.h:231
Definition: OrthancCPlugin.h:288
Definition: OrthancCPlugin.h:280
OrthancPluginErrorCode OrthancPluginSendMultipartItem2(OrthancPluginContext *context, OrthancPluginRestOutput *output, const void *answer, uint32_t answerSize, uint32_t headersCount, const char *const *headersKeys, const char *const *headersValues)
Send an item as a part of some HTTP multipart answer, with custom headers.
Definition: OrthancCPlugin.h:5559
Definition: OrthancCPlugin.h:320
Definition: OrthancCPlugin.h:222
char * OrthancPluginComputeMd5(OrthancPluginContext *context, const void *buffer, uint32_t size)
Compute an MD5 hash.
Definition: OrthancCPlugin.h:5434
Definition: OrthancCPlugin.h:904
Definition: OrthancCPlugin.h:224
OrthancPluginErrorCode
Definition: OrthancCPlugin.h:197
struct _OrthancPluginJob_t OrthancPluginJob
Opaque structure to a job to be executed by Orthanc.
Definition: OrthancCPlugin.h:1097
OrthancPluginImage * OrthancPluginConvertPixelFormat(OrthancPluginContext *context, const OrthancPluginImage *source, OrthancPluginPixelFormat targetFormat)
Change the pixel format of an image.
Definition: OrthancCPlugin.h:4335
Definition: OrthancCPlugin.h:283
OrthancPluginErrorCode(* OrthancPluginWorklistCallback)(OrthancPluginWorklistAnswers *answers, const OrthancPluginWorklistQuery *query, const char *issuerAet, const char *calledAet)
Callback to handle the C-Find SCP requests for worklists.
Definition: OrthancCPlugin.h:1250
OrthancPluginErrorCode OrthancPluginCreateMemoryBuffer(OrthancPluginContext *context, OrthancPluginMemoryBuffer *target, uint32_t size)
Create a memory buffer.
Definition: OrthancCPlugin.h:8186
Definition: OrthancCPlugin.h:719
OrthancPluginErrorCode OrthancPluginStorageAreaRead(OrthancPluginContext *context, OrthancPluginMemoryBuffer *target, OrthancPluginStorageArea *storageArea, const char *uuid, OrthancPluginContentType type)
Read a file from the storage area.
Definition: OrthancCPlugin.h:4589
OrthancPluginErrorCode OrthancPluginRegisterIncomingDicomInstanceFilter(OrthancPluginContext *context, OrthancPluginIncomingDicomInstanceFilter callback)
Register a callback to filter incoming DICOM instances.
Definition: OrthancCPlugin.h:7635
uint32_t OrthancPluginGetFontsCount(OrthancPluginContext *context)
Return the number of available fonts.
Definition: OrthancCPlugin.h:4370
char * OrthancPluginGetConfigurationPath(OrthancPluginContext *context)
Return the path to the configuration file(s).
Definition: OrthancCPlugin.h:3145
Definition: OrthancCPlugin.h:220
OrthancPluginErrorCode OrthancPluginGetFindQueryTag(OrthancPluginContext *context, uint16_t *group, uint16_t *element, const OrthancPluginFindQuery *query, uint32_t index)
Get one tag in a C-Find query.
Definition: OrthancCPlugin.h:5894
void OrthancPluginRegisterOnChangeCallback(OrthancPluginContext *context, OrthancPluginOnChangeCallback callback)
Register a callback to monitor changes.
Definition: OrthancCPlugin.h:3191
Color image in RGBA32 format.
Definition: OrthancCPlugin.h:627
Definition: OrthancCPlugin.h:826
OrthancPluginDicomToJsonFlags
Definition: OrthancCPlugin.h:823
Definition: OrthancCPlugin.h:921
Definition: OrthancCPlugin.h:213
void OrthancPluginSendMethodNotAllowed(OrthancPluginContext *context, OrthancPluginRestOutput *output, const char *allowedMethods)
Signal that this URI does not support this HTTP method.
Definition: OrthancCPlugin.h:2689
Definition: OrthancCPlugin.h:742
OrthancPluginErrorCode OrthancPluginRestApiPut(OrthancPluginContext *context, OrthancPluginMemoryBuffer *target, const char *uri, const void *body, uint32_t bodySize)
Make a PUT call to the built-in Orthanc REST API.
Definition: OrthancCPlugin.h:2356
char * OrthancPluginGenerateUuid(OrthancPluginContext *context)
Generate an UUID.
Definition: OrthancCPlugin.h:5726
void(* OrthancPluginDicomWebBinaryCallback2)(OrthancPluginDicomWebNode *node, OrthancPluginDicomWebSetBinaryNode setter, uint32_t levelDepth, const uint16_t *levelTagGroup, const uint16_t *levelTagElement, const uint32_t *levelIndex, uint16_t tagGroup, uint16_t tagElement, OrthancPluginValueRepresentation vr, void *payload)
Callback executed to encode a binary tag in DICOMweb.
Definition: OrthancCPlugin.h:1647
float(* OrthancPluginJobGetProgress)(void *job)
Callback to check the progress of one custom job.
Definition: OrthancCPlugin.h:1458
Definition: OrthancCPlugin.h:727
uint8_t(* OrthancPluginChunkedClientRequestIsDone)(void *request)
Callback to know whether the request body is entirely read during a chunked transfer.
Definition: OrthancCPlugin.h:7088
Definition: OrthancCPlugin.h:919
Definition: OrthancCPlugin.h:713
struct _OrthancPluginContext_t OrthancPluginContext
Data structure that contains information about the Orthanc core.
OrthancPluginImage * OrthancPluginDecodeDicomImage(OrthancPluginContext *context, const void *buffer, uint32_t bufferSize, uint32_t frameIndex)
Decode one frame from a DICOM instance.
Definition: OrthancCPlugin.h:5388
Definition: OrthancCPlugin.h:259
OrthancPluginDicomToJsonFormat
Definition: OrthancCPlugin.h:808
OrthancPluginErrorCode OrthancPluginLookupDictionary(OrthancPluginContext *context, OrthancPluginDictionaryEntry *target, const char *name)
Get information about the given DICOM tag.
Definition: OrthancCPlugin.h:5516
OrthancPluginErrorCode(* OrthancPluginJobStop)(void *job, OrthancPluginJobStopReason reason)
Callback executed once one custom job leaves the "running" state.
Definition: OrthancCPlugin.h:1530
Definition: OrthancCPlugin.h:810
const void *(* OrthancPluginChunkedClientRequestGetChunkData)(void *request)
Callback to read the current chunk of the request body during a chunked transfer. ...
Definition: OrthancCPlugin.h:7121
OrthancPluginErrorCode OrthancPluginRegisterErrorCode(OrthancPluginContext *context, int32_t code, uint16_t httpStatus, const char *message)
Declare a custom error code for this plugin.
Definition: OrthancCPlugin.h:4665
Definition: OrthancCPlugin.h:240
uint16_t group
Definition: OrthancCPlugin.h:1681
void * OrthancPluginGetImageBuffer(OrthancPluginContext *context, const OrthancPluginImage *image)
Return a pointer to the content of an image.
Definition: OrthancCPlugin.h:3904
int32_t(* OrthancPluginIncomingHttpRequestFilter)(OrthancPluginHttpMethod method, const char *uri, const char *ip, uint32_t headersCount, const char *const *headersKeys, const char *const *headersValues)
Callback to filter incoming HTTP requests received by Orthanc.
Definition: OrthancCPlugin.h:1277
Definition: OrthancCPlugin.h:771
uint32_t minMultiplicity
Definition: OrthancCPlugin.h:1684
Definition: OrthancCPlugin.h:812
OrthancPluginErrorCode(* OrthancPluginTranscoderCallback)(OrthancPluginMemoryBuffer *transcoded, const void *buffer, uint64_t size, const char *const *allowedSyntaxes, uint32_t countSyntaxes, uint8_t allowNewSopInstanceUid)
Signature of a callback function to transcode a DICOM instance.
Definition: OrthancCPlugin.h:8124
Definition: OrthancCPlugin.h:783
OrthancPluginErrorCode OrthancPluginWorklistAddAnswer(OrthancPluginContext *context, OrthancPluginWorklistAnswers *answers, const OrthancPluginWorklistQuery *query, const void *dicom, uint32_t size)
Add one answer to some modality worklist request.
Definition: OrthancCPlugin.h:5043
OrthancPluginErrorCode OrthancPluginHttpPut(OrthancPluginContext *context, OrthancPluginMemoryBuffer *target, const char *url, const void *body, uint32_t bodySize, const char *username, const char *password)
Issue a HTTP PUT call.
Definition: OrthancCPlugin.h:4259
Definition: OrthancCPlugin.h:918
OrthancPluginJobStopReason
Definition: OrthancCPlugin.h:916
struct _OrthancPluginWorklistQuery_t OrthancPluginWorklistQuery
Opaque structure to an object that represents a C-Find query for worklists.
Definition: OrthancCPlugin.h:1049
Definition: OrthancCPlugin.h:757
Definition: OrthancCPlugin.h:252
struct _OrthancPluginStorageArea_t OrthancPluginStorageArea
Opaque structure that represents the storage area that is actually used by Orthanc.
Definition: OrthancCPlugin.h:1041
Definition: OrthancCPlugin.h:244
Definition: OrthancCPlugin.h:681
char * OrthancPluginGetInstanceJson(OrthancPluginContext *context, const OrthancPluginDicomInstance *instance)
Get the DICOM tag hierarchy as a JSON file.
Definition: OrthancCPlugin.h:2882
Definition: OrthancCPlugin.h:717
Color image in RGB48 format.
Definition: OrthancCPlugin.h:637
uint32_t OrthancPluginGetExpectedDatabaseVersion(OrthancPluginContext *context)
Get the expected version of the database schema.
Definition: OrthancCPlugin.h:3436
Definition: OrthancCPlugin.h:275
Graylevel 8bpp image.
Definition: OrthancCPlugin.h:595
Definition: OrthancCPlugin.h:273
Definition: OrthancCPlugin.h:214
OrthancPluginConstraintType
Definition: OrthancCPlugin.h:872
Definition: OrthancCPlugin.h:729
OrthancPluginResourceType
Definition: OrthancCPlugin.h:693
OrthancPluginHttpMethod
Definition: OrthancCPlugin.h:317
void(* OrthancPluginDicomWebSetBinaryNode)(OrthancPluginDicomWebNode *node, OrthancPluginDicomWebBinaryMode mode, const char *bulkDataUri)
Signature of a function to set the content of a node encoding a binary DICOM tag, into a JSON or XML ...
Definition: OrthancCPlugin.h:1168
OrthancPluginDicomInstance * OrthancPluginCreateDicomInstance(OrthancPluginContext *context, const void *buffer, uint32_t size)
Parse a DICOM instance.
Definition: OrthancCPlugin.h:7744
Definition: OrthancCPlugin.h:230
uint32_t OrthancPluginGetImageHeight(OrthancPluginContext *context, const OrthancPluginImage *image)
Return the height of an image.
Definition: OrthancCPlugin.h:3835
OrthancPluginValueRepresentation
Definition: OrthancCPlugin.h:769
char * OrthancPluginGetConfiguration(OrthancPluginContext *context)
Return the content of the configuration file(s).
Definition: OrthancCPlugin.h:3469
Definition: OrthancCPlugin.h:201
void OrthancPluginSendHttpStatus(OrthancPluginContext *context, OrthancPluginRestOutput *output, uint16_t status, const char *body, uint32_t bodySize)
Send a HTTP status, with a custom body.
Definition: OrthancCPlugin.h:3733
OrthancPluginImage * OrthancPluginUncompressImage(OrthancPluginContext *context, const void *data, uint32_t size, OrthancPluginImageFormat format)
Decode a compressed image.
Definition: OrthancCPlugin.h:3947
Definition: OrthancCPlugin.h:278
Definition: OrthancCPlugin.h:773
Definition: OrthancCPlugin.h:217
char * OrthancPluginEncodeDicomWebXml(OrthancPluginContext *context, const void *dicom, uint32_t dicomSize, OrthancPluginDicomWebBinaryCallback callback)
Convert a DICOM instance to DICOMweb XML.
Definition: OrthancCPlugin.h:6907
Definition: OrthancCPlugin.h:698
OrthancPluginErrorCode(* OrthancPluginRestCallback)(OrthancPluginRestOutput *output, const char *url, const OrthancPluginHttpRequest *request)
Signature of a callback function that answers to a REST request.
Definition: OrthancCPlugin.h:1114
Definition: OrthancCPlugin.h:269
Definition: OrthancCPlugin.h:743
int32_t(* OrthancPluginIncomingHttpRequestFilter2)(OrthancPluginHttpMethod method, const char *uri, const char *ip, uint32_t headersCount, const char *const *headersKeys, const char *const *headersValues, uint32_t getArgumentsCount, const char *const *getArgumentsKeys, const char *const *getArgumentsValues)
Callback to filter incoming HTTP requests received by Orthanc.
Definition: OrthancCPlugin.h:1308
OrthancPluginErrorCode OrthancPluginGetInstanceRawFrame(OrthancPluginContext *context, OrthancPluginMemoryBuffer *target, const OrthancPluginDicomInstance *instance, uint32_t frameIndex)
Get the raw content of a frame in a DICOM instance.
Definition: OrthancCPlugin.h:7859
Definition: OrthancCPlugin.h:776
Definition: OrthancCPlugin.h:286
Definition: OrthancCPlugin.h:906
void OrthancPluginSetMetricsValue(OrthancPluginContext *context, const char *name, float value, OrthancPluginMetricsType type)
Set the value of a metrics.
Definition: OrthancCPlugin.h:6799
char * OrthancPluginGetOrthancDirectory(OrthancPluginContext *context)
Return the directory containing the Orthanc.
Definition: OrthancCPlugin.h:3110
Definition: OrthancCPlugin.h:235
OrthancPluginErrorCode OrthancPluginRestApiPost(OrthancPluginContext *context, OrthancPluginMemoryBuffer *target, const char *uri, const void *body, uint32_t bodySize)
Make a POST call to the built-in Orthanc REST API.
Definition: OrthancCPlugin.h:2244
Definition: OrthancCPlugin.h:745
Definition: OrthancCPlugin.h:795
Definition: OrthancCPlugin.h:261
Color image in RGB24 format.
Definition: OrthancCPlugin.h:619
OrthancPluginErrorCode OrthancPluginRegisterIncomingHttpRequestFilter2(OrthancPluginContext *context, OrthancPluginIncomingHttpRequestFilter2 callback)
Register a callback to filter incoming HTTP requests.
Definition: OrthancCPlugin.h:6163
Graylevel, signed 16bpp image.
Definition: OrthancCPlugin.h:611
Definition: OrthancCPlugin.h:930
An entry in the dictionary of DICOM tags.
Definition: OrthancCPlugin.h:1679
Definition: OrthancCPlugin.h:271
Definition: OrthancCPlugin.h:207
struct _OrthancPluginFindMatcher_t OrthancPluginFindMatcher
Opaque structure to an object that can be used to check whether a DICOM instance matches a C-Find que...
Definition: OrthancCPlugin.h:1081
Definition: OrthancCPlugin.h:712
OrthancPluginCompressionType
Definition: OrthancCPlugin.h:740
Definition: OrthancCPlugin.h:199
OrthancPluginErrorCode OrthancPluginRestApiGet2(OrthancPluginContext *context, OrthancPluginMemoryBuffer *target, const char *uri, uint32_t headersCount, const char *const *headersKeys, const char *const *headersValues, int32_t afterPlugins)
Make a GET call to the Orthanc REST API, with custom HTTP headers.
Definition: OrthancCPlugin.h:4969
Definition: OrthancCPlugin.h:829
struct _OrthancPluginPeers_t OrthancPluginPeers
Opaque structure to the set of remote Orthanc Peers that are known to the local Orthanc server...
Definition: OrthancCPlugin.h:1089
OrthancPluginPixelFormat OrthancPluginGetImagePixelFormat(OrthancPluginContext *context, const OrthancPluginImage *image)
Return the pixel format of an image.
Definition: OrthancCPlugin.h:3769
OrthancPluginErrorCode OrthancPluginDrawText(OrthancPluginContext *context, OrthancPluginImage *image, uint32_t fontIndex, const char *utf8Text, int32_t x, int32_t y, uint8_t r, uint8_t g, uint8_t b)
Draw text on an image.
Definition: OrthancCPlugin.h:4495
uint32_t OrthancPluginGetImagePitch(OrthancPluginContext *context, const OrthancPluginImage *image)
Return the pitch of an image.
Definition: OrthancCPlugin.h:3870
Definition: OrthancCPlugin.h:682
void OrthancPluginCompressAndAnswerPngImage(OrthancPluginContext *context, OrthancPluginRestOutput *output, OrthancPluginPixelFormat format, uint32_t width, uint32_t height, uint32_t pitch, const void *buffer)
Answer to a REST request with a PNG image.
Definition: OrthancCPlugin.h:2103
Definition: OrthancCPlugin.h:291
Definition: OrthancCPlugin.h:297
OrthancPluginJobStepStatus(* OrthancPluginJobStep)(void *job)
Callback to execute one step of a custom job.
Definition: OrthancCPlugin.h:1506
uint32_t maxMultiplicity
Definition: OrthancCPlugin.h:1685
Definition: OrthancCPlugin.h:948
Definition: OrthancCPlugin.h:290
OrthancPluginErrorCode(* OrthancPluginDecodeImageCallback)(OrthancPluginImage **target, const void *dicom, const uint32_t size, uint32_t frameIndex)
Signature of a callback function to decode a DICOM instance as an image.
Definition: OrthancCPlugin.h:1146
char * OrthancPluginDicomBufferToJson(OrthancPluginContext *context, const void *buffer, uint32_t size, OrthancPluginDicomToJsonFormat format, OrthancPluginDicomToJsonFlags flags, uint32_t maxStringLength)
Format a DICOM memory buffer as a JSON string.
Definition: OrthancCPlugin.h:4862
void(* OrthancPluginFree)(void *buffer)
Signature of a function to free dynamic memory.
Definition: OrthancCPlugin.h:1158
Definition: OrthancCPlugin.h:877
uint32_t OrthancPluginGetCommandLineArgumentsCount(OrthancPluginContext *context)
Get the number of command-line arguments.
Definition: OrthancCPlugin.h:3370
Definition: OrthancCPlugin.h:242
void OrthancPluginSendUnauthorized(OrthancPluginContext *context, OrthancPluginRestOutput *output, const char *realm)
Signal that a REST request is not authorized.
Definition: OrthancCPlugin.h:2666
OrthancPluginErrorCode OrthancPluginCallPeerApi(OrthancPluginContext *context, OrthancPluginMemoryBuffer *answerBody, OrthancPluginMemoryBuffer *answerHeaders, uint16_t *httpStatus, const OrthancPluginPeers *peers, uint32_t peerIndex, OrthancPluginHttpMethod method, const char *uri, uint32_t additionalHeadersCount, const char *const *additionalHeadersKeys, const char *const *additionalHeadersValues, const void *body, uint32_t bodySize, uint32_t timeout)
Call the REST API of an Orthanc peer.
Definition: OrthancCPlugin.h:6470
Definition: OrthancCPlugin.h:209
Graylevel, unsigned 64bpp image.
Definition: OrthancCPlugin.h:669
Definition: OrthancCPlugin.h:267
Definition: OrthancCPlugin.h:255
void OrthancPluginFreeFindMatcher(OrthancPluginContext *context, OrthancPluginFindMatcher *matcher)
Free a C-Find matcher.
Definition: OrthancCPlugin.h:6088
Definition: OrthancCPlugin.h:287
void OrthancPluginLogError(OrthancPluginContext *context, const char *message)
Log an error.
Definition: OrthancCPlugin.h:1868
Definition: OrthancCPlugin.h:228
OrthancPluginFindMatcher * OrthancPluginCreateFindMatcher(OrthancPluginContext *context, const void *query, uint32_t size)
Create a C-Find matcher.
Definition: OrthancCPlugin.h:6050
void * data
The content of the buffer.
Definition: OrthancCPlugin.h:1002
uint32_t OrthancPluginGetFontSize(OrthancPluginContext *context, uint32_t fontIndex)
Return the size of a font.
Definition: OrthancCPlugin.h:4442
void OrthancPluginExtendOrthancExplorer(OrthancPluginContext *context, const char *javascript)
Extend the JavaScript code of Orthanc Explorer.
Definition: OrthancCPlugin.h:3266
Definition: OrthancCPlugin.h:891
void(* OrthancPluginRefreshMetricsCallback)()
Callback executed to update the metrics of the plugin.
Definition: OrthancCPlugin.h:1581
OrthancPluginErrorCode OrthancPluginRestApiGet(OrthancPluginContext *context, OrthancPluginMemoryBuffer *target, const char *uri)
Make a GET call to the built-in Orthanc REST API.
Definition: OrthancCPlugin.h:2177
const char * OrthancPluginGetErrorDescription(OrthancPluginContext *context, OrthancPluginErrorCode error)
Get the description of a given error code.
Definition: OrthancCPlugin.h:3680
uint32_t headersCount
The number of HTTP headers.
Definition: OrthancCPlugin.h:382
Definition: OrthancCPlugin.h:728
const void * OrthancPluginGetInstanceData(OrthancPluginContext *context, const OrthancPluginDicomInstance *instance)
Get the data of a DICOM file.
Definition: OrthancCPlugin.h:2846
Definition: OrthancCPlugin.h:718
Definition: OrthancCPlugin.h:828
void OrthancPluginFreeMemoryBuffer(OrthancPluginContext *context, OrthancPluginMemoryBuffer *buffer)
Free a memory buffer.
Definition: OrthancCPlugin.h:1852
OrthancPluginErrorCode OrthancPluginRegisterWorklistCallback(OrthancPluginContext *context, OrthancPluginWorklistCallback callback)
Register a callback to handle modality worklists requests.
Definition: OrthancCPlugin.h:5007
OrthancPluginErrorCode(* OrthancPluginStorageCreate)(const char *uuid, const void *content, int64_t size, OrthancPluginContentType type)
Callback for writing to the storage area.
Definition: OrthancCPlugin.h:1187
int OrthancPluginHasInstanceMetadata(OrthancPluginContext *context, const OrthancPluginDicomInstance *instance, const char *metadata)
Check whether a DICOM instance is associated with some metadata.
Definition: OrthancCPlugin.h:2959
void *(* OrthancPluginMoveCallback)(OrthancPluginResourceType resourceType, const char *patientId, const char *accessionNumber, const char *studyInstanceUid, const char *seriesInstanceUid, const char *sopInstanceUid, const char *originatorAet, const char *sourceAet, const char *targetAet, uint16_t originatorId)
Callback to handle incoming C-Move SCP requests.
Definition: OrthancCPlugin.h:1378
Definition: OrthancCPlugin.h:789
OrthancPluginErrorCode OrthancPluginRestApiDelete(OrthancPluginContext *context, const char *uri)
Make a DELETE call to the built-in Orthanc REST API.
Definition: OrthancCPlugin.h:2308
Definition: OrthancCPlugin.h:793
OrthancPluginErrorCode(* OrthancPluginStorageCommitmentLookup)(OrthancPluginStorageCommitmentFailureReason *target, void *handler, const char *sopClassUid, const char *sopInstanceUid)
Callback to get the status of one DICOM instance in the storage commitment SCP.
Definition: OrthancCPlugin.h:7547
Definition: OrthancCPlugin.h:697
OrthancPluginErrorCode OrthancPluginReadFile(OrthancPluginContext *context, OrthancPluginMemoryBuffer *target, const char *path)
Read a file.
Definition: OrthancCPlugin.h:3618
Definition: OrthancCPlugin.h:782
Definition: OrthancCPlugin.h:862
struct _OrthancPluginFindAnswers_t OrthancPluginFindAnswers
Opaque structure to an object that represents the answers to a C-Find query for worklists.
Definition: OrthancCPlugin.h:1073
OrthancPluginErrorCode OrthancPluginRegisterMoveCallback(OrthancPluginContext *context, OrthancPluginMoveCallback callback, OrthancPluginGetMoveSize getMoveSize, OrthancPluginApplyMove applyMove, OrthancPluginFreeMove freeMove)
Register a callback to handle C-Move requests.
Definition: OrthancCPlugin.h:6011
Definition: OrthancCPlugin.h:321
Definition: OrthancCPlugin.h:726
OrthancPluginImage * OrthancPluginCreateImage(OrthancPluginContext *context, OrthancPluginPixelFormat format, uint32_t width, uint32_t height)
Create an image.
Definition: OrthancCPlugin.h:5299
Definition: OrthancCPlugin.h:784
Definition: OrthancCPlugin.h:247
char * OrthancPluginGetOrthancPath(OrthancPluginContext *context)
Return the path to the Orthanc executable.
Definition: OrthancCPlugin.h:3080
char * OrthancPluginGetGlobalProperty(OrthancPluginContext *context, int32_t property, const char *defaultValue)
Get the value of a global property.
Definition: OrthancCPlugin.h:3300
Definition: OrthancCPlugin.h:878
OrthancPluginErrorCode(* OrthancPluginStorageRemove)(const char *uuid, OrthancPluginContentType type)
Callback for removing a file from the storage area.
Definition: OrthancCPlugin.h:1231
const char * OrthancPluginGetInstanceMetadata(OrthancPluginContext *context, const OrthancPluginDicomInstance *instance, const char *metadata)
Get the value of some metadata associated with a given DICOM instance.
Definition: OrthancCPlugin.h:3000
Definition: OrthancCPlugin.h:811
Definition: OrthancCPlugin.h:256
Definition: OrthancCPlugin.h:294
Definition: OrthancCPlugin.h:319
Definition: OrthancCPlugin.h:937
Definition: OrthancCPlugin.h:720
Definition: OrthancCPlugin.h:301
OrthancPluginErrorCode OrthancPluginReconstructMainDicomTags(OrthancPluginContext *context, OrthancPluginStorageArea *storageArea, OrthancPluginResourceType level)
Reconstruct the main DICOM tags.
Definition: OrthancCPlugin.h:4818
char * OrthancPluginGetFindQueryTagName(OrthancPluginContext *context, const OrthancPluginFindQuery *query, uint32_t index)
Get the symbolic name of one tag in a C-Find query.
Definition: OrthancCPlugin.h:5925
void OrthancPluginRegisterJobsUnserializer(OrthancPluginContext *context, OrthancPluginJobsUnserializer unserializer)
Register an unserializer for custom jobs.
Definition: OrthancCPlugin.h:6687
void OrthancPluginFreeDicomInstance(OrthancPluginContext *context, OrthancPluginDicomInstance *dicom)
Free a DICOM instance.
Definition: OrthancCPlugin.h:7782
char * OrthancPluginEncodeDicomWebJson2(OrthancPluginContext *context, const void *dicom, uint32_t dicomSize, OrthancPluginDicomWebBinaryCallback2 callback, void *payload)
Convert a DICOM instance to DICOMweb JSON.
Definition: OrthancCPlugin.h:6959
char * OrthancPluginGetCommandLineArgument(OrthancPluginContext *context, uint32_t argument)
Get the value of a command-line argument.
Definition: OrthancCPlugin.h:3404
OrthancPluginErrorCode OrthancPluginHttpGet(OrthancPluginContext *context, OrthancPluginMemoryBuffer *target, const char *url, const char *username, const char *password)
Issue a HTTP GET call.
Definition: OrthancCPlugin.h:4179
int64_t OrthancPluginGetInstanceSize(OrthancPluginContext *context, const OrthancPluginDicomInstance *instance)
Get the size of a DICOM file.
Definition: OrthancCPlugin.h:2813
OrthancPluginImage * OrthancPluginCreateImageAccessor(OrthancPluginContext *context, OrthancPluginPixelFormat format, uint32_t width, uint32_t height, uint32_t pitch, void *buffer)
Create an image pointing to a memory buffer.
Definition: OrthancCPlugin.h:5342
Definition: OrthancCPlugin.h:264
char * OrthancPluginGetInstanceDicomWebJson(OrthancPluginContext *context, const OrthancPluginDicomInstance *instance, OrthancPluginDicomWebBinaryCallback2 callback, void *payload)
Convert a DICOM instance to DICOMweb JSON.
Definition: OrthancCPlugin.h:8039
OrthancPluginErrorCode OrthancPluginRegisterIncomingHttpRequestFilter(OrthancPluginContext *context, OrthancPluginIncomingHttpRequestFilter callback)
Register a callback to filter incoming HTTP requests.
Definition: OrthancCPlugin.h:5597
Definition: OrthancCPlugin.h:221
char * OrthancPluginDicomInstanceToJson(OrthancPluginContext *context, const char *instanceId, OrthancPluginDicomToJsonFormat format, OrthancPluginDicomToJsonFlags flags, uint32_t maxStringLength)
Format a DICOM instance as a JSON string.
Definition: OrthancCPlugin.h:4911
const char *const * getValues
For a GET request, the values of the GET parameters.
Definition: OrthancCPlugin.h:362
const char * OrthancPluginGetPeerUserProperty(OrthancPluginContext *context, const OrthancPluginPeers *peers, uint32_t peerIndex, const char *userProperty)
Get some user-defined property of an Orthanc peer.
Definition: OrthancCPlugin.h:6390
Definition: OrthancCPlugin.h:796
OrthancPluginErrorCode(* OrthancPluginOnChangeCallback)(OrthancPluginChangeType changeType, OrthancPluginResourceType resourceType, const char *resourceId)
Signature of a callback function that is triggered when a change happens to some DICOM resource...
Definition: OrthancCPlugin.h:1135
OrthancPluginPeers * OrthancPluginGetPeers(OrthancPluginContext *context)
Return the list of available Orthanc peers.
Definition: OrthancCPlugin.h:6191
OrthancPluginErrorCode OrthancPluginBufferCompression(OrthancPluginContext *context, OrthancPluginMemoryBuffer *target, const void *source, uint32_t size, OrthancPluginCompressionType compression, uint8_t uncompress)
Compress or decompress a buffer.
Definition: OrthancCPlugin.h:3581
Definition: OrthancCPlugin.h:257
OrthancPluginErrorCode(* OrthancPluginChunkedClientAnswerAddChunk)(void *answer, const void *data, uint32_t size)
Callback executed when an answer chunk is received during a chunked transfer.
Definition: OrthancCPlugin.h:7068
OrthancPluginErrorCode OrthancPluginWorklistMarkIncomplete(OrthancPluginContext *context, OrthancPluginWorklistAnswers *answers)
Mark the set of worklist answers as incomplete.
Definition: OrthancCPlugin.h:5073
OrthancPluginErrorCode OrthancPluginCreateDicom(OrthancPluginContext *context, OrthancPluginMemoryBuffer *target, const char *json, const OrthancPluginImage *pixelData, OrthancPluginCreateDicomFlags flags)
Create a DICOM instance from a JSON string and an image.
Definition: OrthancCPlugin.h:5225
Definition: OrthancCPlugin.h:250
Definition: OrthancCPlugin.h:759
Definition: OrthancCPlugin.h:208
Definition: OrthancCPlugin.h:263
Definition: OrthancCPlugin.h:215
void OrthancPluginRegisterRestCallbackNoLock(OrthancPluginContext *context, const char *pathRegularExpression, OrthancPluginRestCallback callback)
Register a REST callback, without locking.
Definition: OrthancCPlugin.h:1976
OrthancPluginErrorCode OrthancPluginHttpPost(OrthancPluginContext *context, OrthancPluginMemoryBuffer *target, const char *url, const void *body, uint32_t bodySize, const char *username, const char *password)
Issue a HTTP POST call.
Definition: OrthancCPlugin.h:4217
OrthancPluginErrorCode(* OrthancPluginFindCallback)(OrthancPluginFindAnswers *answers, const OrthancPluginFindQuery *query, const char *issuerAet, const char *calledAet)
Callback to handle incoming C-Find SCP requests.
Definition: OrthancCPlugin.h:1335
Definition: OrthancCPlugin.h:723
OrthancPluginErrorCode OrthancPluginRegisterFindCallback(OrthancPluginContext *context, OrthancPluginFindCallback callback)
Register a callback to handle C-Find requests.
Definition: OrthancCPlugin.h:5765
struct _OrthancPluginImage_t OrthancPluginImage
Opaque structure that represents an image that is uncompressed in memory.
Definition: OrthancCPlugin.h:1033
OrthancPluginErrorCode OrthancPluginStartMultipartAnswer(OrthancPluginContext *context, OrthancPluginRestOutput *output, const char *subType, const char *contentType)
Start an HTTP multipart answer.
Definition: OrthancCPlugin.h:3510
struct _OrthancPluginWorklistAnswers_t OrthancPluginWorklistAnswers
Opaque structure to an object that represents the answers to a C-Find query for worklists.
Definition: OrthancCPlugin.h:1057
Definition: OrthancCPlugin.h:200
Definition: OrthancCPlugin.h:226
Definition: OrthancCPlugin.h:219
OrthancPluginInstanceOrigin OrthancPluginGetInstanceOrigin(OrthancPluginContext *context, const OrthancPluginDicomInstance *instance)
Get the origin of a DICOM file.
Definition: OrthancCPlugin.h:5176
Definition: OrthancCPlugin.h:730
Definition: OrthancCPlugin.h:859
Definition: OrthancCPlugin.h:295
Definition: OrthancCPlugin.h:266
void(* OrthancPluginFreeMove)(void *moveDriver)
Callback to free one C-Move driver.
Definition: OrthancCPlugin.h:1432
char * OrthancPluginEncodeDicomWebXml2(OrthancPluginContext *context, const void *dicom, uint32_t dicomSize, OrthancPluginDicomWebBinaryCallback2 callback, void *payload)
Convert a DICOM instance to DICOMweb XML.
Definition: OrthancCPlugin.h:7003
void OrthancPluginSetRootUri(OrthancPluginContext *context, const char *uri)
Set the URI where the plugin provides its Web interface.
Definition: OrthancCPlugin.h:3222
int32_t OrthancPluginHasInstancePixelData(OrthancPluginContext *context, const OrthancPluginDicomInstance *instance)
Check whether the DICOM file has pixel data.
Definition: OrthancCPlugin.h:7694
const char *(* OrthancPluginJobGetSerialized)(void *job)
Callback to serialize one custom job.
Definition: OrthancCPlugin.h:1491
OrthancPluginErrorCode OrthancPluginStorageAreaRemove(OrthancPluginContext *context, OrthancPluginStorageArea *storageArea, const char *uuid, OrthancPluginContentType type)
Remove a file from the storage area.
Definition: OrthancCPlugin.h:4626
Definition: OrthancCPlugin.h:905
OrthancPluginErrorCode(* OrthancPluginOnStoredInstanceCallback)(const OrthancPluginDicomInstance *instance, const char *instanceId)
Signature of a callback function that is triggered when Orthanc stores a new DICOM instance...
Definition: OrthancCPlugin.h:1125
void OrthancPluginFreeJob(OrthancPluginContext *context, OrthancPluginJob *job)
Free a custom job.
Definition: OrthancCPlugin.h:6610
Definition: OrthancCPlugin.h:788
Definition: OrthancCPlugin.h:724
const char *const * getKeys
For a GET request, the keys of the GET parameters.
Definition: OrthancCPlugin.h:357
Definition: OrthancCPlugin.h:791
Definition: OrthancCPlugin.h:715
char * OrthancPluginLookupPatient(OrthancPluginContext *context, const char *patientID)
Look for a patient.
Definition: OrthancCPlugin.h:2458
OrthancPluginErrorCode(* OrthancPluginStorageCommitmentFactory)(void **handler, const char *jobId, const char *transactionUid, const char *const *sopClassUids, const char *const *sopInstanceUids, uint32_t countInstances, const char *remoteAet, const char *calledAet)
Callback executed by the storage commitment SCP.
Definition: OrthancCPlugin.h:7504
struct _OrthancPluginDicomInstance_t OrthancPluginDicomInstance
Opaque structure that represents a DICOM instance that is managed by the Orthanc core.
Definition: OrthancCPlugin.h:1025
Definition: OrthancCPlugin.h:875
Definition: OrthancCPlugin.h:792
void OrthancPluginFreeImage(OrthancPluginContext *context, OrthancPluginImage *image)
Free an image.
Definition: OrthancCPlugin.h:3989
OrthancPluginValueRepresentation vr
Definition: OrthancCPlugin.h:1683
OrthancPluginErrorCode OrthancPluginChunkedHttpClient(OrthancPluginContext *context, void *answer, OrthancPluginChunkedClientAnswerAddChunk answerAddChunk, OrthancPluginChunkedClientAnswerAddHeader answerAddHeader, uint16_t *httpStatus, OrthancPluginHttpMethod method, const char *url, uint32_t headersCount, const char *const *headersKeys, const char *const *headersValues, void *request, OrthancPluginChunkedClientRequestIsDone requestIsDone, OrthancPluginChunkedClientRequestGetChunkData requestChunkData, OrthancPluginChunkedClientRequestGetChunkSize requestChunkSize, OrthancPluginChunkedClientRequestNext requestNext, const char *username, const char *password, uint32_t timeout, const char *certificateFile, const char *certificateKeyFile, const char *certificateKeyPassword, uint8_t pkcs11)
Issue a HTTP call, using chunked HTTP transfers.
Definition: OrthancCPlugin.h:7216
uint16_t element
Definition: OrthancCPlugin.h:1682
char * OrthancPluginLookupInstance(OrthancPluginContext *context, const char *sopInstanceUID)
Look for an instance.
Definition: OrthancCPlugin.h:2598
Definition: OrthancCPlugin.h:722
OrthancPluginErrorCode OrthancPluginSetGlobalProperty(OrthancPluginContext *context, int32_t property, const char *value)
Set the value of a global property.
Definition: OrthancCPlugin.h:3339
OrthancPluginErrorCode(* OrthancPluginApplyMove)(void *moveDriver)
Callback to apply one C-Move suboperation.
Definition: OrthancCPlugin.h:1418
Definition: OrthancCPlugin.h:232
Definition: OrthancCPlugin.h:683
Definition: OrthancCPlugin.h:239
const char *const * groups
The matched values for the groups of the regular expression.
Definition: OrthancCPlugin.h:347
OrthancPluginErrorCode OrthancPluginWriteFile(OrthancPluginContext *context, const char *path, const void *data, uint32_t size)
Write a file.
Definition: OrthancCPlugin.h:3649
Definition: OrthancCPlugin.h:265
OrthancPluginErrorCode(* OrthancPluginStorageRead)(void **content, int64_t *size, const char *uuid, OrthancPluginContentType type)
Callback for reading from the storage area.
Definition: OrthancCPlugin.h:1213
Definition: OrthancCPlugin.h:268
char * OrthancPluginLookupStudy(OrthancPluginContext *context, const char *studyUID)
Look for a study.
Definition: OrthancCPlugin.h:2493
uint32_t size
The number of bytes in the buffer.
Definition: OrthancCPlugin.h:1007
Graylevel, floating-point 32bpp image.
Definition: OrthancCPlugin.h:653
const char * OrthancPluginGetInstanceRemoteAet(OrthancPluginContext *context, const OrthancPluginDicomInstance *instance)
Get the AET of a DICOM instance.
Definition: OrthancCPlugin.h:2780
Definition: OrthancCPlugin.h:889
Definition: OrthancCPlugin.h:248
OrthancPluginErrorCode(* OrthancPluginJobReset)(void *job)
Callback executed once one stopped custom job is started again.
Definition: OrthancCPlugin.h:1547
char * OrthancPluginEncodeDicomWebJson(OrthancPluginContext *context, const void *dicom, uint32_t dicomSize, OrthancPluginDicomWebBinaryCallback callback)
Convert a DICOM instance to DICOMweb JSON.
Definition: OrthancCPlugin.h:6865
uint32_t groupsCount
The number of groups of the regular expression.
Definition: OrthancCPlugin.h:342
Definition: OrthancCPlugin.h:249
OrthancPluginErrorCode(* OrthancPluginServerChunkedRequestReaderFactory)(OrthancPluginServerChunkedRequestReader **reader, const char *url, const OrthancPluginHttpRequest *request)
Callback to create a reader to handle incoming chunked HTTP transfers.
Definition: OrthancCPlugin.h:7296
Definition: OrthancCPlugin.h:699
void OrthancPluginLogWarning(OrthancPluginContext *context, const char *message)
Log a warning.
Definition: OrthancCPlugin.h:1884
Definition: OrthancCPlugin.h:947
Definition: OrthancCPlugin.h:777
Definition: OrthancCPlugin.h:254
int32_t OrthancPluginWorklistIsMatch(OrthancPluginContext *context, const OrthancPluginWorklistQuery *query, const void *dicom, uint32_t size)
Test whether a worklist matches the query.
Definition: OrthancCPlugin.h:5111
int OrthancPluginCheckVersionAdvanced(OrthancPluginContext *context, int expectedMajor, int expectedMinor, int expectedRevision)
Check that the version of the hosting Orthanc is above a given version.
Definition: OrthancCPlugin.h:1728
Definition: OrthancCPlugin.h:797
const void * body
For a PUT or POST request, the content of the body.
Definition: OrthancCPlugin.h:367
OrthancPluginErrorCode(* OrthancPluginServerChunkedRequestReaderExecute)(OrthancPluginServerChunkedRequestReader *reader, OrthancPluginRestOutput *output)
Callback invoked whenever the request body is entirely received.
Definition: OrthancCPlugin.h:7335
OrthancPluginIdentifierConstraint
Definition: OrthancCPlugin.h:857
uint32_t bodySize
For a PUT or POST request, the number of bytes of the body.
Definition: OrthancCPlugin.h:372
OrthancPluginErrorCode OrthancPluginFindMarkIncomplete(OrthancPluginContext *context, OrthancPluginFindAnswers *answers)
Mark the set of C-Find answers as incomplete.
Definition: OrthancCPlugin.h:5833
Definition: OrthancCPlugin.h:322
OrthancPluginJob *(* OrthancPluginJobsUnserializer)(const char *jobType, const char *serialized)
Callback executed to unserialize a custom job.
Definition: OrthancCPlugin.h:1563
OrthancPluginMetricsType
Definition: OrthancCPlugin.h:928
OrthancPluginErrorCode OrthancPluginRestApiPutAfterPlugins(OrthancPluginContext *context, OrthancPluginMemoryBuffer *target, const char *uri, const void *body, uint32_t bodySize)
Make a PUT call to the REST API, as tainted by the plugins.
Definition: OrthancCPlugin.h:2392
OrthancPluginErrorCode OrthancPluginSendMultipartItem(OrthancPluginContext *context, OrthancPluginRestOutput *output, const void *answer, uint32_t answerSize)
Send an item as a part of some HTTP multipart answer.
Definition: OrthancCPlugin.h:3539
OrthancPluginDicomWebBinaryMode
Definition: OrthancCPlugin.h:945
Definition: OrthancCPlugin.h:237
Definition: OrthancCPlugin.h:300
void OrthancPluginSetCookie(OrthancPluginContext *context, OrthancPluginRestOutput *output, const char *cookie, const char *value)
Set a cookie.
Definition: OrthancCPlugin.h:2719
Definition: OrthancCPlugin.h:714
char * OrthancPluginGetTagName(OrthancPluginContext *context, uint16_t group, uint16_t element, const char *privateCreator)
Returns the symbolic name of a DICOM tag.
Definition: OrthancCPlugin.h:7449
uint32_t OrthancPluginGetPeersCount(OrthancPluginContext *context, const OrthancPluginPeers *peers)
Get the number of Orthanc peers.
Definition: OrthancCPlugin.h:6255
Definition: OrthancCPlugin.h:787
const char * OrthancPluginGetPeerUrl(OrthancPluginContext *context, const OrthancPluginPeers *peers, uint32_t peerIndex)
Get the base URL of an Orthanc peer.
Definition: OrthancCPlugin.h:6344
uint32_t OrthancPluginGetFindQuerySize(OrthancPluginContext *context, const OrthancPluginFindQuery *query)
Get the number of tags in a C-Find query.
Definition: OrthancCPlugin.h:5857
void OrthancPluginSetDescription(OrthancPluginContext *context, const char *description)
Set a description for this plugin.
Definition: OrthancCPlugin.h:3244
Definition: OrthancCPlugin.h:296
Definition: OrthancCPlugin.h:234
void OrthancPluginRegisterOnStoredInstanceCallback(OrthancPluginContext *context, OrthancPluginOnStoredInstanceCallback callback)
Register a callback for received instances.
Definition: OrthancCPlugin.h:2014
Definition: OrthancCPlugin.h:716
Definition: OrthancCPlugin.h:790
OrthancPluginErrorCode OrthancPluginRegisterDictionaryTag(OrthancPluginContext *context, uint16_t group, uint16_t element, OrthancPluginValueRepresentation vr, const char *name, uint32_t minMultiplicity, uint32_t maxMultiplicity)
Register a new tag into the DICOM dictionary.
Definition: OrthancCPlugin.h:4721
Definition: OrthancCPlugin.h:251
Definition: OrthancCPlugin.h:212
int32_t(* OrthancPluginIncomingDicomInstanceFilter)(const OrthancPluginDicomInstance *instance)
Callback to filter incoming DICOM instances received by Orthanc.
Definition: OrthancCPlugin.h:7604
Definition: OrthancCPlugin.h:794
Definition: OrthancCPlugin.h:774
Graylevel, unsigned 32bpp image.
Definition: OrthancCPlugin.h:645
Definition: OrthancCPlugin.h:874
void OrthancPluginRegisterRestCallback(OrthancPluginContext *context, const char *pathRegularExpression, OrthancPluginRestCallback callback)
Register a REST callback.
Definition: OrthancCPlugin.h:1936
uint32_t(* OrthancPluginChunkedClientRequestGetChunkSize)(void *request)
Callback to read the size of the current request chunk during a chunked transfer. ...
Definition: OrthancCPlugin.h:7137
char * OrthancPluginLookupStudyWithAccessionNumber(OrthancPluginContext *context, const char *accessionNumber)
Look for a study, using the accession number.
Definition: OrthancCPlugin.h:2528
Definition: OrthancCPlugin.h:786
Definition: OrthancCPlugin.h:772
Definition: OrthancCPlugin.h:204
Definition: OrthancCPlugin.h:695
void OrthancPluginRegisterChunkedRestCallback(OrthancPluginContext *context, const char *pathRegularExpression, OrthancPluginRestCallback getHandler, OrthancPluginServerChunkedRequestReaderFactory postHandler, OrthancPluginRestCallback deleteHandler, OrthancPluginServerChunkedRequestReaderFactory putHandler, OrthancPluginServerChunkedRequestReaderAddChunk addChunk, OrthancPluginServerChunkedRequestReaderExecute execute, OrthancPluginServerChunkedRequestReaderFinalize finalize)
Register a REST callback to handle chunked HTTP transfers.
Definition: OrthancCPlugin.h:7398
OrthancPluginErrorCode OrthancPluginWorklistGetDicomQuery(OrthancPluginContext *context, OrthancPluginMemoryBuffer *target, const OrthancPluginWorklistQuery *query)
Retrieve the worklist query as a DICOM file.
Definition: OrthancCPlugin.h:5150
OrthancPluginErrorCode OrthancPluginRestApiGetAfterPlugins(OrthancPluginContext *context, OrthancPluginMemoryBuffer *target, const char *uri)
Make a GET call to the REST API, as tainted by the plugins.
Definition: OrthancCPlugin.h:2207
OrthancPluginErrorCode(* OrthancPluginChunkedClientAnswerAddHeader)(void *answer, const char *key, const char *value)
Callback executed when a HTTP header is received during a chunked transfer.
Definition: OrthancCPlugin.h:7047
Definition: OrthancCPlugin.h:890
Definition: OrthancCPlugin.h:223
Definition: OrthancCPlugin.h:289
Definition: OrthancCPlugin.h:205
Definition: OrthancCPlugin.h:210
struct _OrthancPluginFindQuery_t OrthancPluginFindQuery
Opaque structure to an object that represents a C-Find query.
Definition: OrthancCPlugin.h:1065
Definition: OrthancCPlugin.h:202
Definition: OrthancCPlugin.h:227
Definition: OrthancCPlugin.h:721
Definition: OrthancCPlugin.h:744
void OrthancPluginRegisterRefreshMetricsCallback(OrthancPluginContext *context, OrthancPluginRefreshMetricsCallback callback)
Register a callback to refresh the metrics.
Definition: OrthancCPlugin.h:6829
Definition: OrthancCPlugin.h:241
Definition: OrthancCPlugin.h:238
OrthancPluginHttpMethod method
The HTTP method.
Definition: OrthancCPlugin.h:337
Definition: OrthancCPlugin.h:284
OrthancPluginErrorCode OrthancPluginStorageAreaCreate(OrthancPluginContext *context, OrthancPluginStorageArea *storageArea, const char *uuid, const void *content, uint64_t size, OrthancPluginContentType type)
Create a file inside the storage area.
Definition: OrthancCPlugin.h:4547
void OrthancPluginAnswerBuffer(OrthancPluginContext *context, OrthancPluginRestOutput *output, const void *answer, uint32_t answerSize, const char *mimeType)
Answer to a REST request.
Definition: OrthancCPlugin.h:2046
OrthancPluginErrorCode OrthancPluginHttpDelete(OrthancPluginContext *context, const char *url, const char *username, const char *password)
Issue a HTTP DELETE call.
Definition: OrthancCPlugin.h:4297
A memory buffer allocated by the core system of Orthanc.
Definition: OrthancCPlugin.h:997
void(* OrthancPluginServerChunkedRequestReaderFinalize)(OrthancPluginServerChunkedRequestReader *reader)
Callback invoked to release the resources associated with an incoming HTTP chunked transfer...
Definition: OrthancCPlugin.h:7353
const char * OrthancPluginGetPeerName(OrthancPluginContext *context, const OrthancPluginPeers *peers, uint32_t peerIndex)
Get the symbolic name of an Orthanc peer.
Definition: OrthancCPlugin.h:6303
Color image in BGRA32 format.
Definition: OrthancCPlugin.h:661
OrthancPluginStorageCommitmentFailureReason
Definition: OrthancCPlugin.h:958
Definition: OrthancCPlugin.h:779
Definition: OrthancCPlugin.h:827
uint32_t OrthancPluginGetInstanceFramesCount(OrthancPluginContext *context, const OrthancPluginDicomInstance *instance)
Get the number of frames in a DICOM instance.
Definition: OrthancCPlugin.h:7819
OrthancPluginErrorCode OrthancPluginRegisterTranscoderCallback(OrthancPluginContext *context, OrthancPluginTranscoderCallback callback)
Register a callback to handle the transcoding of DICOM images.
Definition: OrthancCPlugin.h:8151
Definition: OrthancCPlugin.h:216
void(* OrthancPluginStorageCommitmentDestructor)(void *handler)
Callback to free one storage commitment SCP handler.
Definition: OrthancCPlugin.h:7526
int32_t OrthancPluginFindMatcherIsMatch(OrthancPluginContext *context, const OrthancPluginFindMatcher *matcher, const void *dicom, uint32_t size)
Test whether a DICOM instance matches a C-Find query.
Definition: OrthancCPlugin.h:6121
Definition: OrthancCPlugin.h:785
void(* OrthancPluginJobFinalize)(void *job)
Callback to finalize one custom job.
Definition: OrthancCPlugin.h:1445
char * OrthancPluginLookupSeries(OrthancPluginContext *context, const char *seriesUID)
Look for a series.
Definition: OrthancCPlugin.h:2563
Definition: OrthancCPlugin.h:206
uint32_t(* OrthancPluginGetMoveSize)(void *moveDriver)
Callback to read the size of a C-Move driver.
Definition: OrthancCPlugin.h:1403
Definition: OrthancCPlugin.h:775
void(* OrthancPluginDicomWebBinaryCallback)(OrthancPluginDicomWebNode *node, OrthancPluginDicomWebSetBinaryNode setter, uint32_t levelDepth, const uint16_t *levelTagGroup, const uint16_t *levelTagElement, const uint32_t *levelIndex, uint16_t tagGroup, uint16_t tagElement, OrthancPluginValueRepresentation vr)
Callback executed to encode a binary tag in DICOMweb.
Definition: OrthancCPlugin.h:1609
Definition: OrthancCPlugin.h:277
uint32_t OrthancPluginGetImageWidth(OrthancPluginContext *context, const OrthancPluginImage *image)
Return the width of an image.
Definition: OrthancCPlugin.h:3802
OrthancPluginErrorCode(* OrthancPluginServerChunkedRequestReaderAddChunk)(OrthancPluginServerChunkedRequestReader *reader, const void *data, uint32_t size)
Callback invoked whenever a new data chunk is available during a chunked transfer.
Definition: OrthancCPlugin.h:7315
OrthancPluginErrorCode OrthancPluginCompressJpegImage(OrthancPluginContext *context, OrthancPluginMemoryBuffer *target, OrthancPluginPixelFormat format, uint32_t width, uint32_t height, uint32_t pitch, const void *buffer, uint8_t quality)
Encode a JPEG image.
Definition: OrthancCPlugin.h:4079
char * OrthancPluginGetFindQueryValue(OrthancPluginContext *context, const OrthancPluginFindQuery *query, uint32_t index)
Get the value associated with one tag in a C-Find query.
Definition: OrthancCPlugin.h:5963
Definition: OrthancCPlugin.h:236
Definition: OrthancCPlugin.h:229