Orthanc Plugin SDK  1.7.1
Documentation of the plugin interface of Orthanc
OrthancCPlugin.h
1 
116 #pragma once
117 
118 
119 #include <stdio.h>
120 #include <string.h>
121 
122 #ifdef WIN32
123 # define ORTHANC_PLUGINS_API __declspec(dllexport)
124 #elif __GNUC__ >= 4
125 # define ORTHANC_PLUGINS_API __attribute__ ((visibility ("default")))
126 #else
127 # define ORTHANC_PLUGINS_API
128 #endif
129 
130 #define ORTHANC_PLUGINS_MINIMAL_MAJOR_NUMBER 1
131 #define ORTHANC_PLUGINS_MINIMAL_MINOR_NUMBER 7
132 #define ORTHANC_PLUGINS_MINIMAL_REVISION_NUMBER 0
133 
134 
135 #if !defined(ORTHANC_PLUGINS_VERSION_IS_ABOVE)
136 #define ORTHANC_PLUGINS_VERSION_IS_ABOVE(major, minor, revision) \
137  (ORTHANC_PLUGINS_MINIMAL_MAJOR_NUMBER > major || \
138  (ORTHANC_PLUGINS_MINIMAL_MAJOR_NUMBER == major && \
139  (ORTHANC_PLUGINS_MINIMAL_MINOR_NUMBER > minor || \
140  (ORTHANC_PLUGINS_MINIMAL_MINOR_NUMBER == minor && \
141  ORTHANC_PLUGINS_MINIMAL_REVISION_NUMBER >= revision))))
142 #endif
143 
144 
145 
146 /********************************************************************
147  ** Check that function inlining is properly supported. The use of
148  ** inlining is required, to avoid the duplication of object code
149  ** between two compilation modules that would use the Orthanc Plugin
150  ** API.
151  ********************************************************************/
152 
153 /* If the auto-detection of the "inline" keyword below does not work
154  automatically and that your compiler is known to properly support
155  inlining, uncomment the following #define and adapt the definition
156  of "static inline". */
157 
158 /* #define ORTHANC_PLUGIN_INLINE static inline */
159 
160 #ifndef ORTHANC_PLUGIN_INLINE
161 # if __STDC_VERSION__ >= 199901L
162 /* This is C99 or above: http://predef.sourceforge.net/prestd.html */
163 # define ORTHANC_PLUGIN_INLINE static inline
164 # elif defined(__cplusplus)
165 /* This is C++ */
166 # define ORTHANC_PLUGIN_INLINE static inline
167 # elif defined(__GNUC__)
168 /* This is GCC running in C89 mode */
169 # define ORTHANC_PLUGIN_INLINE static __inline
170 # elif defined(_MSC_VER)
171 /* This is Visual Studio running in C89 mode */
172 # define ORTHANC_PLUGIN_INLINE static __inline
173 # else
174 # error Your compiler is not known to support the "inline" keyword
175 # endif
176 #endif
177 
178 
179 
180 /********************************************************************
181  ** Inclusion of standard libraries.
182  ********************************************************************/
183 
189 #include <stdint.h>
190 
191 #include <stdlib.h>
192 
193 
194 
195 /********************************************************************
196  ** Definition of the Orthanc Plugin API.
197  ********************************************************************/
198 
201 #ifdef __cplusplus
202 extern "C"
203 {
204 #endif
205 
209  typedef enum
210  {
314 
315  _OrthancPluginErrorCode_INTERNAL = 0x7fffffff
317 
318 
323  ORTHANC_PLUGINS_API const char* OrthancPluginGetName();
324 
325 
329  typedef enum
330  {
336  _OrthancPluginHttpMethod_INTERNAL = 0x7fffffff
338 
339 
344  typedef struct
345  {
350 
354  uint32_t groupsCount;
355 
359  const char* const* groups;
360 
364  uint32_t getCount;
365 
369  const char* const* getKeys;
370 
374  const char* const* getValues;
375 
379  const void* body;
380 
384  uint32_t bodySize;
385 
386 
387  /* --------------------------------------------------
388  New in version 0.8.1
389  -------------------------------------------------- */
390 
394  uint32_t headersCount;
395 
399  const char* const* headersKeys;
400 
404  const char* const* headersValues;
405 
407 
408 
409  typedef enum
410  {
411  /* Generic services */
412  _OrthancPluginService_LogInfo = 1,
413  _OrthancPluginService_LogWarning = 2,
414  _OrthancPluginService_LogError = 3,
415  _OrthancPluginService_GetOrthancPath = 4,
416  _OrthancPluginService_GetOrthancDirectory = 5,
417  _OrthancPluginService_GetConfigurationPath = 6,
418  _OrthancPluginService_SetPluginProperty = 7,
419  _OrthancPluginService_GetGlobalProperty = 8,
420  _OrthancPluginService_SetGlobalProperty = 9,
421  _OrthancPluginService_GetCommandLineArgumentsCount = 10,
422  _OrthancPluginService_GetCommandLineArgument = 11,
423  _OrthancPluginService_GetExpectedDatabaseVersion = 12,
424  _OrthancPluginService_GetConfiguration = 13,
425  _OrthancPluginService_BufferCompression = 14,
426  _OrthancPluginService_ReadFile = 15,
427  _OrthancPluginService_WriteFile = 16,
428  _OrthancPluginService_GetErrorDescription = 17,
429  _OrthancPluginService_CallHttpClient = 18,
430  _OrthancPluginService_RegisterErrorCode = 19,
431  _OrthancPluginService_RegisterDictionaryTag = 20,
432  _OrthancPluginService_DicomBufferToJson = 21,
433  _OrthancPluginService_DicomInstanceToJson = 22,
434  _OrthancPluginService_CreateDicom = 23,
435  _OrthancPluginService_ComputeMd5 = 24,
436  _OrthancPluginService_ComputeSha1 = 25,
437  _OrthancPluginService_LookupDictionary = 26,
438  _OrthancPluginService_CallHttpClient2 = 27,
439  _OrthancPluginService_GenerateUuid = 28,
440  _OrthancPluginService_RegisterPrivateDictionaryTag = 29,
441  _OrthancPluginService_AutodetectMimeType = 30,
442  _OrthancPluginService_SetMetricsValue = 31,
443  _OrthancPluginService_EncodeDicomWebJson = 32,
444  _OrthancPluginService_EncodeDicomWebXml = 33,
445  _OrthancPluginService_ChunkedHttpClient = 34, /* New in Orthanc 1.5.7 */
446  _OrthancPluginService_GetTagName = 35, /* New in Orthanc 1.5.7 */
447  _OrthancPluginService_EncodeDicomWebJson2 = 36, /* New in Orthanc 1.7.0 */
448  _OrthancPluginService_EncodeDicomWebXml2 = 37, /* New in Orthanc 1.7.0 */
449  _OrthancPluginService_CreateMemoryBuffer = 38, /* New in Orthanc 1.7.0 */
450 
451  /* Registration of callbacks */
452  _OrthancPluginService_RegisterRestCallback = 1000,
453  _OrthancPluginService_RegisterOnStoredInstanceCallback = 1001,
454  _OrthancPluginService_RegisterStorageArea = 1002,
455  _OrthancPluginService_RegisterOnChangeCallback = 1003,
456  _OrthancPluginService_RegisterRestCallbackNoLock = 1004,
457  _OrthancPluginService_RegisterWorklistCallback = 1005,
458  _OrthancPluginService_RegisterDecodeImageCallback = 1006,
459  _OrthancPluginService_RegisterIncomingHttpRequestFilter = 1007,
460  _OrthancPluginService_RegisterFindCallback = 1008,
461  _OrthancPluginService_RegisterMoveCallback = 1009,
462  _OrthancPluginService_RegisterIncomingHttpRequestFilter2 = 1010,
463  _OrthancPluginService_RegisterRefreshMetricsCallback = 1011,
464  _OrthancPluginService_RegisterChunkedRestCallback = 1012, /* New in Orthanc 1.5.7 */
465  _OrthancPluginService_RegisterStorageCommitmentScpCallback = 1013,
466  _OrthancPluginService_RegisterIncomingDicomInstanceFilter = 1014,
467  _OrthancPluginService_RegisterTranscoderCallback = 1015, /* New in Orthanc 1.7.0 */
468 
469  /* Sending answers to REST calls */
470  _OrthancPluginService_AnswerBuffer = 2000,
471  _OrthancPluginService_CompressAndAnswerPngImage = 2001, /* Unused as of Orthanc 0.9.4 */
472  _OrthancPluginService_Redirect = 2002,
473  _OrthancPluginService_SendHttpStatusCode = 2003,
474  _OrthancPluginService_SendUnauthorized = 2004,
475  _OrthancPluginService_SendMethodNotAllowed = 2005,
476  _OrthancPluginService_SetCookie = 2006,
477  _OrthancPluginService_SetHttpHeader = 2007,
478  _OrthancPluginService_StartMultipartAnswer = 2008,
479  _OrthancPluginService_SendMultipartItem = 2009,
480  _OrthancPluginService_SendHttpStatus = 2010,
481  _OrthancPluginService_CompressAndAnswerImage = 2011,
482  _OrthancPluginService_SendMultipartItem2 = 2012,
483  _OrthancPluginService_SetHttpErrorDetails = 2013,
484 
485  /* Access to the Orthanc database and API */
486  _OrthancPluginService_GetDicomForInstance = 3000,
487  _OrthancPluginService_RestApiGet = 3001,
488  _OrthancPluginService_RestApiPost = 3002,
489  _OrthancPluginService_RestApiDelete = 3003,
490  _OrthancPluginService_RestApiPut = 3004,
491  _OrthancPluginService_LookupPatient = 3005,
492  _OrthancPluginService_LookupStudy = 3006,
493  _OrthancPluginService_LookupSeries = 3007,
494  _OrthancPluginService_LookupInstance = 3008,
495  _OrthancPluginService_LookupStudyWithAccessionNumber = 3009,
496  _OrthancPluginService_RestApiGetAfterPlugins = 3010,
497  _OrthancPluginService_RestApiPostAfterPlugins = 3011,
498  _OrthancPluginService_RestApiDeleteAfterPlugins = 3012,
499  _OrthancPluginService_RestApiPutAfterPlugins = 3013,
500  _OrthancPluginService_ReconstructMainDicomTags = 3014,
501  _OrthancPluginService_RestApiGet2 = 3015,
502 
503  /* Access to DICOM instances */
504  _OrthancPluginService_GetInstanceRemoteAet = 4000,
505  _OrthancPluginService_GetInstanceSize = 4001,
506  _OrthancPluginService_GetInstanceData = 4002,
507  _OrthancPluginService_GetInstanceJson = 4003,
508  _OrthancPluginService_GetInstanceSimplifiedJson = 4004,
509  _OrthancPluginService_HasInstanceMetadata = 4005,
510  _OrthancPluginService_GetInstanceMetadata = 4006,
511  _OrthancPluginService_GetInstanceOrigin = 4007,
512  _OrthancPluginService_GetInstanceTransferSyntaxUid = 4008,
513  _OrthancPluginService_HasInstancePixelData = 4009,
514  _OrthancPluginService_CreateDicomInstance = 4010, /* New in Orthanc 1.7.0 */
515  _OrthancPluginService_FreeDicomInstance = 4011, /* New in Orthanc 1.7.0 */
516  _OrthancPluginService_GetInstanceFramesCount = 4012, /* New in Orthanc 1.7.0 */
517  _OrthancPluginService_GetInstanceRawFrame = 4013, /* New in Orthanc 1.7.0 */
518  _OrthancPluginService_GetInstanceDecodedFrame = 4014, /* New in Orthanc 1.7.0 */
519  _OrthancPluginService_TranscodeDicomInstance = 4015, /* New in Orthanc 1.7.0 */
520  _OrthancPluginService_SerializeDicomInstance = 4016, /* New in Orthanc 1.7.0 */
521  _OrthancPluginService_GetInstanceAdvancedJson = 4017, /* New in Orthanc 1.7.0 */
522  _OrthancPluginService_GetInstanceDicomWebJson = 4018, /* New in Orthanc 1.7.0 */
523  _OrthancPluginService_GetInstanceDicomWebXml = 4019, /* New in Orthanc 1.7.0 */
524 
525  /* Services for plugins implementing a database back-end */
526  _OrthancPluginService_RegisterDatabaseBackend = 5000,
527  _OrthancPluginService_DatabaseAnswer = 5001,
528  _OrthancPluginService_RegisterDatabaseBackendV2 = 5002,
529  _OrthancPluginService_StorageAreaCreate = 5003,
530  _OrthancPluginService_StorageAreaRead = 5004,
531  _OrthancPluginService_StorageAreaRemove = 5005,
532 
533  /* Primitives for handling images */
534  _OrthancPluginService_GetImagePixelFormat = 6000,
535  _OrthancPluginService_GetImageWidth = 6001,
536  _OrthancPluginService_GetImageHeight = 6002,
537  _OrthancPluginService_GetImagePitch = 6003,
538  _OrthancPluginService_GetImageBuffer = 6004,
539  _OrthancPluginService_UncompressImage = 6005,
540  _OrthancPluginService_FreeImage = 6006,
541  _OrthancPluginService_CompressImage = 6007,
542  _OrthancPluginService_ConvertPixelFormat = 6008,
543  _OrthancPluginService_GetFontsCount = 6009,
544  _OrthancPluginService_GetFontInfo = 6010,
545  _OrthancPluginService_DrawText = 6011,
546  _OrthancPluginService_CreateImage = 6012,
547  _OrthancPluginService_CreateImageAccessor = 6013,
548  _OrthancPluginService_DecodeDicomImage = 6014,
549 
550  /* Primitives for handling C-Find, C-Move and worklists */
551  _OrthancPluginService_WorklistAddAnswer = 7000,
552  _OrthancPluginService_WorklistMarkIncomplete = 7001,
553  _OrthancPluginService_WorklistIsMatch = 7002,
554  _OrthancPluginService_WorklistGetDicomQuery = 7003,
555  _OrthancPluginService_FindAddAnswer = 7004,
556  _OrthancPluginService_FindMarkIncomplete = 7005,
557  _OrthancPluginService_GetFindQuerySize = 7006,
558  _OrthancPluginService_GetFindQueryTag = 7007,
559  _OrthancPluginService_GetFindQueryTagName = 7008,
560  _OrthancPluginService_GetFindQueryValue = 7009,
561  _OrthancPluginService_CreateFindMatcher = 7010,
562  _OrthancPluginService_FreeFindMatcher = 7011,
563  _OrthancPluginService_FindMatcherIsMatch = 7012,
564 
565  /* Primitives for accessing Orthanc Peers (new in 1.4.2) */
566  _OrthancPluginService_GetPeers = 8000,
567  _OrthancPluginService_FreePeers = 8001,
568  _OrthancPluginService_GetPeersCount = 8003,
569  _OrthancPluginService_GetPeerName = 8004,
570  _OrthancPluginService_GetPeerUrl = 8005,
571  _OrthancPluginService_CallPeerApi = 8006,
572  _OrthancPluginService_GetPeerUserProperty = 8007,
573 
574  /* Primitives for handling jobs (new in 1.4.2) */
575  _OrthancPluginService_CreateJob = 9000,
576  _OrthancPluginService_FreeJob = 9001,
577  _OrthancPluginService_SubmitJob = 9002,
578  _OrthancPluginService_RegisterJobsUnserializer = 9003,
579 
580  _OrthancPluginService_INTERNAL = 0x7fffffff
581  } _OrthancPluginService;
582 
583 
584  typedef enum
585  {
586  _OrthancPluginProperty_Description = 1,
587  _OrthancPluginProperty_RootUri = 2,
588  _OrthancPluginProperty_OrthancExplorer = 3,
589 
590  _OrthancPluginProperty_INTERNAL = 0x7fffffff
591  } _OrthancPluginProperty;
592 
593 
594 
599  typedef enum
600  {
608 
616 
624 
632 
640 
650 
658 
666 
674 
682 
683  _OrthancPluginPixelFormat_INTERNAL = 0x7fffffff
685 
686 
687 
691  typedef enum
692  {
697  _OrthancPluginContentType_INTERNAL = 0x7fffffff
699 
700 
701 
705  typedef enum
706  {
713  _OrthancPluginResourceType_INTERNAL = 0x7fffffff
715 
716 
717 
722  typedef enum
723  {
741  _OrthancPluginChangeType_INTERNAL = 0x7fffffff
743 
744 
749  typedef enum
750  {
756  _OrthancPluginCompressionType_INTERNAL = 0x7fffffff
758 
759 
764  typedef enum
765  {
770  _OrthancPluginImageFormat_INTERNAL = 0x7fffffff
772 
773 
778  typedef enum
779  {
808  _OrthancPluginValueRepresentation_INTERNAL = 0x7fffffff
810 
811 
817  typedef enum
818  {
823  _OrthancPluginDicomToJsonFormat_INTERNAL = 0x7fffffff
825 
826 
832  typedef enum
833  {
834  OrthancPluginDicomToJsonFlags_None = 0,
842  _OrthancPluginDicomToJsonFlags_INTERNAL = 0x7fffffff
844 
845 
851  typedef enum
852  {
853  OrthancPluginCreateDicomFlags_None = 0,
857  _OrthancPluginCreateDicomFlags_INTERNAL = 0x7fffffff
859 
860 
866  typedef enum
867  {
873  _OrthancPluginIdentifierConstraint_INTERNAL = 0x7fffffff
875 
876 
881  typedef enum
882  {
889  _OrthancPluginConstraintType_INTERNAL = 0x7fffffff
891 
892 
896  typedef enum
897  {
904  _OrthancPluginInstanceOrigin_INTERNAL = 0x7fffffff
906 
907 
911  typedef enum
912  {
917 
918 
925  typedef enum
926  {
932 
933 
937  typedef enum
938  {
948 
949 
954  typedef enum
955  {
960 
961 
967  typedef enum
968  {
996 
997 
998 
1006  typedef struct
1007  {
1011  void* data;
1012 
1016  uint32_t size;
1018 
1019 
1020 
1021 
1026  typedef struct _OrthancPluginRestOutput_t OrthancPluginRestOutput;
1027 
1028 
1029 
1034  typedef struct _OrthancPluginDicomInstance_t OrthancPluginDicomInstance;
1035 
1036 
1037 
1042  typedef struct _OrthancPluginImage_t OrthancPluginImage;
1043 
1044 
1045 
1050  typedef struct _OrthancPluginStorageArea_t OrthancPluginStorageArea;
1051 
1052 
1053 
1058  typedef struct _OrthancPluginWorklistQuery_t OrthancPluginWorklistQuery;
1059 
1060 
1061 
1066  typedef struct _OrthancPluginWorklistAnswers_t OrthancPluginWorklistAnswers;
1067 
1068 
1069 
1074  typedef struct _OrthancPluginFindQuery_t OrthancPluginFindQuery;
1075 
1076 
1077 
1082  typedef struct _OrthancPluginFindAnswers_t OrthancPluginFindAnswers;
1083 
1084 
1085 
1090  typedef struct _OrthancPluginFindMatcher_t OrthancPluginFindMatcher;
1091 
1092 
1093 
1098  typedef struct _OrthancPluginPeers_t OrthancPluginPeers;
1099 
1100 
1101 
1106  typedef struct _OrthancPluginJob_t OrthancPluginJob;
1107 
1108 
1109 
1115  typedef struct _OrthancPluginDicomWebNode_t OrthancPluginDicomWebNode;
1116 
1117 
1118 
1124  OrthancPluginRestOutput* output,
1125  const char* url,
1126  const OrthancPluginHttpRequest* request);
1127 
1128 
1129 
1135  const OrthancPluginDicomInstance* instance,
1136  const char* instanceId);
1137 
1138 
1139 
1145  OrthancPluginChangeType changeType,
1146  OrthancPluginResourceType resourceType,
1147  const char* resourceId);
1148 
1149 
1150 
1156  OrthancPluginImage** target,
1157  const void* dicom,
1158  const uint32_t size,
1159  uint32_t frameIndex);
1160 
1161 
1162 
1167  typedef void (*OrthancPluginFree) (void* buffer);
1168 
1169 
1170 
1180  const char* bulkDataUri);
1181 
1182 
1183 
1197  const char* uuid,
1198  const void* content,
1199  int64_t size,
1201 
1202 
1203 
1223  void** content,
1224  int64_t* size,
1225  const char* uuid,
1227 
1228 
1229 
1241  const char* uuid,
1243 
1244 
1245 
1261  const OrthancPluginWorklistQuery* query,
1262  const char* issuerAet,
1263  const char* calledAet);
1264 
1265 
1266 
1287  OrthancPluginHttpMethod method,
1288  const char* uri,
1289  const char* ip,
1290  uint32_t headersCount,
1291  const char* const* headersKeys,
1292  const char* const* headersValues);
1293 
1294 
1295 
1318  OrthancPluginHttpMethod method,
1319  const char* uri,
1320  const char* ip,
1321  uint32_t headersCount,
1322  const char* const* headersKeys,
1323  const char* const* headersValues,
1324  uint32_t getArgumentsCount,
1325  const char* const* getArgumentsKeys,
1326  const char* const* getArgumentsValues);
1327 
1328 
1329 
1345  OrthancPluginFindAnswers* answers,
1346  const OrthancPluginFindQuery* query,
1347  const char* issuerAet,
1348  const char* calledAet);
1349 
1350 
1351 
1387  typedef void* (*OrthancPluginMoveCallback) (
1388  OrthancPluginResourceType resourceType,
1389  const char* patientId,
1390  const char* accessionNumber,
1391  const char* studyInstanceUid,
1392  const char* seriesInstanceUid,
1393  const char* sopInstanceUid,
1394  const char* originatorAet,
1395  const char* sourceAet,
1396  const char* targetAet,
1397  uint16_t originatorId);
1398 
1399 
1412  typedef uint32_t (*OrthancPluginGetMoveSize) (void* moveDriver);
1413 
1414 
1427  typedef OrthancPluginErrorCode (*OrthancPluginApplyMove) (void* moveDriver);
1428 
1429 
1441  typedef void (*OrthancPluginFreeMove) (void* moveDriver);
1442 
1443 
1454  typedef void (*OrthancPluginJobFinalize) (void* job);
1455 
1456 
1467  typedef float (*OrthancPluginJobGetProgress) (void* job);
1468 
1469 
1482  typedef const char* (*OrthancPluginJobGetContent) (void* job);
1483 
1484 
1500  typedef const char* (*OrthancPluginJobGetSerialized) (void* job);
1501 
1502 
1516 
1517 
1541 
1542 
1557 
1558 
1572  typedef OrthancPluginJob* (*OrthancPluginJobsUnserializer) (const char* jobType,
1573  const char* serialized);
1574 
1575 
1576 
1591 
1592 
1593 
1621  uint32_t levelDepth,
1622  const uint16_t* levelTagGroup,
1623  const uint16_t* levelTagElement,
1624  const uint32_t* levelIndex,
1625  uint16_t tagGroup,
1626  uint16_t tagElement,
1628 
1629 
1630 
1659  uint32_t levelDepth,
1660  const uint16_t* levelTagGroup,
1661  const uint16_t* levelTagElement,
1662  const uint32_t* levelIndex,
1663  uint16_t tagGroup,
1664  uint16_t tagElement,
1666  void* payload);
1667 
1668 
1669 
1673  typedef struct _OrthancPluginContext_t
1674  {
1675  void* pluginsManager;
1676  const char* orthancVersion;
1677  OrthancPluginFree Free;
1678  OrthancPluginErrorCode (*InvokeService) (struct _OrthancPluginContext_t* context,
1679  _OrthancPluginService service,
1680  const void* params);
1682 
1683 
1684 
1688  typedef struct
1689  {
1690  uint16_t group;
1691  uint16_t element;
1693  uint32_t minMultiplicity;
1694  uint32_t maxMultiplicity;
1696 
1697 
1698 
1707  ORTHANC_PLUGIN_INLINE void OrthancPluginFreeString(
1708  OrthancPluginContext* context,
1709  char* str)
1710  {
1711  if (str != NULL)
1712  {
1713  context->Free(str);
1714  }
1715  }
1716 
1717 
1737  ORTHANC_PLUGIN_INLINE int OrthancPluginCheckVersionAdvanced(
1738  OrthancPluginContext* context,
1739  int expectedMajor,
1740  int expectedMinor,
1741  int expectedRevision)
1742  {
1743  int major, minor, revision;
1744 
1745  if (sizeof(int32_t) != sizeof(OrthancPluginErrorCode) ||
1746  sizeof(int32_t) != sizeof(OrthancPluginHttpMethod) ||
1747  sizeof(int32_t) != sizeof(_OrthancPluginService) ||
1748  sizeof(int32_t) != sizeof(_OrthancPluginProperty) ||
1749  sizeof(int32_t) != sizeof(OrthancPluginPixelFormat) ||
1750  sizeof(int32_t) != sizeof(OrthancPluginContentType) ||
1751  sizeof(int32_t) != sizeof(OrthancPluginResourceType) ||
1752  sizeof(int32_t) != sizeof(OrthancPluginChangeType) ||
1753  sizeof(int32_t) != sizeof(OrthancPluginCompressionType) ||
1754  sizeof(int32_t) != sizeof(OrthancPluginImageFormat) ||
1755  sizeof(int32_t) != sizeof(OrthancPluginValueRepresentation) ||
1756  sizeof(int32_t) != sizeof(OrthancPluginDicomToJsonFormat) ||
1757  sizeof(int32_t) != sizeof(OrthancPluginDicomToJsonFlags) ||
1758  sizeof(int32_t) != sizeof(OrthancPluginCreateDicomFlags) ||
1759  sizeof(int32_t) != sizeof(OrthancPluginIdentifierConstraint) ||
1760  sizeof(int32_t) != sizeof(OrthancPluginInstanceOrigin) ||
1761  sizeof(int32_t) != sizeof(OrthancPluginJobStepStatus) ||
1762  sizeof(int32_t) != sizeof(OrthancPluginConstraintType) ||
1763  sizeof(int32_t) != sizeof(OrthancPluginMetricsType) ||
1764  sizeof(int32_t) != sizeof(OrthancPluginDicomWebBinaryMode) ||
1765  sizeof(int32_t) != sizeof(OrthancPluginStorageCommitmentFailureReason))
1766  {
1767  /* Mismatch in the size of the enumerations */
1768  return 0;
1769  }
1770 
1771  /* Assume compatibility with the mainline */
1772  if (!strcmp(context->orthancVersion, "mainline"))
1773  {
1774  return 1;
1775  }
1776 
1777  /* Parse the version of the Orthanc core */
1778  if (
1779 #ifdef _MSC_VER
1780  sscanf_s
1781 #else
1782  sscanf
1783 #endif
1784  (context->orthancVersion, "%4d.%4d.%4d", &major, &minor, &revision) != 3)
1785  {
1786  return 0;
1787  }
1788 
1789  /* Check the major number of the version */
1790 
1791  if (major > expectedMajor)
1792  {
1793  return 1;
1794  }
1795 
1796  if (major < expectedMajor)
1797  {
1798  return 0;
1799  }
1800 
1801  /* Check the minor number of the version */
1802 
1803  if (minor > expectedMinor)
1804  {
1805  return 1;
1806  }
1807 
1808  if (minor < expectedMinor)
1809  {
1810  return 0;
1811  }
1812 
1813  /* Check the revision number of the version */
1814 
1815  if (revision >= expectedRevision)
1816  {
1817  return 1;
1818  }
1819  else
1820  {
1821  return 0;
1822  }
1823  }
1824 
1825 
1842  ORTHANC_PLUGIN_INLINE int OrthancPluginCheckVersion(
1843  OrthancPluginContext* context)
1844  {
1846  context,
1847  ORTHANC_PLUGINS_MINIMAL_MAJOR_NUMBER,
1848  ORTHANC_PLUGINS_MINIMAL_MINOR_NUMBER,
1849  ORTHANC_PLUGINS_MINIMAL_REVISION_NUMBER);
1850  }
1851 
1852 
1861  ORTHANC_PLUGIN_INLINE void OrthancPluginFreeMemoryBuffer(
1862  OrthancPluginContext* context,
1863  OrthancPluginMemoryBuffer* buffer)
1864  {
1865  context->Free(buffer->data);
1866  }
1867 
1868 
1877  ORTHANC_PLUGIN_INLINE void OrthancPluginLogError(
1878  OrthancPluginContext* context,
1879  const char* message)
1880  {
1881  context->InvokeService(context, _OrthancPluginService_LogError, message);
1882  }
1883 
1884 
1893  ORTHANC_PLUGIN_INLINE void OrthancPluginLogWarning(
1894  OrthancPluginContext* context,
1895  const char* message)
1896  {
1897  context->InvokeService(context, _OrthancPluginService_LogWarning, message);
1898  }
1899 
1900 
1909  ORTHANC_PLUGIN_INLINE void OrthancPluginLogInfo(
1910  OrthancPluginContext* context,
1911  const char* message)
1912  {
1913  context->InvokeService(context, _OrthancPluginService_LogInfo, message);
1914  }
1915 
1916 
1917 
1918  typedef struct
1919  {
1920  const char* pathRegularExpression;
1921  OrthancPluginRestCallback callback;
1922  } _OrthancPluginRestCallback;
1923 
1945  ORTHANC_PLUGIN_INLINE void OrthancPluginRegisterRestCallback(
1946  OrthancPluginContext* context,
1947  const char* pathRegularExpression,
1948  OrthancPluginRestCallback callback)
1949  {
1950  _OrthancPluginRestCallback params;
1951  params.pathRegularExpression = pathRegularExpression;
1952  params.callback = callback;
1953  context->InvokeService(context, _OrthancPluginService_RegisterRestCallback, &params);
1954  }
1955 
1956 
1957 
1985  ORTHANC_PLUGIN_INLINE void OrthancPluginRegisterRestCallbackNoLock(
1986  OrthancPluginContext* context,
1987  const char* pathRegularExpression,
1988  OrthancPluginRestCallback callback)
1989  {
1990  _OrthancPluginRestCallback params;
1991  params.pathRegularExpression = pathRegularExpression;
1992  params.callback = callback;
1993  context->InvokeService(context, _OrthancPluginService_RegisterRestCallbackNoLock, &params);
1994  }
1995 
1996 
1997 
1998  typedef struct
1999  {
2001  } _OrthancPluginOnStoredInstanceCallback;
2002 
2014  OrthancPluginContext* context,
2016  {
2017  _OrthancPluginOnStoredInstanceCallback params;
2018  params.callback = callback;
2019 
2020  context->InvokeService(context, _OrthancPluginService_RegisterOnStoredInstanceCallback, &params);
2021  }
2022 
2023 
2024 
2025  typedef struct
2026  {
2027  OrthancPluginRestOutput* output;
2028  const void* answer;
2029  uint32_t answerSize;
2030  const char* mimeType;
2031  } _OrthancPluginAnswerBuffer;
2032 
2045  ORTHANC_PLUGIN_INLINE void OrthancPluginAnswerBuffer(
2046  OrthancPluginContext* context,
2047  OrthancPluginRestOutput* output,
2048  const void* answer,
2049  uint32_t answerSize,
2050  const char* mimeType)
2051  {
2052  _OrthancPluginAnswerBuffer params;
2053  params.output = output;
2054  params.answer = answer;
2055  params.answerSize = answerSize;
2056  params.mimeType = mimeType;
2057  context->InvokeService(context, _OrthancPluginService_AnswerBuffer, &params);
2058  }
2059 
2060 
2061  typedef struct
2062  {
2063  OrthancPluginRestOutput* output;
2064  OrthancPluginPixelFormat format;
2065  uint32_t width;
2066  uint32_t height;
2067  uint32_t pitch;
2068  const void* buffer;
2069  } _OrthancPluginCompressAndAnswerPngImage;
2070 
2071  typedef struct
2072  {
2073  OrthancPluginRestOutput* output;
2074  OrthancPluginImageFormat imageFormat;
2075  OrthancPluginPixelFormat pixelFormat;
2076  uint32_t width;
2077  uint32_t height;
2078  uint32_t pitch;
2079  const void* buffer;
2080  uint8_t quality;
2081  } _OrthancPluginCompressAndAnswerImage;
2082 
2083 
2102  ORTHANC_PLUGIN_INLINE void OrthancPluginCompressAndAnswerPngImage(
2103  OrthancPluginContext* context,
2104  OrthancPluginRestOutput* output,
2105  OrthancPluginPixelFormat format,
2106  uint32_t width,
2107  uint32_t height,
2108  uint32_t pitch,
2109  const void* buffer)
2110  {
2111  _OrthancPluginCompressAndAnswerImage params;
2112  params.output = output;
2113  params.imageFormat = OrthancPluginImageFormat_Png;
2114  params.pixelFormat = format;
2115  params.width = width;
2116  params.height = height;
2117  params.pitch = pitch;
2118  params.buffer = buffer;
2119  params.quality = 0; /* No quality for PNG */
2120  context->InvokeService(context, _OrthancPluginService_CompressAndAnswerImage, &params);
2121  }
2122 
2123 
2124 
2125  typedef struct
2126  {
2127  OrthancPluginMemoryBuffer* target;
2128  const char* instanceId;
2129  } _OrthancPluginGetDicomForInstance;
2130 
2144  OrthancPluginContext* context,
2145  OrthancPluginMemoryBuffer* target,
2146  const char* instanceId)
2147  {
2148  _OrthancPluginGetDicomForInstance params;
2149  params.target = target;
2150  params.instanceId = instanceId;
2151  return context->InvokeService(context, _OrthancPluginService_GetDicomForInstance, &params);
2152  }
2153 
2154 
2155 
2156  typedef struct
2157  {
2158  OrthancPluginMemoryBuffer* target;
2159  const char* uri;
2160  } _OrthancPluginRestApiGet;
2161 
2177  OrthancPluginContext* context,
2178  OrthancPluginMemoryBuffer* target,
2179  const char* uri)
2180  {
2181  _OrthancPluginRestApiGet params;
2182  params.target = target;
2183  params.uri = uri;
2184  return context->InvokeService(context, _OrthancPluginService_RestApiGet, &params);
2185  }
2186 
2187 
2188 
2207  OrthancPluginContext* context,
2208  OrthancPluginMemoryBuffer* target,
2209  const char* uri)
2210  {
2211  _OrthancPluginRestApiGet params;
2212  params.target = target;
2213  params.uri = uri;
2214  return context->InvokeService(context, _OrthancPluginService_RestApiGetAfterPlugins, &params);
2215  }
2216 
2217 
2218 
2219  typedef struct
2220  {
2221  OrthancPluginMemoryBuffer* target;
2222  const char* uri;
2223  const void* body;
2224  uint32_t bodySize;
2225  } _OrthancPluginRestApiPostPut;
2226 
2244  OrthancPluginContext* context,
2245  OrthancPluginMemoryBuffer* target,
2246  const char* uri,
2247  const void* body,
2248  uint32_t bodySize)
2249  {
2250  _OrthancPluginRestApiPostPut params;
2251  params.target = target;
2252  params.uri = uri;
2253  params.body = body;
2254  params.bodySize = bodySize;
2255  return context->InvokeService(context, _OrthancPluginService_RestApiPost, &params);
2256  }
2257 
2258 
2279  OrthancPluginContext* context,
2280  OrthancPluginMemoryBuffer* target,
2281  const char* uri,
2282  const void* body,
2283  uint32_t bodySize)
2284  {
2285  _OrthancPluginRestApiPostPut params;
2286  params.target = target;
2287  params.uri = uri;
2288  params.body = body;
2289  params.bodySize = bodySize;
2290  return context->InvokeService(context, _OrthancPluginService_RestApiPostAfterPlugins, &params);
2291  }
2292 
2293 
2294 
2308  OrthancPluginContext* context,
2309  const char* uri)
2310  {
2311  return context->InvokeService(context, _OrthancPluginService_RestApiDelete, uri);
2312  }
2313 
2314 
2331  OrthancPluginContext* context,
2332  const char* uri)
2333  {
2334  return context->InvokeService(context, _OrthancPluginService_RestApiDeleteAfterPlugins, uri);
2335  }
2336 
2337 
2338 
2356  OrthancPluginContext* context,
2357  OrthancPluginMemoryBuffer* target,
2358  const char* uri,
2359  const void* body,
2360  uint32_t bodySize)
2361  {
2362  _OrthancPluginRestApiPostPut params;
2363  params.target = target;
2364  params.uri = uri;
2365  params.body = body;
2366  params.bodySize = bodySize;
2367  return context->InvokeService(context, _OrthancPluginService_RestApiPut, &params);
2368  }
2369 
2370 
2371 
2392  OrthancPluginContext* context,
2393  OrthancPluginMemoryBuffer* target,
2394  const char* uri,
2395  const void* body,
2396  uint32_t bodySize)
2397  {
2398  _OrthancPluginRestApiPostPut params;
2399  params.target = target;
2400  params.uri = uri;
2401  params.body = body;
2402  params.bodySize = bodySize;
2403  return context->InvokeService(context, _OrthancPluginService_RestApiPutAfterPlugins, &params);
2404  }
2405 
2406 
2407 
2408  typedef struct
2409  {
2410  OrthancPluginRestOutput* output;
2411  const char* argument;
2412  } _OrthancPluginOutputPlusArgument;
2413 
2425  ORTHANC_PLUGIN_INLINE void OrthancPluginRedirect(
2426  OrthancPluginContext* context,
2427  OrthancPluginRestOutput* output,
2428  const char* redirection)
2429  {
2430  _OrthancPluginOutputPlusArgument params;
2431  params.output = output;
2432  params.argument = redirection;
2433  context->InvokeService(context, _OrthancPluginService_Redirect, &params);
2434  }
2435 
2436 
2437 
2438  typedef struct
2439  {
2440  char** result;
2441  const char* argument;
2442  } _OrthancPluginRetrieveDynamicString;
2443 
2457  ORTHANC_PLUGIN_INLINE char* OrthancPluginLookupPatient(
2458  OrthancPluginContext* context,
2459  const char* patientID)
2460  {
2461  char* result;
2462 
2463  _OrthancPluginRetrieveDynamicString params;
2464  params.result = &result;
2465  params.argument = patientID;
2466 
2467  if (context->InvokeService(context, _OrthancPluginService_LookupPatient, &params) != OrthancPluginErrorCode_Success)
2468  {
2469  /* Error */
2470  return NULL;
2471  }
2472  else
2473  {
2474  return result;
2475  }
2476  }
2477 
2478 
2492  ORTHANC_PLUGIN_INLINE char* OrthancPluginLookupStudy(
2493  OrthancPluginContext* context,
2494  const char* studyUID)
2495  {
2496  char* result;
2497 
2498  _OrthancPluginRetrieveDynamicString params;
2499  params.result = &result;
2500  params.argument = studyUID;
2501 
2502  if (context->InvokeService(context, _OrthancPluginService_LookupStudy, &params) != OrthancPluginErrorCode_Success)
2503  {
2504  /* Error */
2505  return NULL;
2506  }
2507  else
2508  {
2509  return result;
2510  }
2511  }
2512 
2513 
2527  ORTHANC_PLUGIN_INLINE char* OrthancPluginLookupStudyWithAccessionNumber(
2528  OrthancPluginContext* context,
2529  const char* accessionNumber)
2530  {
2531  char* result;
2532 
2533  _OrthancPluginRetrieveDynamicString params;
2534  params.result = &result;
2535  params.argument = accessionNumber;
2536 
2537  if (context->InvokeService(context, _OrthancPluginService_LookupStudyWithAccessionNumber, &params) != OrthancPluginErrorCode_Success)
2538  {
2539  /* Error */
2540  return NULL;
2541  }
2542  else
2543  {
2544  return result;
2545  }
2546  }
2547 
2548 
2562  ORTHANC_PLUGIN_INLINE char* OrthancPluginLookupSeries(
2563  OrthancPluginContext* context,
2564  const char* seriesUID)
2565  {
2566  char* result;
2567 
2568  _OrthancPluginRetrieveDynamicString params;
2569  params.result = &result;
2570  params.argument = seriesUID;
2571 
2572  if (context->InvokeService(context, _OrthancPluginService_LookupSeries, &params) != OrthancPluginErrorCode_Success)
2573  {
2574  /* Error */
2575  return NULL;
2576  }
2577  else
2578  {
2579  return result;
2580  }
2581  }
2582 
2583 
2597  ORTHANC_PLUGIN_INLINE char* OrthancPluginLookupInstance(
2598  OrthancPluginContext* context,
2599  const char* sopInstanceUID)
2600  {
2601  char* result;
2602 
2603  _OrthancPluginRetrieveDynamicString params;
2604  params.result = &result;
2605  params.argument = sopInstanceUID;
2606 
2607  if (context->InvokeService(context, _OrthancPluginService_LookupInstance, &params) != OrthancPluginErrorCode_Success)
2608  {
2609  /* Error */
2610  return NULL;
2611  }
2612  else
2613  {
2614  return result;
2615  }
2616  }
2617 
2618 
2619 
2620  typedef struct
2621  {
2622  OrthancPluginRestOutput* output;
2623  uint16_t status;
2624  } _OrthancPluginSendHttpStatusCode;
2625 
2642  ORTHANC_PLUGIN_INLINE void OrthancPluginSendHttpStatusCode(
2643  OrthancPluginContext* context,
2644  OrthancPluginRestOutput* output,
2645  uint16_t status)
2646  {
2647  _OrthancPluginSendHttpStatusCode params;
2648  params.output = output;
2649  params.status = status;
2650  context->InvokeService(context, _OrthancPluginService_SendHttpStatusCode, &params);
2651  }
2652 
2653 
2665  ORTHANC_PLUGIN_INLINE void OrthancPluginSendUnauthorized(
2666  OrthancPluginContext* context,
2667  OrthancPluginRestOutput* output,
2668  const char* realm)
2669  {
2670  _OrthancPluginOutputPlusArgument params;
2671  params.output = output;
2672  params.argument = realm;
2673  context->InvokeService(context, _OrthancPluginService_SendUnauthorized, &params);
2674  }
2675 
2676 
2688  ORTHANC_PLUGIN_INLINE void OrthancPluginSendMethodNotAllowed(
2689  OrthancPluginContext* context,
2690  OrthancPluginRestOutput* output,
2691  const char* allowedMethods)
2692  {
2693  _OrthancPluginOutputPlusArgument params;
2694  params.output = output;
2695  params.argument = allowedMethods;
2696  context->InvokeService(context, _OrthancPluginService_SendMethodNotAllowed, &params);
2697  }
2698 
2699 
2700  typedef struct
2701  {
2702  OrthancPluginRestOutput* output;
2703  const char* key;
2704  const char* value;
2705  } _OrthancPluginSetHttpHeader;
2706 
2718  ORTHANC_PLUGIN_INLINE void OrthancPluginSetCookie(
2719  OrthancPluginContext* context,
2720  OrthancPluginRestOutput* output,
2721  const char* cookie,
2722  const char* value)
2723  {
2724  _OrthancPluginSetHttpHeader params;
2725  params.output = output;
2726  params.key = cookie;
2727  params.value = value;
2728  context->InvokeService(context, _OrthancPluginService_SetCookie, &params);
2729  }
2730 
2731 
2743  ORTHANC_PLUGIN_INLINE void OrthancPluginSetHttpHeader(
2744  OrthancPluginContext* context,
2745  OrthancPluginRestOutput* output,
2746  const char* key,
2747  const char* value)
2748  {
2749  _OrthancPluginSetHttpHeader params;
2750  params.output = output;
2751  params.key = key;
2752  params.value = value;
2753  context->InvokeService(context, _OrthancPluginService_SetHttpHeader, &params);
2754  }
2755 
2756 
2757  typedef struct
2758  {
2759  char** resultStringToFree;
2760  const char** resultString;
2761  int64_t* resultInt64;
2762  const char* key;
2763  const OrthancPluginDicomInstance* instance;
2764  OrthancPluginInstanceOrigin* resultOrigin; /* New in Orthanc 0.9.5 SDK */
2765  } _OrthancPluginAccessDicomInstance;
2766 
2767 
2779  ORTHANC_PLUGIN_INLINE const char* OrthancPluginGetInstanceRemoteAet(
2780  OrthancPluginContext* context,
2781  const OrthancPluginDicomInstance* instance)
2782  {
2783  const char* result;
2784 
2785  _OrthancPluginAccessDicomInstance params;
2786  memset(&params, 0, sizeof(params));
2787  params.resultString = &result;
2788  params.instance = instance;
2789 
2790  if (context->InvokeService(context, _OrthancPluginService_GetInstanceRemoteAet, &params) != OrthancPluginErrorCode_Success)
2791  {
2792  /* Error */
2793  return NULL;
2794  }
2795  else
2796  {
2797  return result;
2798  }
2799  }
2800 
2801 
2812  ORTHANC_PLUGIN_INLINE int64_t OrthancPluginGetInstanceSize(
2813  OrthancPluginContext* context,
2814  const OrthancPluginDicomInstance* instance)
2815  {
2816  int64_t size;
2817 
2818  _OrthancPluginAccessDicomInstance params;
2819  memset(&params, 0, sizeof(params));
2820  params.resultInt64 = &size;
2821  params.instance = instance;
2822 
2823  if (context->InvokeService(context, _OrthancPluginService_GetInstanceSize, &params) != OrthancPluginErrorCode_Success)
2824  {
2825  /* Error */
2826  return -1;
2827  }
2828  else
2829  {
2830  return size;
2831  }
2832  }
2833 
2834 
2845  ORTHANC_PLUGIN_INLINE const void* OrthancPluginGetInstanceData(
2846  OrthancPluginContext* context,
2847  const OrthancPluginDicomInstance* instance)
2848  {
2849  const char* result;
2850 
2851  _OrthancPluginAccessDicomInstance params;
2852  memset(&params, 0, sizeof(params));
2853  params.resultString = &result;
2854  params.instance = instance;
2855 
2856  if (context->InvokeService(context, _OrthancPluginService_GetInstanceData, &params) != OrthancPluginErrorCode_Success)
2857  {
2858  /* Error */
2859  return NULL;
2860  }
2861  else
2862  {
2863  return result;
2864  }
2865  }
2866 
2867 
2881  ORTHANC_PLUGIN_INLINE char* OrthancPluginGetInstanceJson(
2882  OrthancPluginContext* context,
2883  const OrthancPluginDicomInstance* instance)
2884  {
2885  char* result;
2886 
2887  _OrthancPluginAccessDicomInstance params;
2888  memset(&params, 0, sizeof(params));
2889  params.resultStringToFree = &result;
2890  params.instance = instance;
2891 
2892  if (context->InvokeService(context, _OrthancPluginService_GetInstanceJson, &params) != OrthancPluginErrorCode_Success)
2893  {
2894  /* Error */
2895  return NULL;
2896  }
2897  else
2898  {
2899  return result;
2900  }
2901  }
2902 
2903 
2919  ORTHANC_PLUGIN_INLINE char* OrthancPluginGetInstanceSimplifiedJson(
2920  OrthancPluginContext* context,
2921  const OrthancPluginDicomInstance* instance)
2922  {
2923  char* result;
2924 
2925  _OrthancPluginAccessDicomInstance params;
2926  memset(&params, 0, sizeof(params));
2927  params.resultStringToFree = &result;
2928  params.instance = instance;
2929 
2930  if (context->InvokeService(context, _OrthancPluginService_GetInstanceSimplifiedJson, &params) != OrthancPluginErrorCode_Success)
2931  {
2932  /* Error */
2933  return NULL;
2934  }
2935  else
2936  {
2937  return result;
2938  }
2939  }
2940 
2941 
2958  ORTHANC_PLUGIN_INLINE int OrthancPluginHasInstanceMetadata(
2959  OrthancPluginContext* context,
2960  const OrthancPluginDicomInstance* instance,
2961  const char* metadata)
2962  {
2963  int64_t result;
2964 
2965  _OrthancPluginAccessDicomInstance params;
2966  memset(&params, 0, sizeof(params));
2967  params.resultInt64 = &result;
2968  params.instance = instance;
2969  params.key = metadata;
2970 
2971  if (context->InvokeService(context, _OrthancPluginService_HasInstanceMetadata, &params) != OrthancPluginErrorCode_Success)
2972  {
2973  /* Error */
2974  return -1;
2975  }
2976  else
2977  {
2978  return (result != 0);
2979  }
2980  }
2981 
2982 
2999  ORTHANC_PLUGIN_INLINE const char* OrthancPluginGetInstanceMetadata(
3000  OrthancPluginContext* context,
3001  const OrthancPluginDicomInstance* instance,
3002  const char* metadata)
3003  {
3004  const char* result;
3005 
3006  _OrthancPluginAccessDicomInstance params;
3007  memset(&params, 0, sizeof(params));
3008  params.resultString = &result;
3009  params.instance = instance;
3010  params.key = metadata;
3011 
3012  if (context->InvokeService(context, _OrthancPluginService_GetInstanceMetadata, &params) != OrthancPluginErrorCode_Success)
3013  {
3014  /* Error */
3015  return NULL;
3016  }
3017  else
3018  {
3019  return result;
3020  }
3021  }
3022 
3023 
3024 
3025  typedef struct
3026  {
3030  OrthancPluginFree free;
3031  } _OrthancPluginRegisterStorageArea;
3032 
3047  ORTHANC_PLUGIN_INLINE void OrthancPluginRegisterStorageArea(
3048  OrthancPluginContext* context,
3052  {
3053  _OrthancPluginRegisterStorageArea params;
3054  params.create = create;
3055  params.read = read;
3056  params.remove = remove;
3057 
3058 #ifdef __cplusplus
3059  params.free = ::free;
3060 #else
3061  params.free = free;
3062 #endif
3063 
3064  context->InvokeService(context, _OrthancPluginService_RegisterStorageArea, &params);
3065  }
3066 
3067 
3068 
3079  ORTHANC_PLUGIN_INLINE char *OrthancPluginGetOrthancPath(OrthancPluginContext* context)
3080  {
3081  char* result;
3082 
3083  _OrthancPluginRetrieveDynamicString params;
3084  params.result = &result;
3085  params.argument = NULL;
3086 
3087  if (context->InvokeService(context, _OrthancPluginService_GetOrthancPath, &params) != OrthancPluginErrorCode_Success)
3088  {
3089  /* Error */
3090  return NULL;
3091  }
3092  else
3093  {
3094  return result;
3095  }
3096  }
3097 
3098 
3109  ORTHANC_PLUGIN_INLINE char *OrthancPluginGetOrthancDirectory(OrthancPluginContext* context)
3110  {
3111  char* result;
3112 
3113  _OrthancPluginRetrieveDynamicString params;
3114  params.result = &result;
3115  params.argument = NULL;
3116 
3117  if (context->InvokeService(context, _OrthancPluginService_GetOrthancDirectory, &params) != OrthancPluginErrorCode_Success)
3118  {
3119  /* Error */
3120  return NULL;
3121  }
3122  else
3123  {
3124  return result;
3125  }
3126  }
3127 
3128 
3144  ORTHANC_PLUGIN_INLINE char *OrthancPluginGetConfigurationPath(OrthancPluginContext* context)
3145  {
3146  char* result;
3147 
3148  _OrthancPluginRetrieveDynamicString params;
3149  params.result = &result;
3150  params.argument = NULL;
3151 
3152  if (context->InvokeService(context, _OrthancPluginService_GetConfigurationPath, &params) != OrthancPluginErrorCode_Success)
3153  {
3154  /* Error */
3155  return NULL;
3156  }
3157  else
3158  {
3159  return result;
3160  }
3161  }
3162 
3163 
3164 
3165  typedef struct
3166  {
3168  } _OrthancPluginOnChangeCallback;
3169 
3186  ORTHANC_PLUGIN_INLINE void OrthancPluginRegisterOnChangeCallback(
3187  OrthancPluginContext* context,
3189  {
3190  _OrthancPluginOnChangeCallback params;
3191  params.callback = callback;
3192 
3193  context->InvokeService(context, _OrthancPluginService_RegisterOnChangeCallback, &params);
3194  }
3195 
3196 
3197 
3198  typedef struct
3199  {
3200  const char* plugin;
3201  _OrthancPluginProperty property;
3202  const char* value;
3203  } _OrthancPluginSetPluginProperty;
3204 
3205 
3217  ORTHANC_PLUGIN_INLINE void OrthancPluginSetRootUri(
3218  OrthancPluginContext* context,
3219  const char* uri)
3220  {
3221  _OrthancPluginSetPluginProperty params;
3222  params.plugin = OrthancPluginGetName();
3223  params.property = _OrthancPluginProperty_RootUri;
3224  params.value = uri;
3225 
3226  context->InvokeService(context, _OrthancPluginService_SetPluginProperty, &params);
3227  }
3228 
3229 
3239  ORTHANC_PLUGIN_INLINE void OrthancPluginSetDescription(
3240  OrthancPluginContext* context,
3241  const char* description)
3242  {
3243  _OrthancPluginSetPluginProperty params;
3244  params.plugin = OrthancPluginGetName();
3245  params.property = _OrthancPluginProperty_Description;
3246  params.value = description;
3247 
3248  context->InvokeService(context, _OrthancPluginService_SetPluginProperty, &params);
3249  }
3250 
3251 
3261  ORTHANC_PLUGIN_INLINE void OrthancPluginExtendOrthancExplorer(
3262  OrthancPluginContext* context,
3263  const char* javascript)
3264  {
3265  _OrthancPluginSetPluginProperty params;
3266  params.plugin = OrthancPluginGetName();
3267  params.property = _OrthancPluginProperty_OrthancExplorer;
3268  params.value = javascript;
3269 
3270  context->InvokeService(context, _OrthancPluginService_SetPluginProperty, &params);
3271  }
3272 
3273 
3274  typedef struct
3275  {
3276  char** result;
3277  int32_t property;
3278  const char* value;
3279  } _OrthancPluginGlobalProperty;
3280 
3281 
3295  ORTHANC_PLUGIN_INLINE char* OrthancPluginGetGlobalProperty(
3296  OrthancPluginContext* context,
3297  int32_t property,
3298  const char* defaultValue)
3299  {
3300  char* result;
3301 
3302  _OrthancPluginGlobalProperty params;
3303  params.result = &result;
3304  params.property = property;
3305  params.value = defaultValue;
3306 
3307  if (context->InvokeService(context, _OrthancPluginService_GetGlobalProperty, &params) != OrthancPluginErrorCode_Success)
3308  {
3309  /* Error */
3310  return NULL;
3311  }
3312  else
3313  {
3314  return result;
3315  }
3316  }
3317 
3318 
3335  OrthancPluginContext* context,
3336  int32_t property,
3337  const char* value)
3338  {
3339  _OrthancPluginGlobalProperty params;
3340  params.result = NULL;
3341  params.property = property;
3342  params.value = value;
3343 
3344  return context->InvokeService(context, _OrthancPluginService_SetGlobalProperty, &params);
3345  }
3346 
3347 
3348 
3349  typedef struct
3350  {
3351  int32_t *resultInt32;
3352  uint32_t *resultUint32;
3353  int64_t *resultInt64;
3354  uint64_t *resultUint64;
3355  } _OrthancPluginReturnSingleValue;
3356 
3365  ORTHANC_PLUGIN_INLINE uint32_t OrthancPluginGetCommandLineArgumentsCount(
3366  OrthancPluginContext* context)
3367  {
3368  uint32_t count = 0;
3369 
3370  _OrthancPluginReturnSingleValue params;
3371  memset(&params, 0, sizeof(params));
3372  params.resultUint32 = &count;
3373 
3374  if (context->InvokeService(context, _OrthancPluginService_GetCommandLineArgumentsCount, &params) != OrthancPluginErrorCode_Success)
3375  {
3376  /* Error */
3377  return 0;
3378  }
3379  else
3380  {
3381  return count;
3382  }
3383  }
3384 
3385 
3386 
3399  ORTHANC_PLUGIN_INLINE char* OrthancPluginGetCommandLineArgument(
3400  OrthancPluginContext* context,
3401  uint32_t argument)
3402  {
3403  char* result;
3404 
3405  _OrthancPluginGlobalProperty params;
3406  params.result = &result;
3407  params.property = (int32_t) argument;
3408  params.value = NULL;
3409 
3410  if (context->InvokeService(context, _OrthancPluginService_GetCommandLineArgument, &params) != OrthancPluginErrorCode_Success)
3411  {
3412  /* Error */
3413  return NULL;
3414  }
3415  else
3416  {
3417  return result;
3418  }
3419  }
3420 
3421 
3431  ORTHANC_PLUGIN_INLINE uint32_t OrthancPluginGetExpectedDatabaseVersion(
3432  OrthancPluginContext* context)
3433  {
3434  uint32_t count = 0;
3435 
3436  _OrthancPluginReturnSingleValue params;
3437  memset(&params, 0, sizeof(params));
3438  params.resultUint32 = &count;
3439 
3440  if (context->InvokeService(context, _OrthancPluginService_GetExpectedDatabaseVersion, &params) != OrthancPluginErrorCode_Success)
3441  {
3442  /* Error */
3443  return 0;
3444  }
3445  else
3446  {
3447  return count;
3448  }
3449  }
3450 
3451 
3452 
3464  ORTHANC_PLUGIN_INLINE char *OrthancPluginGetConfiguration(OrthancPluginContext* context)
3465  {
3466  char* result;
3467 
3468  _OrthancPluginRetrieveDynamicString params;
3469  params.result = &result;
3470  params.argument = NULL;
3471 
3472  if (context->InvokeService(context, _OrthancPluginService_GetConfiguration, &params) != OrthancPluginErrorCode_Success)
3473  {
3474  /* Error */
3475  return NULL;
3476  }
3477  else
3478  {
3479  return result;
3480  }
3481  }
3482 
3483 
3484 
3485  typedef struct
3486  {
3487  OrthancPluginRestOutput* output;
3488  const char* subType;
3489  const char* contentType;
3490  } _OrthancPluginStartMultipartAnswer;
3491 
3506  OrthancPluginContext* context,
3507  OrthancPluginRestOutput* output,
3508  const char* subType,
3509  const char* contentType)
3510  {
3511  _OrthancPluginStartMultipartAnswer params;
3512  params.output = output;
3513  params.subType = subType;
3514  params.contentType = contentType;
3515  return context->InvokeService(context, _OrthancPluginService_StartMultipartAnswer, &params);
3516  }
3517 
3518 
3535  OrthancPluginContext* context,
3536  OrthancPluginRestOutput* output,
3537  const char* answer,
3538  uint32_t answerSize)
3539  {
3540  _OrthancPluginAnswerBuffer params;
3541  params.output = output;
3542  params.answer = answer;
3543  params.answerSize = answerSize;
3544  params.mimeType = NULL;
3545  return context->InvokeService(context, _OrthancPluginService_SendMultipartItem, &params);
3546  }
3547 
3548 
3549 
3550  typedef struct
3551  {
3552  OrthancPluginMemoryBuffer* target;
3553  const void* source;
3554  uint32_t size;
3555  OrthancPluginCompressionType compression;
3556  uint8_t uncompress;
3557  } _OrthancPluginBufferCompression;
3558 
3559 
3577  OrthancPluginContext* context,
3578  OrthancPluginMemoryBuffer* target,
3579  const void* source,
3580  uint32_t size,
3581  OrthancPluginCompressionType compression,
3582  uint8_t uncompress)
3583  {
3584  _OrthancPluginBufferCompression params;
3585  params.target = target;
3586  params.source = source;
3587  params.size = size;
3588  params.compression = compression;
3589  params.uncompress = uncompress;
3590 
3591  return context->InvokeService(context, _OrthancPluginService_BufferCompression, &params);
3592  }
3593 
3594 
3595 
3596  typedef struct
3597  {
3598  OrthancPluginMemoryBuffer* target;
3599  const char* path;
3600  } _OrthancPluginReadFile;
3601 
3614  OrthancPluginContext* context,
3615  OrthancPluginMemoryBuffer* target,
3616  const char* path)
3617  {
3618  _OrthancPluginReadFile params;
3619  params.target = target;
3620  params.path = path;
3621  return context->InvokeService(context, _OrthancPluginService_ReadFile, &params);
3622  }
3623 
3624 
3625 
3626  typedef struct
3627  {
3628  const char* path;
3629  const void* data;
3630  uint32_t size;
3631  } _OrthancPluginWriteFile;
3632 
3645  OrthancPluginContext* context,
3646  const char* path,
3647  const void* data,
3648  uint32_t size)
3649  {
3650  _OrthancPluginWriteFile params;
3651  params.path = path;
3652  params.data = data;
3653  params.size = size;
3654  return context->InvokeService(context, _OrthancPluginService_WriteFile, &params);
3655  }
3656 
3657 
3658 
3659  typedef struct
3660  {
3661  const char** target;
3662  OrthancPluginErrorCode error;
3663  } _OrthancPluginGetErrorDescription;
3664 
3675  ORTHANC_PLUGIN_INLINE const char* OrthancPluginGetErrorDescription(
3676  OrthancPluginContext* context,
3677  OrthancPluginErrorCode error)
3678  {
3679  const char* result = NULL;
3680 
3681  _OrthancPluginGetErrorDescription params;
3682  params.target = &result;
3683  params.error = error;
3684 
3685  if (context->InvokeService(context, _OrthancPluginService_GetErrorDescription, &params) != OrthancPluginErrorCode_Success ||
3686  result == NULL)
3687  {
3688  return "Unknown error code";
3689  }
3690  else
3691  {
3692  return result;
3693  }
3694  }
3695 
3696 
3697 
3698  typedef struct
3699  {
3700  OrthancPluginRestOutput* output;
3701  uint16_t status;
3702  const char* body;
3703  uint32_t bodySize;
3704  } _OrthancPluginSendHttpStatus;
3705 
3728  ORTHANC_PLUGIN_INLINE void OrthancPluginSendHttpStatus(
3729  OrthancPluginContext* context,
3730  OrthancPluginRestOutput* output,
3731  uint16_t status,
3732  const char* body,
3733  uint32_t bodySize)
3734  {
3735  _OrthancPluginSendHttpStatus params;
3736  params.output = output;
3737  params.status = status;
3738  params.body = body;
3739  params.bodySize = bodySize;
3740  context->InvokeService(context, _OrthancPluginService_SendHttpStatus, &params);
3741  }
3742 
3743 
3744 
3745  typedef struct
3746  {
3747  const OrthancPluginImage* image;
3748  uint32_t* resultUint32;
3749  OrthancPluginPixelFormat* resultPixelFormat;
3750  void** resultBuffer;
3751  } _OrthancPluginGetImageInfo;
3752 
3753 
3765  OrthancPluginContext* context,
3766  const OrthancPluginImage* image)
3767  {
3768  OrthancPluginPixelFormat target;
3769 
3770  _OrthancPluginGetImageInfo params;
3771  memset(&params, 0, sizeof(params));
3772  params.image = image;
3773  params.resultPixelFormat = &target;
3774 
3775  if (context->InvokeService(context, _OrthancPluginService_GetImagePixelFormat, &params) != OrthancPluginErrorCode_Success)
3776  {
3778  }
3779  else
3780  {
3781  return (OrthancPluginPixelFormat) target;
3782  }
3783  }
3784 
3785 
3786 
3797  ORTHANC_PLUGIN_INLINE uint32_t OrthancPluginGetImageWidth(
3798  OrthancPluginContext* context,
3799  const OrthancPluginImage* image)
3800  {
3801  uint32_t width;
3802 
3803  _OrthancPluginGetImageInfo params;
3804  memset(&params, 0, sizeof(params));
3805  params.image = image;
3806  params.resultUint32 = &width;
3807 
3808  if (context->InvokeService(context, _OrthancPluginService_GetImageWidth, &params) != OrthancPluginErrorCode_Success)
3809  {
3810  return 0;
3811  }
3812  else
3813  {
3814  return width;
3815  }
3816  }
3817 
3818 
3819 
3830  ORTHANC_PLUGIN_INLINE uint32_t OrthancPluginGetImageHeight(
3831  OrthancPluginContext* context,
3832  const OrthancPluginImage* image)
3833  {
3834  uint32_t height;
3835 
3836  _OrthancPluginGetImageInfo params;
3837  memset(&params, 0, sizeof(params));
3838  params.image = image;
3839  params.resultUint32 = &height;
3840 
3841  if (context->InvokeService(context, _OrthancPluginService_GetImageHeight, &params) != OrthancPluginErrorCode_Success)
3842  {
3843  return 0;
3844  }
3845  else
3846  {
3847  return height;
3848  }
3849  }
3850 
3851 
3852 
3865  ORTHANC_PLUGIN_INLINE uint32_t OrthancPluginGetImagePitch(
3866  OrthancPluginContext* context,
3867  const OrthancPluginImage* image)
3868  {
3869  uint32_t pitch;
3870 
3871  _OrthancPluginGetImageInfo params;
3872  memset(&params, 0, sizeof(params));
3873  params.image = image;
3874  params.resultUint32 = &pitch;
3875 
3876  if (context->InvokeService(context, _OrthancPluginService_GetImagePitch, &params) != OrthancPluginErrorCode_Success)
3877  {
3878  return 0;
3879  }
3880  else
3881  {
3882  return pitch;
3883  }
3884  }
3885 
3886 
3887 
3899  ORTHANC_PLUGIN_INLINE void* OrthancPluginGetImageBuffer(
3900  OrthancPluginContext* context,
3901  const OrthancPluginImage* image)
3902  {
3903  void* target = NULL;
3904 
3905  _OrthancPluginGetImageInfo params;
3906  memset(&params, 0, sizeof(params));
3907  params.resultBuffer = &target;
3908  params.image = image;
3909 
3910  if (context->InvokeService(context, _OrthancPluginService_GetImageBuffer, &params) != OrthancPluginErrorCode_Success)
3911  {
3912  return NULL;
3913  }
3914  else
3915  {
3916  return target;
3917  }
3918  }
3919 
3920 
3921  typedef struct
3922  {
3923  OrthancPluginImage** target;
3924  const void* data;
3925  uint32_t size;
3926  OrthancPluginImageFormat format;
3927  } _OrthancPluginUncompressImage;
3928 
3929 
3943  OrthancPluginContext* context,
3944  const void* data,
3945  uint32_t size,
3946  OrthancPluginImageFormat format)
3947  {
3948  OrthancPluginImage* target = NULL;
3949 
3950  _OrthancPluginUncompressImage params;
3951  memset(&params, 0, sizeof(params));
3952  params.target = &target;
3953  params.data = data;
3954  params.size = size;
3955  params.format = format;
3956 
3957  if (context->InvokeService(context, _OrthancPluginService_UncompressImage, &params) != OrthancPluginErrorCode_Success)
3958  {
3959  return NULL;
3960  }
3961  else
3962  {
3963  return target;
3964  }
3965  }
3966 
3967 
3968 
3969 
3970  typedef struct
3971  {
3972  OrthancPluginImage* image;
3973  } _OrthancPluginFreeImage;
3974 
3984  ORTHANC_PLUGIN_INLINE void OrthancPluginFreeImage(
3985  OrthancPluginContext* context,
3986  OrthancPluginImage* image)
3987  {
3988  _OrthancPluginFreeImage params;
3989  params.image = image;
3990 
3991  context->InvokeService(context, _OrthancPluginService_FreeImage, &params);
3992  }
3993 
3994 
3995 
3996 
3997  typedef struct
3998  {
3999  OrthancPluginMemoryBuffer* target;
4000  OrthancPluginImageFormat imageFormat;
4001  OrthancPluginPixelFormat pixelFormat;
4002  uint32_t width;
4003  uint32_t height;
4004  uint32_t pitch;
4005  const void* buffer;
4006  uint8_t quality;
4007  } _OrthancPluginCompressImage;
4008 
4009 
4030  OrthancPluginContext* context,
4031  OrthancPluginMemoryBuffer* target,
4032  OrthancPluginPixelFormat format,
4033  uint32_t width,
4034  uint32_t height,
4035  uint32_t pitch,
4036  const void* buffer)
4037  {
4038  _OrthancPluginCompressImage params;
4039  memset(&params, 0, sizeof(params));
4040  params.target = target;
4041  params.imageFormat = OrthancPluginImageFormat_Png;
4042  params.pixelFormat = format;
4043  params.width = width;
4044  params.height = height;
4045  params.pitch = pitch;
4046  params.buffer = buffer;
4047  params.quality = 0; /* Unused for PNG */
4048 
4049  return context->InvokeService(context, _OrthancPluginService_CompressImage, &params);
4050  }
4051 
4052 
4075  OrthancPluginContext* context,
4076  OrthancPluginMemoryBuffer* target,
4077  OrthancPluginPixelFormat format,
4078  uint32_t width,
4079  uint32_t height,
4080  uint32_t pitch,
4081  const void* buffer,
4082  uint8_t quality)
4083  {
4084  _OrthancPluginCompressImage params;
4085  memset(&params, 0, sizeof(params));
4086  params.target = target;
4087  params.imageFormat = OrthancPluginImageFormat_Jpeg;
4088  params.pixelFormat = format;
4089  params.width = width;
4090  params.height = height;
4091  params.pitch = pitch;
4092  params.buffer = buffer;
4093  params.quality = quality;
4094 
4095  return context->InvokeService(context, _OrthancPluginService_CompressImage, &params);
4096  }
4097 
4098 
4099 
4121  ORTHANC_PLUGIN_INLINE void OrthancPluginCompressAndAnswerJpegImage(
4122  OrthancPluginContext* context,
4123  OrthancPluginRestOutput* output,
4124  OrthancPluginPixelFormat format,
4125  uint32_t width,
4126  uint32_t height,
4127  uint32_t pitch,
4128  const void* buffer,
4129  uint8_t quality)
4130  {
4131  _OrthancPluginCompressAndAnswerImage params;
4132  params.output = output;
4133  params.imageFormat = OrthancPluginImageFormat_Jpeg;
4134  params.pixelFormat = format;
4135  params.width = width;
4136  params.height = height;
4137  params.pitch = pitch;
4138  params.buffer = buffer;
4139  params.quality = quality;
4140  context->InvokeService(context, _OrthancPluginService_CompressAndAnswerImage, &params);
4141  }
4142 
4143 
4144 
4145 
4146  typedef struct
4147  {
4148  OrthancPluginMemoryBuffer* target;
4149  OrthancPluginHttpMethod method;
4150  const char* url;
4151  const char* username;
4152  const char* password;
4153  const void* body;
4154  uint32_t bodySize;
4155  } _OrthancPluginCallHttpClient;
4156 
4157 
4175  OrthancPluginContext* context,
4176  OrthancPluginMemoryBuffer* target,
4177  const char* url,
4178  const char* username,
4179  const char* password)
4180  {
4181  _OrthancPluginCallHttpClient params;
4182  memset(&params, 0, sizeof(params));
4183 
4184  params.target = target;
4185  params.method = OrthancPluginHttpMethod_Get;
4186  params.url = url;
4187  params.username = username;
4188  params.password = password;
4189 
4190  return context->InvokeService(context, _OrthancPluginService_CallHttpClient, &params);
4191  }
4192 
4193 
4213  OrthancPluginContext* context,
4214  OrthancPluginMemoryBuffer* target,
4215  const char* url,
4216  const void* body,
4217  uint32_t bodySize,
4218  const char* username,
4219  const char* password)
4220  {
4221  _OrthancPluginCallHttpClient params;
4222  memset(&params, 0, sizeof(params));
4223 
4224  params.target = target;
4225  params.method = OrthancPluginHttpMethod_Post;
4226  params.url = url;
4227  params.body = body;
4228  params.bodySize = bodySize;
4229  params.username = username;
4230  params.password = password;
4231 
4232  return context->InvokeService(context, _OrthancPluginService_CallHttpClient, &params);
4233  }
4234 
4235 
4255  OrthancPluginContext* context,
4256  OrthancPluginMemoryBuffer* target,
4257  const char* url,
4258  const void* body,
4259  uint32_t bodySize,
4260  const char* username,
4261  const char* password)
4262  {
4263  _OrthancPluginCallHttpClient params;
4264  memset(&params, 0, sizeof(params));
4265 
4266  params.target = target;
4267  params.method = OrthancPluginHttpMethod_Put;
4268  params.url = url;
4269  params.body = body;
4270  params.bodySize = bodySize;
4271  params.username = username;
4272  params.password = password;
4273 
4274  return context->InvokeService(context, _OrthancPluginService_CallHttpClient, &params);
4275  }
4276 
4277 
4293  OrthancPluginContext* context,
4294  const char* url,
4295  const char* username,
4296  const char* password)
4297  {
4298  _OrthancPluginCallHttpClient params;
4299  memset(&params, 0, sizeof(params));
4300 
4301  params.method = OrthancPluginHttpMethod_Delete;
4302  params.url = url;
4303  params.username = username;
4304  params.password = password;
4305 
4306  return context->InvokeService(context, _OrthancPluginService_CallHttpClient, &params);
4307  }
4308 
4309 
4310 
4311  typedef struct
4312  {
4313  OrthancPluginImage** target;
4314  const OrthancPluginImage* source;
4315  OrthancPluginPixelFormat targetFormat;
4316  } _OrthancPluginConvertPixelFormat;
4317 
4318 
4331  OrthancPluginContext* context,
4332  const OrthancPluginImage* source,
4333  OrthancPluginPixelFormat targetFormat)
4334  {
4335  OrthancPluginImage* target = NULL;
4336 
4337  _OrthancPluginConvertPixelFormat params;
4338  params.target = &target;
4339  params.source = source;
4340  params.targetFormat = targetFormat;
4341 
4342  if (context->InvokeService(context, _OrthancPluginService_ConvertPixelFormat, &params) != OrthancPluginErrorCode_Success)
4343  {
4344  return NULL;
4345  }
4346  else
4347  {
4348  return target;
4349  }
4350  }
4351 
4352 
4353 
4365  ORTHANC_PLUGIN_INLINE uint32_t OrthancPluginGetFontsCount(
4366  OrthancPluginContext* context)
4367  {
4368  uint32_t count = 0;
4369 
4370  _OrthancPluginReturnSingleValue params;
4371  memset(&params, 0, sizeof(params));
4372  params.resultUint32 = &count;
4373 
4374  if (context->InvokeService(context, _OrthancPluginService_GetFontsCount, &params) != OrthancPluginErrorCode_Success)
4375  {
4376  /* Error */
4377  return 0;
4378  }
4379  else
4380  {
4381  return count;
4382  }
4383  }
4384 
4385 
4386 
4387 
4388  typedef struct
4389  {
4390  uint32_t fontIndex; /* in */
4391  const char** name; /* out */
4392  uint32_t* size; /* out */
4393  } _OrthancPluginGetFontInfo;
4394 
4405  ORTHANC_PLUGIN_INLINE const char* OrthancPluginGetFontName(
4406  OrthancPluginContext* context,
4407  uint32_t fontIndex)
4408  {
4409  const char* result = NULL;
4410 
4411  _OrthancPluginGetFontInfo params;
4412  memset(&params, 0, sizeof(params));
4413  params.name = &result;
4414  params.fontIndex = fontIndex;
4415 
4416  if (context->InvokeService(context, _OrthancPluginService_GetFontInfo, &params) != OrthancPluginErrorCode_Success)
4417  {
4418  return NULL;
4419  }
4420  else
4421  {
4422  return result;
4423  }
4424  }
4425 
4426 
4437  ORTHANC_PLUGIN_INLINE uint32_t OrthancPluginGetFontSize(
4438  OrthancPluginContext* context,
4439  uint32_t fontIndex)
4440  {
4441  uint32_t result;
4442 
4443  _OrthancPluginGetFontInfo params;
4444  memset(&params, 0, sizeof(params));
4445  params.size = &result;
4446  params.fontIndex = fontIndex;
4447 
4448  if (context->InvokeService(context, _OrthancPluginService_GetFontInfo, &params) != OrthancPluginErrorCode_Success)
4449  {
4450  return 0;
4451  }
4452  else
4453  {
4454  return result;
4455  }
4456  }
4457 
4458 
4459 
4460  typedef struct
4461  {
4462  OrthancPluginImage* image;
4463  uint32_t fontIndex;
4464  const char* utf8Text;
4465  int32_t x;
4466  int32_t y;
4467  uint8_t r;
4468  uint8_t g;
4469  uint8_t b;
4470  } _OrthancPluginDrawText;
4471 
4472 
4491  OrthancPluginContext* context,
4492  OrthancPluginImage* image,
4493  uint32_t fontIndex,
4494  const char* utf8Text,
4495  int32_t x,
4496  int32_t y,
4497  uint8_t r,
4498  uint8_t g,
4499  uint8_t b)
4500  {
4501  _OrthancPluginDrawText params;
4502  memset(&params, 0, sizeof(params));
4503  params.image = image;
4504  params.fontIndex = fontIndex;
4505  params.utf8Text = utf8Text;
4506  params.x = x;
4507  params.y = y;
4508  params.r = r;
4509  params.g = g;
4510  params.b = b;
4511 
4512  return context->InvokeService(context, _OrthancPluginService_DrawText, &params);
4513  }
4514 
4515 
4516 
4517  typedef struct
4518  {
4519  OrthancPluginStorageArea* storageArea;
4520  const char* uuid;
4521  const void* content;
4522  uint64_t size;
4524  } _OrthancPluginStorageAreaCreate;
4525 
4526 
4543  OrthancPluginContext* context,
4544  OrthancPluginStorageArea* storageArea,
4545  const char* uuid,
4546  const void* content,
4547  uint64_t size,
4549  {
4550  _OrthancPluginStorageAreaCreate params;
4551  params.storageArea = storageArea;
4552  params.uuid = uuid;
4553  params.content = content;
4554  params.size = size;
4555  params.type = type;
4556 
4557  return context->InvokeService(context, _OrthancPluginService_StorageAreaCreate, &params);
4558  }
4559 
4560 
4561  typedef struct
4562  {
4563  OrthancPluginMemoryBuffer* target;
4564  OrthancPluginStorageArea* storageArea;
4565  const char* uuid;
4567  } _OrthancPluginStorageAreaRead;
4568 
4569 
4585  OrthancPluginContext* context,
4586  OrthancPluginMemoryBuffer* target,
4587  OrthancPluginStorageArea* storageArea,
4588  const char* uuid,
4590  {
4591  _OrthancPluginStorageAreaRead params;
4592  params.target = target;
4593  params.storageArea = storageArea;
4594  params.uuid = uuid;
4595  params.type = type;
4596 
4597  return context->InvokeService(context, _OrthancPluginService_StorageAreaRead, &params);
4598  }
4599 
4600 
4601  typedef struct
4602  {
4603  OrthancPluginStorageArea* storageArea;
4604  const char* uuid;
4606  } _OrthancPluginStorageAreaRemove;
4607 
4622  OrthancPluginContext* context,
4623  OrthancPluginStorageArea* storageArea,
4624  const char* uuid,
4626  {
4627  _OrthancPluginStorageAreaRemove params;
4628  params.storageArea = storageArea;
4629  params.uuid = uuid;
4630  params.type = type;
4631 
4632  return context->InvokeService(context, _OrthancPluginService_StorageAreaRemove, &params);
4633  }
4634 
4635 
4636 
4637  typedef struct
4638  {
4639  OrthancPluginErrorCode* target;
4640  int32_t code;
4641  uint16_t httpStatus;
4642  const char* message;
4643  } _OrthancPluginRegisterErrorCode;
4644 
4661  OrthancPluginContext* context,
4662  int32_t code,
4663  uint16_t httpStatus,
4664  const char* message)
4665  {
4666  OrthancPluginErrorCode target;
4667 
4668  _OrthancPluginRegisterErrorCode params;
4669  params.target = &target;
4670  params.code = code;
4671  params.httpStatus = httpStatus;
4672  params.message = message;
4673 
4674  if (context->InvokeService(context, _OrthancPluginService_RegisterErrorCode, &params) == OrthancPluginErrorCode_Success)
4675  {
4676  return target;
4677  }
4678  else
4679  {
4680  /* There was an error while assigned the error. Use a generic code. */
4682  }
4683  }
4684 
4685 
4686 
4687  typedef struct
4688  {
4689  uint16_t group;
4690  uint16_t element;
4692  const char* name;
4693  uint32_t minMultiplicity;
4694  uint32_t maxMultiplicity;
4695  } _OrthancPluginRegisterDictionaryTag;
4696 
4717  OrthancPluginContext* context,
4718  uint16_t group,
4719  uint16_t element,
4721  const char* name,
4722  uint32_t minMultiplicity,
4723  uint32_t maxMultiplicity)
4724  {
4725  _OrthancPluginRegisterDictionaryTag params;
4726  params.group = group;
4727  params.element = element;
4728  params.vr = vr;
4729  params.name = name;
4730  params.minMultiplicity = minMultiplicity;
4731  params.maxMultiplicity = maxMultiplicity;
4732 
4733  return context->InvokeService(context, _OrthancPluginService_RegisterDictionaryTag, &params);
4734  }
4735 
4736 
4737 
4738  typedef struct
4739  {
4740  uint16_t group;
4741  uint16_t element;
4743  const char* name;
4744  uint32_t minMultiplicity;
4745  uint32_t maxMultiplicity;
4746  const char* privateCreator;
4747  } _OrthancPluginRegisterPrivateDictionaryTag;
4748 
4770  OrthancPluginContext* context,
4771  uint16_t group,
4772  uint16_t element,
4774  const char* name,
4775  uint32_t minMultiplicity,
4776  uint32_t maxMultiplicity,
4777  const char* privateCreator)
4778  {
4779  _OrthancPluginRegisterPrivateDictionaryTag params;
4780  params.group = group;
4781  params.element = element;
4782  params.vr = vr;
4783  params.name = name;
4784  params.minMultiplicity = minMultiplicity;
4785  params.maxMultiplicity = maxMultiplicity;
4786  params.privateCreator = privateCreator;
4787 
4788  return context->InvokeService(context, _OrthancPluginService_RegisterPrivateDictionaryTag, &params);
4789  }
4790 
4791 
4792 
4793  typedef struct
4794  {
4795  OrthancPluginStorageArea* storageArea;
4797  } _OrthancPluginReconstructMainDicomTags;
4798 
4814  OrthancPluginContext* context,
4815  OrthancPluginStorageArea* storageArea,
4817  {
4818  _OrthancPluginReconstructMainDicomTags params;
4819  params.level = level;
4820  params.storageArea = storageArea;
4821 
4822  return context->InvokeService(context, _OrthancPluginService_ReconstructMainDicomTags, &params);
4823  }
4824 
4825 
4826  typedef struct
4827  {
4828  char** result;
4829  const char* instanceId;
4830  const void* buffer;
4831  uint32_t size;
4834  uint32_t maxStringLength;
4835  } _OrthancPluginDicomToJson;
4836 
4837 
4857  ORTHANC_PLUGIN_INLINE char* OrthancPluginDicomBufferToJson(
4858  OrthancPluginContext* context,
4859  const void* buffer,
4860  uint32_t size,
4863  uint32_t maxStringLength)
4864  {
4865  char* result;
4866 
4867  _OrthancPluginDicomToJson params;
4868  memset(&params, 0, sizeof(params));
4869  params.result = &result;
4870  params.buffer = buffer;
4871  params.size = size;
4872  params.format = format;
4873  params.flags = flags;
4874  params.maxStringLength = maxStringLength;
4875 
4876  if (context->InvokeService(context, _OrthancPluginService_DicomBufferToJson, &params) != OrthancPluginErrorCode_Success)
4877  {
4878  /* Error */
4879  return NULL;
4880  }
4881  else
4882  {
4883  return result;
4884  }
4885  }
4886 
4887 
4906  ORTHANC_PLUGIN_INLINE char* OrthancPluginDicomInstanceToJson(
4907  OrthancPluginContext* context,
4908  const char* instanceId,
4911  uint32_t maxStringLength)
4912  {
4913  char* result;
4914 
4915  _OrthancPluginDicomToJson params;
4916  memset(&params, 0, sizeof(params));
4917  params.result = &result;
4918  params.instanceId = instanceId;
4919  params.format = format;
4920  params.flags = flags;
4921  params.maxStringLength = maxStringLength;
4922 
4923  if (context->InvokeService(context, _OrthancPluginService_DicomInstanceToJson, &params) != OrthancPluginErrorCode_Success)
4924  {
4925  /* Error */
4926  return NULL;
4927  }
4928  else
4929  {
4930  return result;
4931  }
4932  }
4933 
4934 
4935  typedef struct
4936  {
4937  OrthancPluginMemoryBuffer* target;
4938  const char* uri;
4939  uint32_t headersCount;
4940  const char* const* headersKeys;
4941  const char* const* headersValues;
4942  int32_t afterPlugins;
4943  } _OrthancPluginRestApiGet2;
4944 
4965  OrthancPluginContext* context,
4966  OrthancPluginMemoryBuffer* target,
4967  const char* uri,
4968  uint32_t headersCount,
4969  const char* const* headersKeys,
4970  const char* const* headersValues,
4971  int32_t afterPlugins)
4972  {
4973  _OrthancPluginRestApiGet2 params;
4974  params.target = target;
4975  params.uri = uri;
4976  params.headersCount = headersCount;
4977  params.headersKeys = headersKeys;
4978  params.headersValues = headersValues;
4979  params.afterPlugins = afterPlugins;
4980 
4981  return context->InvokeService(context, _OrthancPluginService_RestApiGet2, &params);
4982  }
4983 
4984 
4985 
4986  typedef struct
4987  {
4989  } _OrthancPluginWorklistCallback;
4990 
5003  OrthancPluginContext* context,
5005  {
5006  _OrthancPluginWorklistCallback params;
5007  params.callback = callback;
5008 
5009  return context->InvokeService(context, _OrthancPluginService_RegisterWorklistCallback, &params);
5010  }
5011 
5012 
5013 
5014  typedef struct
5015  {
5017  const OrthancPluginWorklistQuery* query;
5018  const void* dicom;
5019  uint32_t size;
5020  } _OrthancPluginWorklistAnswersOperation;
5021 
5039  OrthancPluginContext* context,
5041  const OrthancPluginWorklistQuery* query,
5042  const void* dicom,
5043  uint32_t size)
5044  {
5045  _OrthancPluginWorklistAnswersOperation params;
5046  params.answers = answers;
5047  params.query = query;
5048  params.dicom = dicom;
5049  params.size = size;
5050 
5051  return context->InvokeService(context, _OrthancPluginService_WorklistAddAnswer, &params);
5052  }
5053 
5054 
5069  OrthancPluginContext* context,
5071  {
5072  _OrthancPluginWorklistAnswersOperation params;
5073  params.answers = answers;
5074  params.query = NULL;
5075  params.dicom = NULL;
5076  params.size = 0;
5077 
5078  return context->InvokeService(context, _OrthancPluginService_WorklistMarkIncomplete, &params);
5079  }
5080 
5081 
5082  typedef struct
5083  {
5084  const OrthancPluginWorklistQuery* query;
5085  const void* dicom;
5086  uint32_t size;
5087  int32_t* isMatch;
5088  OrthancPluginMemoryBuffer* target;
5089  } _OrthancPluginWorklistQueryOperation;
5090 
5106  ORTHANC_PLUGIN_INLINE int32_t OrthancPluginWorklistIsMatch(
5107  OrthancPluginContext* context,
5108  const OrthancPluginWorklistQuery* query,
5109  const void* dicom,
5110  uint32_t size)
5111  {
5112  int32_t isMatch = 0;
5113 
5114  _OrthancPluginWorklistQueryOperation params;
5115  params.query = query;
5116  params.dicom = dicom;
5117  params.size = size;
5118  params.isMatch = &isMatch;
5119  params.target = NULL;
5120 
5121  if (context->InvokeService(context, _OrthancPluginService_WorklistIsMatch, &params) == OrthancPluginErrorCode_Success)
5122  {
5123  return isMatch;
5124  }
5125  else
5126  {
5127  /* Error: Assume non-match */
5128  return 0;
5129  }
5130  }
5131 
5132 
5146  OrthancPluginContext* context,
5147  OrthancPluginMemoryBuffer* target,
5148  const OrthancPluginWorklistQuery* query)
5149  {
5150  _OrthancPluginWorklistQueryOperation params;
5151  params.query = query;
5152  params.dicom = NULL;
5153  params.size = 0;
5154  params.isMatch = NULL;
5155  params.target = target;
5156 
5157  return context->InvokeService(context, _OrthancPluginService_WorklistGetDicomQuery, &params);
5158  }
5159 
5160 
5172  OrthancPluginContext* context,
5173  const OrthancPluginDicomInstance* instance)
5174  {
5176 
5177  _OrthancPluginAccessDicomInstance params;
5178  memset(&params, 0, sizeof(params));
5179  params.resultOrigin = &origin;
5180  params.instance = instance;
5181 
5182  if (context->InvokeService(context, _OrthancPluginService_GetInstanceOrigin, &params) != OrthancPluginErrorCode_Success)
5183  {
5184  /* Error */
5186  }
5187  else
5188  {
5189  return origin;
5190  }
5191  }
5192 
5193 
5194  typedef struct
5195  {
5196  OrthancPluginMemoryBuffer* target;
5197  const char* json;
5198  const OrthancPluginImage* pixelData;
5200  } _OrthancPluginCreateDicom;
5201 
5221  OrthancPluginContext* context,
5222  OrthancPluginMemoryBuffer* target,
5223  const char* json,
5224  const OrthancPluginImage* pixelData,
5226  {
5227  _OrthancPluginCreateDicom params;
5228  params.target = target;
5229  params.json = json;
5230  params.pixelData = pixelData;
5231  params.flags = flags;
5232 
5233  return context->InvokeService(context, _OrthancPluginService_CreateDicom, &params);
5234  }
5235 
5236 
5237  typedef struct
5238  {
5240  } _OrthancPluginDecodeImageCallback;
5241 
5257  OrthancPluginContext* context,
5259  {
5260  _OrthancPluginDecodeImageCallback params;
5261  params.callback = callback;
5262 
5263  return context->InvokeService(context, _OrthancPluginService_RegisterDecodeImageCallback, &params);
5264  }
5265 
5266 
5267 
5268  typedef struct
5269  {
5270  OrthancPluginImage** target;
5271  OrthancPluginPixelFormat format;
5272  uint32_t width;
5273  uint32_t height;
5274  uint32_t pitch;
5275  void* buffer;
5276  const void* constBuffer;
5277  uint32_t bufferSize;
5278  uint32_t frameIndex;
5279  } _OrthancPluginCreateImage;
5280 
5281 
5295  OrthancPluginContext* context,
5296  OrthancPluginPixelFormat format,
5297  uint32_t width,
5298  uint32_t height)
5299  {
5300  OrthancPluginImage* target = NULL;
5301 
5302  _OrthancPluginCreateImage params;
5303  memset(&params, 0, sizeof(params));
5304  params.target = &target;
5305  params.format = format;
5306  params.width = width;
5307  params.height = height;
5308 
5309  if (context->InvokeService(context, _OrthancPluginService_CreateImage, &params) != OrthancPluginErrorCode_Success)
5310  {
5311  return NULL;
5312  }
5313  else
5314  {
5315  return target;
5316  }
5317  }
5318 
5319 
5338  OrthancPluginContext* context,
5339  OrthancPluginPixelFormat format,
5340  uint32_t width,
5341  uint32_t height,
5342  uint32_t pitch,
5343  void* buffer)
5344  {
5345  OrthancPluginImage* target = NULL;
5346 
5347  _OrthancPluginCreateImage params;
5348  memset(&params, 0, sizeof(params));
5349  params.target = &target;
5350  params.format = format;
5351  params.width = width;
5352  params.height = height;
5353  params.pitch = pitch;
5354  params.buffer = buffer;
5355 
5356  if (context->InvokeService(context, _OrthancPluginService_CreateImageAccessor, &params) != OrthancPluginErrorCode_Success)
5357  {
5358  return NULL;
5359  }
5360  else
5361  {
5362  return target;
5363  }
5364  }
5365 
5366 
5367 
5384  OrthancPluginContext* context,
5385  const void* buffer,
5386  uint32_t bufferSize,
5387  uint32_t frameIndex)
5388  {
5389  OrthancPluginImage* target = NULL;
5390 
5391  _OrthancPluginCreateImage params;
5392  memset(&params, 0, sizeof(params));
5393  params.target = &target;
5394  params.constBuffer = buffer;
5395  params.bufferSize = bufferSize;
5396  params.frameIndex = frameIndex;
5397 
5398  if (context->InvokeService(context, _OrthancPluginService_DecodeDicomImage, &params) != OrthancPluginErrorCode_Success)
5399  {
5400  return NULL;
5401  }
5402  else
5403  {
5404  return target;
5405  }
5406  }
5407 
5408 
5409 
5410  typedef struct
5411  {
5412  char** result;
5413  const void* buffer;
5414  uint32_t size;
5415  } _OrthancPluginComputeHash;
5416 
5429  ORTHANC_PLUGIN_INLINE char* OrthancPluginComputeMd5(
5430  OrthancPluginContext* context,
5431  const void* buffer,
5432  uint32_t size)
5433  {
5434  char* result;
5435 
5436  _OrthancPluginComputeHash params;
5437  params.result = &result;
5438  params.buffer = buffer;
5439  params.size = size;
5440 
5441  if (context->InvokeService(context, _OrthancPluginService_ComputeMd5, &params) != OrthancPluginErrorCode_Success)
5442  {
5443  /* Error */
5444  return NULL;
5445  }
5446  else
5447  {
5448  return result;
5449  }
5450  }
5451 
5452 
5465  ORTHANC_PLUGIN_INLINE char* OrthancPluginComputeSha1(
5466  OrthancPluginContext* context,
5467  const void* buffer,
5468  uint32_t size)
5469  {
5470  char* result;
5471 
5472  _OrthancPluginComputeHash params;
5473  params.result = &result;
5474  params.buffer = buffer;
5475  params.size = size;
5476 
5477  if (context->InvokeService(context, _OrthancPluginService_ComputeSha1, &params) != OrthancPluginErrorCode_Success)
5478  {
5479  /* Error */
5480  return NULL;
5481  }
5482  else
5483  {
5484  return result;
5485  }
5486  }
5487 
5488 
5489 
5490  typedef struct
5491  {
5493  const char* name;
5494  } _OrthancPluginLookupDictionary;
5495 
5512  OrthancPluginContext* context,
5514  const char* name)
5515  {
5516  _OrthancPluginLookupDictionary params;
5517  params.target = target;
5518  params.name = name;
5519  return context->InvokeService(context, _OrthancPluginService_LookupDictionary, &params);
5520  }
5521 
5522 
5523 
5524  typedef struct
5525  {
5526  OrthancPluginRestOutput* output;
5527  const char* answer;
5528  uint32_t answerSize;
5529  uint32_t headersCount;
5530  const char* const* headersKeys;
5531  const char* const* headersValues;
5532  } _OrthancPluginSendMultipartItem2;
5533 
5555  OrthancPluginContext* context,
5556  OrthancPluginRestOutput* output,
5557  const char* answer,
5558  uint32_t answerSize,
5559  uint32_t headersCount,
5560  const char* const* headersKeys,
5561  const char* const* headersValues)
5562  {
5563  _OrthancPluginSendMultipartItem2 params;
5564  params.output = output;
5565  params.answer = answer;
5566  params.answerSize = answerSize;
5567  params.headersCount = headersCount;
5568  params.headersKeys = headersKeys;
5569  params.headersValues = headersValues;
5570 
5571  return context->InvokeService(context, _OrthancPluginService_SendMultipartItem2, &params);
5572  }
5573 
5574 
5575  typedef struct
5576  {
5578  } _OrthancPluginIncomingHttpRequestFilter;
5579 
5593  OrthancPluginContext* context,
5595  {
5596  _OrthancPluginIncomingHttpRequestFilter params;
5597  params.callback = callback;
5598 
5599  return context->InvokeService(context, _OrthancPluginService_RegisterIncomingHttpRequestFilter, &params);
5600  }
5601 
5602 
5603 
5604  typedef struct
5605  {
5606  OrthancPluginMemoryBuffer* answerBody;
5607  OrthancPluginMemoryBuffer* answerHeaders;
5608  uint16_t* httpStatus;
5609  OrthancPluginHttpMethod method;
5610  const char* url;
5611  uint32_t headersCount;
5612  const char* const* headersKeys;
5613  const char* const* headersValues;
5614  const void* body;
5615  uint32_t bodySize;
5616  const char* username;
5617  const char* password;
5618  uint32_t timeout;
5619  const char* certificateFile;
5620  const char* certificateKeyFile;
5621  const char* certificateKeyPassword;
5622  uint8_t pkcs11;
5623  } _OrthancPluginCallHttpClient2;
5624 
5625 
5626 
5667  OrthancPluginContext* context,
5668  OrthancPluginMemoryBuffer* answerBody,
5669  OrthancPluginMemoryBuffer* answerHeaders,
5670  uint16_t* httpStatus,
5671  OrthancPluginHttpMethod method,
5672  const char* url,
5673  uint32_t headersCount,
5674  const char* const* headersKeys,
5675  const char* const* headersValues,
5676  const void* body,
5677  uint32_t bodySize,
5678  const char* username,
5679  const char* password,
5680  uint32_t timeout,
5681  const char* certificateFile,
5682  const char* certificateKeyFile,
5683  const char* certificateKeyPassword,
5684  uint8_t pkcs11)
5685  {
5686  _OrthancPluginCallHttpClient2 params;
5687  memset(&params, 0, sizeof(params));
5688 
5689  params.answerBody = answerBody;
5690  params.answerHeaders = answerHeaders;
5691  params.httpStatus = httpStatus;
5692  params.method = method;
5693  params.url = url;
5694  params.headersCount = headersCount;
5695  params.headersKeys = headersKeys;
5696  params.headersValues = headersValues;
5697  params.body = body;
5698  params.bodySize = bodySize;
5699  params.username = username;
5700  params.password = password;
5701  params.timeout = timeout;
5702  params.certificateFile = certificateFile;
5703  params.certificateKeyFile = certificateKeyFile;
5704  params.certificateKeyPassword = certificateKeyPassword;
5705  params.pkcs11 = pkcs11;
5706 
5707  return context->InvokeService(context, _OrthancPluginService_CallHttpClient2, &params);
5708  }
5709 
5710 
5721  ORTHANC_PLUGIN_INLINE char* OrthancPluginGenerateUuid(
5722  OrthancPluginContext* context)
5723  {
5724  char* result;
5725 
5726  _OrthancPluginRetrieveDynamicString params;
5727  params.result = &result;
5728  params.argument = NULL;
5729 
5730  if (context->InvokeService(context, _OrthancPluginService_GenerateUuid, &params) != OrthancPluginErrorCode_Success)
5731  {
5732  /* Error */
5733  return NULL;
5734  }
5735  else
5736  {
5737  return result;
5738  }
5739  }
5740 
5741 
5742 
5743 
5744  typedef struct
5745  {
5746  OrthancPluginFindCallback callback;
5747  } _OrthancPluginFindCallback;
5748 
5761  OrthancPluginContext* context,
5762  OrthancPluginFindCallback callback)
5763  {
5764  _OrthancPluginFindCallback params;
5765  params.callback = callback;
5766 
5767  return context->InvokeService(context, _OrthancPluginService_RegisterFindCallback, &params);
5768  }
5769 
5770 
5771  typedef struct
5772  {
5773  OrthancPluginFindAnswers *answers;
5774  const OrthancPluginFindQuery *query;
5775  const void *dicom;
5776  uint32_t size;
5777  uint32_t index;
5778  uint32_t *resultUint32;
5779  uint16_t *resultGroup;
5780  uint16_t *resultElement;
5781  char **resultString;
5782  } _OrthancPluginFindOperation;
5783 
5800  OrthancPluginContext* context,
5801  OrthancPluginFindAnswers* answers,
5802  const void* dicom,
5803  uint32_t size)
5804  {
5805  _OrthancPluginFindOperation params;
5806  memset(&params, 0, sizeof(params));
5807  params.answers = answers;
5808  params.dicom = dicom;
5809  params.size = size;
5810 
5811  return context->InvokeService(context, _OrthancPluginService_FindAddAnswer, &params);
5812  }
5813 
5814 
5829  OrthancPluginContext* context,
5830  OrthancPluginFindAnswers* answers)
5831  {
5832  _OrthancPluginFindOperation params;
5833  memset(&params, 0, sizeof(params));
5834  params.answers = answers;
5835 
5836  return context->InvokeService(context, _OrthancPluginService_FindMarkIncomplete, &params);
5837  }
5838 
5839 
5840 
5852  ORTHANC_PLUGIN_INLINE uint32_t OrthancPluginGetFindQuerySize(
5853  OrthancPluginContext* context,
5854  const OrthancPluginFindQuery* query)
5855  {
5856  uint32_t count = 0;
5857 
5858  _OrthancPluginFindOperation params;
5859  memset(&params, 0, sizeof(params));
5860  params.query = query;
5861  params.resultUint32 = &count;
5862 
5863  if (context->InvokeService(context, _OrthancPluginService_GetFindQuerySize, &params) != OrthancPluginErrorCode_Success)
5864  {
5865  /* Error */
5866  return 0;
5867  }
5868  else
5869  {
5870  return count;
5871  }
5872  }
5873 
5874 
5890  OrthancPluginContext* context,
5891  uint16_t* group,
5892  uint16_t* element,
5893  const OrthancPluginFindQuery* query,
5894  uint32_t index)
5895  {
5896  _OrthancPluginFindOperation params;
5897  memset(&params, 0, sizeof(params));
5898  params.query = query;
5899  params.index = index;
5900  params.resultGroup = group;
5901  params.resultElement = element;
5902 
5903  return context->InvokeService(context, _OrthancPluginService_GetFindQueryTag, &params);
5904  }
5905 
5906 
5920  ORTHANC_PLUGIN_INLINE char* OrthancPluginGetFindQueryTagName(
5921  OrthancPluginContext* context,
5922  const OrthancPluginFindQuery* query,
5923  uint32_t index)
5924  {
5925  char* result;
5926 
5927  _OrthancPluginFindOperation params;
5928  memset(&params, 0, sizeof(params));
5929  params.query = query;
5930  params.index = index;
5931  params.resultString = &result;
5932 
5933  if (context->InvokeService(context, _OrthancPluginService_GetFindQueryTagName, &params) != OrthancPluginErrorCode_Success)
5934  {
5935  /* Error */
5936  return NULL;
5937  }
5938  else
5939  {
5940  return result;
5941  }
5942  }
5943 
5944 
5958  ORTHANC_PLUGIN_INLINE char* OrthancPluginGetFindQueryValue(
5959  OrthancPluginContext* context,
5960  const OrthancPluginFindQuery* query,
5961  uint32_t index)
5962  {
5963  char* result;
5964 
5965  _OrthancPluginFindOperation params;
5966  memset(&params, 0, sizeof(params));
5967  params.query = query;
5968  params.index = index;
5969  params.resultString = &result;
5970 
5971  if (context->InvokeService(context, _OrthancPluginService_GetFindQueryValue, &params) != OrthancPluginErrorCode_Success)
5972  {
5973  /* Error */
5974  return NULL;
5975  }
5976  else
5977  {
5978  return result;
5979  }
5980  }
5981 
5982 
5983 
5984 
5985  typedef struct
5986  {
5987  OrthancPluginMoveCallback callback;
5988  OrthancPluginGetMoveSize getMoveSize;
5989  OrthancPluginApplyMove applyMove;
5990  OrthancPluginFreeMove freeMove;
5991  } _OrthancPluginMoveCallback;
5992 
6007  OrthancPluginContext* context,
6008  OrthancPluginMoveCallback callback,
6009  OrthancPluginGetMoveSize getMoveSize,
6010  OrthancPluginApplyMove applyMove,
6011  OrthancPluginFreeMove freeMove)
6012  {
6013  _OrthancPluginMoveCallback params;
6014  params.callback = callback;
6015  params.getMoveSize = getMoveSize;
6016  params.applyMove = applyMove;
6017  params.freeMove = freeMove;
6018 
6019  return context->InvokeService(context, _OrthancPluginService_RegisterMoveCallback, &params);
6020  }
6021 
6022 
6023 
6024  typedef struct
6025  {
6026  OrthancPluginFindMatcher** target;
6027  const void* query;
6028  uint32_t size;
6029  } _OrthancPluginCreateFindMatcher;
6030 
6031 
6046  OrthancPluginContext* context,
6047  const void* query,
6048  uint32_t size)
6049  {
6050  OrthancPluginFindMatcher* target = NULL;
6051 
6052  _OrthancPluginCreateFindMatcher params;
6053  memset(&params, 0, sizeof(params));
6054  params.target = &target;
6055  params.query = query;
6056  params.size = size;
6057 
6058  if (context->InvokeService(context, _OrthancPluginService_CreateFindMatcher, &params) != OrthancPluginErrorCode_Success)
6059  {
6060  return NULL;
6061  }
6062  else
6063  {
6064  return target;
6065  }
6066  }
6067 
6068 
6069  typedef struct
6070  {
6071  OrthancPluginFindMatcher* matcher;
6072  } _OrthancPluginFreeFindMatcher;
6073 
6083  ORTHANC_PLUGIN_INLINE void OrthancPluginFreeFindMatcher(
6084  OrthancPluginContext* context,
6085  OrthancPluginFindMatcher* matcher)
6086  {
6087  _OrthancPluginFreeFindMatcher params;
6088  params.matcher = matcher;
6089 
6090  context->InvokeService(context, _OrthancPluginService_FreeFindMatcher, &params);
6091  }
6092 
6093 
6094  typedef struct
6095  {
6096  const OrthancPluginFindMatcher* matcher;
6097  const void* dicom;
6098  uint32_t size;
6099  int32_t* isMatch;
6100  } _OrthancPluginFindMatcherIsMatch;
6101 
6116  ORTHANC_PLUGIN_INLINE int32_t OrthancPluginFindMatcherIsMatch(
6117  OrthancPluginContext* context,
6118  const OrthancPluginFindMatcher* matcher,
6119  const void* dicom,
6120  uint32_t size)
6121  {
6122  int32_t isMatch = 0;
6123 
6124  _OrthancPluginFindMatcherIsMatch params;
6125  params.matcher = matcher;
6126  params.dicom = dicom;
6127  params.size = size;
6128  params.isMatch = &isMatch;
6129 
6130  if (context->InvokeService(context, _OrthancPluginService_FindMatcherIsMatch, &params) == OrthancPluginErrorCode_Success)
6131  {
6132  return isMatch;
6133  }
6134  else
6135  {
6136  /* Error: Assume non-match */
6137  return 0;
6138  }
6139  }
6140 
6141 
6142  typedef struct
6143  {
6145  } _OrthancPluginIncomingHttpRequestFilter2;
6146 
6159  OrthancPluginContext* context,
6161  {
6162  _OrthancPluginIncomingHttpRequestFilter2 params;
6163  params.callback = callback;
6164 
6165  return context->InvokeService(context, _OrthancPluginService_RegisterIncomingHttpRequestFilter2, &params);
6166  }
6167 
6168 
6169 
6170  typedef struct
6171  {
6172  OrthancPluginPeers** peers;
6173  } _OrthancPluginGetPeers;
6174 
6187  OrthancPluginContext* context)
6188  {
6189  OrthancPluginPeers* peers = NULL;
6190 
6191  _OrthancPluginGetPeers params;
6192  memset(&params, 0, sizeof(params));
6193  params.peers = &peers;
6194 
6195  if (context->InvokeService(context, _OrthancPluginService_GetPeers, &params) != OrthancPluginErrorCode_Success)
6196  {
6197  return NULL;
6198  }
6199  else
6200  {
6201  return peers;
6202  }
6203  }
6204 
6205 
6206  typedef struct
6207  {
6208  OrthancPluginPeers* peers;
6209  } _OrthancPluginFreePeers;
6210 
6220  ORTHANC_PLUGIN_INLINE void OrthancPluginFreePeers(
6221  OrthancPluginContext* context,
6222  OrthancPluginPeers* peers)
6223  {
6224  _OrthancPluginFreePeers params;
6225  params.peers = peers;
6226 
6227  context->InvokeService(context, _OrthancPluginService_FreePeers, &params);
6228  }
6229 
6230 
6231  typedef struct
6232  {
6233  uint32_t* target;
6234  const OrthancPluginPeers* peers;
6235  } _OrthancPluginGetPeersCount;
6236 
6250  ORTHANC_PLUGIN_INLINE uint32_t OrthancPluginGetPeersCount(
6251  OrthancPluginContext* context,
6252  const OrthancPluginPeers* peers)
6253  {
6254  uint32_t target = 0;
6255 
6256  _OrthancPluginGetPeersCount params;
6257  memset(&params, 0, sizeof(params));
6258  params.target = &target;
6259  params.peers = peers;
6260 
6261  if (context->InvokeService(context, _OrthancPluginService_GetPeersCount, &params) != OrthancPluginErrorCode_Success)
6262  {
6263  /* Error */
6264  return 0;
6265  }
6266  else
6267  {
6268  return target;
6269  }
6270  }
6271 
6272 
6273  typedef struct
6274  {
6275  const char** target;
6276  const OrthancPluginPeers* peers;
6277  uint32_t peerIndex;
6278  const char* userProperty;
6279  } _OrthancPluginGetPeerProperty;
6280 
6298  ORTHANC_PLUGIN_INLINE const char* OrthancPluginGetPeerName(
6299  OrthancPluginContext* context,
6300  const OrthancPluginPeers* peers,
6301  uint32_t peerIndex)
6302  {
6303  const char* target = NULL;
6304 
6305  _OrthancPluginGetPeerProperty params;
6306  memset(&params, 0, sizeof(params));
6307  params.target = &target;
6308  params.peers = peers;
6309  params.peerIndex = peerIndex;
6310  params.userProperty = NULL;
6311 
6312  if (context->InvokeService(context, _OrthancPluginService_GetPeerName, &params) != OrthancPluginErrorCode_Success)
6313  {
6314  /* Error */
6315  return NULL;
6316  }
6317  else
6318  {
6319  return target;
6320  }
6321  }
6322 
6323 
6339  ORTHANC_PLUGIN_INLINE const char* OrthancPluginGetPeerUrl(
6340  OrthancPluginContext* context,
6341  const OrthancPluginPeers* peers,
6342  uint32_t peerIndex)
6343  {
6344  const char* target = NULL;
6345 
6346  _OrthancPluginGetPeerProperty params;
6347  memset(&params, 0, sizeof(params));
6348  params.target = &target;
6349  params.peers = peers;
6350  params.peerIndex = peerIndex;
6351  params.userProperty = NULL;
6352 
6353  if (context->InvokeService(context, _OrthancPluginService_GetPeerUrl, &params) != OrthancPluginErrorCode_Success)
6354  {
6355  /* Error */
6356  return NULL;
6357  }
6358  else
6359  {
6360  return target;
6361  }
6362  }
6363 
6364 
6365 
6385  ORTHANC_PLUGIN_INLINE const char* OrthancPluginGetPeerUserProperty(
6386  OrthancPluginContext* context,
6387  const OrthancPluginPeers* peers,
6388  uint32_t peerIndex,
6389  const char* userProperty)
6390  {
6391  const char* target = NULL;
6392 
6393  _OrthancPluginGetPeerProperty params;
6394  memset(&params, 0, sizeof(params));
6395  params.target = &target;
6396  params.peers = peers;
6397  params.peerIndex = peerIndex;
6398  params.userProperty = userProperty;
6399 
6400  if (context->InvokeService(context, _OrthancPluginService_GetPeerUserProperty, &params) != OrthancPluginErrorCode_Success)
6401  {
6402  /* No such user property */
6403  return NULL;
6404  }
6405  else
6406  {
6407  return target;
6408  }
6409  }
6410 
6411 
6412 
6413  typedef struct
6414  {
6415  OrthancPluginMemoryBuffer* answerBody;
6416  OrthancPluginMemoryBuffer* answerHeaders;
6417  uint16_t* httpStatus;
6418  const OrthancPluginPeers* peers;
6419  uint32_t peerIndex;
6420  OrthancPluginHttpMethod method;
6421  const char* uri;
6422  uint32_t additionalHeadersCount;
6423  const char* const* additionalHeadersKeys;
6424  const char* const* additionalHeadersValues;
6425  const void* body;
6426  uint32_t bodySize;
6427  uint32_t timeout;
6428  } _OrthancPluginCallPeerApi;
6429 
6466  OrthancPluginContext* context,
6467  OrthancPluginMemoryBuffer* answerBody,
6468  OrthancPluginMemoryBuffer* answerHeaders,
6469  uint16_t* httpStatus,
6470  const OrthancPluginPeers* peers,
6471  uint32_t peerIndex,
6472  OrthancPluginHttpMethod method,
6473  const char* uri,
6474  uint32_t additionalHeadersCount,
6475  const char* const* additionalHeadersKeys,
6476  const char* const* additionalHeadersValues,
6477  const void* body,
6478  uint32_t bodySize,
6479  uint32_t timeout)
6480  {
6481  _OrthancPluginCallPeerApi params;
6482  memset(&params, 0, sizeof(params));
6483 
6484  params.answerBody = answerBody;
6485  params.answerHeaders = answerHeaders;
6486  params.httpStatus = httpStatus;
6487  params.peers = peers;
6488  params.peerIndex = peerIndex;
6489  params.method = method;
6490  params.uri = uri;
6491  params.additionalHeadersCount = additionalHeadersCount;
6492  params.additionalHeadersKeys = additionalHeadersKeys;
6493  params.additionalHeadersValues = additionalHeadersValues;
6494  params.body = body;
6495  params.bodySize = bodySize;
6496  params.timeout = timeout;
6497 
6498  return context->InvokeService(context, _OrthancPluginService_CallPeerApi, &params);
6499  }
6500 
6501 
6502 
6503 
6504 
6505  typedef struct
6506  {
6507  OrthancPluginJob** target;
6508  void *job;
6509  OrthancPluginJobFinalize finalize;
6510  const char *type;
6511  OrthancPluginJobGetProgress getProgress;
6512  OrthancPluginJobGetContent getContent;
6513  OrthancPluginJobGetSerialized getSerialized;
6514  OrthancPluginJobStep step;
6515  OrthancPluginJobStop stop;
6516  OrthancPluginJobReset reset;
6517  } _OrthancPluginCreateJob;
6518 
6551  OrthancPluginContext *context,
6552  void *job,
6553  OrthancPluginJobFinalize finalize,
6554  const char *type,
6555  OrthancPluginJobGetProgress getProgress,
6556  OrthancPluginJobGetContent getContent,
6557  OrthancPluginJobGetSerialized getSerialized,
6558  OrthancPluginJobStep step,
6559  OrthancPluginJobStop stop,
6560  OrthancPluginJobReset reset)
6561  {
6562  OrthancPluginJob* target = NULL;
6563 
6564  _OrthancPluginCreateJob params;
6565  memset(&params, 0, sizeof(params));
6566 
6567  params.target = &target;
6568  params.job = job;
6569  params.finalize = finalize;
6570  params.type = type;
6571  params.getProgress = getProgress;
6572  params.getContent = getContent;
6573  params.getSerialized = getSerialized;
6574  params.step = step;
6575  params.stop = stop;
6576  params.reset = reset;
6577 
6578  if (context->InvokeService(context, _OrthancPluginService_CreateJob, &params) != OrthancPluginErrorCode_Success ||
6579  target == NULL)
6580  {
6581  /* Error */
6582  return NULL;
6583  }
6584  else
6585  {
6586  return target;
6587  }
6588  }
6589 
6590 
6591  typedef struct
6592  {
6593  OrthancPluginJob* job;
6594  } _OrthancPluginFreeJob;
6595 
6605  ORTHANC_PLUGIN_INLINE void OrthancPluginFreeJob(
6606  OrthancPluginContext* context,
6607  OrthancPluginJob* job)
6608  {
6609  _OrthancPluginFreeJob params;
6610  params.job = job;
6611 
6612  context->InvokeService(context, _OrthancPluginService_FreeJob, &params);
6613  }
6614 
6615 
6616 
6617  typedef struct
6618  {
6619  char** resultId;
6620  OrthancPluginJob *job;
6621  int priority;
6622  } _OrthancPluginSubmitJob;
6623 
6637  ORTHANC_PLUGIN_INLINE char *OrthancPluginSubmitJob(
6638  OrthancPluginContext *context,
6639  OrthancPluginJob *job,
6640  int priority)
6641  {
6642  char* resultId = NULL;
6643 
6644  _OrthancPluginSubmitJob params;
6645  memset(&params, 0, sizeof(params));
6646 
6647  params.resultId = &resultId;
6648  params.job = job;
6649  params.priority = priority;
6650 
6651  if (context->InvokeService(context, _OrthancPluginService_SubmitJob, &params) != OrthancPluginErrorCode_Success ||
6652  resultId == NULL)
6653  {
6654  /* Error */
6655  return NULL;
6656  }
6657  else
6658  {
6659  return resultId;
6660  }
6661  }
6662 
6663 
6664 
6665  typedef struct
6666  {
6667  OrthancPluginJobsUnserializer unserializer;
6668  } _OrthancPluginJobsUnserializer;
6669 
6682  ORTHANC_PLUGIN_INLINE void OrthancPluginRegisterJobsUnserializer(
6683  OrthancPluginContext* context,
6684  OrthancPluginJobsUnserializer unserializer)
6685  {
6686  _OrthancPluginJobsUnserializer params;
6687  params.unserializer = unserializer;
6688 
6689  context->InvokeService(context, _OrthancPluginService_RegisterJobsUnserializer, &params);
6690  }
6691 
6692 
6693 
6694  typedef struct
6695  {
6696  OrthancPluginRestOutput* output;
6697  const char* details;
6698  uint8_t log;
6699  } _OrthancPluginSetHttpErrorDetails;
6700 
6718  ORTHANC_PLUGIN_INLINE void OrthancPluginSetHttpErrorDetails(
6719  OrthancPluginContext* context,
6720  OrthancPluginRestOutput* output,
6721  const char* details,
6722  uint8_t log)
6723  {
6724  _OrthancPluginSetHttpErrorDetails params;
6725  params.output = output;
6726  params.details = details;
6727  params.log = log;
6728  context->InvokeService(context, _OrthancPluginService_SetHttpErrorDetails, &params);
6729  }
6730 
6731 
6732 
6733  typedef struct
6734  {
6735  const char** result;
6736  const char* argument;
6737  } _OrthancPluginRetrieveStaticString;
6738 
6750  ORTHANC_PLUGIN_INLINE const char* OrthancPluginAutodetectMimeType(
6751  OrthancPluginContext* context,
6752  const char* path)
6753  {
6754  const char* result = NULL;
6755 
6756  _OrthancPluginRetrieveStaticString params;
6757  params.result = &result;
6758  params.argument = path;
6759 
6760  if (context->InvokeService(context, _OrthancPluginService_AutodetectMimeType, &params) != OrthancPluginErrorCode_Success)
6761  {
6762  /* Error */
6763  return NULL;
6764  }
6765  else
6766  {
6767  return result;
6768  }
6769  }
6770 
6771 
6772 
6773  typedef struct
6774  {
6775  const char* name;
6776  float value;
6778  } _OrthancPluginSetMetricsValue;
6779 
6794  ORTHANC_PLUGIN_INLINE void OrthancPluginSetMetricsValue(
6795  OrthancPluginContext* context,
6796  const char* name,
6797  float value,
6799  {
6800  _OrthancPluginSetMetricsValue params;
6801  params.name = name;
6802  params.value = value;
6803  params.type = type;
6804  context->InvokeService(context, _OrthancPluginService_SetMetricsValue, &params);
6805  }
6806 
6807 
6808 
6809  typedef struct
6810  {
6812  } _OrthancPluginRegisterRefreshMetricsCallback;
6813 
6825  OrthancPluginContext* context,
6827  {
6828  _OrthancPluginRegisterRefreshMetricsCallback params;
6829  params.callback = callback;
6830  context->InvokeService(context, _OrthancPluginService_RegisterRefreshMetricsCallback, &params);
6831  }
6832 
6833 
6834 
6835 
6836  typedef struct
6837  {
6838  char** target;
6839  const void* dicom;
6840  uint32_t dicomSize;
6842  } _OrthancPluginEncodeDicomWeb;
6843 
6860  ORTHANC_PLUGIN_INLINE char* OrthancPluginEncodeDicomWebJson(
6861  OrthancPluginContext* context,
6862  const void* dicom,
6863  uint32_t dicomSize,
6865  {
6866  char* target = NULL;
6867 
6868  _OrthancPluginEncodeDicomWeb params;
6869  params.target = &target;
6870  params.dicom = dicom;
6871  params.dicomSize = dicomSize;
6872  params.callback = callback;
6873 
6874  if (context->InvokeService(context, _OrthancPluginService_EncodeDicomWebJson, &params) != OrthancPluginErrorCode_Success)
6875  {
6876  /* Error */
6877  return NULL;
6878  }
6879  else
6880  {
6881  return target;
6882  }
6883  }
6884 
6885 
6902  ORTHANC_PLUGIN_INLINE char* OrthancPluginEncodeDicomWebXml(
6903  OrthancPluginContext* context,
6904  const void* dicom,
6905  uint32_t dicomSize,
6907  {
6908  char* target = NULL;
6909 
6910  _OrthancPluginEncodeDicomWeb params;
6911  params.target = &target;
6912  params.dicom = dicom;
6913  params.dicomSize = dicomSize;
6914  params.callback = callback;
6915 
6916  if (context->InvokeService(context, _OrthancPluginService_EncodeDicomWebXml, &params) != OrthancPluginErrorCode_Success)
6917  {
6918  /* Error */
6919  return NULL;
6920  }
6921  else
6922  {
6923  return target;
6924  }
6925  }
6926 
6927 
6928 
6929  typedef struct
6930  {
6931  char** target;
6932  const void* dicom;
6933  uint32_t dicomSize;
6935  void* payload;
6936  } _OrthancPluginEncodeDicomWeb2;
6937 
6954  ORTHANC_PLUGIN_INLINE char* OrthancPluginEncodeDicomWebJson2(
6955  OrthancPluginContext* context,
6956  const void* dicom,
6957  uint32_t dicomSize,
6959  void* payload)
6960  {
6961  char* target = NULL;
6962 
6963  _OrthancPluginEncodeDicomWeb2 params;
6964  params.target = &target;
6965  params.dicom = dicom;
6966  params.dicomSize = dicomSize;
6967  params.callback = callback;
6968  params.payload = payload;
6969 
6970  if (context->InvokeService(context, _OrthancPluginService_EncodeDicomWebJson2, &params) != OrthancPluginErrorCode_Success)
6971  {
6972  /* Error */
6973  return NULL;
6974  }
6975  else
6976  {
6977  return target;
6978  }
6979  }
6980 
6981 
6998  ORTHANC_PLUGIN_INLINE char* OrthancPluginEncodeDicomWebXml2(
6999  OrthancPluginContext* context,
7000  const void* dicom,
7001  uint32_t dicomSize,
7003  void* payload)
7004  {
7005  char* target = NULL;
7006 
7007  _OrthancPluginEncodeDicomWeb2 params;
7008  params.target = &target;
7009  params.dicom = dicom;
7010  params.dicomSize = dicomSize;
7011  params.callback = callback;
7012  params.payload = payload;
7013 
7014  if (context->InvokeService(context, _OrthancPluginService_EncodeDicomWebXml2, &params) != OrthancPluginErrorCode_Success)
7015  {
7016  /* Error */
7017  return NULL;
7018  }
7019  else
7020  {
7021  return target;
7022  }
7023  }
7024 
7025 
7026 
7043  void* answer,
7044  const char* key,
7045  const char* value);
7046 
7047 
7064  void* answer,
7065  const void* data,
7066  uint32_t size);
7067 
7068 
7083  typedef uint8_t (*OrthancPluginChunkedClientRequestIsDone) (void* request);
7084 
7085 
7101 
7102 
7116  typedef const void* (*OrthancPluginChunkedClientRequestGetChunkData) (void* request);
7117 
7118 
7132  typedef uint32_t (*OrthancPluginChunkedClientRequestGetChunkSize) (void* request);
7133 
7134 
7135  typedef struct
7136  {
7137  void* answer;
7140  uint16_t* httpStatus;
7141  OrthancPluginHttpMethod method;
7142  const char* url;
7143  uint32_t headersCount;
7144  const char* const* headersKeys;
7145  const char* const* headersValues;
7146  void* request;
7151  const char* username;
7152  const char* password;
7153  uint32_t timeout;
7154  const char* certificateFile;
7155  const char* certificateKeyFile;
7156  const char* certificateKeyPassword;
7157  uint8_t pkcs11;
7158  } _OrthancPluginChunkedHttpClient;
7159 
7160 
7212  OrthancPluginContext* context,
7213  void* answer,
7216  uint16_t* httpStatus,
7217  OrthancPluginHttpMethod method,
7218  const char* url,
7219  uint32_t headersCount,
7220  const char* const* headersKeys,
7221  const char* const* headersValues,
7222  void* request,
7227  const char* username,
7228  const char* password,
7229  uint32_t timeout,
7230  const char* certificateFile,
7231  const char* certificateKeyFile,
7232  const char* certificateKeyPassword,
7233  uint8_t pkcs11)
7234  {
7235  _OrthancPluginChunkedHttpClient params;
7236  memset(&params, 0, sizeof(params));
7237 
7238  /* In common with OrthancPluginHttpClient() */
7239  params.httpStatus = httpStatus;
7240  params.method = method;
7241  params.url = url;
7242  params.headersCount = headersCount;
7243  params.headersKeys = headersKeys;
7244  params.headersValues = headersValues;
7245  params.username = username;
7246  params.password = password;
7247  params.timeout = timeout;
7248  params.certificateFile = certificateFile;
7249  params.certificateKeyFile = certificateKeyFile;
7250  params.certificateKeyPassword = certificateKeyPassword;
7251  params.pkcs11 = pkcs11;
7252 
7253  /* For chunked body/answer */
7254  params.answer = answer;
7255  params.answerAddChunk = answerAddChunk;
7256  params.answerAddHeader = answerAddHeader;
7257  params.request = request;
7258  params.requestIsDone = requestIsDone;
7259  params.requestChunkData = requestChunkData;
7260  params.requestChunkSize = requestChunkSize;
7261  params.requestNext = requestNext;
7262 
7263  return context->InvokeService(context, _OrthancPluginService_ChunkedHttpClient, &params);
7264  }
7265 
7266 
7267 
7272  typedef struct _OrthancPluginServerChunkedRequestReader_t OrthancPluginServerChunkedRequestReader;
7273 
7274 
7275 
7293  const char* url,
7294  const OrthancPluginHttpRequest* request);
7295 
7296 
7312  const void* data,
7313  uint32_t size);
7314 
7315 
7332  OrthancPluginRestOutput* output);
7333 
7334 
7350 
7351  typedef struct
7352  {
7353  const char* pathRegularExpression;
7354  OrthancPluginRestCallback getHandler;
7356  OrthancPluginRestCallback deleteHandler;
7361  } _OrthancPluginChunkedRestCallback;
7362 
7363 
7393  ORTHANC_PLUGIN_INLINE void OrthancPluginRegisterChunkedRestCallback(
7394  OrthancPluginContext* context,
7395  const char* pathRegularExpression,
7396  OrthancPluginRestCallback getHandler,
7398  OrthancPluginRestCallback deleteHandler,
7403  {
7404  _OrthancPluginChunkedRestCallback params;
7405  params.pathRegularExpression = pathRegularExpression;
7406  params.getHandler = getHandler;
7407  params.postHandler = postHandler;
7408  params.deleteHandler = deleteHandler;
7409  params.putHandler = putHandler;
7410  params.addChunk = addChunk;
7411  params.execute = execute;
7412  params.finalize = finalize;
7413 
7414  context->InvokeService(context, _OrthancPluginService_RegisterChunkedRestCallback, &params);
7415  }
7416 
7417 
7418 
7419 
7420 
7421  typedef struct
7422  {
7423  char** result;
7424  uint16_t group;
7425  uint16_t element;
7426  const char* privateCreator;
7427  } _OrthancPluginGetTagName;
7428 
7444  ORTHANC_PLUGIN_INLINE char* OrthancPluginGetTagName(
7445  OrthancPluginContext* context,
7446  uint16_t group,
7447  uint16_t element,
7448  const char* privateCreator)
7449  {
7450  char* result;
7451 
7452  _OrthancPluginGetTagName params;
7453  params.result = &result;
7454  params.group = group;
7455  params.element = element;
7456  params.privateCreator = privateCreator;
7457 
7458  if (context->InvokeService(context, _OrthancPluginService_GetTagName, &params) != OrthancPluginErrorCode_Success)
7459  {
7460  /* Error */
7461  return NULL;
7462  }
7463  else
7464  {
7465  return result;
7466  }
7467  }
7468 
7469 
7470 
7500  void** handler /* out */,
7501  const char* jobId,
7502  const char* transactionUid,
7503  const char* const* sopClassUids,
7504  const char* const* sopInstanceUids,
7505  uint32_t countInstances,
7506  const char* remoteAet,
7507  const char* calledAet);
7508 
7509 
7521  typedef void (*OrthancPluginStorageCommitmentDestructor) (void* handler);
7522 
7523 
7544  void* handler,
7545  const char* sopClassUid,
7546  const char* sopInstanceUid);
7547 
7548 
7549  typedef struct
7550  {
7554  } _OrthancPluginRegisterStorageCommitmentScpCallback;
7555 
7570  OrthancPluginContext* context,
7574  {
7575  _OrthancPluginRegisterStorageCommitmentScpCallback params;
7576  params.factory = factory;
7577  params.destructor = destructor;
7578  params.lookup = lookup;
7579  return context->InvokeService(context, _OrthancPluginService_RegisterStorageCommitmentScpCallback, &params);
7580  }
7581 
7582 
7583 
7600  const OrthancPluginDicomInstance* instance);
7601 
7602 
7603  typedef struct
7604  {
7606  } _OrthancPluginIncomingDicomInstanceFilter;
7607 
7621  OrthancPluginContext* context,
7623  {
7624  _OrthancPluginIncomingDicomInstanceFilter params;
7625  params.callback = callback;
7626 
7627  return context->InvokeService(context, _OrthancPluginService_RegisterIncomingDicomInstanceFilter, &params);
7628  }
7629 
7630 
7644  ORTHANC_PLUGIN_INLINE char* OrthancPluginGetInstanceTransferSyntaxUid(
7645  OrthancPluginContext* context,
7646  const OrthancPluginDicomInstance* instance)
7647  {
7648  char* result;
7649 
7650  _OrthancPluginAccessDicomInstance params;
7651  memset(&params, 0, sizeof(params));
7652  params.resultStringToFree = &result;
7653  params.instance = instance;
7654 
7655  if (context->InvokeService(context, _OrthancPluginService_GetInstanceTransferSyntaxUid, &params) != OrthancPluginErrorCode_Success)
7656  {
7657  /* Error */
7658  return NULL;
7659  }
7660  else
7661  {
7662  return result;
7663  }
7664  }
7665 
7666 
7679  ORTHANC_PLUGIN_INLINE int32_t OrthancPluginHasInstancePixelData(
7680  OrthancPluginContext* context,
7681  const OrthancPluginDicomInstance* instance)
7682  {
7683  int64_t hasPixelData;
7684 
7685  _OrthancPluginAccessDicomInstance params;
7686  memset(&params, 0, sizeof(params));
7687  params.resultInt64 = &hasPixelData;
7688  params.instance = instance;
7689 
7690  if (context->InvokeService(context, _OrthancPluginService_HasInstancePixelData, &params) != OrthancPluginErrorCode_Success ||
7691  hasPixelData < 0 ||
7692  hasPixelData > 1)
7693  {
7694  /* Error */
7695  return -1;
7696  }
7697  else
7698  {
7699  return (hasPixelData != 0);
7700  }
7701  }
7702 
7703 
7704 
7705 
7706 
7707 
7708  typedef struct
7709  {
7710  OrthancPluginDicomInstance** target;
7711  const void* buffer;
7712  uint32_t size;
7713  const char* transferSyntax;
7714  } _OrthancPluginCreateDicomInstance;
7715 
7730  OrthancPluginContext* context,
7731  const void* buffer,
7732  uint32_t size)
7733  {
7734  OrthancPluginDicomInstance* target = NULL;
7735 
7736  _OrthancPluginCreateDicomInstance params;
7737  params.target = &target;
7738  params.buffer = buffer;
7739  params.size = size;
7740 
7741  if (context->InvokeService(context, _OrthancPluginService_CreateDicomInstance, &params) != OrthancPluginErrorCode_Success)
7742  {
7743  /* Error */
7744  return NULL;
7745  }
7746  else
7747  {
7748  return target;
7749  }
7750  }
7751 
7752  typedef struct
7753  {
7755  } _OrthancPluginFreeDicomInstance;
7756 
7767  ORTHANC_PLUGIN_INLINE void OrthancPluginFreeDicomInstance(
7768  OrthancPluginContext* context,
7770  {
7771  _OrthancPluginFreeDicomInstance params;
7772  params.dicom = dicom;
7773 
7774  context->InvokeService(context, _OrthancPluginService_FreeDicomInstance, &params);
7775  }
7776 
7777 
7778  typedef struct
7779  {
7780  uint32_t* targetUint32;
7781  OrthancPluginMemoryBuffer* targetBuffer;
7782  OrthancPluginImage** targetImage;
7783  char** targetStringToFree;
7784  const OrthancPluginDicomInstance* instance;
7785  uint32_t frameIndex;
7788  uint32_t maxStringLength;
7789  OrthancPluginDicomWebBinaryCallback2 dicomWebCallback;
7790  void* dicomWebPayload;
7791  } _OrthancPluginAccessDicomInstance2;
7792 
7804  ORTHANC_PLUGIN_INLINE uint32_t OrthancPluginGetInstanceFramesCount(
7805  OrthancPluginContext* context,
7806  const OrthancPluginDicomInstance* instance)
7807  {
7808  uint32_t count;
7809 
7810  _OrthancPluginAccessDicomInstance2 params;
7811  memset(&params, 0, sizeof(params));
7812  params.targetUint32 = &count;
7813  params.instance = instance;
7814 
7815  if (context->InvokeService(context, _OrthancPluginService_GetInstanceFramesCount, &params) != OrthancPluginErrorCode_Success)
7816  {
7817  /* Error */
7818  return 0;
7819  }
7820  else
7821  {
7822  return count;
7823  }
7824  }
7825 
7826 
7845  OrthancPluginContext* context,
7846  OrthancPluginMemoryBuffer* target,
7847  const OrthancPluginDicomInstance* instance,
7848  uint32_t frameIndex)
7849  {
7850  _OrthancPluginAccessDicomInstance2 params;
7851  memset(&params, 0, sizeof(params));
7852  params.targetBuffer = target;
7853  params.instance = instance;
7854  params.frameIndex = frameIndex;
7855 
7856  return context->InvokeService(context, _OrthancPluginService_GetInstanceRawFrame, &params);
7857  }
7858 
7859 
7873  OrthancPluginContext* context,
7874  const OrthancPluginDicomInstance* instance,
7875  uint32_t frameIndex)
7876  {
7877  OrthancPluginImage* target = NULL;
7878 
7879  _OrthancPluginAccessDicomInstance2 params;
7880  memset(&params, 0, sizeof(params));
7881  params.targetImage = &target;
7882  params.instance = instance;
7883  params.frameIndex = frameIndex;
7884 
7885  if (context->InvokeService(context, _OrthancPluginService_GetInstanceDecodedFrame, &params) != OrthancPluginErrorCode_Success)
7886  {
7887  return NULL;
7888  }
7889  else
7890  {
7891  return target;
7892  }
7893  }
7894 
7895 
7912  OrthancPluginContext* context,
7913  const void* buffer,
7914  uint32_t size,
7915  const char* transferSyntax)
7916  {
7917  OrthancPluginDicomInstance* target = NULL;
7918 
7919  _OrthancPluginCreateDicomInstance params;
7920  params.target = &target;
7921  params.buffer = buffer;
7922  params.size = size;
7923  params.transferSyntax = transferSyntax;
7924 
7925  if (context->InvokeService(context, _OrthancPluginService_TranscodeDicomInstance, &params) != OrthancPluginErrorCode_Success)
7926  {
7927  /* Error */
7928  return NULL;
7929  }
7930  else
7931  {
7932  return target;
7933  }
7934  }
7935 
7950  OrthancPluginContext* context,
7951  OrthancPluginMemoryBuffer* target,
7952  const OrthancPluginDicomInstance* instance)
7953  {
7954  _OrthancPluginAccessDicomInstance2 params;
7955  memset(&params, 0, sizeof(params));
7956  params.targetBuffer = target;
7957  params.instance = instance;
7958 
7959  return context->InvokeService(context, _OrthancPluginService_SerializeDicomInstance, &params);
7960  }
7961 
7962 
7981  ORTHANC_PLUGIN_INLINE char* OrthancPluginGetInstanceAdvancedJson(
7982  OrthancPluginContext* context,
7983  const OrthancPluginDicomInstance* instance,
7986  uint32_t maxStringLength)
7987  {
7988  char* result = NULL;
7989 
7990  _OrthancPluginAccessDicomInstance2 params;
7991  memset(&params, 0, sizeof(params));
7992  params.targetStringToFree = &result;
7993  params.instance = instance;
7994  params.format = format;
7995  params.flags = flags;
7996  params.maxStringLength = maxStringLength;
7997 
7998  if (context->InvokeService(context, _OrthancPluginService_GetInstanceAdvancedJson, &params) != OrthancPluginErrorCode_Success)
7999  {
8000  /* Error */
8001  return NULL;
8002  }
8003  else
8004  {
8005  return result;
8006  }
8007  }
8008 
8009 
8024  ORTHANC_PLUGIN_INLINE char* OrthancPluginGetInstanceDicomWebJson(
8025  OrthancPluginContext* context,
8026  const OrthancPluginDicomInstance* instance,
8028  void* payload)
8029  {
8030  char* target = NULL;
8031 
8032  _OrthancPluginAccessDicomInstance2 params;
8033  params.targetStringToFree = &target;
8034  params.instance = instance;
8035  params.dicomWebCallback = callback;
8036  params.dicomWebPayload = payload;
8037 
8038  if (context->InvokeService(context, _OrthancPluginService_GetInstanceDicomWebJson, &params) != OrthancPluginErrorCode_Success)
8039  {
8040  /* Error */
8041  return NULL;
8042  }
8043  else
8044  {
8045  return target;
8046  }
8047  }
8048 
8049 
8064  ORTHANC_PLUGIN_INLINE char* OrthancPluginGetInstanceDicomWebXml(
8065  OrthancPluginContext* context,
8066  const OrthancPluginDicomInstance* instance,
8068  void* payload)
8069  {
8070  char* target = NULL;
8071 
8072  _OrthancPluginAccessDicomInstance2 params;
8073  params.targetStringToFree = &target;
8074  params.instance = instance;
8075  params.dicomWebCallback = callback;
8076  params.dicomWebPayload = payload;
8077 
8078  if (context->InvokeService(context, _OrthancPluginService_GetInstanceDicomWebXml, &params) != OrthancPluginErrorCode_Success)
8079  {
8080  /* Error */
8081  return NULL;
8082  }
8083  else
8084  {
8085  return target;
8086  }
8087  }
8088 
8089 
8090 
8110  OrthancPluginMemoryBuffer* transcoded /* out */,
8111  const void* buffer,
8112  uint64_t size,
8113  const char* const* allowedSyntaxes,
8114  uint32_t countSyntaxes,
8115  uint8_t allowNewSopInstanceUid);
8116 
8117 
8118  typedef struct
8119  {
8121  } _OrthancPluginTranscoderCallback;
8122 
8137  OrthancPluginContext* context,
8139  {
8140  _OrthancPluginTranscoderCallback params;
8141  params.callback = callback;
8142 
8143  return context->InvokeService(context, _OrthancPluginService_RegisterTranscoderCallback, &params);
8144  }
8145 
8146 
8147 
8148  typedef struct
8149  {
8150  OrthancPluginMemoryBuffer* target;
8151  uint32_t size;
8152  } _OrthancPluginCreateMemoryBuffer;
8153 
8172  OrthancPluginContext* context,
8173  OrthancPluginMemoryBuffer* target,
8174  uint32_t size)
8175  {
8176  _OrthancPluginCreateMemoryBuffer params;
8177  params.target = target;
8178  params.size = size;
8179 
8180  return context->InvokeService(context, _OrthancPluginService_CreateMemoryBuffer, &params);
8181  }
8182 
8183 
8184 #ifdef __cplusplus
8185 }
8186 #endif
8187 
8188 
char * OrthancPluginGetInstanceTransferSyntaxUid(OrthancPluginContext *context, const OrthancPluginDicomInstance *instance)
Get the transfer syntax of a DICOM file.
Definition: OrthancCPlugin.h:7644
Definition: OrthancCPlugin.h:767
Definition: OrthancCPlugin.h:869
OrthancPluginChangeType
Definition: OrthancCPlugin.h:722
Definition: OrthancCPlugin.h:245
void OrthancPluginSendHttpStatusCode(OrthancPluginContext *context, OrthancPluginRestOutput *output, uint16_t status)
Send a HTTP status code.
Definition: OrthancCPlugin.h:2642
void OrthancPluginFreePeers(OrthancPluginContext *context, OrthancPluginPeers *peers)
Free the list of available Orthanc peers.
Definition: OrthancCPlugin.h:6220
struct _OrthancPluginRestOutput_t OrthancPluginRestOutput
Opaque structure that represents the HTTP connection to the client application.
Definition: OrthancCPlugin.h:1026
OrthancPluginErrorCode OrthancPluginFindAddAnswer(OrthancPluginContext *context, OrthancPluginFindAnswers *answers, const void *dicom, uint32_t size)
Add one answer to some C-Find request.
Definition: OrthancCPlugin.h:5799
void OrthancPluginSetHttpHeader(OrthancPluginContext *context, OrthancPluginRestOutput *output, const char *key, const char *value)
Set some HTTP header.
Definition: OrthancCPlugin.h:2743
Definition: OrthancCPlugin.h:790
Definition: OrthancCPlugin.h:958
OrthancPluginImage * OrthancPluginGetInstanceDecodedFrame(OrthancPluginContext *context, const OrthancPluginDicomInstance *instance, uint32_t frameIndex)
Decode one frame from a DICOM instance.
Definition: OrthancCPlugin.h:7872
Definition: OrthancCPlugin.h:282
void OrthancPluginLogInfo(OrthancPluginContext *context, const char *message)
Log an information.
Definition: OrthancCPlugin.h:1909
OrthancPluginErrorCode OrthancPluginRegisterDecodeImageCallback(OrthancPluginContext *context, OrthancPluginDecodeImageCallback callback)
Register a callback to handle the decoding of DICOM images.
Definition: OrthancCPlugin.h:5256
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:5666
Definition: OrthancCPlugin.h:870
The parameters of a REST request.
Definition: OrthancCPlugin.h:344
void OrthancPluginRedirect(OrthancPluginContext *context, OrthancPluginRestOutput *output, const char *redirection)
Redirect a REST request.
Definition: OrthancCPlugin.h:2425
OrthancPluginContentType
Definition: OrthancCPlugin.h:691
OrthancPluginErrorCode OrthancPluginRestApiDeleteAfterPlugins(OrthancPluginContext *context, const char *uri)
Make a DELETE call to the REST API, as tainted by the plugins.
Definition: OrthancCPlugin.h:2330
Definition: OrthancCPlugin.h:708
char * OrthancPluginGetInstanceDicomWebXml(OrthancPluginContext *context, const OrthancPluginDicomInstance *instance, OrthancPluginDicomWebBinaryCallback2 callback, void *payload)
Convert a DICOM instance to DICOMweb XML.
Definition: OrthancCPlugin.h:8064
OrthancPluginErrorCode(* OrthancPluginChunkedClientRequestNext)(void *request)
Callback to advance in the request body during a chunked transfer.
Definition: OrthancCPlugin.h:7100
Definition: OrthancCPlugin.h:789
struct _OrthancPluginDicomWebNode_t OrthancPluginDicomWebNode
Opaque structure that represents a node in a JSON or XML document used in DICOMweb.
Definition: OrthancCPlugin.h:1115
Definition: OrthancCPlugin.h:901
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:4029
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:4121
OrthancPluginJobStepStatus
Definition: OrthancCPlugin.h:911
int OrthancPluginCheckVersion(OrthancPluginContext *context)
Check the compatibility of the plugin wrt. the version of its hosting Orthanc.
Definition: OrthancCPlugin.h:1842
void OrthancPluginSetHttpErrorDetails(OrthancPluginContext *context, OrthancPluginRestOutput *output, const char *details, uint8_t log)
Provide a detailed description for an HTTP error.
Definition: OrthancCPlugin.h:6718
OrthancPluginErrorCode OrthancPluginSerializeDicomInstance(OrthancPluginContext *context, OrthancPluginMemoryBuffer *target, const OrthancPluginDicomInstance *instance)
Writes a DICOM instance to a memory buffer.
Definition: OrthancCPlugin.h:7949
Definition: OrthancCPlugin.h:274
Definition: OrthancCPlugin.h:215
Definition: OrthancCPlugin.h:272
OrthancPluginInstanceOrigin
Definition: OrthancCPlugin.h:896
const char *(* OrthancPluginJobGetContent)(void *job)
Callback to retrieve the content of one custom job.
Definition: OrthancCPlugin.h:1482
OrthancPluginDicomInstance * OrthancPluginTranscodeDicomInstance(OrthancPluginContext *context, const void *buffer, uint32_t size, const char *transferSyntax)
Parse and transcode a DICOM instance.
Definition: OrthancCPlugin.h:7911
Definition: OrthancCPlugin.h:787
Definition: OrthancCPlugin.h:929
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:7981
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:4769
char * OrthancPluginGetInstanceSimplifiedJson(OrthancPluginContext *context, const OrthancPluginDicomInstance *instance)
Get the DICOM tag hierarchy as a JSON file (with simplification).
Definition: OrthancCPlugin.h:2919
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:2278
Definition: OrthancCPlugin.h:297
Graylevel, unsigned 16bpp image.
Definition: OrthancCPlugin.h:615
Definition: OrthancCPlugin.h:737
Definition: OrthancCPlugin.h:237
const char *const * headersValues
The values of the HTTP headers.
Definition: OrthancCPlugin.h:404
Definition: OrthancCPlugin.h:284
Definition: OrthancCPlugin.h:286
const char *const * headersKeys
The keys of the HTTP headers (always converted to low-case).
Definition: OrthancCPlugin.h:399
Definition: OrthancCPlugin.h:270
OrthancPluginCreateDicomFlags
Definition: OrthancCPlugin.h:851
char * OrthancPluginComputeSha1(OrthancPluginContext *context, const void *buffer, uint32_t size)
Compute a SHA-1 hash.
Definition: OrthancCPlugin.h:5465
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:6550
Definition: OrthancCPlugin.h:288
OrthancPluginPixelFormat
Definition: OrthancCPlugin.h:599
Definition: OrthancCPlugin.h:902
uint32_t getCount
For a GET request, the number of GET parameters.
Definition: OrthancCPlugin.h:364
char * OrthancPluginSubmitJob(OrthancPluginContext *context, OrthancPluginJob *job, int priority)
Submit a new job to the jobs engine of Orthanc.
Definition: OrthancCPlugin.h:6637
Definition: OrthancCPlugin.h:641
void OrthancPluginRegisterStorageArea(OrthancPluginContext *context, OrthancPluginStorageCreate create, OrthancPluginStorageRead read, OrthancPluginStorageRemove remove)
Register a custom storage area.
Definition: OrthancCPlugin.h:3047
const char * OrthancPluginAutodetectMimeType(OrthancPluginContext *context, const char *path)
Detect the MIME type of a file.
Definition: OrthancCPlugin.h:6750
Definition: OrthancCPlugin.h:885
OrthancPluginErrorCode OrthancPluginGetDicomForInstance(OrthancPluginContext *context, OrthancPluginMemoryBuffer *target, const char *instanceId)
Retrieve a DICOM instance using its Orthanc identifier.
Definition: OrthancCPlugin.h:2143
struct _OrthancPluginServerChunkedRequestReader_t OrthancPluginServerChunkedRequestReader
Opaque structure that reads the content of a HTTP request body during a chunked HTTP transfer...
Definition: OrthancCPlugin.h:7272
OrthancPluginImageFormat
Definition: OrthancCPlugin.h:764
Definition: OrthancCPlugin.h:223
Definition: OrthancCPlugin.h:310
void OrthancPluginFreeString(OrthancPluginContext *context, char *str)
Free a string.
Definition: OrthancCPlugin.h:1707
Definition: OrthancCPlugin.h:294
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:7569
const char * OrthancPluginGetFontName(OrthancPluginContext *context, uint32_t fontIndex)
Return the name of a font.
Definition: OrthancCPlugin.h:4405
Definition: OrthancCPlugin.h:243
Definition: OrthancCPlugin.h:300
Definition: OrthancCPlugin.h:292
Definition: OrthancCPlugin.h:332
Definition: OrthancCPlugin.h:234
char * OrthancPluginComputeMd5(OrthancPluginContext *context, const void *buffer, uint32_t size)
Compute an MD5 hash.
Definition: OrthancCPlugin.h:5429
Definition: OrthancCPlugin.h:913
Definition: OrthancCPlugin.h:236
OrthancPluginErrorCode
Definition: OrthancCPlugin.h:209
struct _OrthancPluginJob_t OrthancPluginJob
Opaque structure to a job to be executed by Orthanc.
Definition: OrthancCPlugin.h:1106
OrthancPluginImage * OrthancPluginConvertPixelFormat(OrthancPluginContext *context, const OrthancPluginImage *source, OrthancPluginPixelFormat targetFormat)
Change the pixel format of an image.
Definition: OrthancCPlugin.h:4330
Definition: OrthancCPlugin.h:295
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:1259
OrthancPluginErrorCode OrthancPluginCreateMemoryBuffer(OrthancPluginContext *context, OrthancPluginMemoryBuffer *target, uint32_t size)
Create a memory buffer.
Definition: OrthancCPlugin.h:8171
Definition: OrthancCPlugin.h:731
OrthancPluginErrorCode OrthancPluginStorageAreaRead(OrthancPluginContext *context, OrthancPluginMemoryBuffer *target, OrthancPluginStorageArea *storageArea, const char *uuid, OrthancPluginContentType type)
Read a file from the storage area.
Definition: OrthancCPlugin.h:4584
OrthancPluginErrorCode OrthancPluginRegisterIncomingDicomInstanceFilter(OrthancPluginContext *context, OrthancPluginIncomingDicomInstanceFilter callback)
Register a callback to filter incoming DICOM instance.
Definition: OrthancCPlugin.h:7620
uint32_t OrthancPluginGetFontsCount(OrthancPluginContext *context)
Return the number of available fonts.
Definition: OrthancCPlugin.h:4365
char * OrthancPluginGetConfigurationPath(OrthancPluginContext *context)
Return the path to the configuration file(s).
Definition: OrthancCPlugin.h:3144
Definition: OrthancCPlugin.h:232
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:5889
void OrthancPluginRegisterOnChangeCallback(OrthancPluginContext *context, OrthancPluginOnChangeCallback callback)
Register a callback to monitor changes.
Definition: OrthancCPlugin.h:3186
Color image in RGBA32 format.
Definition: OrthancCPlugin.h:639
Definition: OrthancCPlugin.h:835
OrthancPluginDicomToJsonFlags
Definition: OrthancCPlugin.h:832
Definition: OrthancCPlugin.h:930
Definition: OrthancCPlugin.h:225
void OrthancPluginSendMethodNotAllowed(OrthancPluginContext *context, OrthancPluginRestOutput *output, const char *allowedMethods)
Signal that this URI does not support this HTTP method.
Definition: OrthancCPlugin.h:2688
Definition: OrthancCPlugin.h:751
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:2355
char * OrthancPluginGenerateUuid(OrthancPluginContext *context)
Generate an UUID.
Definition: OrthancCPlugin.h:5721
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:1656
float(* OrthancPluginJobGetProgress)(void *job)
Callback to check the progress of one custom job.
Definition: OrthancCPlugin.h:1467
Definition: OrthancCPlugin.h:739
uint8_t(* OrthancPluginChunkedClientRequestIsDone)(void *request)
Callback to know whether the request body is entirely read during a chunked transfer.
Definition: OrthancCPlugin.h:7083
Definition: OrthancCPlugin.h:928
Definition: OrthancCPlugin.h:725
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:5383
Definition: OrthancCPlugin.h:271
OrthancPluginDicomToJsonFormat
Definition: OrthancCPlugin.h:817
OrthancPluginErrorCode OrthancPluginLookupDictionary(OrthancPluginContext *context, OrthancPluginDictionaryEntry *target, const char *name)
Get information about the given DICOM tag.
Definition: OrthancCPlugin.h:5511
OrthancPluginErrorCode(* OrthancPluginJobStop)(void *job, OrthancPluginJobStopReason reason)
Callback executed once one custom job leaves the "running" state.
Definition: OrthancCPlugin.h:1539
Definition: OrthancCPlugin.h:819
const void *(* OrthancPluginChunkedClientRequestGetChunkData)(void *request)
Callback to read the current chunk of the request body during a chunked transfer. ...
Definition: OrthancCPlugin.h:7116
OrthancPluginErrorCode OrthancPluginRegisterErrorCode(OrthancPluginContext *context, int32_t code, uint16_t httpStatus, const char *message)
Declare a custom error code for this plugin.
Definition: OrthancCPlugin.h:4660
Definition: OrthancCPlugin.h:252
uint16_t group
Definition: OrthancCPlugin.h:1690
void * OrthancPluginGetImageBuffer(OrthancPluginContext *context, const OrthancPluginImage *image)
Return a pointer to the content of an image.
Definition: OrthancCPlugin.h:3899
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:1286
Definition: OrthancCPlugin.h:780
uint32_t minMultiplicity
Definition: OrthancCPlugin.h:1693
Definition: OrthancCPlugin.h:821
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:8109
Definition: OrthancCPlugin.h:792
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:5038
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:4254
Definition: OrthancCPlugin.h:927
OrthancPluginJobStopReason
Definition: OrthancCPlugin.h:925
struct _OrthancPluginWorklistQuery_t OrthancPluginWorklistQuery
Opaque structure to an object that represents a C-Find query for worklists.
Definition: OrthancCPlugin.h:1058
Definition: OrthancCPlugin.h:766
Definition: OrthancCPlugin.h:264
struct _OrthancPluginStorageArea_t OrthancPluginStorageArea
Opaque structure that represents the storage area that is actually used by Orthanc.
Definition: OrthancCPlugin.h:1050
Definition: OrthancCPlugin.h:256
Definition: OrthancCPlugin.h:693
char * OrthancPluginGetInstanceJson(OrthancPluginContext *context, const OrthancPluginDicomInstance *instance)
Get the DICOM tag hierarchy as a JSON file.
Definition: OrthancCPlugin.h:2881
Definition: OrthancCPlugin.h:729
Color image in RGB48 format.
Definition: OrthancCPlugin.h:649
uint32_t OrthancPluginGetExpectedDatabaseVersion(OrthancPluginContext *context)
Get the expected version of the database schema.
Definition: OrthancCPlugin.h:3431
Definition: OrthancCPlugin.h:287
Graylevel 8bpp image.
Definition: OrthancCPlugin.h:607
Definition: OrthancCPlugin.h:285
Definition: OrthancCPlugin.h:226
OrthancPluginConstraintType
Definition: OrthancCPlugin.h:881
OrthancPluginResourceType
Definition: OrthancCPlugin.h:705
OrthancPluginHttpMethod
Definition: OrthancCPlugin.h:329
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:1177
OrthancPluginDicomInstance * OrthancPluginCreateDicomInstance(OrthancPluginContext *context, const void *buffer, uint32_t size)
Parse a DICOM instance.
Definition: OrthancCPlugin.h:7729
Definition: OrthancCPlugin.h:242
uint32_t OrthancPluginGetImageHeight(OrthancPluginContext *context, const OrthancPluginImage *image)
Return the height of an image.
Definition: OrthancCPlugin.h:3830
OrthancPluginValueRepresentation
Definition: OrthancCPlugin.h:778
char * OrthancPluginGetConfiguration(OrthancPluginContext *context)
Return the content of the configuration file(s).
Definition: OrthancCPlugin.h:3464
Definition: OrthancCPlugin.h:213
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:3728
OrthancPluginImage * OrthancPluginUncompressImage(OrthancPluginContext *context, const void *data, uint32_t size, OrthancPluginImageFormat format)
Decode a compressed image.
Definition: OrthancCPlugin.h:3942
Definition: OrthancCPlugin.h:290
Definition: OrthancCPlugin.h:782
Definition: OrthancCPlugin.h:229
char * OrthancPluginEncodeDicomWebXml(OrthancPluginContext *context, const void *dicom, uint32_t dicomSize, OrthancPluginDicomWebBinaryCallback callback)
Convert a DICOM instance to DICOMweb XML.
Definition: OrthancCPlugin.h:6902
Definition: OrthancCPlugin.h:710
OrthancPluginErrorCode(* OrthancPluginRestCallback)(OrthancPluginRestOutput *output, const char *url, const OrthancPluginHttpRequest *request)
Signature of a callback function that answers to a REST request.
Definition: OrthancCPlugin.h:1123
Definition: OrthancCPlugin.h:281
Definition: OrthancCPlugin.h:752
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:1317
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:7844
Definition: OrthancCPlugin.h:785
Definition: OrthancCPlugin.h:298
Definition: OrthancCPlugin.h:915
void OrthancPluginSetMetricsValue(OrthancPluginContext *context, const char *name, float value, OrthancPluginMetricsType type)
Set the value of a metrics.
Definition: OrthancCPlugin.h:6794
char * OrthancPluginGetOrthancDirectory(OrthancPluginContext *context)
Return the directory containing the Orthanc.
Definition: OrthancCPlugin.h:3109
Definition: OrthancCPlugin.h:247
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:2243
Definition: OrthancCPlugin.h:754
Definition: OrthancCPlugin.h:804
Definition: OrthancCPlugin.h:273
Color image in RGB24 format.
Definition: OrthancCPlugin.h:631
OrthancPluginErrorCode OrthancPluginRegisterIncomingHttpRequestFilter2(OrthancPluginContext *context, OrthancPluginIncomingHttpRequestFilter2 callback)
Register a callback to filter incoming HTTP requests.
Definition: OrthancCPlugin.h:6158
Graylevel, signed 16bpp image.
Definition: OrthancCPlugin.h:623
Definition: OrthancCPlugin.h:939
An entry in the dictionary of DICOM tags.
Definition: OrthancCPlugin.h:1688
Definition: OrthancCPlugin.h:283
Definition: OrthancCPlugin.h:219
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:1090
Definition: OrthancCPlugin.h:724
OrthancPluginCompressionType
Definition: OrthancCPlugin.h:749
Definition: OrthancCPlugin.h:211
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:4964
Definition: OrthancCPlugin.h:838
struct _OrthancPluginPeers_t OrthancPluginPeers
Opaque structure to the set of remote Orthanc Peers that are known to the local Orthanc server...
Definition: OrthancCPlugin.h:1098
OrthancPluginPixelFormat OrthancPluginGetImagePixelFormat(OrthancPluginContext *context, const OrthancPluginImage *image)
Return the pixel format of an image.
Definition: OrthancCPlugin.h:3764
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:4490
uint32_t OrthancPluginGetImagePitch(OrthancPluginContext *context, const OrthancPluginImage *image)
Return the pitch of an image.
Definition: OrthancCPlugin.h:3865
Definition: OrthancCPlugin.h:694
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:2102
Definition: OrthancCPlugin.h:303
Definition: OrthancCPlugin.h:309
OrthancPluginJobStepStatus(* OrthancPluginJobStep)(void *job)
Callback to execute one step of a custom job.
Definition: OrthancCPlugin.h:1515
uint32_t maxMultiplicity
Definition: OrthancCPlugin.h:1694
Definition: OrthancCPlugin.h:957
Definition: OrthancCPlugin.h:302
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:1155
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:4857
void(* OrthancPluginFree)(void *buffer)
Signature of a function to free dynamic memory.
Definition: OrthancCPlugin.h:1167
Definition: OrthancCPlugin.h:886
uint32_t OrthancPluginGetCommandLineArgumentsCount(OrthancPluginContext *context)
Get the number of command-line arguments.
Definition: OrthancCPlugin.h:3365
Definition: OrthancCPlugin.h:254
void OrthancPluginSendUnauthorized(OrthancPluginContext *context, OrthancPluginRestOutput *output, const char *realm)
Signal that a REST request is not authorized.
Definition: OrthancCPlugin.h:2665
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:6465
Definition: OrthancCPlugin.h:221
Graylevel, unsigned 64bpp image.
Definition: OrthancCPlugin.h:681
Definition: OrthancCPlugin.h:279
Definition: OrthancCPlugin.h:267
void OrthancPluginFreeFindMatcher(OrthancPluginContext *context, OrthancPluginFindMatcher *matcher)
Free a C-Find matcher.
Definition: OrthancCPlugin.h:6083
Definition: OrthancCPlugin.h:299
void OrthancPluginLogError(OrthancPluginContext *context, const char *message)
Log an error.
Definition: OrthancCPlugin.h:1877
Definition: OrthancCPlugin.h:240
OrthancPluginFindMatcher * OrthancPluginCreateFindMatcher(OrthancPluginContext *context, const void *query, uint32_t size)
Create a C-Find matcher.
Definition: OrthancCPlugin.h:6045
void * data
The content of the buffer.
Definition: OrthancCPlugin.h:1011
uint32_t OrthancPluginGetFontSize(OrthancPluginContext *context, uint32_t fontIndex)
Return the size of a font.
Definition: OrthancCPlugin.h:4437
void OrthancPluginExtendOrthancExplorer(OrthancPluginContext *context, const char *javascript)
Extend the JavaScript code of Orthanc Explorer.
Definition: OrthancCPlugin.h:3261
Definition: OrthancCPlugin.h:900
void(* OrthancPluginRefreshMetricsCallback)()
Callback executed to update the metrics of the plugin.
Definition: OrthancCPlugin.h:1590
OrthancPluginErrorCode OrthancPluginRestApiGet(OrthancPluginContext *context, OrthancPluginMemoryBuffer *target, const char *uri)
Make a GET call to the built-in Orthanc REST API.
Definition: OrthancCPlugin.h:2176
const char * OrthancPluginGetErrorDescription(OrthancPluginContext *context, OrthancPluginErrorCode error)
Get the description of a given error code.
Definition: OrthancCPlugin.h:3675
uint32_t headersCount
The number of HTTP headers.
Definition: OrthancCPlugin.h:394
const void * OrthancPluginGetInstanceData(OrthancPluginContext *context, const OrthancPluginDicomInstance *instance)
Get the data of a DICOM file.
Definition: OrthancCPlugin.h:2845
Definition: OrthancCPlugin.h:730
Definition: OrthancCPlugin.h:837
void OrthancPluginFreeMemoryBuffer(OrthancPluginContext *context, OrthancPluginMemoryBuffer *buffer)
Free a memory buffer.
Definition: OrthancCPlugin.h:1861
OrthancPluginErrorCode OrthancPluginRegisterWorklistCallback(OrthancPluginContext *context, OrthancPluginWorklistCallback callback)
Register a callback to handle modality worklists requests.
Definition: OrthancCPlugin.h:5002
OrthancPluginErrorCode(* OrthancPluginStorageCreate)(const char *uuid, const void *content, int64_t size, OrthancPluginContentType type)
Callback for writing to the storage area.
Definition: OrthancCPlugin.h:1196
int OrthancPluginHasInstanceMetadata(OrthancPluginContext *context, const OrthancPluginDicomInstance *instance, const char *metadata)
Check whether a DICOM instance is associated with some metadata.
Definition: OrthancCPlugin.h:2958
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:1387
Definition: OrthancCPlugin.h:798
OrthancPluginErrorCode OrthancPluginRestApiDelete(OrthancPluginContext *context, const char *uri)
Make a DELETE call to the built-in Orthanc REST API.
Definition: OrthancCPlugin.h:2307
Definition: OrthancCPlugin.h:802
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:7542
Definition: OrthancCPlugin.h:709
OrthancPluginErrorCode OrthancPluginReadFile(OrthancPluginContext *context, OrthancPluginMemoryBuffer *target, const char *path)
Read a file.
Definition: OrthancCPlugin.h:3613
Definition: OrthancCPlugin.h:791
Definition: OrthancCPlugin.h:871
struct _OrthancPluginFindAnswers_t OrthancPluginFindAnswers
Opaque structure to an object that represents the answers to a C-Find query for worklists.
Definition: OrthancCPlugin.h:1082
OrthancPluginErrorCode OrthancPluginRegisterMoveCallback(OrthancPluginContext *context, OrthancPluginMoveCallback callback, OrthancPluginGetMoveSize getMoveSize, OrthancPluginApplyMove applyMove, OrthancPluginFreeMove freeMove)
Register a callback to handle C-Move requests.
Definition: OrthancCPlugin.h:6006
Definition: OrthancCPlugin.h:333
Definition: OrthancCPlugin.h:738
OrthancPluginImage * OrthancPluginCreateImage(OrthancPluginContext *context, OrthancPluginPixelFormat format, uint32_t width, uint32_t height)
Create an image.
Definition: OrthancCPlugin.h:5294
Definition: OrthancCPlugin.h:793
Definition: OrthancCPlugin.h:259
char * OrthancPluginGetOrthancPath(OrthancPluginContext *context)
Return the path to the Orthanc executable.
Definition: OrthancCPlugin.h:3079
char * OrthancPluginGetGlobalProperty(OrthancPluginContext *context, int32_t property, const char *defaultValue)
Get the value of a global property.
Definition: OrthancCPlugin.h:3295
Definition: OrthancCPlugin.h:887
OrthancPluginErrorCode OrthancPluginSendMultipartItem2(OrthancPluginContext *context, OrthancPluginRestOutput *output, const char *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:5554
OrthancPluginErrorCode(* OrthancPluginStorageRemove)(const char *uuid, OrthancPluginContentType type)
Callback for removing a file from the storage area.
Definition: OrthancCPlugin.h:1240
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:2999
Definition: OrthancCPlugin.h:820
Definition: OrthancCPlugin.h:268
Definition: OrthancCPlugin.h:306
Definition: OrthancCPlugin.h:331
Definition: OrthancCPlugin.h:946
Definition: OrthancCPlugin.h:732
Definition: OrthancCPlugin.h:313
OrthancPluginErrorCode OrthancPluginReconstructMainDicomTags(OrthancPluginContext *context, OrthancPluginStorageArea *storageArea, OrthancPluginResourceType level)
Reconstruct the main DICOM tags.
Definition: OrthancCPlugin.h:4813
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:5920
void OrthancPluginRegisterJobsUnserializer(OrthancPluginContext *context, OrthancPluginJobsUnserializer unserializer)
Register an unserializer for custom jobs.
Definition: OrthancCPlugin.h:6682
void OrthancPluginFreeDicomInstance(OrthancPluginContext *context, OrthancPluginDicomInstance *dicom)
Free a DICOM instance.
Definition: OrthancCPlugin.h:7767
char * OrthancPluginEncodeDicomWebJson2(OrthancPluginContext *context, const void *dicom, uint32_t dicomSize, OrthancPluginDicomWebBinaryCallback2 callback, void *payload)
Convert a DICOM instance to DICOMweb JSON.
Definition: OrthancCPlugin.h:6954
char * OrthancPluginGetCommandLineArgument(OrthancPluginContext *context, uint32_t argument)
Get the value of a command-line argument.
Definition: OrthancCPlugin.h:3399
OrthancPluginErrorCode OrthancPluginHttpGet(OrthancPluginContext *context, OrthancPluginMemoryBuffer *target, const char *url, const char *username, const char *password)
Issue a HTTP GET call.
Definition: OrthancCPlugin.h:4174
int64_t OrthancPluginGetInstanceSize(OrthancPluginContext *context, const OrthancPluginDicomInstance *instance)
Get the size of a DICOM file.
Definition: OrthancCPlugin.h:2812
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:5337
Definition: OrthancCPlugin.h:276
char * OrthancPluginGetInstanceDicomWebJson(OrthancPluginContext *context, const OrthancPluginDicomInstance *instance, OrthancPluginDicomWebBinaryCallback2 callback, void *payload)
Convert a DICOM instance to DICOMweb JSON.
Definition: OrthancCPlugin.h:8024
OrthancPluginErrorCode OrthancPluginRegisterIncomingHttpRequestFilter(OrthancPluginContext *context, OrthancPluginIncomingHttpRequestFilter callback)
Register a callback to filter incoming HTTP requests.
Definition: OrthancCPlugin.h:5592
Definition: OrthancCPlugin.h:233
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:4906
const char *const * getValues
For a GET request, the values of the GET parameters.
Definition: OrthancCPlugin.h:374
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:6385
Definition: OrthancCPlugin.h:805
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:1144
OrthancPluginPeers * OrthancPluginGetPeers(OrthancPluginContext *context)
Return the list of available Orthanc peers.
Definition: OrthancCPlugin.h:6186
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:3576
Definition: OrthancCPlugin.h:269
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:7063
OrthancPluginErrorCode OrthancPluginWorklistMarkIncomplete(OrthancPluginContext *context, OrthancPluginWorklistAnswers *answers)
Mark the set of worklist answers as incomplete.
Definition: OrthancCPlugin.h:5068
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:5220
Definition: OrthancCPlugin.h:262
Definition: OrthancCPlugin.h:768
Definition: OrthancCPlugin.h:220
Definition: OrthancCPlugin.h:275
Definition: OrthancCPlugin.h:227
void OrthancPluginRegisterRestCallbackNoLock(OrthancPluginContext *context, const char *pathRegularExpression, OrthancPluginRestCallback callback)
Register a REST callback, without locking.
Definition: OrthancCPlugin.h:1985
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:4212
OrthancPluginErrorCode(* OrthancPluginFindCallback)(OrthancPluginFindAnswers *answers, const OrthancPluginFindQuery *query, const char *issuerAet, const char *calledAet)
Callback to handle incoming C-Find SCP requests.
Definition: OrthancCPlugin.h:1344
Definition: OrthancCPlugin.h:735
OrthancPluginErrorCode OrthancPluginRegisterFindCallback(OrthancPluginContext *context, OrthancPluginFindCallback callback)
Register a callback to handle C-Find requests.
Definition: OrthancCPlugin.h:5760
struct _OrthancPluginImage_t OrthancPluginImage
Opaque structure that represents an image that is uncompressed in memory.
Definition: OrthancCPlugin.h:1042
OrthancPluginErrorCode OrthancPluginStartMultipartAnswer(OrthancPluginContext *context, OrthancPluginRestOutput *output, const char *subType, const char *contentType)
Start an HTTP multipart answer.
Definition: OrthancCPlugin.h:3505
struct _OrthancPluginWorklistAnswers_t OrthancPluginWorklistAnswers
Opaque structure to an object that represents the answers to a C-Find query for worklists.
Definition: OrthancCPlugin.h:1066
Definition: OrthancCPlugin.h:212
Definition: OrthancCPlugin.h:238
Definition: OrthancCPlugin.h:231
OrthancPluginInstanceOrigin OrthancPluginGetInstanceOrigin(OrthancPluginContext *context, const OrthancPluginDicomInstance *instance)
Get the origin of a DICOM file.
Definition: OrthancCPlugin.h:5171
Definition: OrthancCPlugin.h:868
Definition: OrthancCPlugin.h:307
Definition: OrthancCPlugin.h:278
void(* OrthancPluginFreeMove)(void *moveDriver)
Callback to free one C-Move driver.
Definition: OrthancCPlugin.h:1441
char * OrthancPluginEncodeDicomWebXml2(OrthancPluginContext *context, const void *dicom, uint32_t dicomSize, OrthancPluginDicomWebBinaryCallback2 callback, void *payload)
Convert a DICOM instance to DICOMweb XML.
Definition: OrthancCPlugin.h:6998
void OrthancPluginSetRootUri(OrthancPluginContext *context, const char *uri)
Set the URI where the plugin provides its Web interface.
Definition: OrthancCPlugin.h:3217
int32_t OrthancPluginHasInstancePixelData(OrthancPluginContext *context, const OrthancPluginDicomInstance *instance)
Check whether the DICOM file has pixel data.
Definition: OrthancCPlugin.h:7679
const char *(* OrthancPluginJobGetSerialized)(void *job)
Callback to serialize one custom job.
Definition: OrthancCPlugin.h:1500
OrthancPluginErrorCode OrthancPluginStorageAreaRemove(OrthancPluginContext *context, OrthancPluginStorageArea *storageArea, const char *uuid, OrthancPluginContentType type)
Remove a file from the storage area.
Definition: OrthancCPlugin.h:4621
Definition: OrthancCPlugin.h:914
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:1134
void OrthancPluginFreeJob(OrthancPluginContext *context, OrthancPluginJob *job)
Free a custom job.
Definition: OrthancCPlugin.h:6605
Definition: OrthancCPlugin.h:797
Definition: OrthancCPlugin.h:736
const char *const * getKeys
For a GET request, the keys of the GET parameters.
Definition: OrthancCPlugin.h:369
Definition: OrthancCPlugin.h:800
Definition: OrthancCPlugin.h:727
char * OrthancPluginLookupPatient(OrthancPluginContext *context, const char *patientID)
Look for a patient.
Definition: OrthancCPlugin.h:2457
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:7499
struct _OrthancPluginDicomInstance_t OrthancPluginDicomInstance
Opaque structure that represents a DICOM instance that is managed by the Orthanc core.
Definition: OrthancCPlugin.h:1034
Definition: OrthancCPlugin.h:884
Definition: OrthancCPlugin.h:801
void OrthancPluginFreeImage(OrthancPluginContext *context, OrthancPluginImage *image)
Free an image.
Definition: OrthancCPlugin.h:3984
OrthancPluginValueRepresentation vr
Definition: OrthancCPlugin.h:1692
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:7211
uint16_t element
Definition: OrthancCPlugin.h:1691
char * OrthancPluginLookupInstance(OrthancPluginContext *context, const char *sopInstanceUID)
Look for an instance.
Definition: OrthancCPlugin.h:2597
Definition: OrthancCPlugin.h:734
OrthancPluginErrorCode OrthancPluginSetGlobalProperty(OrthancPluginContext *context, int32_t property, const char *value)
Set the value of a global property.
Definition: OrthancCPlugin.h:3334
OrthancPluginErrorCode(* OrthancPluginApplyMove)(void *moveDriver)
Callback to apply one C-Move suboperation.
Definition: OrthancCPlugin.h:1427
Definition: OrthancCPlugin.h:244
Definition: OrthancCPlugin.h:695
OrthancPluginErrorCode OrthancPluginSendMultipartItem(OrthancPluginContext *context, OrthancPluginRestOutput *output, const char *answer, uint32_t answerSize)
Send an item as a part of some HTTP multipart answer.
Definition: OrthancCPlugin.h:3534
Definition: OrthancCPlugin.h:251
const char *const * groups
The matched values for the groups of the regular expression.
Definition: OrthancCPlugin.h:359
OrthancPluginErrorCode OrthancPluginWriteFile(OrthancPluginContext *context, const char *path, const void *data, uint32_t size)
Write a file.
Definition: OrthancCPlugin.h:3644
Definition: OrthancCPlugin.h:277
OrthancPluginErrorCode(* OrthancPluginStorageRead)(void **content, int64_t *size, const char *uuid, OrthancPluginContentType type)
Callback for reading from the storage area.
Definition: OrthancCPlugin.h:1222
Definition: OrthancCPlugin.h:280
char * OrthancPluginLookupStudy(OrthancPluginContext *context, const char *studyUID)
Look for a study.
Definition: OrthancCPlugin.h:2492
uint32_t size
The number of bytes in the buffer.
Definition: OrthancCPlugin.h:1016
Graylevel, floating-point 32bpp image.
Definition: OrthancCPlugin.h:665
const char * OrthancPluginGetInstanceRemoteAet(OrthancPluginContext *context, const OrthancPluginDicomInstance *instance)
Get the AET of a DICOM instance.
Definition: OrthancCPlugin.h:2779
Definition: OrthancCPlugin.h:898
Definition: OrthancCPlugin.h:260
OrthancPluginErrorCode(* OrthancPluginJobReset)(void *job)
Callback executed once one stopped custom job is started again.
Definition: OrthancCPlugin.h:1556
char * OrthancPluginEncodeDicomWebJson(OrthancPluginContext *context, const void *dicom, uint32_t dicomSize, OrthancPluginDicomWebBinaryCallback callback)
Convert a DICOM instance to DICOMweb JSON.
Definition: OrthancCPlugin.h:6860
uint32_t groupsCount
The number of groups of the regular expression.
Definition: OrthancCPlugin.h:354
Definition: OrthancCPlugin.h:261
OrthancPluginErrorCode(* OrthancPluginServerChunkedRequestReaderFactory)(OrthancPluginServerChunkedRequestReader **reader, const char *url, const OrthancPluginHttpRequest *request)
Callback to create a reader to handle incoming chunked HTTP transfers.
Definition: OrthancCPlugin.h:7291
Definition: OrthancCPlugin.h:711
void OrthancPluginLogWarning(OrthancPluginContext *context, const char *message)
Log a warning.
Definition: OrthancCPlugin.h:1893
Definition: OrthancCPlugin.h:956
Definition: OrthancCPlugin.h:786
Definition: OrthancCPlugin.h:266
int32_t OrthancPluginWorklistIsMatch(OrthancPluginContext *context, const OrthancPluginWorklistQuery *query, const void *dicom, uint32_t size)
Test whether a worklist matches the query.
Definition: OrthancCPlugin.h:5106
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:1737
Definition: OrthancCPlugin.h:806
const void * body
For a PUT or POST request, the content of the body.
Definition: OrthancCPlugin.h:379
OrthancPluginErrorCode(* OrthancPluginServerChunkedRequestReaderExecute)(OrthancPluginServerChunkedRequestReader *reader, OrthancPluginRestOutput *output)
Callback invoked whenever the request body is entirely received.
Definition: OrthancCPlugin.h:7330
OrthancPluginIdentifierConstraint
Definition: OrthancCPlugin.h:866
uint32_t bodySize
For a PUT or POST request, the number of bytes of the body.
Definition: OrthancCPlugin.h:384
OrthancPluginErrorCode OrthancPluginFindMarkIncomplete(OrthancPluginContext *context, OrthancPluginFindAnswers *answers)
Mark the set of C-Find answers as incomplete.
Definition: OrthancCPlugin.h:5828
Definition: OrthancCPlugin.h:334
OrthancPluginJob *(* OrthancPluginJobsUnserializer)(const char *jobType, const char *serialized)
Callback executed to unserialize a custom job.
Definition: OrthancCPlugin.h:1572
OrthancPluginMetricsType
Definition: OrthancCPlugin.h:937
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:2391
OrthancPluginDicomWebBinaryMode
Definition: OrthancCPlugin.h:954
Definition: OrthancCPlugin.h:249
Definition: OrthancCPlugin.h:312
void OrthancPluginSetCookie(OrthancPluginContext *context, OrthancPluginRestOutput *output, const char *cookie, const char *value)
Set a cookie.
Definition: OrthancCPlugin.h:2718
Definition: OrthancCPlugin.h:726
char * OrthancPluginGetTagName(OrthancPluginContext *context, uint16_t group, uint16_t element, const char *privateCreator)
Returns the symbolic name of a DICOM tag.
Definition: OrthancCPlugin.h:7444
uint32_t OrthancPluginGetPeersCount(OrthancPluginContext *context, const OrthancPluginPeers *peers)
Get the number of Orthanc peers.
Definition: OrthancCPlugin.h:6250
Definition: OrthancCPlugin.h:796
const char * OrthancPluginGetPeerUrl(OrthancPluginContext *context, const OrthancPluginPeers *peers, uint32_t peerIndex)
Get the base URL of an Orthanc peer.
Definition: OrthancCPlugin.h:6339
uint32_t OrthancPluginGetFindQuerySize(OrthancPluginContext *context, const OrthancPluginFindQuery *query)
Get the number of tags in a C-Find query.
Definition: OrthancCPlugin.h:5852
void OrthancPluginSetDescription(OrthancPluginContext *context, const char *description)
Set a description for this plugin.
Definition: OrthancCPlugin.h:3239
Definition: OrthancCPlugin.h:308
Definition: OrthancCPlugin.h:246
void OrthancPluginRegisterOnStoredInstanceCallback(OrthancPluginContext *context, OrthancPluginOnStoredInstanceCallback callback)
Register a callback for received instances.
Definition: OrthancCPlugin.h:2013
Definition: OrthancCPlugin.h:728
Definition: OrthancCPlugin.h:799
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:4716
Definition: OrthancCPlugin.h:263
Definition: OrthancCPlugin.h:224
int32_t(* OrthancPluginIncomingDicomInstanceFilter)(const OrthancPluginDicomInstance *instance)
Callback to filter incoming DICOM instances received by Orthanc.
Definition: OrthancCPlugin.h:7599
Definition: OrthancCPlugin.h:803
Definition: OrthancCPlugin.h:783
Graylevel, unsigned 32bpp image.
Definition: OrthancCPlugin.h:657
Definition: OrthancCPlugin.h:883
void OrthancPluginRegisterRestCallback(OrthancPluginContext *context, const char *pathRegularExpression, OrthancPluginRestCallback callback)
Register a REST callback.
Definition: OrthancCPlugin.h:1945
uint32_t(* OrthancPluginChunkedClientRequestGetChunkSize)(void *request)
Callback to read the size of the current request chunk during a chunked transfer. ...
Definition: OrthancCPlugin.h:7132
char * OrthancPluginLookupStudyWithAccessionNumber(OrthancPluginContext *context, const char *accessionNumber)
Look for a study, using the accession number.
Definition: OrthancCPlugin.h:2527
Definition: OrthancCPlugin.h:795
Definition: OrthancCPlugin.h:781
Definition: OrthancCPlugin.h:216
Definition: OrthancCPlugin.h:707
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:7393
OrthancPluginErrorCode OrthancPluginWorklistGetDicomQuery(OrthancPluginContext *context, OrthancPluginMemoryBuffer *target, const OrthancPluginWorklistQuery *query)
Retrieve the worklist query as a DICOM file.
Definition: OrthancCPlugin.h:5145
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:2206
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:7042
Definition: OrthancCPlugin.h:899
Definition: OrthancCPlugin.h:235
Definition: OrthancCPlugin.h:301
Definition: OrthancCPlugin.h:217
Definition: OrthancCPlugin.h:222
struct _OrthancPluginFindQuery_t OrthancPluginFindQuery
Opaque structure to an object that represents a C-Find query.
Definition: OrthancCPlugin.h:1074
Definition: OrthancCPlugin.h:214
Definition: OrthancCPlugin.h:239
Definition: OrthancCPlugin.h:733
Definition: OrthancCPlugin.h:753
void OrthancPluginRegisterRefreshMetricsCallback(OrthancPluginContext *context, OrthancPluginRefreshMetricsCallback callback)
Register a callback to refresh the metrics.
Definition: OrthancCPlugin.h:6824
Definition: OrthancCPlugin.h:253
Definition: OrthancCPlugin.h:250
OrthancPluginHttpMethod method
The HTTP method.
Definition: OrthancCPlugin.h:349
Definition: OrthancCPlugin.h:296
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:4542
void OrthancPluginAnswerBuffer(OrthancPluginContext *context, OrthancPluginRestOutput *output, const void *answer, uint32_t answerSize, const char *mimeType)
Answer to a REST request.
Definition: OrthancCPlugin.h:2045
OrthancPluginErrorCode OrthancPluginHttpDelete(OrthancPluginContext *context, const char *url, const char *username, const char *password)
Issue a HTTP DELETE call.
Definition: OrthancCPlugin.h:4292
A memory buffer allocated by the core system of Orthanc.
Definition: OrthancCPlugin.h:1006
void(* OrthancPluginServerChunkedRequestReaderFinalize)(OrthancPluginServerChunkedRequestReader *reader)
Callback invoked to release the resources associated with an incoming HTTP chunked transfer...
Definition: OrthancCPlugin.h:7348
const char * OrthancPluginGetPeerName(OrthancPluginContext *context, const OrthancPluginPeers *peers, uint32_t peerIndex)
Get the symbolic name of an Orthanc peer.
Definition: OrthancCPlugin.h:6298
Color image in BGRA32 format.
Definition: OrthancCPlugin.h:673
OrthancPluginStorageCommitmentFailureReason
Definition: OrthancCPlugin.h:967
Definition: OrthancCPlugin.h:788
Definition: OrthancCPlugin.h:836
uint32_t OrthancPluginGetInstanceFramesCount(OrthancPluginContext *context, const OrthancPluginDicomInstance *instance)
Get the number of frames in a DICOM instance.
Definition: OrthancCPlugin.h:7804
OrthancPluginErrorCode OrthancPluginRegisterTranscoderCallback(OrthancPluginContext *context, OrthancPluginTranscoderCallback callback)
Register a callback to handle the transcoding of DICOM images.
Definition: OrthancCPlugin.h:8136
Definition: OrthancCPlugin.h:228
void(* OrthancPluginStorageCommitmentDestructor)(void *handler)
Callback to free one storage commitment SCP handler.
Definition: OrthancCPlugin.h:7521
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:6116
Definition: OrthancCPlugin.h:794
void(* OrthancPluginJobFinalize)(void *job)
Callback to finalize one custom job.
Definition: OrthancCPlugin.h:1454
char * OrthancPluginLookupSeries(OrthancPluginContext *context, const char *seriesUID)
Look for a series.
Definition: OrthancCPlugin.h:2562
Definition: OrthancCPlugin.h:218
uint32_t(* OrthancPluginGetMoveSize)(void *moveDriver)
Callback to read the size of a C-Move driver.
Definition: OrthancCPlugin.h:1412
Definition: OrthancCPlugin.h:784
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:1618
Definition: OrthancCPlugin.h:289
uint32_t OrthancPluginGetImageWidth(OrthancPluginContext *context, const OrthancPluginImage *image)
Return the width of an image.
Definition: OrthancCPlugin.h:3797
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:7310
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:4074
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:5958
Definition: OrthancCPlugin.h:248
Definition: OrthancCPlugin.h:241