Orthanc Plugin SDK  1.12.5
Documentation of the plugin interface of Orthanc
OrthancCPlugin.h
1 
108 #pragma once
109 
110 
111 #include <stdio.h>
112 #include <string.h>
113 
114 #ifdef _WIN32
115 # define ORTHANC_PLUGINS_API __declspec(dllexport)
116 #elif __GNUC__ >= 4
117 # define ORTHANC_PLUGINS_API __attribute__ ((visibility ("default")))
118 #else
119 # define ORTHANC_PLUGINS_API
120 #endif
121 
122 #define ORTHANC_PLUGINS_MINIMAL_MAJOR_NUMBER 1
123 #define ORTHANC_PLUGINS_MINIMAL_MINOR_NUMBER 12
124 #define ORTHANC_PLUGINS_MINIMAL_REVISION_NUMBER 5
125 
126 
127 #if !defined(ORTHANC_PLUGINS_VERSION_IS_ABOVE)
128 #define ORTHANC_PLUGINS_VERSION_IS_ABOVE(major, minor, revision) \
129  (ORTHANC_PLUGINS_MINIMAL_MAJOR_NUMBER > major || \
130  (ORTHANC_PLUGINS_MINIMAL_MAJOR_NUMBER == major && \
131  (ORTHANC_PLUGINS_MINIMAL_MINOR_NUMBER > minor || \
132  (ORTHANC_PLUGINS_MINIMAL_MINOR_NUMBER == minor && \
133  ORTHANC_PLUGINS_MINIMAL_REVISION_NUMBER >= revision))))
134 #endif
135 
136 
137 
138 /********************************************************************
139  ** Check that function inlining is properly supported. The use of
140  ** inlining is required, to avoid the duplication of object code
141  ** between two compilation modules that would use the Orthanc Plugin
142  ** API.
143  ********************************************************************/
144 
145 /* If the auto-detection of the "inline" keyword below does not work
146  automatically and that your compiler is known to properly support
147  inlining, uncomment the following #define and adapt the definition
148  of "static inline". */
149 
150 /* #define ORTHANC_PLUGIN_INLINE static inline */
151 
152 #ifndef ORTHANC_PLUGIN_INLINE
153 # if __STDC_VERSION__ >= 199901L
154 /* This is C99 or above: http://predef.sourceforge.net/prestd.html */
155 # define ORTHANC_PLUGIN_INLINE static inline
156 # elif defined(__cplusplus)
157 /* This is C++ */
158 # define ORTHANC_PLUGIN_INLINE static inline
159 # elif defined(__GNUC__)
160 /* This is GCC running in C89 mode */
161 # define ORTHANC_PLUGIN_INLINE static __inline
162 # elif defined(_MSC_VER)
163 /* This is Visual Studio running in C89 mode */
164 # define ORTHANC_PLUGIN_INLINE static __inline
165 # else
166 # error Your compiler is not known to support the "inline" keyword
167 # endif
168 #endif
169 
170 
171 #ifndef ORTHANC_PLUGIN_DEPRECATED
172 # if defined(_MSC_VER)
173 # define ORTHANC_PLUGIN_DEPRECATED __declspec(deprecated)
174 # elif __GNUC__ >= 4
175 # define ORTHANC_PLUGIN_DEPRECATED __attribute__ ((deprecated))
176 # elif defined(__clang__)
177 # define ORTHANC_PLUGIN_DEPRECATED __attribute__ ((deprecated))
178 # else
179 # pragma message("WARNING: You need to implement ORTHANC_PLUGINS_DEPRECATED for this compiler")
180 # define ORTHANC_PLUGIN_DEPRECATED
181 # endif
182 #endif
183 
184 
185 
186 /********************************************************************
187  ** Inclusion of standard libraries.
188  ********************************************************************/
189 
195 #include <stdint.h>
196 
197 #include <stdlib.h>
198 
199 
200 
201 /********************************************************************
202  ** Definition of the Orthanc Plugin API.
203  ********************************************************************/
204 
207 #ifdef __cplusplus
208 extern "C"
209 {
210 #endif
211 
215  typedef enum
216  {
328 
329  _OrthancPluginErrorCode_INTERNAL = 0x7fffffff
331 
332 
337  ORTHANC_PLUGINS_API const char* OrthancPluginGetName();
338 
339 
343  typedef enum
344  {
350  _OrthancPluginHttpMethod_INTERNAL = 0x7fffffff
352 
353 
358  typedef struct
359  {
364 
368  uint32_t groupsCount;
369 
373  const char* const* groups;
374 
378  uint32_t getCount;
379 
383  const char* const* getKeys;
384 
388  const char* const* getValues;
389 
393  const void* body;
394 
398  uint32_t bodySize;
399 
400 
401  /* --------------------------------------------------
402  New in version 0.8.1
403  -------------------------------------------------- */
404 
408  uint32_t headersCount;
409 
413  const char* const* headersKeys;
414 
418  const char* const* headersValues;
419 
421 
422 
423  typedef enum
424  {
425  /* Generic services */
426  _OrthancPluginService_LogInfo = 1,
427  _OrthancPluginService_LogWarning = 2,
428  _OrthancPluginService_LogError = 3,
429  _OrthancPluginService_GetOrthancPath = 4,
430  _OrthancPluginService_GetOrthancDirectory = 5,
431  _OrthancPluginService_GetConfigurationPath = 6,
432  _OrthancPluginService_SetPluginProperty = 7,
433  _OrthancPluginService_GetGlobalProperty = 8,
434  _OrthancPluginService_SetGlobalProperty = 9,
435  _OrthancPluginService_GetCommandLineArgumentsCount = 10,
436  _OrthancPluginService_GetCommandLineArgument = 11,
437  _OrthancPluginService_GetExpectedDatabaseVersion = 12,
438  _OrthancPluginService_GetConfiguration = 13,
439  _OrthancPluginService_BufferCompression = 14,
440  _OrthancPluginService_ReadFile = 15,
441  _OrthancPluginService_WriteFile = 16,
442  _OrthancPluginService_GetErrorDescription = 17,
443  _OrthancPluginService_CallHttpClient = 18,
444  _OrthancPluginService_RegisterErrorCode = 19,
445  _OrthancPluginService_RegisterDictionaryTag = 20,
446  _OrthancPluginService_DicomBufferToJson = 21,
447  _OrthancPluginService_DicomInstanceToJson = 22,
448  _OrthancPluginService_CreateDicom = 23,
449  _OrthancPluginService_ComputeMd5 = 24,
450  _OrthancPluginService_ComputeSha1 = 25,
451  _OrthancPluginService_LookupDictionary = 26,
452  _OrthancPluginService_CallHttpClient2 = 27,
453  _OrthancPluginService_GenerateUuid = 28,
454  _OrthancPluginService_RegisterPrivateDictionaryTag = 29,
455  _OrthancPluginService_AutodetectMimeType = 30,
456  _OrthancPluginService_SetMetricsValue = 31,
457  _OrthancPluginService_EncodeDicomWebJson = 32,
458  _OrthancPluginService_EncodeDicomWebXml = 33,
459  _OrthancPluginService_ChunkedHttpClient = 34, /* New in Orthanc 1.5.7 */
460  _OrthancPluginService_GetTagName = 35, /* New in Orthanc 1.5.7 */
461  _OrthancPluginService_EncodeDicomWebJson2 = 36, /* New in Orthanc 1.7.0 */
462  _OrthancPluginService_EncodeDicomWebXml2 = 37, /* New in Orthanc 1.7.0 */
463  _OrthancPluginService_CreateMemoryBuffer = 38, /* New in Orthanc 1.7.0 */
464  _OrthancPluginService_GenerateRestApiAuthorizationToken = 39, /* New in Orthanc 1.8.1 */
465  _OrthancPluginService_CreateMemoryBuffer64 = 40, /* New in Orthanc 1.9.0 */
466  _OrthancPluginService_CreateDicom2 = 41, /* New in Orthanc 1.9.0 */
467  _OrthancPluginService_GetDatabaseServerIdentifier = 42, /* New in Orthanc 1.11.1 */
468  _OrthancPluginService_SetMetricsIntegerValue = 43, /* New in Orthanc 1.12.1 */
469  _OrthancPluginService_SetCurrentThreadName = 44, /* New in Orthanc 1.12.2 */
470  _OrthancPluginService_LogMessage = 45, /* New in Orthanc 1.12.4 */
471 
472 
473  /* Registration of callbacks */
474  _OrthancPluginService_RegisterRestCallback = 1000,
475  _OrthancPluginService_RegisterOnStoredInstanceCallback = 1001,
476  _OrthancPluginService_RegisterStorageArea = 1002,
477  _OrthancPluginService_RegisterOnChangeCallback = 1003,
478  _OrthancPluginService_RegisterRestCallbackNoLock = 1004,
479  _OrthancPluginService_RegisterWorklistCallback = 1005,
480  _OrthancPluginService_RegisterDecodeImageCallback = 1006,
481  _OrthancPluginService_RegisterIncomingHttpRequestFilter = 1007,
482  _OrthancPluginService_RegisterFindCallback = 1008,
483  _OrthancPluginService_RegisterMoveCallback = 1009,
484  _OrthancPluginService_RegisterIncomingHttpRequestFilter2 = 1010,
485  _OrthancPluginService_RegisterRefreshMetricsCallback = 1011,
486  _OrthancPluginService_RegisterChunkedRestCallback = 1012, /* New in Orthanc 1.5.7 */
487  _OrthancPluginService_RegisterStorageCommitmentScpCallback = 1013,
488  _OrthancPluginService_RegisterIncomingDicomInstanceFilter = 1014,
489  _OrthancPluginService_RegisterTranscoderCallback = 1015, /* New in Orthanc 1.7.0 */
490  _OrthancPluginService_RegisterStorageArea2 = 1016, /* New in Orthanc 1.9.0 */
491  _OrthancPluginService_RegisterIncomingCStoreInstanceFilter = 1017, /* New in Orthanc 1.10.0 */
492  _OrthancPluginService_RegisterReceivedInstanceCallback = 1018, /* New in Orthanc 1.10.0 */
493  _OrthancPluginService_RegisterWebDavCollection = 1019, /* New in Orthanc 1.10.1 */
494 
495  /* Sending answers to REST calls */
496  _OrthancPluginService_AnswerBuffer = 2000,
497  _OrthancPluginService_CompressAndAnswerPngImage = 2001, /* Unused as of Orthanc 0.9.4 */
498  _OrthancPluginService_Redirect = 2002,
499  _OrthancPluginService_SendHttpStatusCode = 2003,
500  _OrthancPluginService_SendUnauthorized = 2004,
501  _OrthancPluginService_SendMethodNotAllowed = 2005,
502  _OrthancPluginService_SetCookie = 2006,
503  _OrthancPluginService_SetHttpHeader = 2007,
504  _OrthancPluginService_StartMultipartAnswer = 2008,
505  _OrthancPluginService_SendMultipartItem = 2009,
506  _OrthancPluginService_SendHttpStatus = 2010,
507  _OrthancPluginService_CompressAndAnswerImage = 2011,
508  _OrthancPluginService_SendMultipartItem2 = 2012,
509  _OrthancPluginService_SetHttpErrorDetails = 2013,
510 
511  /* Access to the Orthanc database and API */
512  _OrthancPluginService_GetDicomForInstance = 3000,
513  _OrthancPluginService_RestApiGet = 3001,
514  _OrthancPluginService_RestApiPost = 3002,
515  _OrthancPluginService_RestApiDelete = 3003,
516  _OrthancPluginService_RestApiPut = 3004,
517  _OrthancPluginService_LookupPatient = 3005,
518  _OrthancPluginService_LookupStudy = 3006,
519  _OrthancPluginService_LookupSeries = 3007,
520  _OrthancPluginService_LookupInstance = 3008,
521  _OrthancPluginService_LookupStudyWithAccessionNumber = 3009,
522  _OrthancPluginService_RestApiGetAfterPlugins = 3010,
523  _OrthancPluginService_RestApiPostAfterPlugins = 3011,
524  _OrthancPluginService_RestApiDeleteAfterPlugins = 3012,
525  _OrthancPluginService_RestApiPutAfterPlugins = 3013,
526  _OrthancPluginService_ReconstructMainDicomTags = 3014,
527  _OrthancPluginService_RestApiGet2 = 3015,
528  _OrthancPluginService_CallRestApi = 3016, /* New in Orthanc 1.9.2 */
529 
530  /* Access to DICOM instances */
531  _OrthancPluginService_GetInstanceRemoteAet = 4000,
532  _OrthancPluginService_GetInstanceSize = 4001,
533  _OrthancPluginService_GetInstanceData = 4002,
534  _OrthancPluginService_GetInstanceJson = 4003,
535  _OrthancPluginService_GetInstanceSimplifiedJson = 4004,
536  _OrthancPluginService_HasInstanceMetadata = 4005,
537  _OrthancPluginService_GetInstanceMetadata = 4006,
538  _OrthancPluginService_GetInstanceOrigin = 4007,
539  _OrthancPluginService_GetInstanceTransferSyntaxUid = 4008,
540  _OrthancPluginService_HasInstancePixelData = 4009,
541  _OrthancPluginService_CreateDicomInstance = 4010, /* New in Orthanc 1.7.0 */
542  _OrthancPluginService_FreeDicomInstance = 4011, /* New in Orthanc 1.7.0 */
543  _OrthancPluginService_GetInstanceFramesCount = 4012, /* New in Orthanc 1.7.0 */
544  _OrthancPluginService_GetInstanceRawFrame = 4013, /* New in Orthanc 1.7.0 */
545  _OrthancPluginService_GetInstanceDecodedFrame = 4014, /* New in Orthanc 1.7.0 */
546  _OrthancPluginService_TranscodeDicomInstance = 4015, /* New in Orthanc 1.7.0 */
547  _OrthancPluginService_SerializeDicomInstance = 4016, /* New in Orthanc 1.7.0 */
548  _OrthancPluginService_GetInstanceAdvancedJson = 4017, /* New in Orthanc 1.7.0 */
549  _OrthancPluginService_GetInstanceDicomWebJson = 4018, /* New in Orthanc 1.7.0 */
550  _OrthancPluginService_GetInstanceDicomWebXml = 4019, /* New in Orthanc 1.7.0 */
551  _OrthancPluginService_LoadDicomInstance = 4020, /* New in Orthanc 1.12.1 */
552 
553  /* Services for plugins implementing a database back-end */
554  _OrthancPluginService_RegisterDatabaseBackend = 5000, /* New in Orthanc 0.8.6 */
555  _OrthancPluginService_DatabaseAnswer = 5001,
556  _OrthancPluginService_RegisterDatabaseBackendV2 = 5002, /* New in Orthanc 0.9.4 */
557  _OrthancPluginService_StorageAreaCreate = 5003,
558  _OrthancPluginService_StorageAreaRead = 5004,
559  _OrthancPluginService_StorageAreaRemove = 5005,
560  _OrthancPluginService_RegisterDatabaseBackendV3 = 5006, /* New in Orthanc 1.9.2 */
561  _OrthancPluginService_RegisterDatabaseBackendV4 = 5007, /* New in Orthanc 1.12.0 */
562 
563  /* Primitives for handling images */
564  _OrthancPluginService_GetImagePixelFormat = 6000,
565  _OrthancPluginService_GetImageWidth = 6001,
566  _OrthancPluginService_GetImageHeight = 6002,
567  _OrthancPluginService_GetImagePitch = 6003,
568  _OrthancPluginService_GetImageBuffer = 6004,
569  _OrthancPluginService_UncompressImage = 6005,
570  _OrthancPluginService_FreeImage = 6006,
571  _OrthancPluginService_CompressImage = 6007,
572  _OrthancPluginService_ConvertPixelFormat = 6008,
573  _OrthancPluginService_GetFontsCount = 6009,
574  _OrthancPluginService_GetFontInfo = 6010,
575  _OrthancPluginService_DrawText = 6011,
576  _OrthancPluginService_CreateImage = 6012,
577  _OrthancPluginService_CreateImageAccessor = 6013,
578  _OrthancPluginService_DecodeDicomImage = 6014,
579 
580  /* Primitives for handling C-Find, C-Move and worklists */
581  _OrthancPluginService_WorklistAddAnswer = 7000,
582  _OrthancPluginService_WorklistMarkIncomplete = 7001,
583  _OrthancPluginService_WorklistIsMatch = 7002,
584  _OrthancPluginService_WorklistGetDicomQuery = 7003,
585  _OrthancPluginService_FindAddAnswer = 7004,
586  _OrthancPluginService_FindMarkIncomplete = 7005,
587  _OrthancPluginService_GetFindQuerySize = 7006,
588  _OrthancPluginService_GetFindQueryTag = 7007,
589  _OrthancPluginService_GetFindQueryTagName = 7008,
590  _OrthancPluginService_GetFindQueryValue = 7009,
591  _OrthancPluginService_CreateFindMatcher = 7010,
592  _OrthancPluginService_FreeFindMatcher = 7011,
593  _OrthancPluginService_FindMatcherIsMatch = 7012,
594 
595  /* Primitives for accessing Orthanc Peers (new in 1.4.2) */
596  _OrthancPluginService_GetPeers = 8000,
597  _OrthancPluginService_FreePeers = 8001,
598  _OrthancPluginService_GetPeersCount = 8003,
599  _OrthancPluginService_GetPeerName = 8004,
600  _OrthancPluginService_GetPeerUrl = 8005,
601  _OrthancPluginService_CallPeerApi = 8006,
602  _OrthancPluginService_GetPeerUserProperty = 8007,
603 
604  /* Primitives for handling jobs (new in 1.4.2) */
605  _OrthancPluginService_CreateJob = 9000, /* Deprecated since SDK 1.11.3 */
606  _OrthancPluginService_FreeJob = 9001,
607  _OrthancPluginService_SubmitJob = 9002,
608  _OrthancPluginService_RegisterJobsUnserializer = 9003,
609  _OrthancPluginService_CreateJob2 = 9004, /* New in SDK 1.11.3 */
610 
611  _OrthancPluginService_INTERNAL = 0x7fffffff
612  } _OrthancPluginService;
613 
614 
615  typedef enum
616  {
617  _OrthancPluginProperty_Description = 1,
618  _OrthancPluginProperty_RootUri = 2,
619  _OrthancPluginProperty_OrthancExplorer = 3,
620 
621  _OrthancPluginProperty_INTERNAL = 0x7fffffff
622  } _OrthancPluginProperty;
623 
624 
625 
630  typedef enum
631  {
639 
647 
655 
663 
671 
681 
689 
697 
705 
713 
714  _OrthancPluginPixelFormat_INTERNAL = 0x7fffffff
716 
717 
718 
722  typedef enum
723  {
729  _OrthancPluginContentType_INTERNAL = 0x7fffffff
731 
732 
733 
737  typedef enum
738  {
745  _OrthancPluginResourceType_INTERNAL = 0x7fffffff
747 
748 
749 
755  typedef enum
756  {
777  _OrthancPluginChangeType_INTERNAL = 0x7fffffff
779 
780 
785  typedef enum
786  {
792  _OrthancPluginCompressionType_INTERNAL = 0x7fffffff
794 
795 
800  typedef enum
801  {
806  _OrthancPluginImageFormat_INTERNAL = 0x7fffffff
808 
809 
814  typedef enum
815  {
844  _OrthancPluginValueRepresentation_INTERNAL = 0x7fffffff
846 
847 
853  typedef enum
854  {
859  _OrthancPluginDicomToJsonFormat_INTERNAL = 0x7fffffff
861 
862 
868  typedef enum
869  {
880  _OrthancPluginDicomToJsonFlags_INTERNAL = 0x7fffffff
882 
883 
889  typedef enum
890  {
895  _OrthancPluginCreateDicomFlags_INTERNAL = 0x7fffffff
897 
898 
904  typedef enum
905  {
911  _OrthancPluginIdentifierConstraint_INTERNAL = 0x7fffffff
913 
914 
919  typedef enum
920  {
927  _OrthancPluginConstraintType_INTERNAL = 0x7fffffff
929 
930 
934  typedef enum
935  {
943  _OrthancPluginInstanceOrigin_INTERNAL = 0x7fffffff
945 
946 
950  typedef enum
951  {
956 
957 
964  typedef enum
965  {
971 
972 
976  typedef enum
977  {
987 
988 
993  typedef enum
994  {
999 
1000 
1006  typedef enum
1007  {
1012 
1017 
1023 
1029 
1035 
1042 
1049 
1050 
1054  typedef enum
1055  {
1060  _OrthancPluginReceivedInstanceAction_INTERNAL = 0x7fffffff
1062 
1063 
1068  typedef enum
1069  {
1074 
1080 
1087 
1088  _OrthancPluginLoadDicomInstanceMode_INTERNAL = 0x7fffffff
1090 
1091 
1098  typedef enum
1099  {
1105  _OrthancPluginLogLevel_INTERNAL = 0x7fffffff
1107 
1108 
1115  typedef enum
1116  {
1125  _OrthancPluginLogCategory_INTERNAL = 0x7fffffff
1127 
1128 
1136  typedef struct
1137  {
1141  void* data;
1142 
1146  uint32_t size;
1148 
1149 
1150 
1158  typedef struct
1159  {
1163  void* data;
1164 
1168  uint64_t size;
1170 
1171 
1172 
1173 
1178  typedef struct _OrthancPluginRestOutput_t OrthancPluginRestOutput;
1179 
1180 
1181 
1186  typedef struct _OrthancPluginDicomInstance_t OrthancPluginDicomInstance;
1187 
1188 
1189 
1194  typedef struct _OrthancPluginImage_t OrthancPluginImage;
1195 
1196 
1197 
1202  typedef struct _OrthancPluginStorageArea_t OrthancPluginStorageArea;
1203 
1204 
1205 
1210  typedef struct _OrthancPluginWorklistQuery_t OrthancPluginWorklistQuery;
1211 
1212 
1213 
1218  typedef struct _OrthancPluginWorklistAnswers_t OrthancPluginWorklistAnswers;
1219 
1220 
1221 
1226  typedef struct _OrthancPluginFindQuery_t OrthancPluginFindQuery;
1227 
1228 
1229 
1234  typedef struct _OrthancPluginFindAnswers_t OrthancPluginFindAnswers;
1235 
1236 
1237 
1242  typedef struct _OrthancPluginFindMatcher_t OrthancPluginFindMatcher;
1243 
1244 
1245 
1250  typedef struct _OrthancPluginPeers_t OrthancPluginPeers;
1251 
1252 
1253 
1258  typedef struct _OrthancPluginJob_t OrthancPluginJob;
1259 
1260 
1261 
1267  typedef struct _OrthancPluginDicomWebNode_t OrthancPluginDicomWebNode;
1268 
1269 
1270 
1276  OrthancPluginRestOutput* output,
1277  const char* url,
1278  const OrthancPluginHttpRequest* request);
1279 
1280 
1281 
1287  const OrthancPluginDicomInstance* instance,
1288  const char* instanceId);
1289 
1290 
1291 
1297  OrthancPluginChangeType changeType,
1298  OrthancPluginResourceType resourceType,
1299  const char* resourceId);
1300 
1301 
1302 
1308  OrthancPluginImage** target,
1309  const void* dicom,
1310  const uint32_t size,
1311  uint32_t frameIndex);
1312 
1313 
1314 
1319  typedef void (*OrthancPluginFree) (void* buffer);
1320 
1321 
1322 
1332  const char* bulkDataUri);
1333 
1334 
1335 
1349  const char* uuid,
1350  const void* content,
1351  int64_t size,
1353 
1354 
1355 
1376  void** content,
1377  int64_t* size,
1378  const char* uuid,
1380 
1381 
1382 
1397  const char* uuid,
1399 
1400 
1401 
1420  const char* uuid,
1422  uint64_t rangeStart);
1423 
1424 
1425 
1437  const char* uuid,
1439 
1440 
1441 
1457  const OrthancPluginWorklistQuery* query,
1458  const char* issuerAet,
1459  const char* calledAet);
1460 
1461 
1462 
1487  OrthancPluginHttpMethod method,
1488  const char* uri,
1489  const char* ip,
1490  uint32_t headersCount,
1491  const char* const* headersKeys,
1492  const char* const* headersValues);
1493 
1494 
1495 
1522  OrthancPluginHttpMethod method,
1523  const char* uri,
1524  const char* ip,
1525  uint32_t headersCount,
1526  const char* const* headersKeys,
1527  const char* const* headersValues,
1528  uint32_t getArgumentsCount,
1529  const char* const* getArgumentsKeys,
1530  const char* const* getArgumentsValues);
1531 
1532 
1533 
1549  OrthancPluginFindAnswers* answers,
1550  const OrthancPluginFindQuery* query,
1551  const char* issuerAet,
1552  const char* calledAet);
1553 
1554 
1555 
1591  typedef void* (*OrthancPluginMoveCallback) (
1592  OrthancPluginResourceType resourceType,
1593  const char* patientId,
1594  const char* accessionNumber,
1595  const char* studyInstanceUid,
1596  const char* seriesInstanceUid,
1597  const char* sopInstanceUid,
1598  const char* originatorAet,
1599  const char* sourceAet,
1600  const char* targetAet,
1601  uint16_t originatorId);
1602 
1603 
1616  typedef uint32_t (*OrthancPluginGetMoveSize) (void* moveDriver);
1617 
1618 
1631  typedef OrthancPluginErrorCode (*OrthancPluginApplyMove) (void* moveDriver);
1632 
1633 
1645  typedef void (*OrthancPluginFreeMove) (void* moveDriver);
1646 
1647 
1658  typedef void (*OrthancPluginJobFinalize) (void* job);
1659 
1660 
1671  typedef float (*OrthancPluginJobGetProgress) (void* job);
1672 
1673 
1687  typedef const char* (*OrthancPluginJobGetContent) (void* job);
1688 
1689 
1706  void* job);
1707 
1708 
1725  typedef const char* (*OrthancPluginJobGetSerialized) (void* job);
1726 
1727 
1746  void* job);
1747 
1748 
1762 
1763 
1787 
1788 
1803 
1804 
1818  typedef OrthancPluginJob* (*OrthancPluginJobsUnserializer) (const char* jobType,
1819  const char* serialized);
1820 
1821 
1822 
1838 
1839 
1840 
1868  uint32_t levelDepth,
1869  const uint16_t* levelTagGroup,
1870  const uint16_t* levelTagElement,
1871  const uint32_t* levelIndex,
1872  uint16_t tagGroup,
1873  uint16_t tagElement,
1875 
1876 
1877 
1906  uint32_t levelDepth,
1907  const uint16_t* levelTagGroup,
1908  const uint16_t* levelTagElement,
1909  const uint32_t* levelIndex,
1910  uint16_t tagGroup,
1911  uint16_t tagElement,
1913  void* payload);
1914 
1915 
1916 
1920  typedef struct _OrthancPluginContext_t
1921  {
1922  void* pluginsManager;
1923  const char* orthancVersion;
1924  OrthancPluginFree Free;
1925  OrthancPluginErrorCode (*InvokeService) (struct _OrthancPluginContext_t* context,
1926  _OrthancPluginService service,
1927  const void* params);
1929 
1930 
1931 
1935  typedef struct
1936  {
1937  uint16_t group;
1938  uint16_t element;
1940  uint32_t minMultiplicity;
1941  uint32_t maxMultiplicity;
1943 
1944 
1945 
1954  ORTHANC_PLUGIN_INLINE void OrthancPluginFreeString(
1955  OrthancPluginContext* context,
1956  char* str)
1957  {
1958  if (str != NULL)
1959  {
1960  context->Free(str);
1961  }
1962  }
1963 
1964 
1984  ORTHANC_PLUGIN_INLINE int32_t OrthancPluginCheckVersionAdvanced(
1985  OrthancPluginContext* context,
1986  int32_t expectedMajor,
1987  int32_t expectedMinor,
1988  int32_t expectedRevision)
1989  {
1990  int32_t major, minor, revision;
1991 
1992  if (sizeof(int) != sizeof(int32_t) || /* Ensure binary compatibility with Orthanc SDK <= 1.12.1 */
1993  sizeof(int32_t) != sizeof(OrthancPluginErrorCode) ||
1994  sizeof(int32_t) != sizeof(OrthancPluginHttpMethod) ||
1995  sizeof(int32_t) != sizeof(_OrthancPluginService) ||
1996  sizeof(int32_t) != sizeof(_OrthancPluginProperty) ||
1997  sizeof(int32_t) != sizeof(OrthancPluginPixelFormat) ||
1998  sizeof(int32_t) != sizeof(OrthancPluginContentType) ||
1999  sizeof(int32_t) != sizeof(OrthancPluginResourceType) ||
2000  sizeof(int32_t) != sizeof(OrthancPluginChangeType) ||
2001  sizeof(int32_t) != sizeof(OrthancPluginCompressionType) ||
2002  sizeof(int32_t) != sizeof(OrthancPluginImageFormat) ||
2003  sizeof(int32_t) != sizeof(OrthancPluginValueRepresentation) ||
2004  sizeof(int32_t) != sizeof(OrthancPluginDicomToJsonFormat) ||
2005  sizeof(int32_t) != sizeof(OrthancPluginDicomToJsonFlags) ||
2006  sizeof(int32_t) != sizeof(OrthancPluginCreateDicomFlags) ||
2007  sizeof(int32_t) != sizeof(OrthancPluginIdentifierConstraint) ||
2008  sizeof(int32_t) != sizeof(OrthancPluginInstanceOrigin) ||
2009  sizeof(int32_t) != sizeof(OrthancPluginJobStepStatus) ||
2010  sizeof(int32_t) != sizeof(OrthancPluginConstraintType) ||
2011  sizeof(int32_t) != sizeof(OrthancPluginMetricsType) ||
2012  sizeof(int32_t) != sizeof(OrthancPluginDicomWebBinaryMode) ||
2013  sizeof(int32_t) != sizeof(OrthancPluginStorageCommitmentFailureReason) ||
2014  sizeof(int32_t) != sizeof(OrthancPluginLoadDicomInstanceMode) ||
2015  sizeof(int32_t) != sizeof(OrthancPluginLogLevel) ||
2016  sizeof(int32_t) != sizeof(OrthancPluginLogCategory))
2017  {
2018  /* Mismatch in the size of the enumerations */
2019  return 0;
2020  }
2021 
2022  /* Assume compatibility with the mainline */
2023  if (!strcmp(context->orthancVersion, "mainline"))
2024  {
2025  return 1;
2026  }
2027 
2028  /* Parse the version of the Orthanc core */
2029  if (
2030 #ifdef _MSC_VER
2031  sscanf_s
2032 #else
2033  sscanf
2034 #endif
2035  (context->orthancVersion, "%4d.%4d.%4d", &major, &minor, &revision) != 3)
2036  {
2037  return 0;
2038  }
2039 
2040  /* Check the major number of the version */
2041 
2042  if (major > expectedMajor)
2043  {
2044  return 1;
2045  }
2046 
2047  if (major < expectedMajor)
2048  {
2049  return 0;
2050  }
2051 
2052  /* Check the minor number of the version */
2053 
2054  if (minor > expectedMinor)
2055  {
2056  return 1;
2057  }
2058 
2059  if (minor < expectedMinor)
2060  {
2061  return 0;
2062  }
2063 
2064  /* Check the revision number of the version */
2065 
2066  if (revision >= expectedRevision)
2067  {
2068  return 1;
2069  }
2070  else
2071  {
2072  return 0;
2073  }
2074  }
2075 
2076 
2093  ORTHANC_PLUGIN_INLINE int32_t OrthancPluginCheckVersion(
2094  OrthancPluginContext* context)
2095  {
2097  context,
2098  ORTHANC_PLUGINS_MINIMAL_MAJOR_NUMBER,
2099  ORTHANC_PLUGINS_MINIMAL_MINOR_NUMBER,
2100  ORTHANC_PLUGINS_MINIMAL_REVISION_NUMBER);
2101  }
2102 
2103 
2112  ORTHANC_PLUGIN_INLINE void OrthancPluginFreeMemoryBuffer(
2113  OrthancPluginContext* context,
2114  OrthancPluginMemoryBuffer* buffer)
2115  {
2116  context->Free(buffer->data);
2117  }
2118 
2119 
2128  ORTHANC_PLUGIN_INLINE void OrthancPluginFreeMemoryBuffer64(
2129  OrthancPluginContext* context,
2131  {
2132  context->Free(buffer->data);
2133  }
2134 
2135 
2144  ORTHANC_PLUGIN_INLINE void OrthancPluginLogError(
2145  OrthancPluginContext* context,
2146  const char* message)
2147  {
2148  context->InvokeService(context, _OrthancPluginService_LogError, message);
2149  }
2150 
2151 
2160  ORTHANC_PLUGIN_INLINE void OrthancPluginLogWarning(
2161  OrthancPluginContext* context,
2162  const char* message)
2163  {
2164  context->InvokeService(context, _OrthancPluginService_LogWarning, message);
2165  }
2166 
2167 
2176  ORTHANC_PLUGIN_INLINE void OrthancPluginLogInfo(
2177  OrthancPluginContext* context,
2178  const char* message)
2179  {
2180  context->InvokeService(context, _OrthancPluginService_LogInfo, message);
2181  }
2182 
2183 
2184 
2185  typedef struct
2186  {
2187  const char* pathRegularExpression;
2188  OrthancPluginRestCallback callback;
2189  } _OrthancPluginRestCallback;
2190 
2212  ORTHANC_PLUGIN_INLINE void OrthancPluginRegisterRestCallback(
2213  OrthancPluginContext* context,
2214  const char* pathRegularExpression,
2215  OrthancPluginRestCallback callback)
2216  {
2217  _OrthancPluginRestCallback params;
2218  params.pathRegularExpression = pathRegularExpression;
2219  params.callback = callback;
2220  context->InvokeService(context, _OrthancPluginService_RegisterRestCallback, &params);
2221  }
2222 
2223 
2224 
2252  ORTHANC_PLUGIN_INLINE void OrthancPluginRegisterRestCallbackNoLock(
2253  OrthancPluginContext* context,
2254  const char* pathRegularExpression,
2255  OrthancPluginRestCallback callback)
2256  {
2257  _OrthancPluginRestCallback params;
2258  params.pathRegularExpression = pathRegularExpression;
2259  params.callback = callback;
2260  context->InvokeService(context, _OrthancPluginService_RegisterRestCallbackNoLock, &params);
2261  }
2262 
2263 
2264 
2265  typedef struct
2266  {
2268  } _OrthancPluginOnStoredInstanceCallback;
2269 
2291  OrthancPluginContext* context,
2293  {
2294  _OrthancPluginOnStoredInstanceCallback params;
2295  params.callback = callback;
2296 
2297  context->InvokeService(context, _OrthancPluginService_RegisterOnStoredInstanceCallback, &params);
2298  }
2299 
2300 
2301 
2302  typedef struct
2303  {
2304  OrthancPluginRestOutput* output;
2305  const void* answer;
2306  uint32_t answerSize;
2307  const char* mimeType;
2308  } _OrthancPluginAnswerBuffer;
2309 
2322  ORTHANC_PLUGIN_INLINE void OrthancPluginAnswerBuffer(
2323  OrthancPluginContext* context,
2324  OrthancPluginRestOutput* output,
2325  const void* answer,
2326  uint32_t answerSize,
2327  const char* mimeType)
2328  {
2329  _OrthancPluginAnswerBuffer params;
2330  params.output = output;
2331  params.answer = answer;
2332  params.answerSize = answerSize;
2333  params.mimeType = mimeType;
2334  context->InvokeService(context, _OrthancPluginService_AnswerBuffer, &params);
2335  }
2336 
2337 
2338  typedef struct
2339  {
2340  OrthancPluginRestOutput* output;
2341  OrthancPluginPixelFormat format;
2342  uint32_t width;
2343  uint32_t height;
2344  uint32_t pitch;
2345  const void* buffer;
2346  } _OrthancPluginCompressAndAnswerPngImage;
2347 
2348  typedef struct
2349  {
2350  OrthancPluginRestOutput* output;
2351  OrthancPluginImageFormat imageFormat;
2352  OrthancPluginPixelFormat pixelFormat;
2353  uint32_t width;
2354  uint32_t height;
2355  uint32_t pitch;
2356  const void* buffer;
2357  uint8_t quality;
2358  } _OrthancPluginCompressAndAnswerImage;
2359 
2360 
2379  ORTHANC_PLUGIN_INLINE void OrthancPluginCompressAndAnswerPngImage(
2380  OrthancPluginContext* context,
2381  OrthancPluginRestOutput* output,
2382  OrthancPluginPixelFormat format,
2383  uint32_t width,
2384  uint32_t height,
2385  uint32_t pitch,
2386  const void* buffer)
2387  {
2388  _OrthancPluginCompressAndAnswerImage params;
2389  params.output = output;
2390  params.imageFormat = OrthancPluginImageFormat_Png;
2391  params.pixelFormat = format;
2392  params.width = width;
2393  params.height = height;
2394  params.pitch = pitch;
2395  params.buffer = buffer;
2396  params.quality = 0; /* No quality for PNG */
2397  context->InvokeService(context, _OrthancPluginService_CompressAndAnswerImage, &params);
2398  }
2399 
2400 
2401 
2402  typedef struct
2403  {
2404  OrthancPluginMemoryBuffer* target;
2405  const char* instanceId;
2406  } _OrthancPluginGetDicomForInstance;
2407 
2421  OrthancPluginContext* context,
2422  OrthancPluginMemoryBuffer* target,
2423  const char* instanceId)
2424  {
2425  _OrthancPluginGetDicomForInstance params;
2426  params.target = target;
2427  params.instanceId = instanceId;
2428  return context->InvokeService(context, _OrthancPluginService_GetDicomForInstance, &params);
2429  }
2430 
2431 
2432 
2433  typedef struct
2434  {
2435  OrthancPluginMemoryBuffer* target;
2436  const char* uri;
2437  } _OrthancPluginRestApiGet;
2438 
2454  OrthancPluginContext* context,
2455  OrthancPluginMemoryBuffer* target,
2456  const char* uri)
2457  {
2458  _OrthancPluginRestApiGet params;
2459  params.target = target;
2460  params.uri = uri;
2461  return context->InvokeService(context, _OrthancPluginService_RestApiGet, &params);
2462  }
2463 
2464 
2465 
2484  OrthancPluginContext* context,
2485  OrthancPluginMemoryBuffer* target,
2486  const char* uri)
2487  {
2488  _OrthancPluginRestApiGet params;
2489  params.target = target;
2490  params.uri = uri;
2491  return context->InvokeService(context, _OrthancPluginService_RestApiGetAfterPlugins, &params);
2492  }
2493 
2494 
2495 
2496  typedef struct
2497  {
2498  OrthancPluginMemoryBuffer* target;
2499  const char* uri;
2500  const void* body;
2501  uint32_t bodySize;
2502  } _OrthancPluginRestApiPostPut;
2503 
2521  OrthancPluginContext* context,
2522  OrthancPluginMemoryBuffer* target,
2523  const char* uri,
2524  const void* body,
2525  uint32_t bodySize)
2526  {
2527  _OrthancPluginRestApiPostPut params;
2528  params.target = target;
2529  params.uri = uri;
2530  params.body = body;
2531  params.bodySize = bodySize;
2532  return context->InvokeService(context, _OrthancPluginService_RestApiPost, &params);
2533  }
2534 
2535 
2556  OrthancPluginContext* context,
2557  OrthancPluginMemoryBuffer* target,
2558  const char* uri,
2559  const void* body,
2560  uint32_t bodySize)
2561  {
2562  _OrthancPluginRestApiPostPut params;
2563  params.target = target;
2564  params.uri = uri;
2565  params.body = body;
2566  params.bodySize = bodySize;
2567  return context->InvokeService(context, _OrthancPluginService_RestApiPostAfterPlugins, &params);
2568  }
2569 
2570 
2571 
2585  OrthancPluginContext* context,
2586  const char* uri)
2587  {
2588  return context->InvokeService(context, _OrthancPluginService_RestApiDelete, uri);
2589  }
2590 
2591 
2608  OrthancPluginContext* context,
2609  const char* uri)
2610  {
2611  return context->InvokeService(context, _OrthancPluginService_RestApiDeleteAfterPlugins, uri);
2612  }
2613 
2614 
2615 
2633  OrthancPluginContext* context,
2634  OrthancPluginMemoryBuffer* target,
2635  const char* uri,
2636  const void* body,
2637  uint32_t bodySize)
2638  {
2639  _OrthancPluginRestApiPostPut params;
2640  params.target = target;
2641  params.uri = uri;
2642  params.body = body;
2643  params.bodySize = bodySize;
2644  return context->InvokeService(context, _OrthancPluginService_RestApiPut, &params);
2645  }
2646 
2647 
2648 
2669  OrthancPluginContext* context,
2670  OrthancPluginMemoryBuffer* target,
2671  const char* uri,
2672  const void* body,
2673  uint32_t bodySize)
2674  {
2675  _OrthancPluginRestApiPostPut params;
2676  params.target = target;
2677  params.uri = uri;
2678  params.body = body;
2679  params.bodySize = bodySize;
2680  return context->InvokeService(context, _OrthancPluginService_RestApiPutAfterPlugins, &params);
2681  }
2682 
2683 
2684 
2685  typedef struct
2686  {
2687  OrthancPluginRestOutput* output;
2688  const char* argument;
2689  } _OrthancPluginOutputPlusArgument;
2690 
2702  ORTHANC_PLUGIN_INLINE void OrthancPluginRedirect(
2703  OrthancPluginContext* context,
2704  OrthancPluginRestOutput* output,
2705  const char* redirection)
2706  {
2707  _OrthancPluginOutputPlusArgument params;
2708  params.output = output;
2709  params.argument = redirection;
2710  context->InvokeService(context, _OrthancPluginService_Redirect, &params);
2711  }
2712 
2713 
2714 
2715  typedef struct
2716  {
2717  char** result;
2718  const char* argument;
2719  } _OrthancPluginRetrieveDynamicString;
2720 
2734  ORTHANC_PLUGIN_INLINE char* OrthancPluginLookupPatient(
2735  OrthancPluginContext* context,
2736  const char* patientID)
2737  {
2738  char* result;
2739 
2740  _OrthancPluginRetrieveDynamicString params;
2741  params.result = &result;
2742  params.argument = patientID;
2743 
2744  if (context->InvokeService(context, _OrthancPluginService_LookupPatient, &params) != OrthancPluginErrorCode_Success)
2745  {
2746  /* Error */
2747  return NULL;
2748  }
2749  else
2750  {
2751  return result;
2752  }
2753  }
2754 
2755 
2769  ORTHANC_PLUGIN_INLINE char* OrthancPluginLookupStudy(
2770  OrthancPluginContext* context,
2771  const char* studyUID)
2772  {
2773  char* result;
2774 
2775  _OrthancPluginRetrieveDynamicString params;
2776  params.result = &result;
2777  params.argument = studyUID;
2778 
2779  if (context->InvokeService(context, _OrthancPluginService_LookupStudy, &params) != OrthancPluginErrorCode_Success)
2780  {
2781  /* Error */
2782  return NULL;
2783  }
2784  else
2785  {
2786  return result;
2787  }
2788  }
2789 
2790 
2804  ORTHANC_PLUGIN_INLINE char* OrthancPluginLookupStudyWithAccessionNumber(
2805  OrthancPluginContext* context,
2806  const char* accessionNumber)
2807  {
2808  char* result;
2809 
2810  _OrthancPluginRetrieveDynamicString params;
2811  params.result = &result;
2812  params.argument = accessionNumber;
2813 
2814  if (context->InvokeService(context, _OrthancPluginService_LookupStudyWithAccessionNumber, &params) != OrthancPluginErrorCode_Success)
2815  {
2816  /* Error */
2817  return NULL;
2818  }
2819  else
2820  {
2821  return result;
2822  }
2823  }
2824 
2825 
2839  ORTHANC_PLUGIN_INLINE char* OrthancPluginLookupSeries(
2840  OrthancPluginContext* context,
2841  const char* seriesUID)
2842  {
2843  char* result;
2844 
2845  _OrthancPluginRetrieveDynamicString params;
2846  params.result = &result;
2847  params.argument = seriesUID;
2848 
2849  if (context->InvokeService(context, _OrthancPluginService_LookupSeries, &params) != OrthancPluginErrorCode_Success)
2850  {
2851  /* Error */
2852  return NULL;
2853  }
2854  else
2855  {
2856  return result;
2857  }
2858  }
2859 
2860 
2874  ORTHANC_PLUGIN_INLINE char* OrthancPluginLookupInstance(
2875  OrthancPluginContext* context,
2876  const char* sopInstanceUID)
2877  {
2878  char* result;
2879 
2880  _OrthancPluginRetrieveDynamicString params;
2881  params.result = &result;
2882  params.argument = sopInstanceUID;
2883 
2884  if (context->InvokeService(context, _OrthancPluginService_LookupInstance, &params) != OrthancPluginErrorCode_Success)
2885  {
2886  /* Error */
2887  return NULL;
2888  }
2889  else
2890  {
2891  return result;
2892  }
2893  }
2894 
2895 
2896 
2897  typedef struct
2898  {
2899  OrthancPluginRestOutput* output;
2900  uint16_t status;
2901  } _OrthancPluginSendHttpStatusCode;
2902 
2919  ORTHANC_PLUGIN_INLINE void OrthancPluginSendHttpStatusCode(
2920  OrthancPluginContext* context,
2921  OrthancPluginRestOutput* output,
2922  uint16_t status)
2923  {
2924  _OrthancPluginSendHttpStatusCode params;
2925  params.output = output;
2926  params.status = status;
2927  context->InvokeService(context, _OrthancPluginService_SendHttpStatusCode, &params);
2928  }
2929 
2930 
2942  ORTHANC_PLUGIN_INLINE void OrthancPluginSendUnauthorized(
2943  OrthancPluginContext* context,
2944  OrthancPluginRestOutput* output,
2945  const char* realm)
2946  {
2947  _OrthancPluginOutputPlusArgument params;
2948  params.output = output;
2949  params.argument = realm;
2950  context->InvokeService(context, _OrthancPluginService_SendUnauthorized, &params);
2951  }
2952 
2953 
2965  ORTHANC_PLUGIN_INLINE void OrthancPluginSendMethodNotAllowed(
2966  OrthancPluginContext* context,
2967  OrthancPluginRestOutput* output,
2968  const char* allowedMethods)
2969  {
2970  _OrthancPluginOutputPlusArgument params;
2971  params.output = output;
2972  params.argument = allowedMethods;
2973  context->InvokeService(context, _OrthancPluginService_SendMethodNotAllowed, &params);
2974  }
2975 
2976 
2977  typedef struct
2978  {
2979  OrthancPluginRestOutput* output;
2980  const char* key;
2981  const char* value;
2982  } _OrthancPluginSetHttpHeader;
2983 
2995  ORTHANC_PLUGIN_INLINE void OrthancPluginSetCookie(
2996  OrthancPluginContext* context,
2997  OrthancPluginRestOutput* output,
2998  const char* cookie,
2999  const char* value)
3000  {
3001  _OrthancPluginSetHttpHeader params;
3002  params.output = output;
3003  params.key = cookie;
3004  params.value = value;
3005  context->InvokeService(context, _OrthancPluginService_SetCookie, &params);
3006  }
3007 
3008 
3020  ORTHANC_PLUGIN_INLINE void OrthancPluginSetHttpHeader(
3021  OrthancPluginContext* context,
3022  OrthancPluginRestOutput* output,
3023  const char* key,
3024  const char* value)
3025  {
3026  _OrthancPluginSetHttpHeader params;
3027  params.output = output;
3028  params.key = key;
3029  params.value = value;
3030  context->InvokeService(context, _OrthancPluginService_SetHttpHeader, &params);
3031  }
3032 
3033 
3034  typedef struct
3035  {
3036  char** resultStringToFree;
3037  const char** resultString;
3038  int64_t* resultInt64;
3039  const char* key;
3040  const OrthancPluginDicomInstance* instance;
3041  OrthancPluginInstanceOrigin* resultOrigin; /* New in Orthanc 0.9.5 SDK */
3042  } _OrthancPluginAccessDicomInstance;
3043 
3044 
3056  ORTHANC_PLUGIN_INLINE const char* OrthancPluginGetInstanceRemoteAet(
3057  OrthancPluginContext* context,
3058  const OrthancPluginDicomInstance* instance)
3059  {
3060  const char* result;
3061 
3062  _OrthancPluginAccessDicomInstance params;
3063  memset(&params, 0, sizeof(params));
3064  params.resultString = &result;
3065  params.instance = instance;
3066 
3067  if (context->InvokeService(context, _OrthancPluginService_GetInstanceRemoteAet, &params) != OrthancPluginErrorCode_Success)
3068  {
3069  /* Error */
3070  return NULL;
3071  }
3072  else
3073  {
3074  return result;
3075  }
3076  }
3077 
3078 
3089  ORTHANC_PLUGIN_INLINE int64_t OrthancPluginGetInstanceSize(
3090  OrthancPluginContext* context,
3091  const OrthancPluginDicomInstance* instance)
3092  {
3093  int64_t size;
3094 
3095  _OrthancPluginAccessDicomInstance params;
3096  memset(&params, 0, sizeof(params));
3097  params.resultInt64 = &size;
3098  params.instance = instance;
3099 
3100  if (context->InvokeService(context, _OrthancPluginService_GetInstanceSize, &params) != OrthancPluginErrorCode_Success)
3101  {
3102  /* Error */
3103  return -1;
3104  }
3105  else
3106  {
3107  return size;
3108  }
3109  }
3110 
3111 
3122  ORTHANC_PLUGIN_INLINE const void* OrthancPluginGetInstanceData(
3123  OrthancPluginContext* context,
3124  const OrthancPluginDicomInstance* instance)
3125  {
3126  const char* result;
3127 
3128  _OrthancPluginAccessDicomInstance params;
3129  memset(&params, 0, sizeof(params));
3130  params.resultString = &result;
3131  params.instance = instance;
3132 
3133  if (context->InvokeService(context, _OrthancPluginService_GetInstanceData, &params) != OrthancPluginErrorCode_Success)
3134  {
3135  /* Error */
3136  return NULL;
3137  }
3138  else
3139  {
3140  return result;
3141  }
3142  }
3143 
3144 
3158  ORTHANC_PLUGIN_INLINE char* OrthancPluginGetInstanceJson(
3159  OrthancPluginContext* context,
3160  const OrthancPluginDicomInstance* instance)
3161  {
3162  char* result;
3163 
3164  _OrthancPluginAccessDicomInstance params;
3165  memset(&params, 0, sizeof(params));
3166  params.resultStringToFree = &result;
3167  params.instance = instance;
3168 
3169  if (context->InvokeService(context, _OrthancPluginService_GetInstanceJson, &params) != OrthancPluginErrorCode_Success)
3170  {
3171  /* Error */
3172  return NULL;
3173  }
3174  else
3175  {
3176  return result;
3177  }
3178  }
3179 
3180 
3196  ORTHANC_PLUGIN_INLINE char* OrthancPluginGetInstanceSimplifiedJson(
3197  OrthancPluginContext* context,
3198  const OrthancPluginDicomInstance* instance)
3199  {
3200  char* result;
3201 
3202  _OrthancPluginAccessDicomInstance params;
3203  memset(&params, 0, sizeof(params));
3204  params.resultStringToFree = &result;
3205  params.instance = instance;
3206 
3207  if (context->InvokeService(context, _OrthancPluginService_GetInstanceSimplifiedJson, &params) != OrthancPluginErrorCode_Success)
3208  {
3209  /* Error */
3210  return NULL;
3211  }
3212  else
3213  {
3214  return result;
3215  }
3216  }
3217 
3218 
3235  ORTHANC_PLUGIN_INLINE int32_t OrthancPluginHasInstanceMetadata(
3236  OrthancPluginContext* context,
3237  const OrthancPluginDicomInstance* instance,
3238  const char* metadata)
3239  {
3240  int64_t result;
3241 
3242  _OrthancPluginAccessDicomInstance params;
3243  memset(&params, 0, sizeof(params));
3244  params.resultInt64 = &result;
3245  params.instance = instance;
3246  params.key = metadata;
3247 
3248  if (context->InvokeService(context, _OrthancPluginService_HasInstanceMetadata, &params) != OrthancPluginErrorCode_Success)
3249  {
3250  /* Error */
3251  return -1;
3252  }
3253  else
3254  {
3255  return (result != 0);
3256  }
3257  }
3258 
3259 
3276  ORTHANC_PLUGIN_INLINE const char* OrthancPluginGetInstanceMetadata(
3277  OrthancPluginContext* context,
3278  const OrthancPluginDicomInstance* instance,
3279  const char* metadata)
3280  {
3281  const char* result;
3282 
3283  _OrthancPluginAccessDicomInstance params;
3284  memset(&params, 0, sizeof(params));
3285  params.resultString = &result;
3286  params.instance = instance;
3287  params.key = metadata;
3288 
3289  if (context->InvokeService(context, _OrthancPluginService_GetInstanceMetadata, &params) != OrthancPluginErrorCode_Success)
3290  {
3291  /* Error */
3292  return NULL;
3293  }
3294  else
3295  {
3296  return result;
3297  }
3298  }
3299 
3300 
3301 
3302  typedef struct
3303  {
3307  OrthancPluginFree free;
3308  } _OrthancPluginRegisterStorageArea;
3309 
3325  ORTHANC_PLUGIN_DEPRECATED ORTHANC_PLUGIN_INLINE void OrthancPluginRegisterStorageArea(
3326  OrthancPluginContext* context,
3330  {
3331  _OrthancPluginRegisterStorageArea params;
3332  params.create = create;
3333  params.read = read;
3334  params.remove = remove;
3335 
3336 #ifdef __cplusplus
3337  params.free = ::free;
3338 #else
3339  params.free = free;
3340 #endif
3341 
3342  context->InvokeService(context, _OrthancPluginService_RegisterStorageArea, &params);
3343  }
3344 
3345 
3346 
3357  ORTHANC_PLUGIN_INLINE char *OrthancPluginGetOrthancPath(OrthancPluginContext* context)
3358  {
3359  char* result;
3360 
3361  _OrthancPluginRetrieveDynamicString params;
3362  params.result = &result;
3363  params.argument = NULL;
3364 
3365  if (context->InvokeService(context, _OrthancPluginService_GetOrthancPath, &params) != OrthancPluginErrorCode_Success)
3366  {
3367  /* Error */
3368  return NULL;
3369  }
3370  else
3371  {
3372  return result;
3373  }
3374  }
3375 
3376 
3387  ORTHANC_PLUGIN_INLINE char *OrthancPluginGetOrthancDirectory(OrthancPluginContext* context)
3388  {
3389  char* result;
3390 
3391  _OrthancPluginRetrieveDynamicString params;
3392  params.result = &result;
3393  params.argument = NULL;
3394 
3395  if (context->InvokeService(context, _OrthancPluginService_GetOrthancDirectory, &params) != OrthancPluginErrorCode_Success)
3396  {
3397  /* Error */
3398  return NULL;
3399  }
3400  else
3401  {
3402  return result;
3403  }
3404  }
3405 
3406 
3422  ORTHANC_PLUGIN_DEPRECATED ORTHANC_PLUGIN_INLINE char *OrthancPluginGetConfigurationPath(OrthancPluginContext* context)
3423  {
3424  char* result;
3425 
3426  _OrthancPluginRetrieveDynamicString params;
3427  params.result = &result;
3428  params.argument = NULL;
3429 
3430  if (context->InvokeService(context, _OrthancPluginService_GetConfigurationPath, &params) != OrthancPluginErrorCode_Success)
3431  {
3432  /* Error */
3433  return NULL;
3434  }
3435  else
3436  {
3437  return result;
3438  }
3439  }
3440 
3441 
3442 
3443  typedef struct
3444  {
3446  } _OrthancPluginOnChangeCallback;
3447 
3468  ORTHANC_PLUGIN_INLINE void OrthancPluginRegisterOnChangeCallback(
3469  OrthancPluginContext* context,
3471  {
3472  _OrthancPluginOnChangeCallback params;
3473  params.callback = callback;
3474 
3475  context->InvokeService(context, _OrthancPluginService_RegisterOnChangeCallback, &params);
3476  }
3477 
3478 
3479 
3480  typedef struct
3481  {
3482  const char* plugin;
3483  _OrthancPluginProperty property;
3484  const char* value;
3485  } _OrthancPluginSetPluginProperty;
3486 
3487 
3503  ORTHANC_PLUGIN_DEPRECATED ORTHANC_PLUGIN_INLINE void OrthancPluginSetRootUri(
3504  OrthancPluginContext* context,
3505  const char* uri)
3506  {
3507  _OrthancPluginSetPluginProperty params;
3508  params.plugin = OrthancPluginGetName();
3509  params.property = _OrthancPluginProperty_RootUri;
3510  params.value = uri;
3511 
3512  context->InvokeService(context, _OrthancPluginService_SetPluginProperty, &params);
3513  }
3514 
3515 
3528  ORTHANC_PLUGIN_INLINE void OrthancPluginSetRootUri2(
3529  OrthancPluginContext* context,
3530  const char* plugin,
3531  const char* uri)
3532  {
3533  _OrthancPluginSetPluginProperty params;
3534  params.plugin = plugin;
3535  params.property = _OrthancPluginProperty_RootUri;
3536  params.value = uri;
3537 
3538  context->InvokeService(context, _OrthancPluginService_SetPluginProperty, &params);
3539  }
3540 
3541 
3555  ORTHANC_PLUGIN_DEPRECATED ORTHANC_PLUGIN_INLINE void OrthancPluginSetDescription(
3556  OrthancPluginContext* context,
3557  const char* description)
3558  {
3559  _OrthancPluginSetPluginProperty params;
3560  params.plugin = OrthancPluginGetName();
3561  params.property = _OrthancPluginProperty_Description;
3562  params.value = description;
3563 
3564  context->InvokeService(context, _OrthancPluginService_SetPluginProperty, &params);
3565  }
3566 
3567 
3578  ORTHANC_PLUGIN_INLINE void OrthancPluginSetDescription2(
3579  OrthancPluginContext* context,
3580  const char* plugin,
3581  const char* description)
3582  {
3583  _OrthancPluginSetPluginProperty params;
3584  params.plugin = plugin;
3585  params.property = _OrthancPluginProperty_Description;
3586  params.value = description;
3587 
3588  context->InvokeService(context, _OrthancPluginService_SetPluginProperty, &params);
3589  }
3590 
3591 
3605  ORTHANC_PLUGIN_DEPRECATED ORTHANC_PLUGIN_INLINE void OrthancPluginExtendOrthancExplorer(
3606  OrthancPluginContext* context,
3607  const char* javascript)
3608  {
3609  _OrthancPluginSetPluginProperty params;
3610  params.plugin = OrthancPluginGetName();
3611  params.property = _OrthancPluginProperty_OrthancExplorer;
3612  params.value = javascript;
3613 
3614  context->InvokeService(context, _OrthancPluginService_SetPluginProperty, &params);
3615  }
3616 
3617 
3628  ORTHANC_PLUGIN_INLINE void OrthancPluginExtendOrthancExplorer2(
3629  OrthancPluginContext* context,
3630  const char* plugin,
3631  const char* javascript)
3632  {
3633  _OrthancPluginSetPluginProperty params;
3634  params.plugin = plugin;
3635  params.property = _OrthancPluginProperty_OrthancExplorer;
3636  params.value = javascript;
3637 
3638  context->InvokeService(context, _OrthancPluginService_SetPluginProperty, &params);
3639  }
3640 
3641 
3642  typedef struct
3643  {
3644  char** result;
3645  int32_t property;
3646  const char* value;
3647  } _OrthancPluginGlobalProperty;
3648 
3649 
3663  ORTHANC_PLUGIN_INLINE char* OrthancPluginGetGlobalProperty(
3664  OrthancPluginContext* context,
3665  int32_t property,
3666  const char* defaultValue)
3667  {
3668  char* result;
3669 
3670  _OrthancPluginGlobalProperty params;
3671  params.result = &result;
3672  params.property = property;
3673  params.value = defaultValue;
3674 
3675  if (context->InvokeService(context, _OrthancPluginService_GetGlobalProperty, &params) != OrthancPluginErrorCode_Success)
3676  {
3677  /* Error */
3678  return NULL;
3679  }
3680  else
3681  {
3682  return result;
3683  }
3684  }
3685 
3686 
3703  OrthancPluginContext* context,
3704  int32_t property,
3705  const char* value)
3706  {
3707  _OrthancPluginGlobalProperty params;
3708  params.result = NULL;
3709  params.property = property;
3710  params.value = value;
3711 
3712  return context->InvokeService(context, _OrthancPluginService_SetGlobalProperty, &params);
3713  }
3714 
3715 
3716 
3717  typedef struct
3718  {
3719  int32_t *resultInt32;
3720  uint32_t *resultUint32;
3721  int64_t *resultInt64;
3722  uint64_t *resultUint64;
3723  } _OrthancPluginReturnSingleValue;
3724 
3733  ORTHANC_PLUGIN_INLINE uint32_t OrthancPluginGetCommandLineArgumentsCount(
3734  OrthancPluginContext* context)
3735  {
3736  uint32_t count = 0;
3737 
3738  _OrthancPluginReturnSingleValue params;
3739  memset(&params, 0, sizeof(params));
3740  params.resultUint32 = &count;
3741 
3742  if (context->InvokeService(context, _OrthancPluginService_GetCommandLineArgumentsCount, &params) != OrthancPluginErrorCode_Success)
3743  {
3744  /* Error */
3745  return 0;
3746  }
3747  else
3748  {
3749  return count;
3750  }
3751  }
3752 
3753 
3754 
3767  ORTHANC_PLUGIN_INLINE char* OrthancPluginGetCommandLineArgument(
3768  OrthancPluginContext* context,
3769  uint32_t argument)
3770  {
3771  char* result;
3772 
3773  _OrthancPluginGlobalProperty params;
3774  params.result = &result;
3775  params.property = (int32_t) argument;
3776  params.value = NULL;
3777 
3778  if (context->InvokeService(context, _OrthancPluginService_GetCommandLineArgument, &params) != OrthancPluginErrorCode_Success)
3779  {
3780  /* Error */
3781  return NULL;
3782  }
3783  else
3784  {
3785  return result;
3786  }
3787  }
3788 
3789 
3799  ORTHANC_PLUGIN_INLINE uint32_t OrthancPluginGetExpectedDatabaseVersion(
3800  OrthancPluginContext* context)
3801  {
3802  uint32_t count = 0;
3803 
3804  _OrthancPluginReturnSingleValue params;
3805  memset(&params, 0, sizeof(params));
3806  params.resultUint32 = &count;
3807 
3808  if (context->InvokeService(context, _OrthancPluginService_GetExpectedDatabaseVersion, &params) != OrthancPluginErrorCode_Success)
3809  {
3810  /* Error */
3811  return 0;
3812  }
3813  else
3814  {
3815  return count;
3816  }
3817  }
3818 
3819 
3820 
3832  ORTHANC_PLUGIN_INLINE char *OrthancPluginGetConfiguration(OrthancPluginContext* context)
3833  {
3834  char* result;
3835 
3836  _OrthancPluginRetrieveDynamicString params;
3837  params.result = &result;
3838  params.argument = NULL;
3839 
3840  if (context->InvokeService(context, _OrthancPluginService_GetConfiguration, &params) != OrthancPluginErrorCode_Success)
3841  {
3842  /* Error */
3843  return NULL;
3844  }
3845  else
3846  {
3847  return result;
3848  }
3849  }
3850 
3851 
3852 
3853  typedef struct
3854  {
3855  OrthancPluginRestOutput* output;
3856  const char* subType;
3857  const char* contentType;
3858  } _OrthancPluginStartMultipartAnswer;
3859 
3874  OrthancPluginContext* context,
3875  OrthancPluginRestOutput* output,
3876  const char* subType,
3877  const char* contentType)
3878  {
3879  _OrthancPluginStartMultipartAnswer params;
3880  params.output = output;
3881  params.subType = subType;
3882  params.contentType = contentType;
3883  return context->InvokeService(context, _OrthancPluginService_StartMultipartAnswer, &params);
3884  }
3885 
3886 
3903  OrthancPluginContext* context,
3904  OrthancPluginRestOutput* output,
3905  const void* answer,
3906  uint32_t answerSize)
3907  {
3908  _OrthancPluginAnswerBuffer params;
3909  params.output = output;
3910  params.answer = answer;
3911  params.answerSize = answerSize;
3912  params.mimeType = NULL;
3913  return context->InvokeService(context, _OrthancPluginService_SendMultipartItem, &params);
3914  }
3915 
3916 
3917 
3918  typedef struct
3919  {
3920  OrthancPluginMemoryBuffer* target;
3921  const void* source;
3922  uint32_t size;
3923  OrthancPluginCompressionType compression;
3924  uint8_t uncompress;
3925  } _OrthancPluginBufferCompression;
3926 
3927 
3945  OrthancPluginContext* context,
3946  OrthancPluginMemoryBuffer* target,
3947  const void* source,
3948  uint32_t size,
3949  OrthancPluginCompressionType compression,
3950  uint8_t uncompress)
3951  {
3952  _OrthancPluginBufferCompression params;
3953  params.target = target;
3954  params.source = source;
3955  params.size = size;
3956  params.compression = compression;
3957  params.uncompress = uncompress;
3958 
3959  return context->InvokeService(context, _OrthancPluginService_BufferCompression, &params);
3960  }
3961 
3962 
3963 
3964  typedef struct
3965  {
3966  OrthancPluginMemoryBuffer* target;
3967  const char* path;
3968  } _OrthancPluginReadFile;
3969 
3982  OrthancPluginContext* context,
3983  OrthancPluginMemoryBuffer* target,
3984  const char* path)
3985  {
3986  _OrthancPluginReadFile params;
3987  params.target = target;
3988  params.path = path;
3989  return context->InvokeService(context, _OrthancPluginService_ReadFile, &params);
3990  }
3991 
3992 
3993 
3994  typedef struct
3995  {
3996  const char* path;
3997  const void* data;
3998  uint32_t size;
3999  } _OrthancPluginWriteFile;
4000 
4013  OrthancPluginContext* context,
4014  const char* path,
4015  const void* data,
4016  uint32_t size)
4017  {
4018  _OrthancPluginWriteFile params;
4019  params.path = path;
4020  params.data = data;
4021  params.size = size;
4022  return context->InvokeService(context, _OrthancPluginService_WriteFile, &params);
4023  }
4024 
4025 
4026 
4027  typedef struct
4028  {
4029  const char** target;
4030  OrthancPluginErrorCode error;
4031  } _OrthancPluginGetErrorDescription;
4032 
4043  ORTHANC_PLUGIN_INLINE const char* OrthancPluginGetErrorDescription(
4044  OrthancPluginContext* context,
4045  OrthancPluginErrorCode error)
4046  {
4047  const char* result = NULL;
4048 
4049  _OrthancPluginGetErrorDescription params;
4050  params.target = &result;
4051  params.error = error;
4052 
4053  if (context->InvokeService(context, _OrthancPluginService_GetErrorDescription, &params) != OrthancPluginErrorCode_Success ||
4054  result == NULL)
4055  {
4056  return "Unknown error code";
4057  }
4058  else
4059  {
4060  return result;
4061  }
4062  }
4063 
4064 
4065 
4066  typedef struct
4067  {
4068  OrthancPluginRestOutput* output;
4069  uint16_t status;
4070  const void* body;
4071  uint32_t bodySize;
4072  } _OrthancPluginSendHttpStatus;
4073 
4096  ORTHANC_PLUGIN_INLINE void OrthancPluginSendHttpStatus(
4097  OrthancPluginContext* context,
4098  OrthancPluginRestOutput* output,
4099  uint16_t status,
4100  const void* body,
4101  uint32_t bodySize)
4102  {
4103  _OrthancPluginSendHttpStatus params;
4104  params.output = output;
4105  params.status = status;
4106  params.body = body;
4107  params.bodySize = bodySize;
4108  context->InvokeService(context, _OrthancPluginService_SendHttpStatus, &params);
4109  }
4110 
4111 
4112 
4113  typedef struct
4114  {
4115  const OrthancPluginImage* image;
4116  uint32_t* resultUint32;
4117  OrthancPluginPixelFormat* resultPixelFormat;
4118  void** resultBuffer;
4119  } _OrthancPluginGetImageInfo;
4120 
4121 
4133  OrthancPluginContext* context,
4134  const OrthancPluginImage* image)
4135  {
4136  OrthancPluginPixelFormat target;
4137 
4138  _OrthancPluginGetImageInfo params;
4139  memset(&params, 0, sizeof(params));
4140  params.image = image;
4141  params.resultPixelFormat = &target;
4142 
4143  if (context->InvokeService(context, _OrthancPluginService_GetImagePixelFormat, &params) != OrthancPluginErrorCode_Success)
4144  {
4146  }
4147  else
4148  {
4149  return (OrthancPluginPixelFormat) target;
4150  }
4151  }
4152 
4153 
4154 
4165  ORTHANC_PLUGIN_INLINE uint32_t OrthancPluginGetImageWidth(
4166  OrthancPluginContext* context,
4167  const OrthancPluginImage* image)
4168  {
4169  uint32_t width;
4170 
4171  _OrthancPluginGetImageInfo params;
4172  memset(&params, 0, sizeof(params));
4173  params.image = image;
4174  params.resultUint32 = &width;
4175 
4176  if (context->InvokeService(context, _OrthancPluginService_GetImageWidth, &params) != OrthancPluginErrorCode_Success)
4177  {
4178  return 0;
4179  }
4180  else
4181  {
4182  return width;
4183  }
4184  }
4185 
4186 
4187 
4198  ORTHANC_PLUGIN_INLINE uint32_t OrthancPluginGetImageHeight(
4199  OrthancPluginContext* context,
4200  const OrthancPluginImage* image)
4201  {
4202  uint32_t height;
4203 
4204  _OrthancPluginGetImageInfo params;
4205  memset(&params, 0, sizeof(params));
4206  params.image = image;
4207  params.resultUint32 = &height;
4208 
4209  if (context->InvokeService(context, _OrthancPluginService_GetImageHeight, &params) != OrthancPluginErrorCode_Success)
4210  {
4211  return 0;
4212  }
4213  else
4214  {
4215  return height;
4216  }
4217  }
4218 
4219 
4220 
4233  ORTHANC_PLUGIN_INLINE uint32_t OrthancPluginGetImagePitch(
4234  OrthancPluginContext* context,
4235  const OrthancPluginImage* image)
4236  {
4237  uint32_t pitch;
4238 
4239  _OrthancPluginGetImageInfo params;
4240  memset(&params, 0, sizeof(params));
4241  params.image = image;
4242  params.resultUint32 = &pitch;
4243 
4244  if (context->InvokeService(context, _OrthancPluginService_GetImagePitch, &params) != OrthancPluginErrorCode_Success)
4245  {
4246  return 0;
4247  }
4248  else
4249  {
4250  return pitch;
4251  }
4252  }
4253 
4254 
4255 
4267  ORTHANC_PLUGIN_INLINE void* OrthancPluginGetImageBuffer(
4268  OrthancPluginContext* context,
4269  const OrthancPluginImage* image)
4270  {
4271  void* target = NULL;
4272 
4273  _OrthancPluginGetImageInfo params;
4274  memset(&params, 0, sizeof(params));
4275  params.resultBuffer = &target;
4276  params.image = image;
4277 
4278  if (context->InvokeService(context, _OrthancPluginService_GetImageBuffer, &params) != OrthancPluginErrorCode_Success)
4279  {
4280  return NULL;
4281  }
4282  else
4283  {
4284  return target;
4285  }
4286  }
4287 
4288 
4289  typedef struct
4290  {
4291  OrthancPluginImage** target;
4292  const void* data;
4293  uint32_t size;
4294  OrthancPluginImageFormat format;
4295  } _OrthancPluginUncompressImage;
4296 
4297 
4311  OrthancPluginContext* context,
4312  const void* data,
4313  uint32_t size,
4314  OrthancPluginImageFormat format)
4315  {
4316  OrthancPluginImage* target = NULL;
4317 
4318  _OrthancPluginUncompressImage params;
4319  memset(&params, 0, sizeof(params));
4320  params.target = &target;
4321  params.data = data;
4322  params.size = size;
4323  params.format = format;
4324 
4325  if (context->InvokeService(context, _OrthancPluginService_UncompressImage, &params) != OrthancPluginErrorCode_Success)
4326  {
4327  return NULL;
4328  }
4329  else
4330  {
4331  return target;
4332  }
4333  }
4334 
4335 
4336 
4337 
4338  typedef struct
4339  {
4340  OrthancPluginImage* image;
4341  } _OrthancPluginFreeImage;
4342 
4352  ORTHANC_PLUGIN_INLINE void OrthancPluginFreeImage(
4353  OrthancPluginContext* context,
4354  OrthancPluginImage* image)
4355  {
4356  _OrthancPluginFreeImage params;
4357  params.image = image;
4358 
4359  context->InvokeService(context, _OrthancPluginService_FreeImage, &params);
4360  }
4361 
4362 
4363 
4364 
4365  typedef struct
4366  {
4367  OrthancPluginMemoryBuffer* target;
4368  OrthancPluginImageFormat imageFormat;
4369  OrthancPluginPixelFormat pixelFormat;
4370  uint32_t width;
4371  uint32_t height;
4372  uint32_t pitch;
4373  const void* buffer;
4374  uint8_t quality;
4375  } _OrthancPluginCompressImage;
4376 
4377 
4398  OrthancPluginContext* context,
4399  OrthancPluginMemoryBuffer* target,
4400  OrthancPluginPixelFormat format,
4401  uint32_t width,
4402  uint32_t height,
4403  uint32_t pitch,
4404  const void* buffer)
4405  {
4406  _OrthancPluginCompressImage params;
4407  memset(&params, 0, sizeof(params));
4408  params.target = target;
4409  params.imageFormat = OrthancPluginImageFormat_Png;
4410  params.pixelFormat = format;
4411  params.width = width;
4412  params.height = height;
4413  params.pitch = pitch;
4414  params.buffer = buffer;
4415  params.quality = 0; /* Unused for PNG */
4416 
4417  return context->InvokeService(context, _OrthancPluginService_CompressImage, &params);
4418  }
4419 
4420 
4443  OrthancPluginContext* context,
4444  OrthancPluginMemoryBuffer* target,
4445  OrthancPluginPixelFormat format,
4446  uint32_t width,
4447  uint32_t height,
4448  uint32_t pitch,
4449  const void* buffer,
4450  uint8_t quality)
4451  {
4452  _OrthancPluginCompressImage params;
4453  memset(&params, 0, sizeof(params));
4454  params.target = target;
4455  params.imageFormat = OrthancPluginImageFormat_Jpeg;
4456  params.pixelFormat = format;
4457  params.width = width;
4458  params.height = height;
4459  params.pitch = pitch;
4460  params.buffer = buffer;
4461  params.quality = quality;
4462 
4463  return context->InvokeService(context, _OrthancPluginService_CompressImage, &params);
4464  }
4465 
4466 
4467 
4489  ORTHANC_PLUGIN_INLINE void OrthancPluginCompressAndAnswerJpegImage(
4490  OrthancPluginContext* context,
4491  OrthancPluginRestOutput* output,
4492  OrthancPluginPixelFormat format,
4493  uint32_t width,
4494  uint32_t height,
4495  uint32_t pitch,
4496  const void* buffer,
4497  uint8_t quality)
4498  {
4499  _OrthancPluginCompressAndAnswerImage params;
4500  params.output = output;
4501  params.imageFormat = OrthancPluginImageFormat_Jpeg;
4502  params.pixelFormat = format;
4503  params.width = width;
4504  params.height = height;
4505  params.pitch = pitch;
4506  params.buffer = buffer;
4507  params.quality = quality;
4508  context->InvokeService(context, _OrthancPluginService_CompressAndAnswerImage, &params);
4509  }
4510 
4511 
4512 
4513 
4514  typedef struct
4515  {
4516  OrthancPluginMemoryBuffer* target;
4517  OrthancPluginHttpMethod method;
4518  const char* url;
4519  const char* username;
4520  const char* password;
4521  const void* body;
4522  uint32_t bodySize;
4523  } _OrthancPluginCallHttpClient;
4524 
4525 
4543  OrthancPluginContext* context,
4544  OrthancPluginMemoryBuffer* target,
4545  const char* url,
4546  const char* username,
4547  const char* password)
4548  {
4549  _OrthancPluginCallHttpClient params;
4550  memset(&params, 0, sizeof(params));
4551 
4552  params.target = target;
4553  params.method = OrthancPluginHttpMethod_Get;
4554  params.url = url;
4555  params.username = username;
4556  params.password = password;
4557 
4558  return context->InvokeService(context, _OrthancPluginService_CallHttpClient, &params);
4559  }
4560 
4561 
4581  OrthancPluginContext* context,
4582  OrthancPluginMemoryBuffer* target,
4583  const char* url,
4584  const void* body,
4585  uint32_t bodySize,
4586  const char* username,
4587  const char* password)
4588  {
4589  _OrthancPluginCallHttpClient params;
4590  memset(&params, 0, sizeof(params));
4591 
4592  params.target = target;
4593  params.method = OrthancPluginHttpMethod_Post;
4594  params.url = url;
4595  params.body = body;
4596  params.bodySize = bodySize;
4597  params.username = username;
4598  params.password = password;
4599 
4600  return context->InvokeService(context, _OrthancPluginService_CallHttpClient, &params);
4601  }
4602 
4603 
4623  OrthancPluginContext* context,
4624  OrthancPluginMemoryBuffer* target,
4625  const char* url,
4626  const void* body,
4627  uint32_t bodySize,
4628  const char* username,
4629  const char* password)
4630  {
4631  _OrthancPluginCallHttpClient params;
4632  memset(&params, 0, sizeof(params));
4633 
4634  params.target = target;
4635  params.method = OrthancPluginHttpMethod_Put;
4636  params.url = url;
4637  params.body = body;
4638  params.bodySize = bodySize;
4639  params.username = username;
4640  params.password = password;
4641 
4642  return context->InvokeService(context, _OrthancPluginService_CallHttpClient, &params);
4643  }
4644 
4645 
4661  OrthancPluginContext* context,
4662  const char* url,
4663  const char* username,
4664  const char* password)
4665  {
4666  _OrthancPluginCallHttpClient params;
4667  memset(&params, 0, sizeof(params));
4668 
4669  params.method = OrthancPluginHttpMethod_Delete;
4670  params.url = url;
4671  params.username = username;
4672  params.password = password;
4673 
4674  return context->InvokeService(context, _OrthancPluginService_CallHttpClient, &params);
4675  }
4676 
4677 
4678 
4679  typedef struct
4680  {
4681  OrthancPluginImage** target;
4682  const OrthancPluginImage* source;
4683  OrthancPluginPixelFormat targetFormat;
4684  } _OrthancPluginConvertPixelFormat;
4685 
4686 
4699  OrthancPluginContext* context,
4700  const OrthancPluginImage* source,
4701  OrthancPluginPixelFormat targetFormat)
4702  {
4703  OrthancPluginImage* target = NULL;
4704 
4705  _OrthancPluginConvertPixelFormat params;
4706  params.target = &target;
4707  params.source = source;
4708  params.targetFormat = targetFormat;
4709 
4710  if (context->InvokeService(context, _OrthancPluginService_ConvertPixelFormat, &params) != OrthancPluginErrorCode_Success)
4711  {
4712  return NULL;
4713  }
4714  else
4715  {
4716  return target;
4717  }
4718  }
4719 
4720 
4721 
4733  ORTHANC_PLUGIN_INLINE uint32_t OrthancPluginGetFontsCount(
4734  OrthancPluginContext* context)
4735  {
4736  uint32_t count = 0;
4737 
4738  _OrthancPluginReturnSingleValue params;
4739  memset(&params, 0, sizeof(params));
4740  params.resultUint32 = &count;
4741 
4742  if (context->InvokeService(context, _OrthancPluginService_GetFontsCount, &params) != OrthancPluginErrorCode_Success)
4743  {
4744  /* Error */
4745  return 0;
4746  }
4747  else
4748  {
4749  return count;
4750  }
4751  }
4752 
4753 
4754 
4755 
4756  typedef struct
4757  {
4758  uint32_t fontIndex; /* in */
4759  const char** name; /* out */
4760  uint32_t* size; /* out */
4761  } _OrthancPluginGetFontInfo;
4762 
4773  ORTHANC_PLUGIN_INLINE const char* OrthancPluginGetFontName(
4774  OrthancPluginContext* context,
4775  uint32_t fontIndex)
4776  {
4777  const char* result = NULL;
4778 
4779  _OrthancPluginGetFontInfo params;
4780  memset(&params, 0, sizeof(params));
4781  params.name = &result;
4782  params.fontIndex = fontIndex;
4783 
4784  if (context->InvokeService(context, _OrthancPluginService_GetFontInfo, &params) != OrthancPluginErrorCode_Success)
4785  {
4786  return NULL;
4787  }
4788  else
4789  {
4790  return result;
4791  }
4792  }
4793 
4794 
4805  ORTHANC_PLUGIN_INLINE uint32_t OrthancPluginGetFontSize(
4806  OrthancPluginContext* context,
4807  uint32_t fontIndex)
4808  {
4809  uint32_t result;
4810 
4811  _OrthancPluginGetFontInfo params;
4812  memset(&params, 0, sizeof(params));
4813  params.size = &result;
4814  params.fontIndex = fontIndex;
4815 
4816  if (context->InvokeService(context, _OrthancPluginService_GetFontInfo, &params) != OrthancPluginErrorCode_Success)
4817  {
4818  return 0;
4819  }
4820  else
4821  {
4822  return result;
4823  }
4824  }
4825 
4826 
4827 
4828  typedef struct
4829  {
4830  OrthancPluginImage* image;
4831  uint32_t fontIndex;
4832  const char* utf8Text;
4833  int32_t x;
4834  int32_t y;
4835  uint8_t r;
4836  uint8_t g;
4837  uint8_t b;
4838  } _OrthancPluginDrawText;
4839 
4840 
4859  OrthancPluginContext* context,
4860  OrthancPluginImage* image,
4861  uint32_t fontIndex,
4862  const char* utf8Text,
4863  int32_t x,
4864  int32_t y,
4865  uint8_t r,
4866  uint8_t g,
4867  uint8_t b)
4868  {
4869  _OrthancPluginDrawText params;
4870  memset(&params, 0, sizeof(params));
4871  params.image = image;
4872  params.fontIndex = fontIndex;
4873  params.utf8Text = utf8Text;
4874  params.x = x;
4875  params.y = y;
4876  params.r = r;
4877  params.g = g;
4878  params.b = b;
4879 
4880  return context->InvokeService(context, _OrthancPluginService_DrawText, &params);
4881  }
4882 
4883 
4884 
4885  typedef struct
4886  {
4887  OrthancPluginStorageArea* storageArea;
4888  const char* uuid;
4889  const void* content;
4890  uint64_t size;
4892  } _OrthancPluginStorageAreaCreate;
4893 
4894 
4912  ORTHANC_PLUGIN_DEPRECATED ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginStorageAreaCreate(
4913  OrthancPluginContext* context,
4914  OrthancPluginStorageArea* storageArea,
4915  const char* uuid,
4916  const void* content,
4917  uint64_t size,
4919  {
4920  _OrthancPluginStorageAreaCreate params;
4921  params.storageArea = storageArea;
4922  params.uuid = uuid;
4923  params.content = content;
4924  params.size = size;
4925  params.type = type;
4926 
4927  return context->InvokeService(context, _OrthancPluginService_StorageAreaCreate, &params);
4928  }
4929 
4930 
4931  typedef struct
4932  {
4933  OrthancPluginMemoryBuffer* target;
4934  OrthancPluginStorageArea* storageArea;
4935  const char* uuid;
4937  } _OrthancPluginStorageAreaRead;
4938 
4939 
4956  ORTHANC_PLUGIN_DEPRECATED ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginStorageAreaRead(
4957  OrthancPluginContext* context,
4958  OrthancPluginMemoryBuffer* target,
4959  OrthancPluginStorageArea* storageArea,
4960  const char* uuid,
4962  {
4963  _OrthancPluginStorageAreaRead params;
4964  params.target = target;
4965  params.storageArea = storageArea;
4966  params.uuid = uuid;
4967  params.type = type;
4968 
4969  return context->InvokeService(context, _OrthancPluginService_StorageAreaRead, &params);
4970  }
4971 
4972 
4973  typedef struct
4974  {
4975  OrthancPluginStorageArea* storageArea;
4976  const char* uuid;
4978  } _OrthancPluginStorageAreaRemove;
4979 
4995  ORTHANC_PLUGIN_DEPRECATED ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginStorageAreaRemove(
4996  OrthancPluginContext* context,
4997  OrthancPluginStorageArea* storageArea,
4998  const char* uuid,
5000  {
5001  _OrthancPluginStorageAreaRemove params;
5002  params.storageArea = storageArea;
5003  params.uuid = uuid;
5004  params.type = type;
5005 
5006  return context->InvokeService(context, _OrthancPluginService_StorageAreaRemove, &params);
5007  }
5008 
5009 
5010 
5011  typedef struct
5012  {
5013  OrthancPluginErrorCode* target;
5014  int32_t code;
5015  uint16_t httpStatus;
5016  const char* message;
5017  } _OrthancPluginRegisterErrorCode;
5018 
5035  OrthancPluginContext* context,
5036  int32_t code,
5037  uint16_t httpStatus,
5038  const char* message)
5039  {
5040  OrthancPluginErrorCode target;
5041 
5042  _OrthancPluginRegisterErrorCode params;
5043  params.target = &target;
5044  params.code = code;
5045  params.httpStatus = httpStatus;
5046  params.message = message;
5047 
5048  if (context->InvokeService(context, _OrthancPluginService_RegisterErrorCode, &params) == OrthancPluginErrorCode_Success)
5049  {
5050  return target;
5051  }
5052  else
5053  {
5054  /* There was an error while assigned the error. Use a generic code. */
5056  }
5057  }
5058 
5059 
5060 
5061  typedef struct
5062  {
5063  uint16_t group;
5064  uint16_t element;
5066  const char* name;
5067  uint32_t minMultiplicity;
5068  uint32_t maxMultiplicity;
5069  } _OrthancPluginRegisterDictionaryTag;
5070 
5091  OrthancPluginContext* context,
5092  uint16_t group,
5093  uint16_t element,
5095  const char* name,
5096  uint32_t minMultiplicity,
5097  uint32_t maxMultiplicity)
5098  {
5099  _OrthancPluginRegisterDictionaryTag params;
5100  params.group = group;
5101  params.element = element;
5102  params.vr = vr;
5103  params.name = name;
5104  params.minMultiplicity = minMultiplicity;
5105  params.maxMultiplicity = maxMultiplicity;
5106 
5107  return context->InvokeService(context, _OrthancPluginService_RegisterDictionaryTag, &params);
5108  }
5109 
5110 
5111 
5112  typedef struct
5113  {
5114  uint16_t group;
5115  uint16_t element;
5117  const char* name;
5118  uint32_t minMultiplicity;
5119  uint32_t maxMultiplicity;
5120  const char* privateCreator;
5121  } _OrthancPluginRegisterPrivateDictionaryTag;
5122 
5144  OrthancPluginContext* context,
5145  uint16_t group,
5146  uint16_t element,
5148  const char* name,
5149  uint32_t minMultiplicity,
5150  uint32_t maxMultiplicity,
5151  const char* privateCreator)
5152  {
5153  _OrthancPluginRegisterPrivateDictionaryTag params;
5154  params.group = group;
5155  params.element = element;
5156  params.vr = vr;
5157  params.name = name;
5158  params.minMultiplicity = minMultiplicity;
5159  params.maxMultiplicity = maxMultiplicity;
5160  params.privateCreator = privateCreator;
5161 
5162  return context->InvokeService(context, _OrthancPluginService_RegisterPrivateDictionaryTag, &params);
5163  }
5164 
5165 
5166 
5167  typedef struct
5168  {
5169  OrthancPluginStorageArea* storageArea;
5171  } _OrthancPluginReconstructMainDicomTags;
5172 
5188  OrthancPluginContext* context,
5189  OrthancPluginStorageArea* storageArea,
5191  {
5192  _OrthancPluginReconstructMainDicomTags params;
5193  params.level = level;
5194  params.storageArea = storageArea;
5195 
5196  return context->InvokeService(context, _OrthancPluginService_ReconstructMainDicomTags, &params);
5197  }
5198 
5199 
5200  typedef struct
5201  {
5202  char** result;
5203  const char* instanceId;
5204  const void* buffer;
5205  uint32_t size;
5208  uint32_t maxStringLength;
5209  } _OrthancPluginDicomToJson;
5210 
5211 
5231  ORTHANC_PLUGIN_INLINE char* OrthancPluginDicomBufferToJson(
5232  OrthancPluginContext* context,
5233  const void* buffer,
5234  uint32_t size,
5237  uint32_t maxStringLength)
5238  {
5239  char* result;
5240 
5241  _OrthancPluginDicomToJson params;
5242  memset(&params, 0, sizeof(params));
5243  params.result = &result;
5244  params.buffer = buffer;
5245  params.size = size;
5246  params.format = format;
5247  params.flags = flags;
5248  params.maxStringLength = maxStringLength;
5249 
5250  if (context->InvokeService(context, _OrthancPluginService_DicomBufferToJson, &params) != OrthancPluginErrorCode_Success)
5251  {
5252  /* Error */
5253  return NULL;
5254  }
5255  else
5256  {
5257  return result;
5258  }
5259  }
5260 
5261 
5280  ORTHANC_PLUGIN_INLINE char* OrthancPluginDicomInstanceToJson(
5281  OrthancPluginContext* context,
5282  const char* instanceId,
5285  uint32_t maxStringLength)
5286  {
5287  char* result;
5288 
5289  _OrthancPluginDicomToJson params;
5290  memset(&params, 0, sizeof(params));
5291  params.result = &result;
5292  params.instanceId = instanceId;
5293  params.format = format;
5294  params.flags = flags;
5295  params.maxStringLength = maxStringLength;
5296 
5297  if (context->InvokeService(context, _OrthancPluginService_DicomInstanceToJson, &params) != OrthancPluginErrorCode_Success)
5298  {
5299  /* Error */
5300  return NULL;
5301  }
5302  else
5303  {
5304  return result;
5305  }
5306  }
5307 
5308 
5309  typedef struct
5310  {
5311  OrthancPluginMemoryBuffer* target;
5312  const char* uri;
5313  uint32_t headersCount;
5314  const char* const* headersKeys;
5315  const char* const* headersValues;
5316  int32_t afterPlugins;
5317  } _OrthancPluginRestApiGet2;
5318 
5339  OrthancPluginContext* context,
5340  OrthancPluginMemoryBuffer* target,
5341  const char* uri,
5342  uint32_t headersCount,
5343  const char* const* headersKeys,
5344  const char* const* headersValues,
5345  int32_t afterPlugins)
5346  {
5347  _OrthancPluginRestApiGet2 params;
5348  params.target = target;
5349  params.uri = uri;
5350  params.headersCount = headersCount;
5351  params.headersKeys = headersKeys;
5352  params.headersValues = headersValues;
5353  params.afterPlugins = afterPlugins;
5354 
5355  return context->InvokeService(context, _OrthancPluginService_RestApiGet2, &params);
5356  }
5357 
5358 
5359 
5360  typedef struct
5361  {
5363  } _OrthancPluginWorklistCallback;
5364 
5377  OrthancPluginContext* context,
5379  {
5380  _OrthancPluginWorklistCallback params;
5381  params.callback = callback;
5382 
5383  return context->InvokeService(context, _OrthancPluginService_RegisterWorklistCallback, &params);
5384  }
5385 
5386 
5387 
5388  typedef struct
5389  {
5391  const OrthancPluginWorklistQuery* query;
5392  const void* dicom;
5393  uint32_t size;
5394  } _OrthancPluginWorklistAnswersOperation;
5395 
5413  OrthancPluginContext* context,
5415  const OrthancPluginWorklistQuery* query,
5416  const void* dicom,
5417  uint32_t size)
5418  {
5419  _OrthancPluginWorklistAnswersOperation params;
5420  params.answers = answers;
5421  params.query = query;
5422  params.dicom = dicom;
5423  params.size = size;
5424 
5425  return context->InvokeService(context, _OrthancPluginService_WorklistAddAnswer, &params);
5426  }
5427 
5428 
5443  OrthancPluginContext* context,
5445  {
5446  _OrthancPluginWorklistAnswersOperation params;
5447  params.answers = answers;
5448  params.query = NULL;
5449  params.dicom = NULL;
5450  params.size = 0;
5451 
5452  return context->InvokeService(context, _OrthancPluginService_WorklistMarkIncomplete, &params);
5453  }
5454 
5455 
5456  typedef struct
5457  {
5458  const OrthancPluginWorklistQuery* query;
5459  const void* dicom;
5460  uint32_t size;
5461  int32_t* isMatch;
5462  OrthancPluginMemoryBuffer* target;
5463  } _OrthancPluginWorklistQueryOperation;
5464 
5480  ORTHANC_PLUGIN_INLINE int32_t OrthancPluginWorklistIsMatch(
5481  OrthancPluginContext* context,
5482  const OrthancPluginWorklistQuery* query,
5483  const void* dicom,
5484  uint32_t size)
5485  {
5486  int32_t isMatch = 0;
5487 
5488  _OrthancPluginWorklistQueryOperation params;
5489  params.query = query;
5490  params.dicom = dicom;
5491  params.size = size;
5492  params.isMatch = &isMatch;
5493  params.target = NULL;
5494 
5495  if (context->InvokeService(context, _OrthancPluginService_WorklistIsMatch, &params) == OrthancPluginErrorCode_Success)
5496  {
5497  return isMatch;
5498  }
5499  else
5500  {
5501  /* Error: Assume non-match */
5502  return 0;
5503  }
5504  }
5505 
5506 
5520  OrthancPluginContext* context,
5521  OrthancPluginMemoryBuffer* target,
5522  const OrthancPluginWorklistQuery* query)
5523  {
5524  _OrthancPluginWorklistQueryOperation params;
5525  params.query = query;
5526  params.dicom = NULL;
5527  params.size = 0;
5528  params.isMatch = NULL;
5529  params.target = target;
5530 
5531  return context->InvokeService(context, _OrthancPluginService_WorklistGetDicomQuery, &params);
5532  }
5533 
5534 
5546  OrthancPluginContext* context,
5547  const OrthancPluginDicomInstance* instance)
5548  {
5550 
5551  _OrthancPluginAccessDicomInstance params;
5552  memset(&params, 0, sizeof(params));
5553  params.resultOrigin = &origin;
5554  params.instance = instance;
5555 
5556  if (context->InvokeService(context, _OrthancPluginService_GetInstanceOrigin, &params) != OrthancPluginErrorCode_Success)
5557  {
5558  /* Error */
5560  }
5561  else
5562  {
5563  return origin;
5564  }
5565  }
5566 
5567 
5568  typedef struct
5569  {
5570  OrthancPluginMemoryBuffer* target;
5571  const char* json;
5572  const OrthancPluginImage* pixelData;
5574  } _OrthancPluginCreateDicom;
5575 
5602  OrthancPluginContext* context,
5603  OrthancPluginMemoryBuffer* target,
5604  const char* json,
5605  const OrthancPluginImage* pixelData,
5607  {
5608  _OrthancPluginCreateDicom params;
5609  params.target = target;
5610  params.json = json;
5611  params.pixelData = pixelData;
5612  params.flags = flags;
5613 
5614  return context->InvokeService(context, _OrthancPluginService_CreateDicom, &params);
5615  }
5616 
5617 
5618  typedef struct
5619  {
5621  } _OrthancPluginDecodeImageCallback;
5622 
5638  OrthancPluginContext* context,
5640  {
5641  _OrthancPluginDecodeImageCallback params;
5642  params.callback = callback;
5643 
5644  return context->InvokeService(context, _OrthancPluginService_RegisterDecodeImageCallback, &params);
5645  }
5646 
5647 
5648 
5649  typedef struct
5650  {
5651  OrthancPluginImage** target;
5652  OrthancPluginPixelFormat format;
5653  uint32_t width;
5654  uint32_t height;
5655  uint32_t pitch;
5656  void* buffer;
5657  const void* constBuffer;
5658  uint32_t bufferSize;
5659  uint32_t frameIndex;
5660  } _OrthancPluginCreateImage;
5661 
5662 
5676  OrthancPluginContext* context,
5677  OrthancPluginPixelFormat format,
5678  uint32_t width,
5679  uint32_t height)
5680  {
5681  OrthancPluginImage* target = NULL;
5682 
5683  _OrthancPluginCreateImage params;
5684  memset(&params, 0, sizeof(params));
5685  params.target = &target;
5686  params.format = format;
5687  params.width = width;
5688  params.height = height;
5689 
5690  if (context->InvokeService(context, _OrthancPluginService_CreateImage, &params) != OrthancPluginErrorCode_Success)
5691  {
5692  return NULL;
5693  }
5694  else
5695  {
5696  return target;
5697  }
5698  }
5699 
5700 
5719  OrthancPluginContext* context,
5720  OrthancPluginPixelFormat format,
5721  uint32_t width,
5722  uint32_t height,
5723  uint32_t pitch,
5724  void* buffer)
5725  {
5726  OrthancPluginImage* target = NULL;
5727 
5728  _OrthancPluginCreateImage params;
5729  memset(&params, 0, sizeof(params));
5730  params.target = &target;
5731  params.format = format;
5732  params.width = width;
5733  params.height = height;
5734  params.pitch = pitch;
5735  params.buffer = buffer;
5736 
5737  if (context->InvokeService(context, _OrthancPluginService_CreateImageAccessor, &params) != OrthancPluginErrorCode_Success)
5738  {
5739  return NULL;
5740  }
5741  else
5742  {
5743  return target;
5744  }
5745  }
5746 
5747 
5748 
5765  OrthancPluginContext* context,
5766  const void* buffer,
5767  uint32_t bufferSize,
5768  uint32_t frameIndex)
5769  {
5770  OrthancPluginImage* target = NULL;
5771 
5772  _OrthancPluginCreateImage params;
5773  memset(&params, 0, sizeof(params));
5774  params.target = &target;
5775  params.constBuffer = buffer;
5776  params.bufferSize = bufferSize;
5777  params.frameIndex = frameIndex;
5778 
5779  if (context->InvokeService(context, _OrthancPluginService_DecodeDicomImage, &params) != OrthancPluginErrorCode_Success)
5780  {
5781  return NULL;
5782  }
5783  else
5784  {
5785  return target;
5786  }
5787  }
5788 
5789 
5790 
5791  typedef struct
5792  {
5793  char** result;
5794  const void* buffer;
5795  uint32_t size;
5796  } _OrthancPluginComputeHash;
5797 
5810  ORTHANC_PLUGIN_INLINE char* OrthancPluginComputeMd5(
5811  OrthancPluginContext* context,
5812  const void* buffer,
5813  uint32_t size)
5814  {
5815  char* result;
5816 
5817  _OrthancPluginComputeHash params;
5818  params.result = &result;
5819  params.buffer = buffer;
5820  params.size = size;
5821 
5822  if (context->InvokeService(context, _OrthancPluginService_ComputeMd5, &params) != OrthancPluginErrorCode_Success)
5823  {
5824  /* Error */
5825  return NULL;
5826  }
5827  else
5828  {
5829  return result;
5830  }
5831  }
5832 
5833 
5846  ORTHANC_PLUGIN_INLINE char* OrthancPluginComputeSha1(
5847  OrthancPluginContext* context,
5848  const void* buffer,
5849  uint32_t size)
5850  {
5851  char* result;
5852 
5853  _OrthancPluginComputeHash params;
5854  params.result = &result;
5855  params.buffer = buffer;
5856  params.size = size;
5857 
5858  if (context->InvokeService(context, _OrthancPluginService_ComputeSha1, &params) != OrthancPluginErrorCode_Success)
5859  {
5860  /* Error */
5861  return NULL;
5862  }
5863  else
5864  {
5865  return result;
5866  }
5867  }
5868 
5869 
5870 
5871  typedef struct
5872  {
5874  const char* name;
5875  } _OrthancPluginLookupDictionary;
5876 
5893  OrthancPluginContext* context,
5895  const char* name)
5896  {
5897  _OrthancPluginLookupDictionary params;
5898  params.target = target;
5899  params.name = name;
5900  return context->InvokeService(context, _OrthancPluginService_LookupDictionary, &params);
5901  }
5902 
5903 
5904 
5905  typedef struct
5906  {
5907  OrthancPluginRestOutput* output;
5908  const void* answer;
5909  uint32_t answerSize;
5910  uint32_t headersCount;
5911  const char* const* headersKeys;
5912  const char* const* headersValues;
5913  } _OrthancPluginSendMultipartItem2;
5914 
5936  OrthancPluginContext* context,
5937  OrthancPluginRestOutput* output,
5938  const void* answer,
5939  uint32_t answerSize,
5940  uint32_t headersCount,
5941  const char* const* headersKeys,
5942  const char* const* headersValues)
5943  {
5944  _OrthancPluginSendMultipartItem2 params;
5945  params.output = output;
5946  params.answer = answer;
5947  params.answerSize = answerSize;
5948  params.headersCount = headersCount;
5949  params.headersKeys = headersKeys;
5950  params.headersValues = headersValues;
5951 
5952  return context->InvokeService(context, _OrthancPluginService_SendMultipartItem2, &params);
5953  }
5954 
5955 
5956  typedef struct
5957  {
5959  } _OrthancPluginIncomingHttpRequestFilter;
5960 
5973  ORTHANC_PLUGIN_DEPRECATED ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRegisterIncomingHttpRequestFilter(
5974  OrthancPluginContext* context,
5976  {
5977  _OrthancPluginIncomingHttpRequestFilter params;
5978  params.callback = callback;
5979 
5980  return context->InvokeService(context, _OrthancPluginService_RegisterIncomingHttpRequestFilter, &params);
5981  }
5982 
5983 
5984 
5985  typedef struct
5986  {
5987  OrthancPluginMemoryBuffer* answerBody;
5988  OrthancPluginMemoryBuffer* answerHeaders;
5989  uint16_t* httpStatus;
5990  OrthancPluginHttpMethod method;
5991  const char* url;
5992  uint32_t headersCount;
5993  const char* const* headersKeys;
5994  const char* const* headersValues;
5995  const void* body;
5996  uint32_t bodySize;
5997  const char* username;
5998  const char* password;
5999  uint32_t timeout;
6000  const char* certificateFile;
6001  const char* certificateKeyFile;
6002  const char* certificateKeyPassword;
6003  uint8_t pkcs11;
6004  } _OrthancPluginCallHttpClient2;
6005 
6006 
6007 
6049  OrthancPluginContext* context,
6050  OrthancPluginMemoryBuffer* answerBody,
6051  OrthancPluginMemoryBuffer* answerHeaders,
6052  uint16_t* httpStatus,
6053  OrthancPluginHttpMethod method,
6054  const char* url,
6055  uint32_t headersCount,
6056  const char* const* headersKeys,
6057  const char* const* headersValues,
6058  const void* body,
6059  uint32_t bodySize,
6060  const char* username,
6061  const char* password,
6062  uint32_t timeout,
6063  const char* certificateFile,
6064  const char* certificateKeyFile,
6065  const char* certificateKeyPassword,
6066  uint8_t pkcs11)
6067  {
6068  _OrthancPluginCallHttpClient2 params;
6069  memset(&params, 0, sizeof(params));
6070 
6071  params.answerBody = answerBody;
6072  params.answerHeaders = answerHeaders;
6073  params.httpStatus = httpStatus;
6074  params.method = method;
6075  params.url = url;
6076  params.headersCount = headersCount;
6077  params.headersKeys = headersKeys;
6078  params.headersValues = headersValues;
6079  params.body = body;
6080  params.bodySize = bodySize;
6081  params.username = username;
6082  params.password = password;
6083  params.timeout = timeout;
6084  params.certificateFile = certificateFile;
6085  params.certificateKeyFile = certificateKeyFile;
6086  params.certificateKeyPassword = certificateKeyPassword;
6087  params.pkcs11 = pkcs11;
6088 
6089  return context->InvokeService(context, _OrthancPluginService_CallHttpClient2, &params);
6090  }
6091 
6092 
6103  ORTHANC_PLUGIN_INLINE char* OrthancPluginGenerateUuid(
6104  OrthancPluginContext* context)
6105  {
6106  char* result;
6107 
6108  _OrthancPluginRetrieveDynamicString params;
6109  params.result = &result;
6110  params.argument = NULL;
6111 
6112  if (context->InvokeService(context, _OrthancPluginService_GenerateUuid, &params) != OrthancPluginErrorCode_Success)
6113  {
6114  /* Error */
6115  return NULL;
6116  }
6117  else
6118  {
6119  return result;
6120  }
6121  }
6122 
6123 
6124 
6125 
6126  typedef struct
6127  {
6128  OrthancPluginFindCallback callback;
6129  } _OrthancPluginFindCallback;
6130 
6143  OrthancPluginContext* context,
6144  OrthancPluginFindCallback callback)
6145  {
6146  _OrthancPluginFindCallback params;
6147  params.callback = callback;
6148 
6149  return context->InvokeService(context, _OrthancPluginService_RegisterFindCallback, &params);
6150  }
6151 
6152 
6153  typedef struct
6154  {
6155  OrthancPluginFindAnswers *answers;
6156  const OrthancPluginFindQuery *query;
6157  const void *dicom;
6158  uint32_t size;
6159  uint32_t index;
6160  uint32_t *resultUint32;
6161  uint16_t *resultGroup;
6162  uint16_t *resultElement;
6163  char **resultString;
6164  } _OrthancPluginFindOperation;
6165 
6182  OrthancPluginContext* context,
6183  OrthancPluginFindAnswers* answers,
6184  const void* dicom,
6185  uint32_t size)
6186  {
6187  _OrthancPluginFindOperation params;
6188  memset(&params, 0, sizeof(params));
6189  params.answers = answers;
6190  params.dicom = dicom;
6191  params.size = size;
6192 
6193  return context->InvokeService(context, _OrthancPluginService_FindAddAnswer, &params);
6194  }
6195 
6196 
6211  OrthancPluginContext* context,
6212  OrthancPluginFindAnswers* answers)
6213  {
6214  _OrthancPluginFindOperation params;
6215  memset(&params, 0, sizeof(params));
6216  params.answers = answers;
6217 
6218  return context->InvokeService(context, _OrthancPluginService_FindMarkIncomplete, &params);
6219  }
6220 
6221 
6222 
6234  ORTHANC_PLUGIN_INLINE uint32_t OrthancPluginGetFindQuerySize(
6235  OrthancPluginContext* context,
6236  const OrthancPluginFindQuery* query)
6237  {
6238  uint32_t count = 0;
6239 
6240  _OrthancPluginFindOperation params;
6241  memset(&params, 0, sizeof(params));
6242  params.query = query;
6243  params.resultUint32 = &count;
6244 
6245  if (context->InvokeService(context, _OrthancPluginService_GetFindQuerySize, &params) != OrthancPluginErrorCode_Success)
6246  {
6247  /* Error */
6248  return 0;
6249  }
6250  else
6251  {
6252  return count;
6253  }
6254  }
6255 
6256 
6272  OrthancPluginContext* context,
6273  uint16_t* group,
6274  uint16_t* element,
6275  const OrthancPluginFindQuery* query,
6276  uint32_t index)
6277  {
6278  _OrthancPluginFindOperation params;
6279  memset(&params, 0, sizeof(params));
6280  params.query = query;
6281  params.index = index;
6282  params.resultGroup = group;
6283  params.resultElement = element;
6284 
6285  return context->InvokeService(context, _OrthancPluginService_GetFindQueryTag, &params);
6286  }
6287 
6288 
6302  ORTHANC_PLUGIN_INLINE char* OrthancPluginGetFindQueryTagName(
6303  OrthancPluginContext* context,
6304  const OrthancPluginFindQuery* query,
6305  uint32_t index)
6306  {
6307  char* result;
6308 
6309  _OrthancPluginFindOperation params;
6310  memset(&params, 0, sizeof(params));
6311  params.query = query;
6312  params.index = index;
6313  params.resultString = &result;
6314 
6315  if (context->InvokeService(context, _OrthancPluginService_GetFindQueryTagName, &params) != OrthancPluginErrorCode_Success)
6316  {
6317  /* Error */
6318  return NULL;
6319  }
6320  else
6321  {
6322  return result;
6323  }
6324  }
6325 
6326 
6340  ORTHANC_PLUGIN_INLINE char* OrthancPluginGetFindQueryValue(
6341  OrthancPluginContext* context,
6342  const OrthancPluginFindQuery* query,
6343  uint32_t index)
6344  {
6345  char* result;
6346 
6347  _OrthancPluginFindOperation params;
6348  memset(&params, 0, sizeof(params));
6349  params.query = query;
6350  params.index = index;
6351  params.resultString = &result;
6352 
6353  if (context->InvokeService(context, _OrthancPluginService_GetFindQueryValue, &params) != OrthancPluginErrorCode_Success)
6354  {
6355  /* Error */
6356  return NULL;
6357  }
6358  else
6359  {
6360  return result;
6361  }
6362  }
6363 
6364 
6365 
6366 
6367  typedef struct
6368  {
6369  OrthancPluginMoveCallback callback;
6370  OrthancPluginGetMoveSize getMoveSize;
6371  OrthancPluginApplyMove applyMove;
6372  OrthancPluginFreeMove freeMove;
6373  } _OrthancPluginMoveCallback;
6374 
6389  OrthancPluginContext* context,
6390  OrthancPluginMoveCallback callback,
6391  OrthancPluginGetMoveSize getMoveSize,
6392  OrthancPluginApplyMove applyMove,
6393  OrthancPluginFreeMove freeMove)
6394  {
6395  _OrthancPluginMoveCallback params;
6396  params.callback = callback;
6397  params.getMoveSize = getMoveSize;
6398  params.applyMove = applyMove;
6399  params.freeMove = freeMove;
6400 
6401  return context->InvokeService(context, _OrthancPluginService_RegisterMoveCallback, &params);
6402  }
6403 
6404 
6405 
6406  typedef struct
6407  {
6408  OrthancPluginFindMatcher** target;
6409  const void* query;
6410  uint32_t size;
6411  } _OrthancPluginCreateFindMatcher;
6412 
6413 
6428  OrthancPluginContext* context,
6429  const void* query,
6430  uint32_t size)
6431  {
6432  OrthancPluginFindMatcher* target = NULL;
6433 
6434  _OrthancPluginCreateFindMatcher params;
6435  memset(&params, 0, sizeof(params));
6436  params.target = &target;
6437  params.query = query;
6438  params.size = size;
6439 
6440  if (context->InvokeService(context, _OrthancPluginService_CreateFindMatcher, &params) != OrthancPluginErrorCode_Success)
6441  {
6442  return NULL;
6443  }
6444  else
6445  {
6446  return target;
6447  }
6448  }
6449 
6450 
6451  typedef struct
6452  {
6453  OrthancPluginFindMatcher* matcher;
6454  } _OrthancPluginFreeFindMatcher;
6455 
6465  ORTHANC_PLUGIN_INLINE void OrthancPluginFreeFindMatcher(
6466  OrthancPluginContext* context,
6467  OrthancPluginFindMatcher* matcher)
6468  {
6469  _OrthancPluginFreeFindMatcher params;
6470  params.matcher = matcher;
6471 
6472  context->InvokeService(context, _OrthancPluginService_FreeFindMatcher, &params);
6473  }
6474 
6475 
6476  typedef struct
6477  {
6478  const OrthancPluginFindMatcher* matcher;
6479  const void* dicom;
6480  uint32_t size;
6481  int32_t* isMatch;
6482  } _OrthancPluginFindMatcherIsMatch;
6483 
6498  ORTHANC_PLUGIN_INLINE int32_t OrthancPluginFindMatcherIsMatch(
6499  OrthancPluginContext* context,
6500  const OrthancPluginFindMatcher* matcher,
6501  const void* dicom,
6502  uint32_t size)
6503  {
6504  int32_t isMatch = 0;
6505 
6506  _OrthancPluginFindMatcherIsMatch params;
6507  params.matcher = matcher;
6508  params.dicom = dicom;
6509  params.size = size;
6510  params.isMatch = &isMatch;
6511 
6512  if (context->InvokeService(context, _OrthancPluginService_FindMatcherIsMatch, &params) == OrthancPluginErrorCode_Success)
6513  {
6514  return isMatch;
6515  }
6516  else
6517  {
6518  /* Error: Assume non-match */
6519  return 0;
6520  }
6521  }
6522 
6523 
6524  typedef struct
6525  {
6527  } _OrthancPluginIncomingHttpRequestFilter2;
6528 
6541  OrthancPluginContext* context,
6543  {
6544  _OrthancPluginIncomingHttpRequestFilter2 params;
6545  params.callback = callback;
6546 
6547  return context->InvokeService(context, _OrthancPluginService_RegisterIncomingHttpRequestFilter2, &params);
6548  }
6549 
6550 
6551 
6552  typedef struct
6553  {
6554  OrthancPluginPeers** peers;
6555  } _OrthancPluginGetPeers;
6556 
6569  OrthancPluginContext* context)
6570  {
6571  OrthancPluginPeers* peers = NULL;
6572 
6573  _OrthancPluginGetPeers params;
6574  memset(&params, 0, sizeof(params));
6575  params.peers = &peers;
6576 
6577  if (context->InvokeService(context, _OrthancPluginService_GetPeers, &params) != OrthancPluginErrorCode_Success)
6578  {
6579  return NULL;
6580  }
6581  else
6582  {
6583  return peers;
6584  }
6585  }
6586 
6587 
6588  typedef struct
6589  {
6590  OrthancPluginPeers* peers;
6591  } _OrthancPluginFreePeers;
6592 
6602  ORTHANC_PLUGIN_INLINE void OrthancPluginFreePeers(
6603  OrthancPluginContext* context,
6604  OrthancPluginPeers* peers)
6605  {
6606  _OrthancPluginFreePeers params;
6607  params.peers = peers;
6608 
6609  context->InvokeService(context, _OrthancPluginService_FreePeers, &params);
6610  }
6611 
6612 
6613  typedef struct
6614  {
6615  uint32_t* target;
6616  const OrthancPluginPeers* peers;
6617  } _OrthancPluginGetPeersCount;
6618 
6632  ORTHANC_PLUGIN_INLINE uint32_t OrthancPluginGetPeersCount(
6633  OrthancPluginContext* context,
6634  const OrthancPluginPeers* peers)
6635  {
6636  uint32_t target = 0;
6637 
6638  _OrthancPluginGetPeersCount params;
6639  memset(&params, 0, sizeof(params));
6640  params.target = &target;
6641  params.peers = peers;
6642 
6643  if (context->InvokeService(context, _OrthancPluginService_GetPeersCount, &params) != OrthancPluginErrorCode_Success)
6644  {
6645  /* Error */
6646  return 0;
6647  }
6648  else
6649  {
6650  return target;
6651  }
6652  }
6653 
6654 
6655  typedef struct
6656  {
6657  const char** target;
6658  const OrthancPluginPeers* peers;
6659  uint32_t peerIndex;
6660  const char* userProperty;
6661  } _OrthancPluginGetPeerProperty;
6662 
6680  ORTHANC_PLUGIN_INLINE const char* OrthancPluginGetPeerName(
6681  OrthancPluginContext* context,
6682  const OrthancPluginPeers* peers,
6683  uint32_t peerIndex)
6684  {
6685  const char* target = NULL;
6686 
6687  _OrthancPluginGetPeerProperty params;
6688  memset(&params, 0, sizeof(params));
6689  params.target = &target;
6690  params.peers = peers;
6691  params.peerIndex = peerIndex;
6692  params.userProperty = NULL;
6693 
6694  if (context->InvokeService(context, _OrthancPluginService_GetPeerName, &params) != OrthancPluginErrorCode_Success)
6695  {
6696  /* Error */
6697  return NULL;
6698  }
6699  else
6700  {
6701  return target;
6702  }
6703  }
6704 
6705 
6721  ORTHANC_PLUGIN_INLINE const char* OrthancPluginGetPeerUrl(
6722  OrthancPluginContext* context,
6723  const OrthancPluginPeers* peers,
6724  uint32_t peerIndex)
6725  {
6726  const char* target = NULL;
6727 
6728  _OrthancPluginGetPeerProperty params;
6729  memset(&params, 0, sizeof(params));
6730  params.target = &target;
6731  params.peers = peers;
6732  params.peerIndex = peerIndex;
6733  params.userProperty = NULL;
6734 
6735  if (context->InvokeService(context, _OrthancPluginService_GetPeerUrl, &params) != OrthancPluginErrorCode_Success)
6736  {
6737  /* Error */
6738  return NULL;
6739  }
6740  else
6741  {
6742  return target;
6743  }
6744  }
6745 
6746 
6747 
6767  ORTHANC_PLUGIN_INLINE const char* OrthancPluginGetPeerUserProperty(
6768  OrthancPluginContext* context,
6769  const OrthancPluginPeers* peers,
6770  uint32_t peerIndex,
6771  const char* userProperty)
6772  {
6773  const char* target = NULL;
6774 
6775  _OrthancPluginGetPeerProperty params;
6776  memset(&params, 0, sizeof(params));
6777  params.target = &target;
6778  params.peers = peers;
6779  params.peerIndex = peerIndex;
6780  params.userProperty = userProperty;
6781 
6782  if (context->InvokeService(context, _OrthancPluginService_GetPeerUserProperty, &params) != OrthancPluginErrorCode_Success)
6783  {
6784  /* No such user property */
6785  return NULL;
6786  }
6787  else
6788  {
6789  return target;
6790  }
6791  }
6792 
6793 
6794 
6795  typedef struct
6796  {
6797  OrthancPluginMemoryBuffer* answerBody;
6798  OrthancPluginMemoryBuffer* answerHeaders;
6799  uint16_t* httpStatus;
6800  const OrthancPluginPeers* peers;
6801  uint32_t peerIndex;
6802  OrthancPluginHttpMethod method;
6803  const char* uri;
6804  uint32_t additionalHeadersCount;
6805  const char* const* additionalHeadersKeys;
6806  const char* const* additionalHeadersValues;
6807  const void* body;
6808  uint32_t bodySize;
6809  uint32_t timeout;
6810  } _OrthancPluginCallPeerApi;
6811 
6849  OrthancPluginContext* context,
6850  OrthancPluginMemoryBuffer* answerBody,
6851  OrthancPluginMemoryBuffer* answerHeaders,
6852  uint16_t* httpStatus,
6853  const OrthancPluginPeers* peers,
6854  uint32_t peerIndex,
6855  OrthancPluginHttpMethod method,
6856  const char* uri,
6857  uint32_t additionalHeadersCount,
6858  const char* const* additionalHeadersKeys,
6859  const char* const* additionalHeadersValues,
6860  const void* body,
6861  uint32_t bodySize,
6862  uint32_t timeout)
6863  {
6864  _OrthancPluginCallPeerApi params;
6865  memset(&params, 0, sizeof(params));
6866 
6867  params.answerBody = answerBody;
6868  params.answerHeaders = answerHeaders;
6869  params.httpStatus = httpStatus;
6870  params.peers = peers;
6871  params.peerIndex = peerIndex;
6872  params.method = method;
6873  params.uri = uri;
6874  params.additionalHeadersCount = additionalHeadersCount;
6875  params.additionalHeadersKeys = additionalHeadersKeys;
6876  params.additionalHeadersValues = additionalHeadersValues;
6877  params.body = body;
6878  params.bodySize = bodySize;
6879  params.timeout = timeout;
6880 
6881  return context->InvokeService(context, _OrthancPluginService_CallPeerApi, &params);
6882  }
6883 
6884 
6885 
6886 
6887 
6888  typedef struct
6889  {
6890  OrthancPluginJob** target;
6891  void *job;
6892  OrthancPluginJobFinalize finalize;
6893  const char *type;
6894  OrthancPluginJobGetProgress getProgress;
6895  OrthancPluginJobGetContent getContent;
6896  OrthancPluginJobGetSerialized getSerialized;
6897  OrthancPluginJobStep step;
6898  OrthancPluginJobStop stop;
6899  OrthancPluginJobReset reset;
6900  } _OrthancPluginCreateJob;
6901 
6934  ORTHANC_PLUGIN_DEPRECATED ORTHANC_PLUGIN_INLINE OrthancPluginJob *OrthancPluginCreateJob(
6935  OrthancPluginContext *context,
6936  void *job,
6937  OrthancPluginJobFinalize finalize,
6938  const char *type,
6939  OrthancPluginJobGetProgress getProgress,
6940  OrthancPluginJobGetContent getContent,
6941  OrthancPluginJobGetSerialized getSerialized,
6942  OrthancPluginJobStep step,
6943  OrthancPluginJobStop stop,
6944  OrthancPluginJobReset reset)
6945  {
6946  OrthancPluginJob* target = NULL;
6947 
6948  _OrthancPluginCreateJob params;
6949  memset(&params, 0, sizeof(params));
6950 
6951  params.target = &target;
6952  params.job = job;
6953  params.finalize = finalize;
6954  params.type = type;
6955  params.getProgress = getProgress;
6956  params.getContent = getContent;
6957  params.getSerialized = getSerialized;
6958  params.step = step;
6959  params.stop = stop;
6960  params.reset = reset;
6961 
6962  if (context->InvokeService(context, _OrthancPluginService_CreateJob, &params) != OrthancPluginErrorCode_Success ||
6963  target == NULL)
6964  {
6965  /* Error */
6966  return NULL;
6967  }
6968  else
6969  {
6970  return target;
6971  }
6972  }
6973 
6974 
6975  typedef struct
6976  {
6977  OrthancPluginJob** target;
6978  void *job;
6979  OrthancPluginJobFinalize finalize;
6980  const char *type;
6981  OrthancPluginJobGetProgress getProgress;
6982  OrthancPluginJobGetContent2 getContent;
6983  OrthancPluginJobGetSerialized2 getSerialized;
6984  OrthancPluginJobStep step;
6985  OrthancPluginJobStop stop;
6986  OrthancPluginJobReset reset;
6987  } _OrthancPluginCreateJob2;
6988 
7021  OrthancPluginContext *context,
7022  void *job,
7023  OrthancPluginJobFinalize finalize,
7024  const char *type,
7025  OrthancPluginJobGetProgress getProgress,
7026  OrthancPluginJobGetContent2 getContent,
7027  OrthancPluginJobGetSerialized2 getSerialized,
7028  OrthancPluginJobStep step,
7029  OrthancPluginJobStop stop,
7030  OrthancPluginJobReset reset)
7031  {
7032  OrthancPluginJob* target = NULL;
7033 
7034  _OrthancPluginCreateJob2 params;
7035  memset(&params, 0, sizeof(params));
7036 
7037  params.target = &target;
7038  params.job = job;
7039  params.finalize = finalize;
7040  params.type = type;
7041  params.getProgress = getProgress;
7042  params.getContent = getContent;
7043  params.getSerialized = getSerialized;
7044  params.step = step;
7045  params.stop = stop;
7046  params.reset = reset;
7047 
7048  if (context->InvokeService(context, _OrthancPluginService_CreateJob2, &params) != OrthancPluginErrorCode_Success ||
7049  target == NULL)
7050  {
7051  /* Error */
7052  return NULL;
7053  }
7054  else
7055  {
7056  return target;
7057  }
7058  }
7059 
7060 
7061  typedef struct
7062  {
7063  OrthancPluginJob* job;
7064  } _OrthancPluginFreeJob;
7065 
7075  ORTHANC_PLUGIN_INLINE void OrthancPluginFreeJob(
7076  OrthancPluginContext* context,
7077  OrthancPluginJob* job)
7078  {
7079  _OrthancPluginFreeJob params;
7080  params.job = job;
7081 
7082  context->InvokeService(context, _OrthancPluginService_FreeJob, &params);
7083  }
7084 
7085 
7086 
7087  typedef struct
7088  {
7089  char** resultId;
7090  OrthancPluginJob *job;
7091  int32_t priority;
7092  } _OrthancPluginSubmitJob;
7093 
7107  ORTHANC_PLUGIN_INLINE char *OrthancPluginSubmitJob(
7108  OrthancPluginContext *context,
7109  OrthancPluginJob *job,
7110  int32_t priority)
7111  {
7112  char* resultId = NULL;
7113 
7114  _OrthancPluginSubmitJob params;
7115  memset(&params, 0, sizeof(params));
7116 
7117  params.resultId = &resultId;
7118  params.job = job;
7119  params.priority = priority;
7120 
7121  if (context->InvokeService(context, _OrthancPluginService_SubmitJob, &params) != OrthancPluginErrorCode_Success ||
7122  resultId == NULL)
7123  {
7124  /* Error */
7125  return NULL;
7126  }
7127  else
7128  {
7129  return resultId;
7130  }
7131  }
7132 
7133 
7134 
7135  typedef struct
7136  {
7137  OrthancPluginJobsUnserializer unserializer;
7138  } _OrthancPluginJobsUnserializer;
7139 
7152  ORTHANC_PLUGIN_INLINE void OrthancPluginRegisterJobsUnserializer(
7153  OrthancPluginContext* context,
7154  OrthancPluginJobsUnserializer unserializer)
7155  {
7156  _OrthancPluginJobsUnserializer params;
7157  params.unserializer = unserializer;
7158 
7159  context->InvokeService(context, _OrthancPluginService_RegisterJobsUnserializer, &params);
7160  }
7161 
7162 
7163 
7164  typedef struct
7165  {
7166  OrthancPluginRestOutput* output;
7167  const char* details;
7168  uint8_t log;
7169  } _OrthancPluginSetHttpErrorDetails;
7170 
7188  ORTHANC_PLUGIN_INLINE void OrthancPluginSetHttpErrorDetails(
7189  OrthancPluginContext* context,
7190  OrthancPluginRestOutput* output,
7191  const char* details,
7192  uint8_t log)
7193  {
7194  _OrthancPluginSetHttpErrorDetails params;
7195  params.output = output;
7196  params.details = details;
7197  params.log = log;
7198  context->InvokeService(context, _OrthancPluginService_SetHttpErrorDetails, &params);
7199  }
7200 
7201 
7202 
7203  typedef struct
7204  {
7205  const char** result;
7206  const char* argument;
7207  } _OrthancPluginRetrieveStaticString;
7208 
7220  ORTHANC_PLUGIN_INLINE const char* OrthancPluginAutodetectMimeType(
7221  OrthancPluginContext* context,
7222  const char* path)
7223  {
7224  const char* result = NULL;
7225 
7226  _OrthancPluginRetrieveStaticString params;
7227  params.result = &result;
7228  params.argument = path;
7229 
7230  if (context->InvokeService(context, _OrthancPluginService_AutodetectMimeType, &params) != OrthancPluginErrorCode_Success)
7231  {
7232  /* Error */
7233  return NULL;
7234  }
7235  else
7236  {
7237  return result;
7238  }
7239  }
7240 
7241 
7242 
7243  typedef struct
7244  {
7245  const char* name;
7246  float value;
7248  } _OrthancPluginSetMetricsValue;
7249 
7266  ORTHANC_PLUGIN_INLINE void OrthancPluginSetMetricsValue(
7267  OrthancPluginContext* context,
7268  const char* name,
7269  float value,
7271  {
7272  _OrthancPluginSetMetricsValue params;
7273  params.name = name;
7274  params.value = value;
7275  params.type = type;
7276  context->InvokeService(context, _OrthancPluginService_SetMetricsValue, &params);
7277  }
7278 
7279 
7280 
7281  typedef struct
7282  {
7284  } _OrthancPluginRegisterRefreshMetricsCallback;
7285 
7298  OrthancPluginContext* context,
7300  {
7301  _OrthancPluginRegisterRefreshMetricsCallback params;
7302  params.callback = callback;
7303  context->InvokeService(context, _OrthancPluginService_RegisterRefreshMetricsCallback, &params);
7304  }
7305 
7306 
7307 
7308 
7309  typedef struct
7310  {
7311  char** target;
7312  const void* dicom;
7313  uint32_t dicomSize;
7315  } _OrthancPluginEncodeDicomWeb;
7316 
7333  ORTHANC_PLUGIN_DEPRECATED ORTHANC_PLUGIN_INLINE char* OrthancPluginEncodeDicomWebJson(
7334  OrthancPluginContext* context,
7335  const void* dicom,
7336  uint32_t dicomSize,
7338  {
7339  char* target = NULL;
7340 
7341  _OrthancPluginEncodeDicomWeb params;
7342  params.target = &target;
7343  params.dicom = dicom;
7344  params.dicomSize = dicomSize;
7345  params.callback = callback;
7346 
7347  if (context->InvokeService(context, _OrthancPluginService_EncodeDicomWebJson, &params) != OrthancPluginErrorCode_Success)
7348  {
7349  /* Error */
7350  return NULL;
7351  }
7352  else
7353  {
7354  return target;
7355  }
7356  }
7357 
7358 
7375  ORTHANC_PLUGIN_DEPRECATED ORTHANC_PLUGIN_INLINE char* OrthancPluginEncodeDicomWebXml(
7376  OrthancPluginContext* context,
7377  const void* dicom,
7378  uint32_t dicomSize,
7380  {
7381  char* target = NULL;
7382 
7383  _OrthancPluginEncodeDicomWeb params;
7384  params.target = &target;
7385  params.dicom = dicom;
7386  params.dicomSize = dicomSize;
7387  params.callback = callback;
7388 
7389  if (context->InvokeService(context, _OrthancPluginService_EncodeDicomWebXml, &params) != OrthancPluginErrorCode_Success)
7390  {
7391  /* Error */
7392  return NULL;
7393  }
7394  else
7395  {
7396  return target;
7397  }
7398  }
7399 
7400 
7401 
7402  typedef struct
7403  {
7404  char** target;
7405  const void* dicom;
7406  uint32_t dicomSize;
7408  void* payload;
7409  } _OrthancPluginEncodeDicomWeb2;
7410 
7427  ORTHANC_PLUGIN_INLINE char* OrthancPluginEncodeDicomWebJson2(
7428  OrthancPluginContext* context,
7429  const void* dicom,
7430  uint32_t dicomSize,
7432  void* payload)
7433  {
7434  char* target = NULL;
7435 
7436  _OrthancPluginEncodeDicomWeb2 params;
7437  params.target = &target;
7438  params.dicom = dicom;
7439  params.dicomSize = dicomSize;
7440  params.callback = callback;
7441  params.payload = payload;
7442 
7443  if (context->InvokeService(context, _OrthancPluginService_EncodeDicomWebJson2, &params) != OrthancPluginErrorCode_Success)
7444  {
7445  /* Error */
7446  return NULL;
7447  }
7448  else
7449  {
7450  return target;
7451  }
7452  }
7453 
7454 
7471  ORTHANC_PLUGIN_INLINE char* OrthancPluginEncodeDicomWebXml2(
7472  OrthancPluginContext* context,
7473  const void* dicom,
7474  uint32_t dicomSize,
7476  void* payload)
7477  {
7478  char* target = NULL;
7479 
7480  _OrthancPluginEncodeDicomWeb2 params;
7481  params.target = &target;
7482  params.dicom = dicom;
7483  params.dicomSize = dicomSize;
7484  params.callback = callback;
7485  params.payload = payload;
7486 
7487  if (context->InvokeService(context, _OrthancPluginService_EncodeDicomWebXml2, &params) != OrthancPluginErrorCode_Success)
7488  {
7489  /* Error */
7490  return NULL;
7491  }
7492  else
7493  {
7494  return target;
7495  }
7496  }
7497 
7498 
7499 
7516  void* answer,
7517  const char* key,
7518  const char* value);
7519 
7520 
7537  void* answer,
7538  const void* data,
7539  uint32_t size);
7540 
7541 
7556  typedef uint8_t (*OrthancPluginChunkedClientRequestIsDone) (void* request);
7557 
7558 
7574 
7575 
7589  typedef const void* (*OrthancPluginChunkedClientRequestGetChunkData) (void* request);
7590 
7591 
7605  typedef uint32_t (*OrthancPluginChunkedClientRequestGetChunkSize) (void* request);
7606 
7607 
7608  typedef struct
7609  {
7610  void* answer;
7613  uint16_t* httpStatus;
7614  OrthancPluginHttpMethod method;
7615  const char* url;
7616  uint32_t headersCount;
7617  const char* const* headersKeys;
7618  const char* const* headersValues;
7619  void* request;
7624  const char* username;
7625  const char* password;
7626  uint32_t timeout;
7627  const char* certificateFile;
7628  const char* certificateKeyFile;
7629  const char* certificateKeyPassword;
7630  uint8_t pkcs11;
7631  } _OrthancPluginChunkedHttpClient;
7632 
7633 
7685  OrthancPluginContext* context,
7686  void* answer,
7689  uint16_t* httpStatus,
7690  OrthancPluginHttpMethod method,
7691  const char* url,
7692  uint32_t headersCount,
7693  const char* const* headersKeys,
7694  const char* const* headersValues,
7695  void* request,
7700  const char* username,
7701  const char* password,
7702  uint32_t timeout,
7703  const char* certificateFile,
7704  const char* certificateKeyFile,
7705  const char* certificateKeyPassword,
7706  uint8_t pkcs11)
7707  {
7708  _OrthancPluginChunkedHttpClient params;
7709  memset(&params, 0, sizeof(params));
7710 
7711  /* In common with OrthancPluginHttpClient() */
7712  params.httpStatus = httpStatus;
7713  params.method = method;
7714  params.url = url;
7715  params.headersCount = headersCount;
7716  params.headersKeys = headersKeys;
7717  params.headersValues = headersValues;
7718  params.username = username;
7719  params.password = password;
7720  params.timeout = timeout;
7721  params.certificateFile = certificateFile;
7722  params.certificateKeyFile = certificateKeyFile;
7723  params.certificateKeyPassword = certificateKeyPassword;
7724  params.pkcs11 = pkcs11;
7725 
7726  /* For chunked body/answer */
7727  params.answer = answer;
7728  params.answerAddChunk = answerAddChunk;
7729  params.answerAddHeader = answerAddHeader;
7730  params.request = request;
7731  params.requestIsDone = requestIsDone;
7732  params.requestChunkData = requestChunkData;
7733  params.requestChunkSize = requestChunkSize;
7734  params.requestNext = requestNext;
7735 
7736  return context->InvokeService(context, _OrthancPluginService_ChunkedHttpClient, &params);
7737  }
7738 
7739 
7740 
7745  typedef struct _OrthancPluginServerChunkedRequestReader_t OrthancPluginServerChunkedRequestReader;
7746 
7747 
7748 
7766  const char* url,
7767  const OrthancPluginHttpRequest* request);
7768 
7769 
7785  const void* data,
7786  uint32_t size);
7787 
7788 
7805  OrthancPluginRestOutput* output);
7806 
7807 
7823 
7824  typedef struct
7825  {
7826  const char* pathRegularExpression;
7827  OrthancPluginRestCallback getHandler;
7829  OrthancPluginRestCallback deleteHandler;
7834  } _OrthancPluginChunkedRestCallback;
7835 
7836 
7866  ORTHANC_PLUGIN_INLINE void OrthancPluginRegisterChunkedRestCallback(
7867  OrthancPluginContext* context,
7868  const char* pathRegularExpression,
7869  OrthancPluginRestCallback getHandler,
7871  OrthancPluginRestCallback deleteHandler,
7876  {
7877  _OrthancPluginChunkedRestCallback params;
7878  params.pathRegularExpression = pathRegularExpression;
7879  params.getHandler = getHandler;
7880  params.postHandler = postHandler;
7881  params.deleteHandler = deleteHandler;
7882  params.putHandler = putHandler;
7883  params.addChunk = addChunk;
7884  params.execute = execute;
7885  params.finalize = finalize;
7886 
7887  context->InvokeService(context, _OrthancPluginService_RegisterChunkedRestCallback, &params);
7888  }
7889 
7890 
7891 
7892 
7893 
7894  typedef struct
7895  {
7896  char** result;
7897  uint16_t group;
7898  uint16_t element;
7899  const char* privateCreator;
7900  } _OrthancPluginGetTagName;
7901 
7917  ORTHANC_PLUGIN_INLINE char* OrthancPluginGetTagName(
7918  OrthancPluginContext* context,
7919  uint16_t group,
7920  uint16_t element,
7921  const char* privateCreator)
7922  {
7923  char* result;
7924 
7925  _OrthancPluginGetTagName params;
7926  params.result = &result;
7927  params.group = group;
7928  params.element = element;
7929  params.privateCreator = privateCreator;
7930 
7931  if (context->InvokeService(context, _OrthancPluginService_GetTagName, &params) != OrthancPluginErrorCode_Success)
7932  {
7933  /* Error */
7934  return NULL;
7935  }
7936  else
7937  {
7938  return result;
7939  }
7940  }
7941 
7942 
7943 
7973  void** handler /* out */,
7974  const char* jobId,
7975  const char* transactionUid,
7976  const char* const* sopClassUids,
7977  const char* const* sopInstanceUids,
7978  uint32_t countInstances,
7979  const char* remoteAet,
7980  const char* calledAet);
7981 
7982 
7994  typedef void (*OrthancPluginStorageCommitmentDestructor) (void* handler);
7995 
7996 
8017  void* handler,
8018  const char* sopClassUid,
8019  const char* sopInstanceUid);
8020 
8021 
8022  typedef struct
8023  {
8027  } _OrthancPluginRegisterStorageCommitmentScpCallback;
8028 
8043  OrthancPluginContext* context,
8047  {
8048  _OrthancPluginRegisterStorageCommitmentScpCallback params;
8049  params.factory = factory;
8050  params.destructor = destructor;
8051  params.lookup = lookup;
8052  return context->InvokeService(context, _OrthancPluginService_RegisterStorageCommitmentScpCallback, &params);
8053  }
8054 
8055 
8056 
8083  const OrthancPluginDicomInstance* instance);
8084 
8085 
8086  typedef struct
8087  {
8089  } _OrthancPluginIncomingDicomInstanceFilter;
8090 
8104  OrthancPluginContext* context,
8106  {
8107  _OrthancPluginIncomingDicomInstanceFilter params;
8108  params.callback = callback;
8109 
8110  return context->InvokeService(context, _OrthancPluginService_RegisterIncomingDicomInstanceFilter, &params);
8111  }
8112 
8113 
8145  uint16_t* dimseStatus /* out */,
8146  const OrthancPluginDicomInstance* instance);
8147 
8148 
8149  typedef struct
8150  {
8152  } _OrthancPluginIncomingCStoreInstanceFilter;
8153 
8167  OrthancPluginContext* context,
8169  {
8170  _OrthancPluginIncomingCStoreInstanceFilter params;
8171  params.callback = callback;
8172 
8173  return context->InvokeService(context, _OrthancPluginService_RegisterIncomingCStoreInstanceFilter, &params);
8174  }
8175 
8212  OrthancPluginMemoryBuffer64* modifiedDicomBuffer,
8213  const void* receivedDicomBuffer,
8214  uint64_t receivedDicomBufferSize,
8216 
8217 
8218  typedef struct
8219  {
8221  } _OrthancPluginReceivedInstanceCallback;
8222 
8244  OrthancPluginContext* context,
8246  {
8247  _OrthancPluginReceivedInstanceCallback params;
8248  params.callback = callback;
8249 
8250  return context->InvokeService(context, _OrthancPluginService_RegisterReceivedInstanceCallback, &params);
8251  }
8252 
8266  ORTHANC_PLUGIN_INLINE char* OrthancPluginGetInstanceTransferSyntaxUid(
8267  OrthancPluginContext* context,
8268  const OrthancPluginDicomInstance* instance)
8269  {
8270  char* result;
8271 
8272  _OrthancPluginAccessDicomInstance params;
8273  memset(&params, 0, sizeof(params));
8274  params.resultStringToFree = &result;
8275  params.instance = instance;
8276 
8277  if (context->InvokeService(context, _OrthancPluginService_GetInstanceTransferSyntaxUid, &params) != OrthancPluginErrorCode_Success)
8278  {
8279  /* Error */
8280  return NULL;
8281  }
8282  else
8283  {
8284  return result;
8285  }
8286  }
8287 
8288 
8301  ORTHANC_PLUGIN_INLINE int32_t OrthancPluginHasInstancePixelData(
8302  OrthancPluginContext* context,
8303  const OrthancPluginDicomInstance* instance)
8304  {
8305  int64_t hasPixelData;
8306 
8307  _OrthancPluginAccessDicomInstance params;
8308  memset(&params, 0, sizeof(params));
8309  params.resultInt64 = &hasPixelData;
8310  params.instance = instance;
8311 
8312  if (context->InvokeService(context, _OrthancPluginService_HasInstancePixelData, &params) != OrthancPluginErrorCode_Success ||
8313  hasPixelData < 0 ||
8314  hasPixelData > 1)
8315  {
8316  /* Error */
8317  return -1;
8318  }
8319  else
8320  {
8321  return (hasPixelData != 0);
8322  }
8323  }
8324 
8325 
8326 
8327 
8328 
8329 
8330  typedef struct
8331  {
8332  OrthancPluginDicomInstance** target;
8333  const void* buffer;
8334  uint32_t size;
8335  const char* transferSyntax;
8336  } _OrthancPluginCreateDicomInstance;
8337 
8352  OrthancPluginContext* context,
8353  const void* buffer,
8354  uint32_t size)
8355  {
8356  OrthancPluginDicomInstance* target = NULL;
8357 
8358  _OrthancPluginCreateDicomInstance params;
8359  params.target = &target;
8360  params.buffer = buffer;
8361  params.size = size;
8362 
8363  if (context->InvokeService(context, _OrthancPluginService_CreateDicomInstance, &params) != OrthancPluginErrorCode_Success)
8364  {
8365  /* Error */
8366  return NULL;
8367  }
8368  else
8369  {
8370  return target;
8371  }
8372  }
8373 
8374  typedef struct
8375  {
8377  } _OrthancPluginFreeDicomInstance;
8378 
8389  ORTHANC_PLUGIN_INLINE void OrthancPluginFreeDicomInstance(
8390  OrthancPluginContext* context,
8392  {
8393  _OrthancPluginFreeDicomInstance params;
8394  params.dicom = dicom;
8395 
8396  context->InvokeService(context, _OrthancPluginService_FreeDicomInstance, &params);
8397  }
8398 
8399 
8400  typedef struct
8401  {
8402  uint32_t* targetUint32;
8403  OrthancPluginMemoryBuffer* targetBuffer;
8404  OrthancPluginImage** targetImage;
8405  char** targetStringToFree;
8406  const OrthancPluginDicomInstance* instance;
8407  uint32_t frameIndex;
8410  uint32_t maxStringLength;
8411  OrthancPluginDicomWebBinaryCallback2 dicomWebCallback;
8412  void* dicomWebPayload;
8413  } _OrthancPluginAccessDicomInstance2;
8414 
8426  ORTHANC_PLUGIN_INLINE uint32_t OrthancPluginGetInstanceFramesCount(
8427  OrthancPluginContext* context,
8428  const OrthancPluginDicomInstance* instance)
8429  {
8430  uint32_t count;
8431 
8432  _OrthancPluginAccessDicomInstance2 params;
8433  memset(&params, 0, sizeof(params));
8434  params.targetUint32 = &count;
8435  params.instance = instance;
8436 
8437  if (context->InvokeService(context, _OrthancPluginService_GetInstanceFramesCount, &params) != OrthancPluginErrorCode_Success)
8438  {
8439  /* Error */
8440  return 0;
8441  }
8442  else
8443  {
8444  return count;
8445  }
8446  }
8447 
8448 
8467  OrthancPluginContext* context,
8468  OrthancPluginMemoryBuffer* target,
8469  const OrthancPluginDicomInstance* instance,
8470  uint32_t frameIndex)
8471  {
8472  _OrthancPluginAccessDicomInstance2 params;
8473  memset(&params, 0, sizeof(params));
8474  params.targetBuffer = target;
8475  params.instance = instance;
8476  params.frameIndex = frameIndex;
8477 
8478  return context->InvokeService(context, _OrthancPluginService_GetInstanceRawFrame, &params);
8479  }
8480 
8481 
8495  OrthancPluginContext* context,
8496  const OrthancPluginDicomInstance* instance,
8497  uint32_t frameIndex)
8498  {
8499  OrthancPluginImage* target = NULL;
8500 
8501  _OrthancPluginAccessDicomInstance2 params;
8502  memset(&params, 0, sizeof(params));
8503  params.targetImage = &target;
8504  params.instance = instance;
8505  params.frameIndex = frameIndex;
8506 
8507  if (context->InvokeService(context, _OrthancPluginService_GetInstanceDecodedFrame, &params) != OrthancPluginErrorCode_Success)
8508  {
8509  return NULL;
8510  }
8511  else
8512  {
8513  return target;
8514  }
8515  }
8516 
8517 
8534  OrthancPluginContext* context,
8535  const void* buffer,
8536  uint32_t size,
8537  const char* transferSyntax)
8538  {
8539  OrthancPluginDicomInstance* target = NULL;
8540 
8541  _OrthancPluginCreateDicomInstance params;
8542  params.target = &target;
8543  params.buffer = buffer;
8544  params.size = size;
8545  params.transferSyntax = transferSyntax;
8546 
8547  if (context->InvokeService(context, _OrthancPluginService_TranscodeDicomInstance, &params) != OrthancPluginErrorCode_Success)
8548  {
8549  /* Error */
8550  return NULL;
8551  }
8552  else
8553  {
8554  return target;
8555  }
8556  }
8557 
8572  OrthancPluginContext* context,
8573  OrthancPluginMemoryBuffer* target,
8574  const OrthancPluginDicomInstance* instance)
8575  {
8576  _OrthancPluginAccessDicomInstance2 params;
8577  memset(&params, 0, sizeof(params));
8578  params.targetBuffer = target;
8579  params.instance = instance;
8580 
8581  return context->InvokeService(context, _OrthancPluginService_SerializeDicomInstance, &params);
8582  }
8583 
8584 
8603  ORTHANC_PLUGIN_INLINE char* OrthancPluginGetInstanceAdvancedJson(
8604  OrthancPluginContext* context,
8605  const OrthancPluginDicomInstance* instance,
8608  uint32_t maxStringLength)
8609  {
8610  char* result = NULL;
8611 
8612  _OrthancPluginAccessDicomInstance2 params;
8613  memset(&params, 0, sizeof(params));
8614  params.targetStringToFree = &result;
8615  params.instance = instance;
8616  params.format = format;
8617  params.flags = flags;
8618  params.maxStringLength = maxStringLength;
8619 
8620  if (context->InvokeService(context, _OrthancPluginService_GetInstanceAdvancedJson, &params) != OrthancPluginErrorCode_Success)
8621  {
8622  /* Error */
8623  return NULL;
8624  }
8625  else
8626  {
8627  return result;
8628  }
8629  }
8630 
8631 
8646  ORTHANC_PLUGIN_INLINE char* OrthancPluginGetInstanceDicomWebJson(
8647  OrthancPluginContext* context,
8648  const OrthancPluginDicomInstance* instance,
8650  void* payload)
8651  {
8652  char* target = NULL;
8653 
8654  _OrthancPluginAccessDicomInstance2 params;
8655  params.targetStringToFree = &target;
8656  params.instance = instance;
8657  params.dicomWebCallback = callback;
8658  params.dicomWebPayload = payload;
8659 
8660  if (context->InvokeService(context, _OrthancPluginService_GetInstanceDicomWebJson, &params) != OrthancPluginErrorCode_Success)
8661  {
8662  /* Error */
8663  return NULL;
8664  }
8665  else
8666  {
8667  return target;
8668  }
8669  }
8670 
8671 
8686  ORTHANC_PLUGIN_INLINE char* OrthancPluginGetInstanceDicomWebXml(
8687  OrthancPluginContext* context,
8688  const OrthancPluginDicomInstance* instance,
8690  void* payload)
8691  {
8692  char* target = NULL;
8693 
8694  _OrthancPluginAccessDicomInstance2 params;
8695  params.targetStringToFree = &target;
8696  params.instance = instance;
8697  params.dicomWebCallback = callback;
8698  params.dicomWebPayload = payload;
8699 
8700  if (context->InvokeService(context, _OrthancPluginService_GetInstanceDicomWebXml, &params) != OrthancPluginErrorCode_Success)
8701  {
8702  /* Error */
8703  return NULL;
8704  }
8705  else
8706  {
8707  return target;
8708  }
8709  }
8710 
8711 
8712 
8732  OrthancPluginMemoryBuffer* transcoded /* out */,
8733  const void* buffer,
8734  uint64_t size,
8735  const char* const* allowedSyntaxes,
8736  uint32_t countSyntaxes,
8737  uint8_t allowNewSopInstanceUid);
8738 
8739 
8740  typedef struct
8741  {
8743  } _OrthancPluginTranscoderCallback;
8744 
8759  OrthancPluginContext* context,
8761  {
8762  _OrthancPluginTranscoderCallback params;
8763  params.callback = callback;
8764 
8765  return context->InvokeService(context, _OrthancPluginService_RegisterTranscoderCallback, &params);
8766  }
8767 
8768 
8769 
8770  typedef struct
8771  {
8772  OrthancPluginMemoryBuffer* target;
8773  uint32_t size;
8774  } _OrthancPluginCreateMemoryBuffer;
8775 
8794  OrthancPluginContext* context,
8795  OrthancPluginMemoryBuffer* target,
8796  uint32_t size)
8797  {
8798  _OrthancPluginCreateMemoryBuffer params;
8799  params.target = target;
8800  params.size = size;
8801 
8802  return context->InvokeService(context, _OrthancPluginService_CreateMemoryBuffer, &params);
8803  }
8804 
8805 
8832  OrthancPluginContext* context)
8833  {
8834  char* result;
8835 
8836  _OrthancPluginRetrieveDynamicString params;
8837  params.result = &result;
8838  params.argument = NULL;
8839 
8840  if (context->InvokeService(context, _OrthancPluginService_GenerateRestApiAuthorizationToken,
8841  &params) != OrthancPluginErrorCode_Success)
8842  {
8843  /* Error */
8844  return NULL;
8845  }
8846  else
8847  {
8848  return result;
8849  }
8850  }
8851 
8852 
8853 
8854  typedef struct
8855  {
8857  uint64_t size;
8858  } _OrthancPluginCreateMemoryBuffer64;
8859 
8878  OrthancPluginContext* context,
8880  uint64_t size)
8881  {
8882  _OrthancPluginCreateMemoryBuffer64 params;
8883  params.target = target;
8884  params.size = size;
8885 
8886  return context->InvokeService(context, _OrthancPluginService_CreateMemoryBuffer64, &params);
8887  }
8888 
8889 
8890  typedef struct
8891  {
8896  } _OrthancPluginRegisterStorageArea2;
8897 
8914  ORTHANC_PLUGIN_INLINE void OrthancPluginRegisterStorageArea2(
8915  OrthancPluginContext* context,
8920  {
8921  _OrthancPluginRegisterStorageArea2 params;
8922  params.create = create;
8923  params.readWhole = readWhole;
8924  params.readRange = readRange;
8925  params.remove = remove;
8926  context->InvokeService(context, _OrthancPluginService_RegisterStorageArea2, &params);
8927  }
8928 
8929 
8930 
8931  typedef struct
8932  {
8933  _OrthancPluginCreateDicom createDicom;
8934  const char* privateCreator;
8935  } _OrthancPluginCreateDicom2;
8936 
8962  OrthancPluginContext* context,
8963  OrthancPluginMemoryBuffer* target,
8964  const char* json,
8965  const OrthancPluginImage* pixelData,
8967  const char* privateCreator)
8968  {
8969  _OrthancPluginCreateDicom2 params;
8970  params.createDicom.target = target;
8971  params.createDicom.json = json;
8972  params.createDicom.pixelData = pixelData;
8973  params.createDicom.flags = flags;
8974  params.privateCreator = privateCreator;
8975 
8976  return context->InvokeService(context, _OrthancPluginService_CreateDicom2, &params);
8977  }
8978 
8979 
8980 
8981 
8982 
8983 
8984  typedef struct
8985  {
8986  OrthancPluginMemoryBuffer* answerBody;
8987  OrthancPluginMemoryBuffer* answerHeaders;
8988  uint16_t* httpStatus;
8989  OrthancPluginHttpMethod method;
8990  const char* uri;
8991  uint32_t headersCount;
8992  const char* const* headersKeys;
8993  const char* const* headersValues;
8994  const void* body;
8995  uint32_t bodySize;
8996  uint8_t afterPlugins;
8997  } _OrthancPluginCallRestApi;
8998 
9030  OrthancPluginContext* context,
9031  OrthancPluginMemoryBuffer* answerBody,
9032  OrthancPluginMemoryBuffer* answerHeaders,
9033  uint16_t* httpStatus,
9034  OrthancPluginHttpMethod method,
9035  const char* uri,
9036  uint32_t headersCount,
9037  const char* const* headersKeys,
9038  const char* const* headersValues,
9039  const void* body,
9040  uint32_t bodySize,
9041  uint8_t afterPlugins)
9042  {
9043  _OrthancPluginCallRestApi params;
9044  memset(&params, 0, sizeof(params));
9045 
9046  params.answerBody = answerBody;
9047  params.answerHeaders = answerHeaders;
9048  params.httpStatus = httpStatus;
9049  params.method = method;
9050  params.uri = uri;
9051  params.headersCount = headersCount;
9052  params.headersKeys = headersKeys;
9053  params.headersValues = headersValues;
9054  params.body = body;
9055  params.bodySize = bodySize;
9056  params.afterPlugins = afterPlugins;
9057 
9058  return context->InvokeService(context, _OrthancPluginService_CallRestApi, &params);
9059  }
9060 
9061 
9062 
9067  typedef struct _OrthancPluginWebDavCollection_t OrthancPluginWebDavCollection;
9068 
9069 
9087  OrthancPluginWebDavCollection* collection,
9088  const char* name,
9089  uint64_t size,
9090  const char* mimeType,
9091  const char* dateTime);
9092 
9093 
9108  OrthancPluginWebDavCollection* collection,
9109  const char* name,
9110  const char* dateTime);
9111 
9112 
9135  OrthancPluginWebDavCollection* collection,
9136  const void* data,
9137  uint64_t size,
9138  const char* mimeType,
9139  const char* dateTime);
9140 
9141 
9156  uint8_t* isExisting, /* out */
9157  uint32_t pathSize,
9158  const char* const* pathItems,
9159  void* payload);
9160 
9161 
9181  uint8_t* isExisting, /* out */
9182  OrthancPluginWebDavCollection* collection,
9184  OrthancPluginWebDavAddFolder addFolder,
9185  uint32_t pathSize,
9186  const char* const* pathItems,
9187  void* payload);
9188 
9189 
9207  OrthancPluginWebDavCollection* collection,
9208  OrthancPluginWebDavRetrieveFile retrieveFile,
9209  uint32_t pathSize,
9210  const char* const* pathItems,
9211  void* payload);
9212 
9213 
9230  uint8_t* isReadOnly, /* out */
9231  uint32_t pathSize,
9232  const char* const* pathItems,
9233  const void* data,
9234  uint64_t size,
9235  void* payload);
9236 
9237 
9252  uint8_t* isReadOnly, /* out */
9253  uint32_t pathSize,
9254  const char* const* pathItems,
9255  void* payload);
9256 
9257 
9272  uint8_t* isReadOnly, /* out */
9273  uint32_t pathSize,
9274  const char* const* pathItems,
9275  void* payload);
9276 
9277 
9278  typedef struct
9279  {
9280  const char* uri;
9287  void* payload;
9288  } _OrthancPluginRegisterWebDavCollection;
9289 
9311  OrthancPluginContext* context,
9312  const char* uri,
9319  void* payload)
9320  {
9321  _OrthancPluginRegisterWebDavCollection params;
9322  params.uri = uri;
9323  params.isExistingFolder = isExistingFolder;
9324  params.listFolder = listFolder;
9325  params.retrieveFile = retrieveFile;
9326  params.storeFile = storeFile;
9327  params.createFolder = createFolder;
9328  params.deleteItem = deleteItem;
9329  params.payload = payload;
9330 
9331  return context->InvokeService(context, _OrthancPluginService_RegisterWebDavCollection, &params);
9332  }
9333 
9334 
9343  ORTHANC_PLUGIN_INLINE const char* OrthancPluginGetDatabaseServerIdentifier(
9344  OrthancPluginContext* context)
9345  {
9346  const char* result;
9347 
9348  _OrthancPluginRetrieveStaticString params;
9349  params.result = &result;
9350  params.argument = NULL;
9351 
9352  if (context->InvokeService(context, _OrthancPluginService_GetDatabaseServerIdentifier, &params) != OrthancPluginErrorCode_Success)
9353  {
9354  /* Error */
9355  return NULL;
9356  }
9357  else
9358  {
9359  return result;
9360  }
9361  }
9362 
9363 
9371  OrthancPluginMemoryBuffer64* response,
9372  void* backend,
9373  const void* request,
9374  uint64_t requestSize);
9375 
9381  typedef void (*OrthancPluginFinalizeDatabaseBackendV4) (void* backend);
9382 
9383  typedef struct
9384  {
9385  void* backend;
9386  uint32_t maxDatabaseRetries;
9389  } _OrthancPluginRegisterDatabaseBackendV4;
9390 
9409  OrthancPluginContext* context,
9410  void* backend,
9411  uint32_t maxDatabaseRetries,
9414  {
9415  _OrthancPluginRegisterDatabaseBackendV4 params;
9416  params.backend = backend;
9417  params.maxDatabaseRetries = maxDatabaseRetries;
9418  params.operations = operations;
9419  params.finalize = finalize;
9420 
9421  return context->InvokeService(context, _OrthancPluginService_RegisterDatabaseBackendV4, &params);
9422  }
9423 
9424 
9425  typedef struct
9426  {
9427  OrthancPluginDicomInstance** target;
9428  const char* instanceId;
9430  } _OrthancPluginLoadDicomInstance;
9431 
9446  OrthancPluginContext* context,
9447  const char* instanceId,
9449  {
9450  OrthancPluginDicomInstance* target = NULL;
9451 
9452  _OrthancPluginLoadDicomInstance params;
9453  params.target = &target;
9454  params.instanceId = instanceId;
9455  params.mode = mode;
9456 
9457  if (context->InvokeService(context, _OrthancPluginService_LoadDicomInstance, &params) != OrthancPluginErrorCode_Success)
9458  {
9459  /* Error */
9460  return NULL;
9461  }
9462  else
9463  {
9464  return target;
9465  }
9466  }
9467 
9468 
9469  typedef struct
9470  {
9471  const char* name;
9472  int64_t value;
9474  } _OrthancPluginSetMetricsIntegerValue;
9475 
9491  ORTHANC_PLUGIN_INLINE void OrthancPluginSetMetricsIntegerValue(
9492  OrthancPluginContext* context,
9493  const char* name,
9494  int64_t value,
9496  {
9497  _OrthancPluginSetMetricsIntegerValue params;
9498  params.name = name;
9499  params.value = value;
9500  params.type = type;
9501  context->InvokeService(context, _OrthancPluginService_SetMetricsIntegerValue, &params);
9502  }
9503 
9504 
9519  OrthancPluginContext* context,
9520  const char* threadName)
9521  {
9522  return context->InvokeService(context, _OrthancPluginService_SetCurrentThreadName, threadName);
9523  }
9524 
9525 
9526  typedef struct
9527  {
9528  /* Note: This structure is also defined in Logging.h and it must be binary compatible */
9529  const char* message;
9530  const char* plugin;
9531  const char* file;
9532  uint32_t line;
9533  OrthancPluginLogCategory category;
9534  OrthancPluginLogLevel level;
9535  } _OrthancPluginLogMessage;
9536 
9537 
9551  ORTHANC_PLUGIN_INLINE void OrthancPluginLogMessage(
9552  OrthancPluginContext* context,
9553  const char* message,
9554  const char* plugin,
9555  const char* file,
9556  uint32_t line,
9557  OrthancPluginLogCategory category,
9558  OrthancPluginLogLevel level)
9559  {
9560  _OrthancPluginLogMessage m;
9561  m.message = message;
9562  m.plugin = plugin;
9563  m.file = file;
9564  m.line = line;
9565  m.category = category;
9566  m.level = level;
9567  context->InvokeService(context, _OrthancPluginService_LogMessage, &m);
9568  }
9569 
9570 
9571 #ifdef __cplusplus
9572 }
9573 #endif
9574 
9575 
OrthancPluginErrorCode OrthancPluginRegisterDatabaseBackendV4(OrthancPluginContext *context, void *backend, uint32_t maxDatabaseRetries, OrthancPluginCallDatabaseBackendV4 operations, OrthancPluginFinalizeDatabaseBackendV4 finalize)
Register a custom database back-end.
Definition: OrthancCPlugin.h:9408
OrthancPluginErrorCode(* OrthancPluginCallDatabaseBackendV4)(OrthancPluginMemoryBuffer64 *response, void *backend, const void *request, uint64_t requestSize)
Signature of a callback function that is triggered when the Orthanc core requests an operation from t...
Definition: OrthancCPlugin.h:9370
OrthancPluginReceivedInstanceAction(* OrthancPluginReceivedInstanceCallback)(OrthancPluginMemoryBuffer64 *modifiedDicomBuffer, const void *receivedDicomBuffer, uint64_t receivedDicomBufferSize, OrthancPluginInstanceOrigin origin)
Callback to keep/discard/modify a DICOM instance received by Orthanc from any source (C-STORE or REST...
Definition: OrthancCPlugin.h:8211
OrthancPluginErrorCode(* OrthancPluginWebDavAddFile)(OrthancPluginWebDavCollection *collection, const char *name, uint64_t size, const char *mimeType, const char *dateTime)
Declare a file while returning the content of a folder.
Definition: OrthancCPlugin.h:9086
void OrthancPluginRegisterStorageArea(OrthancPluginContext *context, OrthancPluginStorageCreate create, OrthancPluginStorageRead read, OrthancPluginStorageRemove remove)
Register a custom storage area.
Definition: OrthancCPlugin.h:3325
void OrthancPluginRegisterOnStoredInstanceCallback(OrthancPluginContext *context, OrthancPluginOnStoredInstanceCallback callback)
Register a callback for received instances.
Definition: OrthancCPlugin.h:2290
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:1329
OrthancPluginErrorCode OrthancPluginRegisterDecodeImageCallback(OrthancPluginContext *context, OrthancPluginDecodeImageCallback callback)
Register a callback to handle the decoding of DICOM images.
Definition: OrthancCPlugin.h:5637
OrthancPluginChangeType
Definition: OrthancCPlugin.h:756
OrthancPluginErrorCode(* OrthancPluginStorageReadWhole)(OrthancPluginMemoryBuffer64 *target, const char *uuid, OrthancPluginContentType type)
Callback for reading a whole file from the storage area.
Definition: OrthancCPlugin.h:1395
OrthancPluginErrorCode OrthancPluginRegisterIncomingCStoreInstanceFilter(OrthancPluginContext *context, OrthancPluginIncomingCStoreInstanceFilter callback)
Register a callback to filter incoming DICOM instances received by Orthanc through C-STORE.
Definition: OrthancCPlugin.h:8166
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:1307
void OrthancPluginRegisterRefreshMetricsCallback(OrthancPluginContext *context, OrthancPluginRefreshMetricsCallback callback)
Register a callback to refresh the metrics.
Definition: OrthancCPlugin.h:7297
OrthancPluginErrorCode(* OrthancPluginWebDavCreateFolderCallback)(uint8_t *isReadOnly, uint32_t pathSize, const char *const *pathItems, void *payload)
Callback to create a folder.
Definition: OrthancCPlugin.h:9251
struct _OrthancPluginWebDavCollection_t OrthancPluginWebDavCollection
Opaque structure that represents a WebDAV collection.
Definition: OrthancCPlugin.h:9067
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:1865
OrthancPluginErrorCode(* OrthancPluginWebDavRetrieveFileCallback)(OrthancPluginWebDavCollection *collection, OrthancPluginWebDavRetrieveFile retrieveFile, uint32_t pathSize, const char *const *pathItems, void *payload)
Callback for retrieving the content of a file.
Definition: OrthancCPlugin.h:9206
int32_t(* OrthancPluginIncomingDicomInstanceFilter)(const OrthancPluginDicomInstance *instance)
Callback to filter incoming DICOM instances received by Orthanc.
Definition: OrthancCPlugin.h:8082
OrthancPluginErrorCode OrthancPluginStorageAreaRemove(OrthancPluginContext *context, OrthancPluginStorageArea *storageArea, const char *uuid, OrthancPluginContentType type)
Remove a file from the storage area.
Definition: OrthancCPlugin.h:4995
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:8731
OrthancPluginErrorCode OrthancPluginRegisterIncomingHttpRequestFilter2(OrthancPluginContext *context, OrthancPluginIncomingHttpRequestFilter2 callback)
Register a callback to filter incoming HTTP requests.
Definition: OrthancCPlugin.h:6540
OrthancPluginErrorCode(* OrthancPluginWebDavRetrieveFile)(OrthancPluginWebDavCollection *collection, const void *data, uint64_t size, const char *mimeType, const char *dateTime)
Retrieve the content of a file.
Definition: OrthancCPlugin.h:9134
OrthancPluginErrorCode(* OrthancPluginStorageRead)(void **content, int64_t *size, const char *uuid, OrthancPluginContentType type)
Callback for reading from the storage area.
Definition: OrthancCPlugin.h:1375
void OrthancPluginRegisterRestCallback(OrthancPluginContext *context, const char *pathRegularExpression, OrthancPluginRestCallback callback)
Register a REST callback.
Definition: OrthancCPlugin.h:2212
uint32_t OrthancPluginGetExpectedDatabaseVersion(OrthancPluginContext *context)
Get the expected version of the database schema.
Definition: OrthancCPlugin.h:3799
OrthancPluginErrorCode OrthancPluginRegisterReceivedInstanceCallback(OrthancPluginContext *context, OrthancPluginReceivedInstanceCallback callback)
Register a callback to keep/discard/modify a DICOM instance received by Orthanc from any source (C-ST...
Definition: OrthancCPlugin.h:8243
int32_t OrthancPluginCheckVersion(OrthancPluginContext *context)
Check the compatibility of the plugin wrt. the version of its hosting Orthanc.
Definition: OrthancCPlugin.h:2093
OrthancPluginErrorCode(* OrthancPluginWebDavListFolderCallback)(uint8_t *isExisting, OrthancPluginWebDavCollection *collection, OrthancPluginWebDavAddFile addFile, OrthancPluginWebDavAddFolder addFolder, uint32_t pathSize, const char *const *pathItems, void *payload)
Callback for listing the content of a folder.
Definition: OrthancCPlugin.h:9180
struct _OrthancPluginRestOutput_t OrthancPluginRestOutput
Opaque structure that represents the HTTP connection to the client application.
Definition: OrthancCPlugin.h:1178
void OrthancPluginRegisterOnChangeCallback(OrthancPluginContext *context, OrthancPluginOnChangeCallback callback)
Register a callback to monitor changes.
Definition: OrthancCPlugin.h:3468
void OrthancPluginRegisterStorageArea2(OrthancPluginContext *context, OrthancPluginStorageCreate create, OrthancPluginStorageReadWhole readWhole, OrthancPluginStorageReadRange readRange, OrthancPluginStorageRemove remove)
Register a custom storage area, with support for range request.
Definition: OrthancCPlugin.h:8914
OrthancPluginErrorCode(* OrthancPluginWebDavAddFolder)(OrthancPluginWebDavCollection *collection, const char *name, const char *dateTime)
Declare a subfolder while returning the content of a folder.
Definition: OrthancCPlugin.h:9107
OrthancPluginErrorCode OrthancPluginRegisterWebDavCollection(OrthancPluginContext *context, const char *uri, OrthancPluginWebDavIsExistingFolderCallback isExistingFolder, OrthancPluginWebDavListFolderCallback listFolder, OrthancPluginWebDavRetrieveFileCallback retrieveFile, OrthancPluginWebDavStoreFileCallback storeFile, OrthancPluginWebDavCreateFolderCallback createFolder, OrthancPluginWebDavDeleteItemCallback deleteItem, void *payload)
Register a WebDAV virtual filesystem.
Definition: OrthancCPlugin.h:9310
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:1521
OrthancPluginErrorCode(* OrthancPluginRestCallback)(OrthancPluginRestOutput *output, const char *url, const OrthancPluginHttpRequest *request)
Signature of a callback function that answers to a REST request.
Definition: OrthancCPlugin.h:1275
void(* OrthancPluginRefreshMetricsCallback)()
Callback executed to update the metrics of the plugin.
Definition: OrthancCPlugin.h:1837
OrthancPluginErrorCode OrthancPluginRegisterTranscoderCallback(OrthancPluginContext *context, OrthancPluginTranscoderCallback callback)
Register a callback to handle the transcoding of DICOM images.
Definition: OrthancCPlugin.h:8758
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:1286
OrthancPluginErrorCode(* OrthancPluginWebDavStoreFileCallback)(uint8_t *isReadOnly, uint32_t pathSize, const char *const *pathItems, const void *data, uint64_t size, void *payload)
Callback to store a file.
Definition: OrthancCPlugin.h:9229
OrthancPluginErrorCode(* OrthancPluginWebDavDeleteItemCallback)(uint8_t *isReadOnly, uint32_t pathSize, const char *const *pathItems, void *payload)
Callback to remove a file or a folder.
Definition: OrthancCPlugin.h:9271
OrthancPluginErrorCode OrthancPluginReconstructMainDicomTags(OrthancPluginContext *context, OrthancPluginStorageArea *storageArea, OrthancPluginResourceType level)
Reconstruct the main DICOM tags.
Definition: OrthancCPlugin.h:5187
OrthancPluginErrorCode(* OrthancPluginStorageRemove)(const char *uuid, OrthancPluginContentType type)
Callback for removing a file from the storage area.
Definition: OrthancCPlugin.h:1436
OrthancPluginErrorCode(* OrthancPluginStorageCreate)(const char *uuid, const void *content, int64_t size, OrthancPluginContentType type)
Callback for writing to the storage area.
Definition: OrthancCPlugin.h:1348
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:1903
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:1296
void(* OrthancPluginFinalizeDatabaseBackendV4)(void *backend)
Signature of a callback function that is triggered when the database plugin must be finalized.
Definition: OrthancCPlugin.h:9381
struct _OrthancPluginServerChunkedRequestReader_t OrthancPluginServerChunkedRequestReader
Opaque structure that reads the content of a HTTP request body during a chunked HTTP transfer.
Definition: OrthancCPlugin.h:7745
OrthancPluginErrorCode(* OrthancPluginWebDavIsExistingFolderCallback)(uint8_t *isExisting, uint32_t pathSize, const char *const *pathItems, void *payload)
Callback for testing the existence of a folder.
Definition: OrthancCPlugin.h:9155
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:1486
OrthancPluginJob *(* OrthancPluginJobsUnserializer)(const char *jobType, const char *serialized)
Callback executed to unserialize a custom job.
Definition: OrthancCPlugin.h:1818
void OrthancPluginRegisterJobsUnserializer(OrthancPluginContext *context, OrthancPluginJobsUnserializer unserializer)
Register an unserializer for custom jobs.
Definition: OrthancCPlugin.h:7152
void(* OrthancPluginFree)(void *buffer)
Signature of a function to free dynamic memory.
Definition: OrthancCPlugin.h:1319
void OrthancPluginRegisterRestCallbackNoLock(OrthancPluginContext *context, const char *pathRegularExpression, OrthancPluginRestCallback callback)
Register a REST callback, without locking.
Definition: OrthancCPlugin.h:2252
OrthancPluginErrorCode OrthancPluginStorageAreaRead(OrthancPluginContext *context, OrthancPluginMemoryBuffer *target, OrthancPluginStorageArea *storageArea, const char *uuid, OrthancPluginContentType type)
Read a file from the storage area.
Definition: OrthancCPlugin.h:4956
int32_t OrthancPluginCheckVersionAdvanced(OrthancPluginContext *context, int32_t expectedMajor, int32_t expectedMinor, int32_t expectedRevision)
Check that the version of the hosting Orthanc is above a given version.
Definition: OrthancCPlugin.h:1984
OrthancPluginErrorCode(* OrthancPluginStorageReadRange)(OrthancPluginMemoryBuffer64 *target, const char *uuid, OrthancPluginContentType type, uint64_t rangeStart)
Callback for reading a range of a file from the storage area.
Definition: OrthancCPlugin.h:1418
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:7866
int32_t(* OrthancPluginIncomingCStoreInstanceFilter)(uint16_t *dimseStatus, const OrthancPluginDicomInstance *instance)
Callback to filter incoming DICOM instances received by Orthanc through C-STORE.
Definition: OrthancCPlugin.h:8144
OrthancPluginErrorCode OrthancPluginRegisterIncomingDicomInstanceFilter(OrthancPluginContext *context, OrthancPluginIncomingDicomInstanceFilter callback)
Register a callback to filter incoming DICOM instances.
Definition: OrthancCPlugin.h:8103
OrthancPluginErrorCode OrthancPluginRegisterIncomingHttpRequestFilter(OrthancPluginContext *context, OrthancPluginIncomingHttpRequestFilter callback)
Register a callback to filter incoming HTTP requests.
Definition: OrthancCPlugin.h:5973
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:4912
@ OrthancPluginChangeType_OrthancStopped
Definition: OrthancCPlugin.h:768
@ OrthancPluginChangeType_OrthancStarted
Definition: OrthancCPlugin.h:767
@ OrthancPluginChangeType_Deleted
Definition: OrthancCPlugin.h:758
@ OrthancPluginChangeType_JobFailure
Definition: OrthancCPlugin.h:775
@ OrthancPluginChangeType_NewInstance
Definition: OrthancCPlugin.h:760
@ OrthancPluginChangeType_NewPatient
Definition: OrthancCPlugin.h:761
@ OrthancPluginChangeType_JobSubmitted
Definition: OrthancCPlugin.h:773
@ OrthancPluginChangeType_NewSeries
Definition: OrthancCPlugin.h:762
@ OrthancPluginChangeType_StablePatient
Definition: OrthancCPlugin.h:764
@ OrthancPluginChangeType_UpdatedPeers
Definition: OrthancCPlugin.h:771
@ OrthancPluginChangeType_StableStudy
Definition: OrthancCPlugin.h:766
@ OrthancPluginChangeType_CompletedSeries
Definition: OrthancCPlugin.h:757
@ OrthancPluginChangeType_NewChildInstance
Definition: OrthancCPlugin.h:759
@ OrthancPluginChangeType_UpdatedAttachment
Definition: OrthancCPlugin.h:769
@ OrthancPluginChangeType_UpdatedMetadata
Definition: OrthancCPlugin.h:770
@ OrthancPluginChangeType_StableSeries
Definition: OrthancCPlugin.h:765
@ OrthancPluginChangeType_UpdatedModalities
Definition: OrthancCPlugin.h:772
@ OrthancPluginChangeType_JobSuccess
Definition: OrthancCPlugin.h:774
@ OrthancPluginChangeType_NewStudy
Definition: OrthancCPlugin.h:763
uint32_t OrthancPluginGetFindQuerySize(OrthancPluginContext *context, const OrthancPluginFindQuery *query)
Get the number of tags in a C-Find query.
Definition: OrthancCPlugin.h:6234
struct _OrthancPluginFindQuery_t OrthancPluginFindQuery
Opaque structure to an object that represents a C-Find query.
Definition: OrthancCPlugin.h:1226
OrthancPluginErrorCode(* OrthancPluginApplyMove)(void *moveDriver)
Callback to apply one C-Move suboperation.
Definition: OrthancCPlugin.h:1631
OrthancPluginErrorCode OrthancPluginFindMarkIncomplete(OrthancPluginContext *context, OrthancPluginFindAnswers *answers)
Mark the set of C-Find answers as incomplete.
Definition: OrthancCPlugin.h:6210
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:6302
void(* OrthancPluginStorageCommitmentDestructor)(void *handler)
Callback to free one storage commitment SCP handler.
Definition: OrthancCPlugin.h:7994
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:1455
OrthancPluginErrorCode OrthancPluginRegisterMoveCallback(OrthancPluginContext *context, OrthancPluginMoveCallback callback, OrthancPluginGetMoveSize getMoveSize, OrthancPluginApplyMove applyMove, OrthancPluginFreeMove freeMove)
Register a callback to handle C-Move requests.
Definition: OrthancCPlugin.h:6388
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:7972
OrthancPluginErrorCode OrthancPluginRegisterFindCallback(OrthancPluginContext *context, OrthancPluginFindCallback callback)
Register a callback to handle C-Find requests.
Definition: OrthancCPlugin.h:6142
OrthancPluginErrorCode OrthancPluginWorklistGetDicomQuery(OrthancPluginContext *context, OrthancPluginMemoryBuffer *target, const OrthancPluginWorklistQuery *query)
Retrieve the worklist query as a DICOM file.
Definition: OrthancCPlugin.h:5519
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:8015
int32_t OrthancPluginWorklistIsMatch(OrthancPluginContext *context, const OrthancPluginWorklistQuery *query, const void *dicom, uint32_t size)
Test whether a worklist matches the query.
Definition: OrthancCPlugin.h:5480
OrthancPluginErrorCode OrthancPluginFindAddAnswer(OrthancPluginContext *context, OrthancPluginFindAnswers *answers, const void *dicom, uint32_t size)
Add one answer to some C-Find request.
Definition: OrthancCPlugin.h:6181
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:1591
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:8042
struct _OrthancPluginFindAnswers_t OrthancPluginFindAnswers
Opaque structure to an object that represents the answers to a C-Find query for worklists.
Definition: OrthancCPlugin.h:1234
struct _OrthancPluginWorklistAnswers_t OrthancPluginWorklistAnswers
Opaque structure to an object that represents the answers to a C-Find query for worklists.
Definition: OrthancCPlugin.h:1218
OrthancPluginErrorCode(* OrthancPluginFindCallback)(OrthancPluginFindAnswers *answers, const OrthancPluginFindQuery *query, const char *issuerAet, const char *calledAet)
Callback to handle incoming C-Find SCP requests.
Definition: OrthancCPlugin.h:1548
uint32_t(* OrthancPluginGetMoveSize)(void *moveDriver)
Callback to read the size of a C-Move driver.
Definition: OrthancCPlugin.h:1616
OrthancPluginErrorCode OrthancPluginRegisterWorklistCallback(OrthancPluginContext *context, OrthancPluginWorklistCallback callback)
Register a callback to handle modality worklists requests.
Definition: OrthancCPlugin.h:5376
OrthancPluginErrorCode OrthancPluginWorklistMarkIncomplete(OrthancPluginContext *context, OrthancPluginWorklistAnswers *answers)
Mark the set of worklist answers as incomplete.
Definition: OrthancCPlugin.h:5442
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:6340
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:6271
void(* OrthancPluginFreeMove)(void *moveDriver)
Callback to free one C-Move driver.
Definition: OrthancCPlugin.h:1645
struct _OrthancPluginWorklistQuery_t OrthancPluginWorklistQuery
Opaque structure to an object that represents a C-Find query for worklists.
Definition: OrthancCPlugin.h:1210
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:5412
int32_t OrthancPluginHasInstancePixelData(OrthancPluginContext *context, const OrthancPluginDicomInstance *instance)
Check whether the DICOM file has pixel data.
Definition: OrthancCPlugin.h:8301
char * OrthancPluginGetInstanceDicomWebXml(OrthancPluginContext *context, const OrthancPluginDicomInstance *instance, OrthancPluginDicomWebBinaryCallback2 callback, void *payload)
Convert a DICOM instance to DICOMweb XML.
Definition: OrthancCPlugin.h:8686
struct _OrthancPluginDicomInstance_t OrthancPluginDicomInstance
Opaque structure that represents a DICOM instance that is managed by the Orthanc core.
Definition: OrthancCPlugin.h:1186
char * OrthancPluginGetInstanceTransferSyntaxUid(OrthancPluginContext *context, const OrthancPluginDicomInstance *instance)
Get the transfer syntax of a DICOM file.
Definition: OrthancCPlugin.h:8266
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:8466
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:8603
const void * OrthancPluginGetInstanceData(OrthancPluginContext *context, const OrthancPluginDicomInstance *instance)
Get the data of a DICOM file.
Definition: OrthancCPlugin.h:3122
OrthancPluginDicomInstance * OrthancPluginCreateDicomInstance(OrthancPluginContext *context, const void *buffer, uint32_t size)
Parse a DICOM instance.
Definition: OrthancCPlugin.h:8351
int32_t OrthancPluginHasInstanceMetadata(OrthancPluginContext *context, const OrthancPluginDicomInstance *instance, const char *metadata)
Check whether a DICOM instance is associated with some metadata.
Definition: OrthancCPlugin.h:3235
uint32_t OrthancPluginGetInstanceFramesCount(OrthancPluginContext *context, const OrthancPluginDicomInstance *instance)
Get the number of frames in a DICOM instance.
Definition: OrthancCPlugin.h:8426
OrthancPluginImage * OrthancPluginGetInstanceDecodedFrame(OrthancPluginContext *context, const OrthancPluginDicomInstance *instance, uint32_t frameIndex)
Decode one frame from a DICOM instance.
Definition: OrthancCPlugin.h:8494
OrthancPluginDicomInstance * OrthancPluginLoadDicomInstance(OrthancPluginContext *context, const char *instanceId, OrthancPluginLoadDicomInstanceMode mode)
Load a DICOM instance from the Orthanc server.
Definition: OrthancCPlugin.h:9445
OrthancPluginInstanceOrigin OrthancPluginGetInstanceOrigin(OrthancPluginContext *context, const OrthancPluginDicomInstance *instance)
Get the origin of a DICOM file.
Definition: OrthancCPlugin.h:5545
int64_t OrthancPluginGetInstanceSize(OrthancPluginContext *context, const OrthancPluginDicomInstance *instance)
Get the size of a DICOM file.
Definition: OrthancCPlugin.h:3089
char * OrthancPluginGetInstanceDicomWebJson(OrthancPluginContext *context, const OrthancPluginDicomInstance *instance, OrthancPluginDicomWebBinaryCallback2 callback, void *payload)
Convert a DICOM instance to DICOMweb JSON.
Definition: OrthancCPlugin.h:8646
char * OrthancPluginGetInstanceSimplifiedJson(OrthancPluginContext *context, const OrthancPluginDicomInstance *instance)
Get the DICOM tag hierarchy as a JSON file (with simplification).
Definition: OrthancCPlugin.h:3196
char * OrthancPluginGetInstanceJson(OrthancPluginContext *context, const OrthancPluginDicomInstance *instance)
Get the DICOM tag hierarchy as a JSON file.
Definition: OrthancCPlugin.h:3158
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:3276
void OrthancPluginFreeDicomInstance(OrthancPluginContext *context, OrthancPluginDicomInstance *dicom)
Free a DICOM instance.
Definition: OrthancCPlugin.h:8389
OrthancPluginErrorCode OrthancPluginSerializeDicomInstance(OrthancPluginContext *context, OrthancPluginMemoryBuffer *target, const OrthancPluginDicomInstance *instance)
Writes a DICOM instance to a memory buffer.
Definition: OrthancCPlugin.h:8571
OrthancPluginDicomInstance * OrthancPluginTranscodeDicomInstance(OrthancPluginContext *context, const void *buffer, uint32_t size, const char *transferSyntax)
Parse and transcode a DICOM instance.
Definition: OrthancCPlugin.h:8533
const char * OrthancPluginGetInstanceRemoteAet(OrthancPluginContext *context, const OrthancPluginDicomInstance *instance)
Get the AET of a DICOM instance.
Definition: OrthancCPlugin.h:3056
OrthancPluginPixelFormat
Definition: OrthancCPlugin.h:631
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:4858
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:4442
uint32_t OrthancPluginGetImagePitch(OrthancPluginContext *context, const OrthancPluginImage *image)
Return the pitch of an image.
Definition: OrthancCPlugin.h:4233
OrthancPluginImage * OrthancPluginConvertPixelFormat(OrthancPluginContext *context, const OrthancPluginImage *source, OrthancPluginPixelFormat targetFormat)
Change the pixel format of an image.
Definition: OrthancCPlugin.h:4698
OrthancPluginPixelFormat OrthancPluginGetImagePixelFormat(OrthancPluginContext *context, const OrthancPluginImage *image)
Return the pixel format of an image.
Definition: OrthancCPlugin.h:4132
uint32_t OrthancPluginGetFontsCount(OrthancPluginContext *context)
Return the number of available fonts.
Definition: OrthancCPlugin.h:4733
uint32_t OrthancPluginGetImageHeight(OrthancPluginContext *context, const OrthancPluginImage *image)
Return the height of an image.
Definition: OrthancCPlugin.h:4198
void OrthancPluginFreeImage(OrthancPluginContext *context, OrthancPluginImage *image)
Free an image.
Definition: OrthancCPlugin.h:4352
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:4397
OrthancPluginImage * OrthancPluginCreateImage(OrthancPluginContext *context, OrthancPluginPixelFormat format, uint32_t width, uint32_t height)
Create an image.
Definition: OrthancCPlugin.h:5675
OrthancPluginImage * OrthancPluginUncompressImage(OrthancPluginContext *context, const void *data, uint32_t size, OrthancPluginImageFormat format)
Decode a compressed image.
Definition: OrthancCPlugin.h:4310
const char * OrthancPluginGetFontName(OrthancPluginContext *context, uint32_t fontIndex)
Return the name of a font.
Definition: OrthancCPlugin.h:4773
void * OrthancPluginGetImageBuffer(OrthancPluginContext *context, const OrthancPluginImage *image)
Return a pointer to the content of an image.
Definition: OrthancCPlugin.h:4267
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:5718
OrthancPluginImageFormat
Definition: OrthancCPlugin.h:801
struct _OrthancPluginStorageArea_t OrthancPluginStorageArea
Opaque structure that represents the storage area that is actually used by Orthanc.
Definition: OrthancCPlugin.h:1202
OrthancPluginCompressionType
Definition: OrthancCPlugin.h:786
uint32_t OrthancPluginGetImageWidth(OrthancPluginContext *context, const OrthancPluginImage *image)
Return the width of an image.
Definition: OrthancCPlugin.h:4165
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:3944
OrthancPluginImage * OrthancPluginDecodeDicomImage(OrthancPluginContext *context, const void *buffer, uint32_t bufferSize, uint32_t frameIndex)
Decode one frame from a DICOM instance.
Definition: OrthancCPlugin.h:5764
uint32_t OrthancPluginGetFontSize(OrthancPluginContext *context, uint32_t fontIndex)
Return the size of a font.
Definition: OrthancCPlugin.h:4805
struct _OrthancPluginImage_t OrthancPluginImage
Opaque structure that represents an image that is uncompressed in memory.
Definition: OrthancCPlugin.h:1194
@ OrthancPluginPixelFormat_RGBA32
Color image in RGBA32 format.
Definition: OrthancCPlugin.h:670
@ OrthancPluginPixelFormat_RGB48
Color image in RGB48 format.
Definition: OrthancCPlugin.h:680
@ OrthancPluginPixelFormat_Grayscale8
Graylevel 8bpp image.
Definition: OrthancCPlugin.h:638
@ OrthancPluginPixelFormat_SignedGrayscale16
Graylevel, signed 16bpp image.
Definition: OrthancCPlugin.h:654
@ OrthancPluginPixelFormat_Float32
Graylevel, floating-point 32bpp image.
Definition: OrthancCPlugin.h:696
@ OrthancPluginPixelFormat_RGB24
Color image in RGB24 format.
Definition: OrthancCPlugin.h:662
@ OrthancPluginPixelFormat_BGRA32
Color image in BGRA32 format.
Definition: OrthancCPlugin.h:704
@ OrthancPluginPixelFormat_Unknown
Definition: OrthancCPlugin.h:672
@ OrthancPluginPixelFormat_Grayscale64
Graylevel, unsigned 64bpp image.
Definition: OrthancCPlugin.h:712
@ OrthancPluginPixelFormat_Grayscale32
Graylevel, unsigned 32bpp image.
Definition: OrthancCPlugin.h:688
@ OrthancPluginPixelFormat_Grayscale16
Graylevel, unsigned 16bpp image.
Definition: OrthancCPlugin.h:646
@ OrthancPluginImageFormat_Png
Definition: OrthancCPlugin.h:802
@ OrthancPluginImageFormat_Jpeg
Definition: OrthancCPlugin.h:803
@ OrthancPluginImageFormat_Dicom
Definition: OrthancCPlugin.h:804
@ OrthancPluginCompressionType_Gzip
Definition: OrthancCPlugin.h:789
@ OrthancPluginCompressionType_ZlibWithSize
Definition: OrthancCPlugin.h:788
@ OrthancPluginCompressionType_Zlib
Definition: OrthancCPlugin.h:787
@ OrthancPluginCompressionType_GzipWithSize
Definition: OrthancCPlugin.h:790
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:2520
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:2555
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:2668
char * OrthancPluginLookupStudy(OrthancPluginContext *context, const char *studyUID)
Look for a study.
Definition: OrthancCPlugin.h:2769
OrthancPluginErrorCode OrthancPluginSetGlobalProperty(OrthancPluginContext *context, int32_t property, const char *value)
Set the value of a global property.
Definition: OrthancCPlugin.h:3702
char * OrthancPluginGetGlobalProperty(OrthancPluginContext *context, int32_t property, const char *defaultValue)
Get the value of a global property.
Definition: OrthancCPlugin.h:3663
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:2632
char * OrthancPluginLookupSeries(OrthancPluginContext *context, const char *seriesUID)
Look for a series.
Definition: OrthancCPlugin.h:2839
char * OrthancPluginLookupStudyWithAccessionNumber(OrthancPluginContext *context, const char *accessionNumber)
Look for a study, using the accession number.
Definition: OrthancCPlugin.h:2804
char * OrthancPluginGenerateRestApiAuthorizationToken(OrthancPluginContext *context)
Generate a token to grant full access to the REST API of Orthanc.
Definition: OrthancCPlugin.h:8831
OrthancPluginErrorCode OrthancPluginRestApiGet(OrthancPluginContext *context, OrthancPluginMemoryBuffer *target, const char *uri)
Make a GET call to the built-in Orthanc REST API.
Definition: OrthancCPlugin.h:2453
char * OrthancPluginLookupInstance(OrthancPluginContext *context, const char *sopInstanceUID)
Look for an instance.
Definition: OrthancCPlugin.h:2874
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:2483
char * OrthancPluginLookupPatient(OrthancPluginContext *context, const char *patientID)
Look for a patient.
Definition: OrthancCPlugin.h:2734
OrthancPluginErrorCode OrthancPluginRestApiDelete(OrthancPluginContext *context, const char *uri)
Make a DELETE call to the built-in Orthanc REST API.
Definition: OrthancCPlugin.h:2584
OrthancPluginErrorCode OrthancPluginRestApiDeleteAfterPlugins(OrthancPluginContext *context, const char *uri)
Make a DELETE call to the REST API, as tainted by the plugins.
Definition: OrthancCPlugin.h:2607
OrthancPluginErrorCode OrthancPluginCallRestApi(OrthancPluginContext *context, OrthancPluginMemoryBuffer *answerBody, OrthancPluginMemoryBuffer *answerHeaders, uint16_t *httpStatus, OrthancPluginHttpMethod method, const char *uri, uint32_t headersCount, const char *const *headersKeys, const char *const *headersValues, const void *body, uint32_t bodySize, uint8_t afterPlugins)
Call the REST API of Orthanc with full flexibility.
Definition: OrthancCPlugin.h:9029
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:5338
OrthancPluginErrorCode OrthancPluginGetDicomForInstance(OrthancPluginContext *context, OrthancPluginMemoryBuffer *target, const char *instanceId)
Retrieve a DICOM instance using its Orthanc identifier.
Definition: OrthancCPlugin.h:2420
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:2379
void OrthancPluginSendUnauthorized(OrthancPluginContext *context, OrthancPluginRestOutput *output, const char *realm)
Signal that a REST request is not authorized.
Definition: OrthancCPlugin.h:2942
void OrthancPluginSetHttpErrorDetails(OrthancPluginContext *context, OrthancPluginRestOutput *output, const char *details, uint8_t log)
Provide a detailed description for an HTTP error.
Definition: OrthancCPlugin.h:7188
void OrthancPluginSendMethodNotAllowed(OrthancPluginContext *context, OrthancPluginRestOutput *output, const char *allowedMethods)
Signal that this URI does not support this HTTP method.
Definition: OrthancCPlugin.h:2965
void OrthancPluginAnswerBuffer(OrthancPluginContext *context, OrthancPluginRestOutput *output, const void *answer, uint32_t answerSize, const char *mimeType)
Answer to a REST request.
Definition: OrthancCPlugin.h:2322
void OrthancPluginSendHttpStatusCode(OrthancPluginContext *context, OrthancPluginRestOutput *output, uint16_t status)
Send a HTTP status code.
Definition: OrthancCPlugin.h:2919
void OrthancPluginSetHttpHeader(OrthancPluginContext *context, OrthancPluginRestOutput *output, const char *key, const char *value)
Set some HTTP header.
Definition: OrthancCPlugin.h:3020
void OrthancPluginSetCookie(OrthancPluginContext *context, OrthancPluginRestOutput *output, const char *cookie, const char *value)
Set a cookie.
Definition: OrthancCPlugin.h:2995
void OrthancPluginRedirect(OrthancPluginContext *context, OrthancPluginRestOutput *output, const char *redirection)
Redirect a REST request.
Definition: OrthancCPlugin.h:2702
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:4489
OrthancPluginErrorCode OrthancPluginSendMultipartItem(OrthancPluginContext *context, OrthancPluginRestOutput *output, const void *answer, uint32_t answerSize)
Send an item as a part of some HTTP multipart answer.
Definition: OrthancCPlugin.h:3902
OrthancPluginErrorCode OrthancPluginSendMultipartItem2(OrthancPluginContext *context, OrthancPluginRestOutput *output, const void *answer, uint32_t answerSize, uint32_t headersCount, const char *const *headersKeys, const char *const *headersValues)
Send an item as a part of some HTTP multipart answer, with custom headers.
Definition: OrthancCPlugin.h:5935
void OrthancPluginSendHttpStatus(OrthancPluginContext *context, OrthancPluginRestOutput *output, uint16_t status, const void *body, uint32_t bodySize)
Send a HTTP status, with a custom body.
Definition: OrthancCPlugin.h:4096
OrthancPluginErrorCode OrthancPluginStartMultipartAnswer(OrthancPluginContext *context, OrthancPluginRestOutput *output, const char *subType, const char *contentType)
Start an HTTP multipart answer.
Definition: OrthancCPlugin.h:3873
OrthancPluginErrorCode(* OrthancPluginJobStop)(void *job, OrthancPluginJobStopReason reason)
Callback executed once one custom job leaves the "running" state.
Definition: OrthancCPlugin.h:1785
OrthancPluginErrorCode(* OrthancPluginServerChunkedRequestReaderExecute)(OrthancPluginServerChunkedRequestReader *reader, OrthancPluginRestOutput *output)
Callback invoked whenever the request body is entirely received.
Definition: OrthancCPlugin.h:7803
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:6048
struct _OrthancPluginJob_t OrthancPluginJob
Opaque structure to a job to be executed by Orthanc.
Definition: OrthancCPlugin.h:1258
OrthancPluginErrorCode OrthancPluginCreateDicom2(OrthancPluginContext *context, OrthancPluginMemoryBuffer *target, const char *json, const OrthancPluginImage *pixelData, OrthancPluginCreateDicomFlags flags, const char *privateCreator)
Create a DICOM instance from a JSON string and an image, with a private creator.
Definition: OrthancCPlugin.h:8961
void OrthancPluginLogMessage(OrthancPluginContext *context, const char *message, const char *plugin, const char *file, uint32_t line, OrthancPluginLogCategory category, OrthancPluginLogLevel level)
Log a message.
Definition: OrthancCPlugin.h:9551
void OrthancPluginLogInfo(OrthancPluginContext *context, const char *message)
Log an information.
Definition: OrthancCPlugin.h:2176
OrthancPluginErrorCode(* OrthancPluginServerChunkedRequestReaderFactory)(OrthancPluginServerChunkedRequestReader **reader, const char *url, const OrthancPluginHttpRequest *request)
Callback to create a reader to handle incoming chunked HTTP transfers.
Definition: OrthancCPlugin.h:7764
void OrthancPluginFreeFindMatcher(OrthancPluginContext *context, OrthancPluginFindMatcher *matcher)
Free a C-Find matcher.
Definition: OrthancCPlugin.h:6465
void OrthancPluginFreePeers(OrthancPluginContext *context, OrthancPluginPeers *peers)
Free the list of available Orthanc peers.
Definition: OrthancCPlugin.h:6602
OrthancPluginLogLevel
Definition: OrthancCPlugin.h:1099
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:5143
OrthancPluginIdentifierConstraint
Definition: OrthancCPlugin.h:905
void OrthancPluginExtendOrthancExplorer2(OrthancPluginContext *context, const char *plugin, const char *javascript)
Extend the JavaScript code of Orthanc Explorer.
Definition: OrthancCPlugin.h:3628
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:5090
OrthancPluginResourceType
Definition: OrthancCPlugin.h:738
void OrthancPluginSetRootUri2(OrthancPluginContext *context, const char *plugin, const char *uri)
Set the URI where the plugin provides its Web interface.
Definition: OrthancCPlugin.h:3528
void OrthancPluginSetMetricsIntegerValue(OrthancPluginContext *context, const char *name, int64_t value, OrthancPluginMetricsType type)
Set the value of an integer metrics.
Definition: OrthancCPlugin.h:9491
OrthancPluginLogCategory
Definition: OrthancCPlugin.h:1116
OrthancPluginErrorCode OrthancPluginWriteFile(OrthancPluginContext *context, const char *path, const void *data, uint32_t size)
Write a file.
Definition: OrthancCPlugin.h:4012
uint32_t OrthancPluginGetCommandLineArgumentsCount(OrthancPluginContext *context)
Get the number of command-line arguments.
Definition: OrthancCPlugin.h:3733
OrthancPluginErrorCode
Definition: OrthancCPlugin.h:216
struct _OrthancPluginPeers_t OrthancPluginPeers
Opaque structure to the set of remote Orthanc Peers that are known to the local Orthanc server.
Definition: OrthancCPlugin.h:1250
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:4580
uint32_t(* OrthancPluginChunkedClientRequestGetChunkSize)(void *request)
Callback to read the size of the current request chunk during a chunked transfer.
Definition: OrthancCPlugin.h:7605
OrthancPluginErrorCode OrthancPluginRegisterErrorCode(OrthancPluginContext *context, int32_t code, uint16_t httpStatus, const char *message)
Declare a custom error code for this plugin.
Definition: OrthancCPlugin.h:5034
OrthancPluginErrorCode OrthancPluginCreateMemoryBuffer(OrthancPluginContext *context, OrthancPluginMemoryBuffer *target, uint32_t size)
Create a 32-bit memory buffer.
Definition: OrthancCPlugin.h:8793
OrthancPluginDicomWebBinaryMode
Definition: OrthancCPlugin.h:994
char * OrthancPluginEncodeDicomWebJson2(OrthancPluginContext *context, const void *dicom, uint32_t dicomSize, OrthancPluginDicomWebBinaryCallback2 callback, void *payload)
Convert a DICOM instance to DICOMweb JSON.
Definition: OrthancCPlugin.h:7427
OrthancPluginErrorCode(* OrthancPluginJobGetContent2)(OrthancPluginMemoryBuffer *target, void *job)
Callback to retrieve the content of one custom job.
Definition: OrthancCPlugin.h:1705
const char *(* OrthancPluginJobGetSerialized)(void *job)
Callback to serialize one custom job.
Definition: OrthancCPlugin.h:1725
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:5280
OrthancPluginErrorCode(* OrthancPluginChunkedClientRequestNext)(void *request)
Callback to advance in the request body during a chunked transfer.
Definition: OrthancCPlugin.h:7573
struct _OrthancPluginDicomWebNode_t OrthancPluginDicomWebNode
Opaque structure that represents a node in a JSON or XML document used in DICOMweb.
Definition: OrthancCPlugin.h:1267
float(* OrthancPluginJobGetProgress)(void *job)
Callback to check the progress of one custom job.
Definition: OrthancCPlugin.h:1671
OrthancPluginDicomToJsonFlags
Definition: OrthancCPlugin.h:869
OrthancPluginJobStepStatus
Definition: OrthancCPlugin.h:951
OrthancPluginCreateDicomFlags
Definition: OrthancCPlugin.h:890
void(* OrthancPluginServerChunkedRequestReaderFinalize)(OrthancPluginServerChunkedRequestReader *reader)
Callback invoked to release the resources associated with an incoming HTTP chunked transfer.
Definition: OrthancCPlugin.h:7821
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:6498
void OrthancPluginExtendOrthancExplorer(OrthancPluginContext *context, const char *javascript)
Extend the JavaScript code of Orthanc Explorer.
Definition: OrthancCPlugin.h:3605
void OrthancPluginLogWarning(OrthancPluginContext *context, const char *message)
Log a warning.
Definition: OrthancCPlugin.h:2160
OrthancPluginConstraintType
Definition: OrthancCPlugin.h:920
OrthancPluginErrorCode OrthancPluginReadFile(OrthancPluginContext *context, OrthancPluginMemoryBuffer *target, const char *path)
Read a file.
Definition: OrthancCPlugin.h:3981
OrthancPluginJobStepStatus(* OrthancPluginJobStep)(void *job)
Callback to execute one step of a custom job.
Definition: OrthancCPlugin.h:1761
void OrthancPluginSetMetricsValue(OrthancPluginContext *context, const char *name, float value, OrthancPluginMetricsType type)
Set the value of a floating-point metrics.
Definition: OrthancCPlugin.h:7266
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:7783
OrthancPluginReceivedInstanceAction
Definition: OrthancCPlugin.h:1055
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:7684
int32_t(* OrthancPluginJobGetSerialized2)(OrthancPluginMemoryBuffer *target, void *job)
Callback to serialize one custom job.
Definition: OrthancCPlugin.h:1745
const char * OrthancPluginAutodetectMimeType(OrthancPluginContext *context, const char *path)
Detect the MIME type of a file.
Definition: OrthancCPlugin.h:7220
void OrthancPluginFreeMemoryBuffer64(OrthancPluginContext *context, OrthancPluginMemoryBuffer64 *buffer)
Free a memory buffer.
Definition: OrthancCPlugin.h:2128
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:4622
const char * OrthancPluginGetPeerName(OrthancPluginContext *context, const OrthancPluginPeers *peers, uint32_t peerIndex)
Get the symbolic name of an Orthanc peer.
Definition: OrthancCPlugin.h:6680
char * OrthancPluginGetCommandLineArgument(OrthancPluginContext *context, uint32_t argument)
Get the value of a command-line argument.
Definition: OrthancCPlugin.h:3767
const char * OrthancPluginGetErrorDescription(OrthancPluginContext *context, OrthancPluginErrorCode error)
Get the description of a given error code.
Definition: OrthancCPlugin.h:4043
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:5601
char * OrthancPluginGenerateUuid(OrthancPluginContext *context)
Generate an UUID.
Definition: OrthancCPlugin.h:6103
void OrthancPluginFreeJob(OrthancPluginContext *context, OrthancPluginJob *job)
Free a custom job.
Definition: OrthancCPlugin.h:7075
OrthancPluginStorageCommitmentFailureReason
Definition: OrthancCPlugin.h:1007
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:7536
const char * OrthancPluginGetPeerUrl(OrthancPluginContext *context, const OrthancPluginPeers *peers, uint32_t peerIndex)
Get the base URL of an Orthanc peer.
Definition: OrthancCPlugin.h:6721
OrthancPluginPeers * OrthancPluginGetPeers(OrthancPluginContext *context)
Return the list of available Orthanc peers.
Definition: OrthancCPlugin.h:6568
OrthancPluginMetricsType
Definition: OrthancCPlugin.h:977
char * OrthancPluginSubmitJob(OrthancPluginContext *context, OrthancPluginJob *job, int32_t priority)
Submit a new job to the jobs engine of Orthanc.
Definition: OrthancCPlugin.h:7107
char * OrthancPluginEncodeDicomWebXml2(OrthancPluginContext *context, const void *dicom, uint32_t dicomSize, OrthancPluginDicomWebBinaryCallback2 callback, void *payload)
Convert a DICOM instance to DICOMweb XML.
Definition: OrthancCPlugin.h:7471
char * OrthancPluginEncodeDicomWebXml(OrthancPluginContext *context, const void *dicom, uint32_t dicomSize, OrthancPluginDicomWebBinaryCallback callback)
Convert a DICOM instance to DICOMweb XML.
Definition: OrthancCPlugin.h:7375
const char * OrthancPluginGetDatabaseServerIdentifier(OrthancPluginContext *context)
Gets the DatabaseServerIdentifier.
Definition: OrthancCPlugin.h:9343
OrthancPluginErrorCode OrthancPluginHttpDelete(OrthancPluginContext *context, const char *url, const char *username, const char *password)
Issue a HTTP DELETE call.
Definition: OrthancCPlugin.h:4660
uint8_t(* OrthancPluginChunkedClientRequestIsDone)(void *request)
Callback to know whether the request body is entirely read during a chunked transfer.
Definition: OrthancCPlugin.h:7556
char * OrthancPluginGetTagName(OrthancPluginContext *context, uint16_t group, uint16_t element, const char *privateCreator)
Returns the symbolic name of a DICOM tag.
Definition: OrthancCPlugin.h:7917
char * OrthancPluginComputeMd5(OrthancPluginContext *context, const void *buffer, uint32_t size)
Compute an MD5 hash.
Definition: OrthancCPlugin.h:5810
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:5231
void OrthancPluginFreeMemoryBuffer(OrthancPluginContext *context, OrthancPluginMemoryBuffer *buffer)
Free a memory buffer.
Definition: OrthancCPlugin.h:2112
OrthancPluginErrorCode OrthancPluginCreateMemoryBuffer64(OrthancPluginContext *context, OrthancPluginMemoryBuffer64 *target, uint64_t size)
Create a 64-bit memory buffer.
Definition: OrthancCPlugin.h:8877
OrthancPluginLoadDicomInstanceMode
Definition: OrthancCPlugin.h:1069
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:7515
uint32_t OrthancPluginGetPeersCount(OrthancPluginContext *context, const OrthancPluginPeers *peers)
Get the number of Orthanc peers.
Definition: OrthancCPlugin.h:6632
OrthancPluginValueRepresentation
Definition: OrthancCPlugin.h:815
char * OrthancPluginGetConfigurationPath(OrthancPluginContext *context)
Return the path to the configuration file(s).
Definition: OrthancCPlugin.h:3422
const void *(* OrthancPluginChunkedClientRequestGetChunkData)(void *request)
Callback to read the current chunk of the request body during a chunked transfer.
Definition: OrthancCPlugin.h:7589
OrthancPluginErrorCode OrthancPluginHttpGet(OrthancPluginContext *context, OrthancPluginMemoryBuffer *target, const char *url, const char *username, const char *password)
Issue a HTTP GET call.
Definition: OrthancCPlugin.h:4542
OrthancPluginJobStopReason
Definition: OrthancCPlugin.h:965
char * OrthancPluginGetOrthancDirectory(OrthancPluginContext *context)
Return the directory containing the Orthanc.
Definition: OrthancCPlugin.h:3387
OrthancPluginFindMatcher * OrthancPluginCreateFindMatcher(OrthancPluginContext *context, const void *query, uint32_t size)
Create a C-Find matcher.
Definition: OrthancCPlugin.h:6427
OrthancPluginDicomToJsonFormat
Definition: OrthancCPlugin.h:854
void OrthancPluginSetDescription2(OrthancPluginContext *context, const char *plugin, const char *description)
Set a description for this plugin.
Definition: OrthancCPlugin.h:3578
void OrthancPluginLogError(OrthancPluginContext *context, const char *message)
Log an error.
Definition: OrthancCPlugin.h:2144
OrthancPluginHttpMethod
Definition: OrthancCPlugin.h:344
char * OrthancPluginGetConfiguration(OrthancPluginContext *context)
Return the content of the configuration file(s).
Definition: OrthancCPlugin.h:3832
void OrthancPluginSetRootUri(OrthancPluginContext *context, const char *uri)
Set the URI where the plugin provides its Web interface.
Definition: OrthancCPlugin.h:3503
OrthancPluginJob * OrthancPluginCreateJob2(OrthancPluginContext *context, void *job, OrthancPluginJobFinalize finalize, const char *type, OrthancPluginJobGetProgress getProgress, OrthancPluginJobGetContent2 getContent, OrthancPluginJobGetSerialized2 getSerialized, OrthancPluginJobStep step, OrthancPluginJobStop stop, OrthancPluginJobReset reset)
Create a custom job.
Definition: OrthancCPlugin.h:7020
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:6934
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:6848
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:1242
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:6767
OrthancPluginErrorCode OrthancPluginLookupDictionary(OrthancPluginContext *context, OrthancPluginDictionaryEntry *target, const char *name)
Get information about the given DICOM tag.
Definition: OrthancCPlugin.h:5892
char * OrthancPluginComputeSha1(OrthancPluginContext *context, const void *buffer, uint32_t size)
Compute a SHA-1 hash.
Definition: OrthancCPlugin.h:5846
OrthancPluginInstanceOrigin
Definition: OrthancCPlugin.h:935
void(* OrthancPluginJobFinalize)(void *job)
Callback to finalize one custom job.
Definition: OrthancCPlugin.h:1658
void OrthancPluginFreeString(OrthancPluginContext *context, char *str)
Free a string.
Definition: OrthancCPlugin.h:1954
const char *(* OrthancPluginJobGetContent)(void *job)
Callback to retrieve the content of one custom job.
Definition: OrthancCPlugin.h:1687
OrthancPluginErrorCode OrthancPluginSetCurrentThreadName(OrthancPluginContext *context, const char *threadName)
Set the name of the current thread.
Definition: OrthancCPlugin.h:9518
char * OrthancPluginEncodeDicomWebJson(OrthancPluginContext *context, const void *dicom, uint32_t dicomSize, OrthancPluginDicomWebBinaryCallback callback)
Convert a DICOM instance to DICOMweb JSON.
Definition: OrthancCPlugin.h:7333
char * OrthancPluginGetOrthancPath(OrthancPluginContext *context)
Return the path to the Orthanc executable.
Definition: OrthancCPlugin.h:3357
OrthancPluginErrorCode(* OrthancPluginJobReset)(void *job)
Callback executed once one stopped custom job is started again.
Definition: OrthancCPlugin.h:1802
struct _OrthancPluginContext_t OrthancPluginContext
Data structure that contains information about the Orthanc core.
OrthancPluginContentType
Definition: OrthancCPlugin.h:723
void OrthancPluginSetDescription(OrthancPluginContext *context, const char *description)
Set a description for this plugin.
Definition: OrthancCPlugin.h:3555
@ OrthancPluginLogLevel_Warning
Definition: OrthancCPlugin.h:1101
@ OrthancPluginLogLevel_Trace
Definition: OrthancCPlugin.h:1103
@ OrthancPluginLogLevel_Error
Definition: OrthancCPlugin.h:1100
@ OrthancPluginLogLevel_Info
Definition: OrthancCPlugin.h:1102
@ OrthancPluginIdentifierConstraint_Wildcard
Definition: OrthancCPlugin.h:909
@ OrthancPluginIdentifierConstraint_Equal
Definition: OrthancCPlugin.h:906
@ OrthancPluginIdentifierConstraint_SmallerOrEqual
Definition: OrthancCPlugin.h:907
@ OrthancPluginIdentifierConstraint_GreaterOrEqual
Definition: OrthancCPlugin.h:908
@ OrthancPluginResourceType_Instance
Definition: OrthancCPlugin.h:742
@ OrthancPluginResourceType_None
Definition: OrthancCPlugin.h:743
@ OrthancPluginResourceType_Series
Definition: OrthancCPlugin.h:741
@ OrthancPluginResourceType_Study
Definition: OrthancCPlugin.h:740
@ OrthancPluginResourceType_Patient
Definition: OrthancCPlugin.h:739
@ OrthancPluginLogCategory_Dicom
Definition: OrthancCPlugin.h:1121
@ OrthancPluginLogCategory_Jobs
Definition: OrthancCPlugin.h:1122
@ OrthancPluginLogCategory_Sqlite
Definition: OrthancCPlugin.h:1120
@ OrthancPluginLogCategory_Plugins
Definition: OrthancCPlugin.h:1118
@ OrthancPluginLogCategory_Generic
Definition: OrthancCPlugin.h:1117
@ OrthancPluginLogCategory_Lua
Definition: OrthancCPlugin.h:1123
@ OrthancPluginLogCategory_Http
Definition: OrthancCPlugin.h:1119
@ OrthancPluginErrorCode_CreateDicomBadParent
Definition: OrthancCPlugin.h:306
@ OrthancPluginErrorCode_MainDicomTagsMultiplyDefined
Definition: OrthancCPlugin.h:262
@ OrthancPluginErrorCode_SQLiteFlush
Definition: OrthancCPlugin.h:274
@ OrthancPluginErrorCode_IncompatibleDatabaseVersion
Definition: OrthancCPlugin.h:236
@ OrthancPluginErrorCode_BadSequenceOfCalls
Definition: OrthancCPlugin.h:224
@ OrthancPluginErrorCode_SharedLibrary
Definition: OrthancCPlugin.h:243
@ OrthancPluginErrorCode_NullPointer
Definition: OrthancCPlugin.h:253
@ OrthancPluginErrorCode_NotLuaPredicate
Definition: OrthancCPlugin.h:316
@ OrthancPluginErrorCode_LuaAlreadyExecuted
Definition: OrthancCPlugin.h:314
@ OrthancPluginErrorCode_NotAcceptable
Definition: OrthancCPlugin.h:252
@ OrthancPluginErrorCode_FullStorage
Definition: OrthancCPlugin.h:237
@ OrthancPluginErrorCode_DatabaseBackendAlreadyRegistered
Definition: OrthancCPlugin.h:319
@ OrthancPluginErrorCode_InexistentFile
Definition: OrthancCPlugin.h:231
@ OrthancPluginErrorCode_CreateDicomParentEncoding
Definition: OrthancCPlugin.h:308
@ OrthancPluginErrorCode_CannotOrderSlices
Definition: OrthancCPlugin.h:322
@ OrthancPluginErrorCode_InternalError
Definition: OrthancCPlugin.h:217
@ OrthancPluginErrorCode_DiscontinuedAbi
Definition: OrthancCPlugin.h:258
@ OrthancPluginErrorCode_NoCFindHandler
Definition: OrthancCPlugin.h:292
@ OrthancPluginErrorCode_SQLiteCommitWithoutTransaction
Definition: OrthancCPlugin.h:272
@ OrthancPluginErrorCode_DatabasePlugin
Definition: OrthancCPlugin.h:249
@ OrthancPluginErrorCode_SQLiteStatementAlreadyUsed
Definition: OrthancCPlugin.h:269
@ OrthancPluginErrorCode_SQLiteCannotRun
Definition: OrthancCPlugin.h:275
@ OrthancPluginErrorCode_UnknownPluginService
Definition: OrthancCPlugin.h:244
@ OrthancPluginErrorCode_JsonToLuaTable
Definition: OrthancCPlugin.h:311
@ OrthancPluginErrorCode_CreateDicomOverrideTag
Definition: OrthancCPlugin.h:302
@ OrthancPluginErrorCode_SQLiteBindOutOfRange
Definition: OrthancCPlugin.h:277
@ OrthancPluginErrorCode_ParameterOutOfRange
Definition: OrthancCPlugin.h:221
@ OrthancPluginErrorCode_SQLiteRegisterFunction
Definition: OrthancCPlugin.h:273
@ OrthancPluginErrorCode_SQLiteTransactionBegin
Definition: OrthancCPlugin.h:281
@ OrthancPluginErrorCode_CreateDicomNoPayload
Definition: OrthancCPlugin.h:304
@ OrthancPluginErrorCode_Unauthorized
Definition: OrthancCPlugin.h:247
@ OrthancPluginErrorCode_RegularFileExpected
Definition: OrthancCPlugin.h:288
@ OrthancPluginErrorCode_DicomPortInUse
Definition: OrthancCPlugin.h:286
@ OrthancPluginErrorCode_BadApplicationEntityTitle
Definition: OrthancCPlugin.h:291
@ OrthancPluginErrorCode_NoCStoreHandler
Definition: OrthancCPlugin.h:294
@ OrthancPluginErrorCode_PathToExecutable
Definition: OrthancCPlugin.h:289
@ OrthancPluginErrorCode_NoSopClassOrInstance
Definition: OrthancCPlugin.h:296
@ OrthancPluginErrorCode_BadFont
Definition: OrthancCPlugin.h:248
@ OrthancPluginErrorCode_DatabaseUnavailable
Definition: OrthancCPlugin.h:254
@ OrthancPluginErrorCode_CannotCreateLua
Definition: OrthancCPlugin.h:312
@ OrthancPluginErrorCode_SQLiteExecute
Definition: OrthancCPlugin.h:270
@ OrthancPluginErrorCode_UriSyntax
Definition: OrthancCPlugin.h:230
@ OrthancPluginErrorCode_DirectoryOverFile
Definition: OrthancCPlugin.h:282
@ OrthancPluginErrorCode_Revision
Definition: OrthancCPlugin.h:261
@ OrthancPluginErrorCode_InexistentTag
Definition: OrthancCPlugin.h:239
@ OrthancPluginErrorCode_IncompatibleImageFormat
Definition: OrthancCPlugin.h:241
@ OrthancPluginErrorCode_UnsupportedMediaType
Definition: OrthancCPlugin.h:327
@ OrthancPluginErrorCode_DicomFindUnavailable
Definition: OrthancCPlugin.h:298
@ OrthancPluginErrorCode_SQLiteCannotStep
Definition: OrthancCPlugin.h:276
@ OrthancPluginErrorCode_CreateDicomParentIsInstance
Definition: OrthancCPlugin.h:307
@ OrthancPluginErrorCode_DuplicateResource
Definition: OrthancCPlugin.h:264
@ OrthancPluginErrorCode_StorageAreaAlreadyRegistered
Definition: OrthancCPlugin.h:318
@ OrthancPluginErrorCode_LuaReturnsNoString
Definition: OrthancCPlugin.h:317
@ OrthancPluginErrorCode_UnknownResource
Definition: OrthancCPlugin.h:235
@ OrthancPluginErrorCode_CreateDicomNotString
Definition: OrthancCPlugin.h:301
@ OrthancPluginErrorCode_HttpPortInUse
Definition: OrthancCPlugin.h:285
@ OrthancPluginErrorCode_SslDisabled
Definition: OrthancCPlugin.h:321
@ OrthancPluginErrorCode_UnknownModality
Definition: OrthancCPlugin.h:309
@ OrthancPluginErrorCode_BadHttpStatusInRest
Definition: OrthancCPlugin.h:287
@ OrthancPluginErrorCode_BadGeometry
Definition: OrthancCPlugin.h:256
@ OrthancPluginErrorCode_AlreadyExistingTag
Definition: OrthancCPlugin.h:324
@ OrthancPluginErrorCode_FileStorageCannotWrite
Definition: OrthancCPlugin.h:283
@ OrthancPluginErrorCode_CreateDicomUseDataUriScheme
Definition: OrthancCPlugin.h:305
@ OrthancPluginErrorCode_DirectoryExpected
Definition: OrthancCPlugin.h:284
@ OrthancPluginErrorCode_NoCMoveHandler
Definition: OrthancCPlugin.h:293
@ OrthancPluginErrorCode_SQLitePrepareStatement
Definition: OrthancCPlugin.h:278
@ OrthancPluginErrorCode_CorruptedFile
Definition: OrthancCPlugin.h:238
@ OrthancPluginErrorCode_StorageAreaPlugin
Definition: OrthancCPlugin.h:250
@ OrthancPluginErrorCode_BadJobOrdering
Definition: OrthancCPlugin.h:310
@ OrthancPluginErrorCode_IncompatibleConfigurations
Definition: OrthancCPlugin.h:265
@ OrthancPluginErrorCode_DatabaseCannotSerialize
Definition: OrthancCPlugin.h:260
@ OrthancPluginErrorCode_CanceledJob
Definition: OrthancCPlugin.h:255
@ OrthancPluginErrorCode_BadRange
Definition: OrthancCPlugin.h:259
@ OrthancPluginErrorCode_NotImplemented
Definition: OrthancCPlugin.h:220
@ OrthancPluginErrorCode_SslInitialization
Definition: OrthancCPlugin.h:257
@ OrthancPluginErrorCode_IncompatibleImageSize
Definition: OrthancCPlugin.h:242
@ OrthancPluginErrorCode_BadFileFormat
Definition: OrthancCPlugin.h:233
@ OrthancPluginErrorCode_BadRequest
Definition: OrthancCPlugin.h:226
@ OrthancPluginErrorCode_SystemCommand
Definition: OrthancCPlugin.h:228
@ OrthancPluginErrorCode_NoStorageCommitmentHandler
Definition: OrthancCPlugin.h:325
@ OrthancPluginErrorCode_SQLiteAlreadyOpened
Definition: OrthancCPlugin.h:267
@ OrthancPluginErrorCode_Plugin
Definition: OrthancCPlugin.h:219
@ OrthancPluginErrorCode_CannotExecuteLua
Definition: OrthancCPlugin.h:313
@ OrthancPluginErrorCode_SQLiteRollbackWithoutTransaction
Definition: OrthancCPlugin.h:271
@ OrthancPluginErrorCode_UnknownDicomTag
Definition: OrthancCPlugin.h:245
@ OrthancPluginErrorCode_ForbiddenAccess
Definition: OrthancCPlugin.h:263
@ OrthancPluginErrorCode_NoPresentationContext
Definition: OrthancCPlugin.h:297
@ OrthancPluginErrorCode_EmptyRequest
Definition: OrthancCPlugin.h:251
@ OrthancPluginErrorCode_DatabaseNotInitialized
Definition: OrthancCPlugin.h:320
@ OrthancPluginErrorCode_DicomMoveUnavailable
Definition: OrthancCPlugin.h:299
@ OrthancPluginErrorCode_SQLiteTransactionCommit
Definition: OrthancCPlugin.h:280
@ OrthancPluginErrorCode_BadJson
Definition: OrthancCPlugin.h:246
@ OrthancPluginErrorCode_Success
Definition: OrthancCPlugin.h:218
@ OrthancPluginErrorCode_NetworkProtocol
Definition: OrthancCPlugin.h:227
@ OrthancPluginErrorCode_NoApplicationEntityFilter
Definition: OrthancCPlugin.h:295
@ OrthancPluginErrorCode_InexistentItem
Definition: OrthancCPlugin.h:225
@ OrthancPluginErrorCode_Timeout
Definition: OrthancCPlugin.h:234
@ OrthancPluginErrorCode_LuaBadOutput
Definition: OrthancCPlugin.h:315
@ OrthancPluginErrorCode_SQLiteTransactionAlreadyStarted
Definition: OrthancCPlugin.h:279
@ OrthancPluginErrorCode_NoCGetHandler
Definition: OrthancCPlugin.h:326
@ OrthancPluginErrorCode_SQLiteNotOpened
Definition: OrthancCPlugin.h:266
@ OrthancPluginErrorCode_ReadOnly
Definition: OrthancCPlugin.h:240
@ OrthancPluginErrorCode_CannotStoreInstance
Definition: OrthancCPlugin.h:300
@ OrthancPluginErrorCode_CannotWriteFile
Definition: OrthancCPlugin.h:232
@ OrthancPluginErrorCode_BadParameterType
Definition: OrthancCPlugin.h:223
@ OrthancPluginErrorCode_NotEnoughMemory
Definition: OrthancCPlugin.h:222
@ OrthancPluginErrorCode_CreateDicomUseContent
Definition: OrthancCPlugin.h:303
@ OrthancPluginErrorCode_Database
Definition: OrthancCPlugin.h:229
@ OrthancPluginErrorCode_SQLiteCannotOpen
Definition: OrthancCPlugin.h:268
@ OrthancPluginErrorCode_MakeDirectory
Definition: OrthancCPlugin.h:290
@ OrthancPluginErrorCode_NoWorklistHandler
Definition: OrthancCPlugin.h:323
@ OrthancPluginDicomWebBinaryMode_InlineBinary
Definition: OrthancCPlugin.h:996
@ OrthancPluginDicomWebBinaryMode_BulkDataUri
Definition: OrthancCPlugin.h:997
@ OrthancPluginDicomWebBinaryMode_Ignore
Definition: OrthancCPlugin.h:995
@ OrthancPluginDicomToJsonFlags_ConvertBinaryToAscii
Definition: OrthancCPlugin.h:875
@ OrthancPluginDicomToJsonFlags_IncludeBinary
Definition: OrthancCPlugin.h:871
@ OrthancPluginDicomToJsonFlags_IncludePixelData
Definition: OrthancCPlugin.h:874
@ OrthancPluginDicomToJsonFlags_IncludeUnknownTags
Definition: OrthancCPlugin.h:873
@ OrthancPluginDicomToJsonFlags_SkipGroupLengths
Definition: OrthancCPlugin.h:878
@ OrthancPluginDicomToJsonFlags_None
Definition: OrthancCPlugin.h:870
@ OrthancPluginDicomToJsonFlags_ConvertBinaryToNull
Definition: OrthancCPlugin.h:876
@ OrthancPluginDicomToJsonFlags_StopAfterPixelData
Definition: OrthancCPlugin.h:877
@ OrthancPluginDicomToJsonFlags_IncludePrivateTags
Definition: OrthancCPlugin.h:872
@ OrthancPluginJobStepStatus_Continue
Definition: OrthancCPlugin.h:954
@ OrthancPluginJobStepStatus_Success
Definition: OrthancCPlugin.h:952
@ OrthancPluginJobStepStatus_Failure
Definition: OrthancCPlugin.h:953
@ OrthancPluginCreateDicomFlags_DecodeDataUriScheme
Definition: OrthancCPlugin.h:892
@ OrthancPluginCreateDicomFlags_None
Definition: OrthancCPlugin.h:891
@ OrthancPluginCreateDicomFlags_GenerateIdentifiers
Definition: OrthancCPlugin.h:893
@ OrthancPluginConstraintType_SmallerOrEqual
Definition: OrthancCPlugin.h:922
@ OrthancPluginConstraintType_List
Definition: OrthancCPlugin.h:925
@ OrthancPluginConstraintType_GreaterOrEqual
Definition: OrthancCPlugin.h:923
@ OrthancPluginConstraintType_Equal
Definition: OrthancCPlugin.h:921
@ OrthancPluginConstraintType_Wildcard
Definition: OrthancCPlugin.h:924
@ OrthancPluginReceivedInstanceAction_KeepAsIs
Definition: OrthancCPlugin.h:1056
@ OrthancPluginReceivedInstanceAction_Discard
Definition: OrthancCPlugin.h:1058
@ OrthancPluginReceivedInstanceAction_Modify
Definition: OrthancCPlugin.h:1057
@ OrthancPluginStorageCommitmentFailureReason_ReferencedSOPClassNotSupported
Definition: OrthancCPlugin.h:1034
@ OrthancPluginStorageCommitmentFailureReason_Success
Definition: OrthancCPlugin.h:1011
@ OrthancPluginStorageCommitmentFailureReason_DuplicateTransactionUID
Definition: OrthancCPlugin.h:1047
@ OrthancPluginStorageCommitmentFailureReason_ClassInstanceConflict
Definition: OrthancCPlugin.h:1041
@ OrthancPluginStorageCommitmentFailureReason_ResourceLimitation
Definition: OrthancCPlugin.h:1028
@ OrthancPluginStorageCommitmentFailureReason_NoSuchObjectInstance
Definition: OrthancCPlugin.h:1022
@ OrthancPluginStorageCommitmentFailureReason_ProcessingFailure
Definition: OrthancCPlugin.h:1016
@ OrthancPluginMetricsType_Default
Definition: OrthancCPlugin.h:978
@ OrthancPluginMetricsType_Timer
Definition: OrthancCPlugin.h:985
@ OrthancPluginLoadDicomInstanceMode_UntilPixelData
Definition: OrthancCPlugin.h:1079
@ OrthancPluginLoadDicomInstanceMode_WholeDicom
Definition: OrthancCPlugin.h:1073
@ OrthancPluginLoadDicomInstanceMode_EmptyPixelData
Definition: OrthancCPlugin.h:1086
@ OrthancPluginValueRepresentation_PN
Definition: OrthancCPlugin.h:831
@ OrthancPluginValueRepresentation_UL
Definition: OrthancCPlugin.h:839
@ OrthancPluginValueRepresentation_UN
Definition: OrthancCPlugin.h:840
@ OrthancPluginValueRepresentation_DA
Definition: OrthancCPlugin.h:820
@ OrthancPluginValueRepresentation_OF
Definition: OrthancCPlugin.h:829
@ OrthancPluginValueRepresentation_OW
Definition: OrthancCPlugin.h:830
@ OrthancPluginValueRepresentation_CS
Definition: OrthancCPlugin.h:819
@ OrthancPluginValueRepresentation_US
Definition: OrthancCPlugin.h:841
@ OrthancPluginValueRepresentation_SH
Definition: OrthancCPlugin.h:832
@ OrthancPluginValueRepresentation_FL
Definition: OrthancCPlugin.h:824
@ OrthancPluginValueRepresentation_DT
Definition: OrthancCPlugin.h:822
@ OrthancPluginValueRepresentation_TM
Definition: OrthancCPlugin.h:837
@ OrthancPluginValueRepresentation_SQ
Definition: OrthancCPlugin.h:834
@ OrthancPluginValueRepresentation_DS
Definition: OrthancCPlugin.h:821
@ OrthancPluginValueRepresentation_OB
Definition: OrthancCPlugin.h:828
@ OrthancPluginValueRepresentation_SL
Definition: OrthancCPlugin.h:833
@ OrthancPluginValueRepresentation_ST
Definition: OrthancCPlugin.h:836
@ OrthancPluginValueRepresentation_IS
Definition: OrthancCPlugin.h:825
@ OrthancPluginValueRepresentation_LT
Definition: OrthancCPlugin.h:827
@ OrthancPluginValueRepresentation_SS
Definition: OrthancCPlugin.h:835
@ OrthancPluginValueRepresentation_UT
Definition: OrthancCPlugin.h:842
@ OrthancPluginValueRepresentation_LO
Definition: OrthancCPlugin.h:826
@ OrthancPluginValueRepresentation_AE
Definition: OrthancCPlugin.h:816
@ OrthancPluginValueRepresentation_FD
Definition: OrthancCPlugin.h:823
@ OrthancPluginValueRepresentation_UI
Definition: OrthancCPlugin.h:838
@ OrthancPluginValueRepresentation_AS
Definition: OrthancCPlugin.h:817
@ OrthancPluginValueRepresentation_AT
Definition: OrthancCPlugin.h:818
@ OrthancPluginJobStopReason_Failure
Definition: OrthancCPlugin.h:968
@ OrthancPluginJobStopReason_Success
Definition: OrthancCPlugin.h:966
@ OrthancPluginJobStopReason_Canceled
Definition: OrthancCPlugin.h:969
@ OrthancPluginJobStopReason_Paused
Definition: OrthancCPlugin.h:967
@ OrthancPluginDicomToJsonFormat_Full
Definition: OrthancCPlugin.h:855
@ OrthancPluginDicomToJsonFormat_Human
Definition: OrthancCPlugin.h:857
@ OrthancPluginDicomToJsonFormat_Short
Definition: OrthancCPlugin.h:856
@ OrthancPluginHttpMethod_Delete
Definition: OrthancCPlugin.h:348
@ OrthancPluginHttpMethod_Post
Definition: OrthancCPlugin.h:346
@ OrthancPluginHttpMethod_Put
Definition: OrthancCPlugin.h:347
@ OrthancPluginHttpMethod_Get
Definition: OrthancCPlugin.h:345
@ OrthancPluginInstanceOrigin_Unknown
Definition: OrthancCPlugin.h:936
@ OrthancPluginInstanceOrigin_RestApi
Definition: OrthancCPlugin.h:938
@ OrthancPluginInstanceOrigin_Lua
Definition: OrthancCPlugin.h:940
@ OrthancPluginInstanceOrigin_WebDav
Definition: OrthancCPlugin.h:941
@ OrthancPluginInstanceOrigin_DicomProtocol
Definition: OrthancCPlugin.h:937
@ OrthancPluginInstanceOrigin_Plugin
Definition: OrthancCPlugin.h:939
@ OrthancPluginContentType_Dicom
Definition: OrthancCPlugin.h:725
@ OrthancPluginContentType_DicomAsJson
Definition: OrthancCPlugin.h:726
@ OrthancPluginContentType_Unknown
Definition: OrthancCPlugin.h:724
@ OrthancPluginContentType_DicomUntilPixelData
Definition: OrthancCPlugin.h:727
An entry in the dictionary of DICOM tags.
Definition: OrthancCPlugin.h:1936
uint32_t minMultiplicity
Definition: OrthancCPlugin.h:1940
uint32_t maxMultiplicity
Definition: OrthancCPlugin.h:1941
OrthancPluginValueRepresentation vr
Definition: OrthancCPlugin.h:1939
uint16_t element
Definition: OrthancCPlugin.h:1938
uint16_t group
Definition: OrthancCPlugin.h:1937
The parameters of a REST request.
Definition: OrthancCPlugin.h:359
const char *const * getValues
For a GET request, the values of the GET parameters.
Definition: OrthancCPlugin.h:388
const char *const * groups
The matched values for the groups of the regular expression.
Definition: OrthancCPlugin.h:373
uint32_t bodySize
For a PUT or POST request, the number of bytes of the body.
Definition: OrthancCPlugin.h:398
uint32_t groupsCount
The number of groups of the regular expression.
Definition: OrthancCPlugin.h:368
const char *const * headersKeys
The keys of the HTTP headers (always converted to low-case).
Definition: OrthancCPlugin.h:413
const void * body
For a PUT or POST request, the content of the body.
Definition: OrthancCPlugin.h:393
const char *const * getKeys
For a GET request, the keys of the GET parameters.
Definition: OrthancCPlugin.h:383
uint32_t headersCount
The number of HTTP headers.
Definition: OrthancCPlugin.h:408
OrthancPluginHttpMethod method
The HTTP method.
Definition: OrthancCPlugin.h:363
uint32_t getCount
For a GET request, the number of GET parameters.
Definition: OrthancCPlugin.h:378
const char *const * headersValues
The values of the HTTP headers.
Definition: OrthancCPlugin.h:418
A 64-bit memory buffer allocated by the core system of Orthanc.
Definition: OrthancCPlugin.h:1159
uint64_t size
The number of bytes in the buffer.
Definition: OrthancCPlugin.h:1168
void * data
The content of the buffer.
Definition: OrthancCPlugin.h:1163
A 32-bit memory buffer allocated by the core system of Orthanc.
Definition: OrthancCPlugin.h:1137
uint32_t size
The number of bytes in the buffer.
Definition: OrthancCPlugin.h:1146
void * data
The content of the buffer.
Definition: OrthancCPlugin.h:1141