| Orthanc Plugin SDK 1.3.0 Documentation of the plugin interface of Orthanc

OrthancCPlugin.h
1
107 #pragma once
108
109
110 #include <stdio.h>
111 #include <string.h>
112
113 #ifdef WIN32
114 #define ORTHANC_PLUGINS_API __declspec(dllexport)
115 #else
116 #define ORTHANC_PLUGINS_API
117 #endif
118
119 #define ORTHANC_PLUGINS_MINIMAL_MAJOR_NUMBER 1
120 #define ORTHANC_PLUGINS_MINIMAL_MINOR_NUMBER 3
121 #define ORTHANC_PLUGINS_MINIMAL_REVISION_NUMBER 0
122
123
124
125 /********************************************************************
126 ** Check that function inlining is properly supported. The use of
127 ** inlining is required, to avoid the duplication of object code
128 ** between two compilation modules that would use the Orthanc Plugin
129 ** API.
130 ********************************************************************/
131
132 /* If the auto-detection of the "inline" keyword below does not work
133 automatically and that your compiler is known to properly support
134 inlining, uncomment the following #define and adapt the definition
135 of "static inline". */
136
137 /* #define ORTHANC_PLUGIN_INLINE static inline */
138
139 #ifndef ORTHANC_PLUGIN_INLINE
140 # if __STDC_VERSION__ >= 199901L
141 /* This is C99 or above: http://predef.sourceforge.net/prestd.html */
142 # define ORTHANC_PLUGIN_INLINE static inline
143 # elif defined(__cplusplus)
144 /* This is C++ */
145 # define ORTHANC_PLUGIN_INLINE static inline
146 # elif defined(__GNUC__)
147 /* This is GCC running in C89 mode */
148 # define ORTHANC_PLUGIN_INLINE static __inline
149 # elif defined(_MSC_VER)
150 /* This is Visual Studio running in C89 mode */
151 # define ORTHANC_PLUGIN_INLINE static __inline
152 # else
153 # error Your compiler is not known to support the "inline" keyword
154 # endif
155 #endif
156
157
158
159 /********************************************************************
160 ** Inclusion of standard libraries.
161 ********************************************************************/
162
168 #include <stdint.h>
169
170 #include <stdlib.h>
171
172
173
174 /********************************************************************
175 ** Definition of the Orthanc Plugin API.
176 ********************************************************************/
177
180 #ifdef __cplusplus
181 extern "C"
182 {
183 #endif
184
188 typedef enum
189 {
190 OrthancPluginErrorCode_InternalError = -1 ,
191 OrthancPluginErrorCode_Success = 0 ,
192 OrthancPluginErrorCode_Plugin = 1 ,
193 OrthancPluginErrorCode_NotImplemented = 2 ,
194 OrthancPluginErrorCode_ParameterOutOfRange = 3 ,
195 OrthancPluginErrorCode_NotEnoughMemory = 4 ,
196 OrthancPluginErrorCode_BadParameterType = 5 ,
197 OrthancPluginErrorCode_BadSequenceOfCalls = 6 ,
198 OrthancPluginErrorCode_InexistentItem = 7 ,
199 OrthancPluginErrorCode_BadRequest = 8 ,
200 OrthancPluginErrorCode_NetworkProtocol = 9 ,
201 OrthancPluginErrorCode_SystemCommand = 10 ,
202 OrthancPluginErrorCode_Database = 11 ,
203 OrthancPluginErrorCode_UriSyntax = 12 ,
204 OrthancPluginErrorCode_InexistentFile = 13 ,
205 OrthancPluginErrorCode_CannotWriteFile = 14 ,
206 OrthancPluginErrorCode_BadFileFormat = 15 ,
207 OrthancPluginErrorCode_Timeout = 16 ,
208 OrthancPluginErrorCode_UnknownResource = 17 ,
209 OrthancPluginErrorCode_IncompatibleDatabaseVersion = 18 ,
210 OrthancPluginErrorCode_FullStorage = 19 ,
211 OrthancPluginErrorCode_CorruptedFile = 20 ,
212 OrthancPluginErrorCode_InexistentTag = 21 ,
213 OrthancPluginErrorCode_ReadOnly = 22 ,
214 OrthancPluginErrorCode_IncompatibleImageFormat = 23 ,
215 OrthancPluginErrorCode_IncompatibleImageSize = 24 ,
216 OrthancPluginErrorCode_SharedLibrary = 25 ,
217 OrthancPluginErrorCode_UnknownPluginService = 26 ,
218 OrthancPluginErrorCode_UnknownDicomTag = 27 ,
219 OrthancPluginErrorCode_BadJson = 28 ,
220 OrthancPluginErrorCode_Unauthorized = 29 ,
221 OrthancPluginErrorCode_BadFont = 30 ,
222 OrthancPluginErrorCode_DatabasePlugin = 31 ,
223 OrthancPluginErrorCode_StorageAreaPlugin = 32 ,
224 OrthancPluginErrorCode_EmptyRequest = 33 ,
225 OrthancPluginErrorCode_NotAcceptable = 34 ,
226 OrthancPluginErrorCode_NullPointer = 35 ,
227 OrthancPluginErrorCode_SQLiteNotOpened = 1000 ,
228 OrthancPluginErrorCode_SQLiteAlreadyOpened = 1001 ,
229 OrthancPluginErrorCode_SQLiteCannotOpen = 1002 ,
230 OrthancPluginErrorCode_SQLiteStatementAlreadyUsed = 1003 ,
231 OrthancPluginErrorCode_SQLiteExecute = 1004 ,
232 OrthancPluginErrorCode_SQLiteRollbackWithoutTransaction = 1005 ,
233 OrthancPluginErrorCode_SQLiteCommitWithoutTransaction = 1006 ,
234 OrthancPluginErrorCode_SQLiteRegisterFunction = 1007 ,
235 OrthancPluginErrorCode_SQLiteFlush = 1008 ,
236 OrthancPluginErrorCode_SQLiteCannotRun = 1009 ,
237 OrthancPluginErrorCode_SQLiteCannotStep = 1010 ,
238 OrthancPluginErrorCode_SQLiteBindOutOfRange = 1011 ,
239 OrthancPluginErrorCode_SQLitePrepareStatement = 1012 ,
240 OrthancPluginErrorCode_SQLiteTransactionAlreadyStarted = 1013 ,
241 OrthancPluginErrorCode_SQLiteTransactionCommit = 1014 ,
242 OrthancPluginErrorCode_SQLiteTransactionBegin = 1015 ,
243 OrthancPluginErrorCode_DirectoryOverFile = 2000 ,
244 OrthancPluginErrorCode_FileStorageCannotWrite = 2001 ,
245 OrthancPluginErrorCode_DirectoryExpected = 2002 ,
246 OrthancPluginErrorCode_HttpPortInUse = 2003 ,
247 OrthancPluginErrorCode_DicomPortInUse = 2004 ,
248 OrthancPluginErrorCode_BadHttpStatusInRest = 2005 ,
249 OrthancPluginErrorCode_RegularFileExpected = 2006 ,
250 OrthancPluginErrorCode_PathToExecutable = 2007 ,
251 OrthancPluginErrorCode_MakeDirectory = 2008 ,
252 OrthancPluginErrorCode_BadApplicationEntityTitle = 2009 ,
253 OrthancPluginErrorCode_NoCFindHandler = 2010 ,
254 OrthancPluginErrorCode_NoCMoveHandler = 2011 ,
255 OrthancPluginErrorCode_NoCStoreHandler = 2012 ,
256 OrthancPluginErrorCode_NoApplicationEntityFilter = 2013 ,
257 OrthancPluginErrorCode_NoSopClassOrInstance = 2014 ,
258 OrthancPluginErrorCode_NoPresentationContext = 2015 ,
259 OrthancPluginErrorCode_DicomFindUnavailable = 2016 ,
260 OrthancPluginErrorCode_DicomMoveUnavailable = 2017 ,
261 OrthancPluginErrorCode_CannotStoreInstance = 2018 ,
262 OrthancPluginErrorCode_CreateDicomNotString = 2019 ,
263 OrthancPluginErrorCode_CreateDicomOverrideTag = 2020 ,
264 OrthancPluginErrorCode_CreateDicomUseContent = 2021 ,
265 OrthancPluginErrorCode_CreateDicomNoPayload = 2022 ,
266 OrthancPluginErrorCode_CreateDicomUseDataUriScheme = 2023 ,
267 OrthancPluginErrorCode_CreateDicomBadParent = 2024 ,
268 OrthancPluginErrorCode_CreateDicomParentIsInstance = 2025 ,
269 OrthancPluginErrorCode_CreateDicomParentEncoding = 2026 ,
270 OrthancPluginErrorCode_UnknownModality = 2027 ,
271 OrthancPluginErrorCode_BadJobOrdering = 2028 ,
272 OrthancPluginErrorCode_JsonToLuaTable = 2029 ,
273 OrthancPluginErrorCode_CannotCreateLua = 2030 ,
274 OrthancPluginErrorCode_CannotExecuteLua = 2031 ,
275 OrthancPluginErrorCode_LuaAlreadyExecuted = 2032 ,
276 OrthancPluginErrorCode_LuaBadOutput = 2033 ,
277 OrthancPluginErrorCode_NotLuaPredicate = 2034 ,
278 OrthancPluginErrorCode_LuaReturnsNoString = 2035 ,
279 OrthancPluginErrorCode_StorageAreaAlreadyRegistered = 2036 ,
280 OrthancPluginErrorCode_DatabaseBackendAlreadyRegistered = 2037 ,
281 OrthancPluginErrorCode_DatabaseNotInitialized = 2038 ,
282 OrthancPluginErrorCode_SslDisabled = 2039 ,
283 OrthancPluginErrorCode_CannotOrderSlices = 2040 ,
284 OrthancPluginErrorCode_NoWorklistHandler = 2041 ,
285 OrthancPluginErrorCode_AlreadyExistingTag = 2042 ,
286
287 _OrthancPluginErrorCode_INTERNAL = 0x7fffffff
288 } OrthancPluginErrorCode;
289
290
295 ORTHANC_PLUGINS_API const char* OrthancPluginGetName();
296
297
301 typedef enum
302 {
303 OrthancPluginHttpMethod_Get = 1,
304 OrthancPluginHttpMethod_Post = 2,
305 OrthancPluginHttpMethod_Put = 3,
306 OrthancPluginHttpMethod_Delete = 4,
308 _OrthancPluginHttpMethod_INTERNAL = 0x7fffffff
309 } OrthancPluginHttpMethod;
310
311
316 typedef struct
317 {
321 OrthancPluginHttpMethod method;
322
326 uint32_t groupsCount;
327
331 const char* const* groups;
332
336 uint32_t getCount;
337
341 const char* const* getKeys;
342
346 const char* const* getValues;
347
351 const char* body;
352
356 uint32_t bodySize;
357
358
359 /* --------------------------------------------------
360 New in version 0.8.1
361 -------------------------------------------------- */
362
366 uint32_t headersCount;
367
371 const char* const* headersKeys;
372
376 const char* const* headersValues;
377
378 } OrthancPluginHttpRequest;
379
380
381 typedef enum
382 {
383 /* Generic services */
384 _OrthancPluginService_LogInfo = 1,
385 _OrthancPluginService_LogWarning = 2,
386 _OrthancPluginService_LogError = 3,
387 _OrthancPluginService_GetOrthancPath = 4,
388 _OrthancPluginService_GetOrthancDirectory = 5,
389 _OrthancPluginService_GetConfigurationPath = 6,
390 _OrthancPluginService_SetPluginProperty = 7,
391 _OrthancPluginService_GetGlobalProperty = 8,
392 _OrthancPluginService_SetGlobalProperty = 9,
393 _OrthancPluginService_GetCommandLineArgumentsCount = 10,
394 _OrthancPluginService_GetCommandLineArgument = 11,
395 _OrthancPluginService_GetExpectedDatabaseVersion = 12,
396 _OrthancPluginService_GetConfiguration = 13,
397 _OrthancPluginService_BufferCompression = 14,
398 _OrthancPluginService_ReadFile = 15,
399 _OrthancPluginService_WriteFile = 16,
400 _OrthancPluginService_GetErrorDescription = 17,
401 _OrthancPluginService_CallHttpClient = 18,
402 _OrthancPluginService_RegisterErrorCode = 19,
403 _OrthancPluginService_RegisterDictionaryTag = 20,
404 _OrthancPluginService_DicomBufferToJson = 21,
405 _OrthancPluginService_DicomInstanceToJson = 22,
406 _OrthancPluginService_CreateDicom = 23,
407 _OrthancPluginService_ComputeMd5 = 24,
408 _OrthancPluginService_ComputeSha1 = 25,
409 _OrthancPluginService_LookupDictionary = 26,
410 _OrthancPluginService_CallHttpClient2 = 27,
411 _OrthancPluginService_GenerateUuid = 28,
412 _OrthancPluginService_RegisterPrivateDictionaryTag = 29,
413
414 /* Registration of callbacks */
415 _OrthancPluginService_RegisterRestCallback = 1000,
416 _OrthancPluginService_RegisterOnStoredInstanceCallback = 1001,
417 _OrthancPluginService_RegisterStorageArea = 1002,
418 _OrthancPluginService_RegisterOnChangeCallback = 1003,
419 _OrthancPluginService_RegisterRestCallbackNoLock = 1004,
420 _OrthancPluginService_RegisterWorklistCallback = 1005,
421 _OrthancPluginService_RegisterDecodeImageCallback = 1006,
422 _OrthancPluginService_RegisterIncomingHttpRequestFilter = 1007,
423 _OrthancPluginService_RegisterFindCallback = 1008,
424 _OrthancPluginService_RegisterMoveCallback = 1009,
425 _OrthancPluginService_RegisterIncomingHttpRequestFilter2 = 1010,
426
427 /* Sending answers to REST calls */
428 _OrthancPluginService_AnswerBuffer = 2000,
429 _OrthancPluginService_CompressAndAnswerPngImage = 2001, /* Unused as of Orthanc 0.9.4 */
430 _OrthancPluginService_Redirect = 2002,
431 _OrthancPluginService_SendHttpStatusCode = 2003,
432 _OrthancPluginService_SendUnauthorized = 2004,
433 _OrthancPluginService_SendMethodNotAllowed = 2005,
434 _OrthancPluginService_SetCookie = 2006,
435 _OrthancPluginService_SetHttpHeader = 2007,
436 _OrthancPluginService_StartMultipartAnswer = 2008,
437 _OrthancPluginService_SendMultipartItem = 2009,
438 _OrthancPluginService_SendHttpStatus = 2010,
439 _OrthancPluginService_CompressAndAnswerImage = 2011,
440 _OrthancPluginService_SendMultipartItem2 = 2012,
441
442 /* Access to the Orthanc database and API */
443 _OrthancPluginService_GetDicomForInstance = 3000,
444 _OrthancPluginService_RestApiGet = 3001,
445 _OrthancPluginService_RestApiPost = 3002,
446 _OrthancPluginService_RestApiDelete = 3003,
447 _OrthancPluginService_RestApiPut = 3004,
448 _OrthancPluginService_LookupPatient = 3005,
449 _OrthancPluginService_LookupStudy = 3006,
450 _OrthancPluginService_LookupSeries = 3007,
451 _OrthancPluginService_LookupInstance = 3008,
452 _OrthancPluginService_LookupStudyWithAccessionNumber = 3009,
453 _OrthancPluginService_RestApiGetAfterPlugins = 3010,
454 _OrthancPluginService_RestApiPostAfterPlugins = 3011,
455 _OrthancPluginService_RestApiDeleteAfterPlugins = 3012,
456 _OrthancPluginService_RestApiPutAfterPlugins = 3013,
457 _OrthancPluginService_ReconstructMainDicomTags = 3014,
458 _OrthancPluginService_RestApiGet2 = 3015,
459
460 /* Access to DICOM instances */
461 _OrthancPluginService_GetInstanceRemoteAet = 4000,
462 _OrthancPluginService_GetInstanceSize = 4001,
463 _OrthancPluginService_GetInstanceData = 4002,
464 _OrthancPluginService_GetInstanceJson = 4003,
465 _OrthancPluginService_GetInstanceSimplifiedJson = 4004,
466 _OrthancPluginService_HasInstanceMetadata = 4005,
467 _OrthancPluginService_GetInstanceMetadata = 4006,
468 _OrthancPluginService_GetInstanceOrigin = 4007,
469
470 /* Services for plugins implementing a database back-end */
471 _OrthancPluginService_RegisterDatabaseBackend = 5000,
472 _OrthancPluginService_DatabaseAnswer = 5001,
473 _OrthancPluginService_RegisterDatabaseBackendV2 = 5002,
474 _OrthancPluginService_StorageAreaCreate = 5003,
475 _OrthancPluginService_StorageAreaRead = 5004,
476 _OrthancPluginService_StorageAreaRemove = 5005,
477
478 /* Primitives for handling images */
479 _OrthancPluginService_GetImagePixelFormat = 6000,
480 _OrthancPluginService_GetImageWidth = 6001,
481 _OrthancPluginService_GetImageHeight = 6002,
482 _OrthancPluginService_GetImagePitch = 6003,
483 _OrthancPluginService_GetImageBuffer = 6004,
484 _OrthancPluginService_UncompressImage = 6005,
485 _OrthancPluginService_FreeImage = 6006,
486 _OrthancPluginService_CompressImage = 6007,
487 _OrthancPluginService_ConvertPixelFormat = 6008,
488 _OrthancPluginService_GetFontsCount = 6009,
489 _OrthancPluginService_GetFontInfo = 6010,
490 _OrthancPluginService_DrawText = 6011,
491 _OrthancPluginService_CreateImage = 6012,
492 _OrthancPluginService_CreateImageAccessor = 6013,
493 _OrthancPluginService_DecodeDicomImage = 6014,
494
495 /* Primitives for handling C-Find, C-Move and worklists */
496 _OrthancPluginService_WorklistAddAnswer = 7000,
497 _OrthancPluginService_WorklistMarkIncomplete = 7001,
498 _OrthancPluginService_WorklistIsMatch = 7002,
499 _OrthancPluginService_WorklistGetDicomQuery = 7003,
500 _OrthancPluginService_FindAddAnswer = 7004,
501 _OrthancPluginService_FindMarkIncomplete = 7005,
502 _OrthancPluginService_GetFindQuerySize = 7006,
503 _OrthancPluginService_GetFindQueryTag = 7007,
504 _OrthancPluginService_GetFindQueryTagName = 7008,
505 _OrthancPluginService_GetFindQueryValue = 7009,
506 _OrthancPluginService_CreateFindMatcher = 7010,
507 _OrthancPluginService_FreeFindMatcher = 7011,
508 _OrthancPluginService_FindMatcherIsMatch = 7012,
509
510 _OrthancPluginService_INTERNAL = 0x7fffffff
511 } _OrthancPluginService;
512
513
514 typedef enum
515 {
516 _OrthancPluginProperty_Description = 1,
517 _OrthancPluginProperty_RootUri = 2,
518 _OrthancPluginProperty_OrthancExplorer = 3,
519
520 _OrthancPluginProperty_INTERNAL = 0x7fffffff
521 } _OrthancPluginProperty;
522
523
524
529 typedef enum
530 {
537 OrthancPluginPixelFormat_Grayscale8 = 1,
538
545 OrthancPluginPixelFormat_Grayscale16 = 2,
546
553 OrthancPluginPixelFormat_SignedGrayscale16 = 3,
554
561 OrthancPluginPixelFormat_RGB24 = 4,
562
569 OrthancPluginPixelFormat_RGBA32 = 5,
570
571 OrthancPluginPixelFormat_Unknown = 6,
573 _OrthancPluginPixelFormat_INTERNAL = 0x7fffffff
574 } OrthancPluginPixelFormat;
575
576
577
581 typedef enum
582 {
583 OrthancPluginContentType_Unknown = 0,
584 OrthancPluginContentType_Dicom = 1,
585 OrthancPluginContentType_DicomAsJson = 2,
587 _OrthancPluginContentType_INTERNAL = 0x7fffffff
588 } OrthancPluginContentType;
589
590
591
595 typedef enum
596 {
597 OrthancPluginResourceType_Patient = 0,
598 OrthancPluginResourceType_Study = 1,
599 OrthancPluginResourceType_Series = 2,
600 OrthancPluginResourceType_Instance = 3,
601 OrthancPluginResourceType_None = 4,
603 _OrthancPluginResourceType_INTERNAL = 0x7fffffff
604 } OrthancPluginResourceType;
605
606
607
612 typedef enum
613 {
614 OrthancPluginChangeType_CompletedSeries = 0,
615 OrthancPluginChangeType_Deleted = 1,
616 OrthancPluginChangeType_NewChildInstance = 2,
617 OrthancPluginChangeType_NewInstance = 3,
618 OrthancPluginChangeType_NewPatient = 4,
619 OrthancPluginChangeType_NewSeries = 5,
620 OrthancPluginChangeType_NewStudy = 6,
621 OrthancPluginChangeType_StablePatient = 7,
622 OrthancPluginChangeType_StableSeries = 8,
623 OrthancPluginChangeType_StableStudy = 9,
624 OrthancPluginChangeType_OrthancStarted = 10,
625 OrthancPluginChangeType_OrthancStopped = 11,
626 OrthancPluginChangeType_UpdatedAttachment = 12,
627 OrthancPluginChangeType_UpdatedMetadata = 13,
629 _OrthancPluginChangeType_INTERNAL = 0x7fffffff
630 } OrthancPluginChangeType;
631
632
637 typedef enum
638 {
639 OrthancPluginCompressionType_Zlib = 0,
640 OrthancPluginCompressionType_ZlibWithSize = 1,
641 OrthancPluginCompressionType_Gzip = 2,
642 OrthancPluginCompressionType_GzipWithSize = 3,
644 _OrthancPluginCompressionType_INTERNAL = 0x7fffffff
645 } OrthancPluginCompressionType;
646
647
652 typedef enum
653 {
654 OrthancPluginImageFormat_Png = 0,
655 OrthancPluginImageFormat_Jpeg = 1,
656 OrthancPluginImageFormat_Dicom = 2,
658 _OrthancPluginImageFormat_INTERNAL = 0x7fffffff
659 } OrthancPluginImageFormat;
660
661
666 typedef enum
667 {
668 OrthancPluginValueRepresentation_AE = 1,
669 OrthancPluginValueRepresentation_AS = 2,
670 OrthancPluginValueRepresentation_AT = 3,
671 OrthancPluginValueRepresentation_CS = 4,
672 OrthancPluginValueRepresentation_DA = 5,
673 OrthancPluginValueRepresentation_DS = 6,
674 OrthancPluginValueRepresentation_DT = 7,
675 OrthancPluginValueRepresentation_FD = 8,
676 OrthancPluginValueRepresentation_FL = 9,
677 OrthancPluginValueRepresentation_IS = 10,
678 OrthancPluginValueRepresentation_LO = 11,
679 OrthancPluginValueRepresentation_LT = 12,
680 OrthancPluginValueRepresentation_OB = 13,
681 OrthancPluginValueRepresentation_OF = 14,
682 OrthancPluginValueRepresentation_OW = 15,
683 OrthancPluginValueRepresentation_PN = 16,
684 OrthancPluginValueRepresentation_SH = 17,
685 OrthancPluginValueRepresentation_SL = 18,
686 OrthancPluginValueRepresentation_SQ = 19,
687 OrthancPluginValueRepresentation_SS = 20,
688 OrthancPluginValueRepresentation_ST = 21,
689 OrthancPluginValueRepresentation_TM = 22,
690 OrthancPluginValueRepresentation_UI = 23,
691 OrthancPluginValueRepresentation_UL = 24,
692 OrthancPluginValueRepresentation_UN = 25,
693 OrthancPluginValueRepresentation_US = 26,
694 OrthancPluginValueRepresentation_UT = 27,
696 _OrthancPluginValueRepresentation_INTERNAL = 0x7fffffff
697 } OrthancPluginValueRepresentation;
698
699
705 typedef enum
706 {
707 OrthancPluginDicomToJsonFormat_Full = 1,
708 OrthancPluginDicomToJsonFormat_Short = 2,
709 OrthancPluginDicomToJsonFormat_Human = 3,
711 _OrthancPluginDicomToJsonFormat_INTERNAL = 0x7fffffff
712 } OrthancPluginDicomToJsonFormat;
713
714
720 typedef enum
721 {
722 OrthancPluginDicomToJsonFlags_None = 0,
723 OrthancPluginDicomToJsonFlags_IncludeBinary = (1 << 0),
724 OrthancPluginDicomToJsonFlags_IncludePrivateTags = (1 << 1),
725 OrthancPluginDicomToJsonFlags_IncludeUnknownTags = (1 << 2),
726 OrthancPluginDicomToJsonFlags_IncludePixelData = (1 << 3),
727 OrthancPluginDicomToJsonFlags_ConvertBinaryToAscii = (1 << 4),
728 OrthancPluginDicomToJsonFlags_ConvertBinaryToNull = (1 << 5),
730 _OrthancPluginDicomToJsonFlags_INTERNAL = 0x7fffffff
731 } OrthancPluginDicomToJsonFlags;
732
733
739 typedef enum
740 {
741 OrthancPluginCreateDicomFlags_None = 0,
742 OrthancPluginCreateDicomFlags_DecodeDataUriScheme = (1 << 0),
743 OrthancPluginCreateDicomFlags_GenerateIdentifiers = (1 << 1),
745 _OrthancPluginCreateDicomFlags_INTERNAL = 0x7fffffff
746 } OrthancPluginCreateDicomFlags;
747
748
753 typedef enum
754 {
755 OrthancPluginIdentifierConstraint_Equal = 1,
756 OrthancPluginIdentifierConstraint_SmallerOrEqual = 2,
757 OrthancPluginIdentifierConstraint_GreaterOrEqual = 3,
758 OrthancPluginIdentifierConstraint_Wildcard = 4,
760 _OrthancPluginIdentifierConstraint_INTERNAL = 0x7fffffff
761 } OrthancPluginIdentifierConstraint;
762
763
767 typedef enum
768 {
769 OrthancPluginInstanceOrigin_Unknown = 1,
770 OrthancPluginInstanceOrigin_DicomProtocol = 2,
771 OrthancPluginInstanceOrigin_RestApi = 3,
772 OrthancPluginInstanceOrigin_Plugin = 4,
773 OrthancPluginInstanceOrigin_Lua = 5,
775 _OrthancPluginInstanceOrigin_INTERNAL = 0x7fffffff
776 } OrthancPluginInstanceOrigin;
777
778
786 typedef struct
787 {
791 void* data;
792
796 uint32_t size;
797 } OrthancPluginMemoryBuffer;
798
799
800
801
806 typedef struct _OrthancPluginRestOutput_t OrthancPluginRestOutput;
807
808
809
813 typedef struct _OrthancPluginDicomInstance_t OrthancPluginDicomInstance;
814
815
816
821 typedef struct _OrthancPluginImage_t OrthancPluginImage;
822
823
824
829 typedef struct _OrthancPluginStorageArea_t OrthancPluginStorageArea;
830
831
832
837 typedef struct _OrthancPluginWorklistQuery_t OrthancPluginWorklistQuery;
838
839
840
845 typedef struct _OrthancPluginWorklistAnswers_t OrthancPluginWorklistAnswers;
846
847
848
853 typedef struct _OrthancPluginFindQuery_t OrthancPluginFindQuery;
854
855
856
861 typedef struct _OrthancPluginFindAnswers_t OrthancPluginFindAnswers;
862
863
864
869 typedef struct _OrthancPluginFindAnswers_t OrthancPluginFindMatcher;
870
871
872
877 typedef OrthancPluginErrorCode (*OrthancPluginRestCallback) (
878 OrthancPluginRestOutput* output,
879 const char* url,
880 const OrthancPluginHttpRequest* request);
881
882
883
888 typedef OrthancPluginErrorCode (*OrthancPluginOnStoredInstanceCallback) (
889 OrthancPluginDicomInstance* instance,
890 const char* instanceId);
891
892
893
898 typedef OrthancPluginErrorCode (*OrthancPluginOnChangeCallback) (
899 OrthancPluginChangeType changeType,
900 OrthancPluginResourceType resourceType,
901 const char* resourceId);
902
903
904
909 typedef OrthancPluginErrorCode (*OrthancPluginDecodeImageCallback) (
910 OrthancPluginImage** target,
911 const void* dicom,
912 const uint32_t size,
913 uint32_t frameIndex);
914
915
916
920 typedef void (*OrthancPluginFree) (void* buffer);
921
922
923
936 typedef OrthancPluginErrorCode (*OrthancPluginStorageCreate) (
937 const char* uuid,
938 const void* content,
939 int64_t size,
940 OrthancPluginContentType type);
941
942
943
956 typedef OrthancPluginErrorCode (*OrthancPluginStorageRead) (
957 void** content,
958 int64_t* size,
959 const char* uuid,
960 OrthancPluginContentType type);
961
962
963
974 typedef OrthancPluginErrorCode (*OrthancPluginStorageRemove) (
975 const char* uuid,
976 OrthancPluginContentType type);
977
978
979
993 typedef OrthancPluginErrorCode (*OrthancPluginWorklistCallback) (
994 OrthancPluginWorklistAnswers* answers,
995 const OrthancPluginWorklistQuery* query,
996 const char* issuerAet,
997 const char* calledAet);
998
999
1000
1020 typedef int32_t (*OrthancPluginIncomingHttpRequestFilter) (
1021 OrthancPluginHttpMethod method,
1022 const char* uri,
1023 const char* ip,
1024 uint32_t headersCount,
1025 const char* const* headersKeys,
1026 const char* const* headersValues);
1027
1028
1029
1051 typedef int32_t (*OrthancPluginIncomingHttpRequestFilter2) (
1052 OrthancPluginHttpMethod method,
1053 const char* uri,
1054 const char* ip,
1055 uint32_t headersCount,
1056 const char* const* headersKeys,
1057 const char* const* headersValues,
1058 uint32_t getArgumentsCount,
1059 const char* const* getArgumentsKeys,
1060 const char* const* getArgumentsValues);
1061
1062
1063
1078 typedef OrthancPluginErrorCode (*OrthancPluginFindCallback) (
1079 OrthancPluginFindAnswers* answers,
1080 const OrthancPluginFindQuery* query,
1081 const char* issuerAet,
1082 const char* calledAet);
1083
1084
1085
1121 typedef void* (*OrthancPluginMoveCallback) (
1122 OrthancPluginResourceType resourceType,
1123 const char* patientId,
1124 const char* accessionNumber,
1125 const char* studyInstanceUid,
1126 const char* seriesInstanceUid,
1127 const char* sopInstanceUid,
1128 const char* originatorAet,
1129 const char* sourceAet,
1130 const char* targetAet,
1131 uint16_t originatorId);
1132
1133
1145 typedef uint32_t (*OrthancPluginGetMoveSize) (void* moveDriver);
1146
1147
1159 typedef OrthancPluginErrorCode (*OrthancPluginApplyMove) (void* moveDriver);
1160
1161
1172 typedef void (*OrthancPluginFreeMove) (void* moveDriver);
1173
1174
1175
1179 typedef struct _OrthancPluginContext_t
1180 {
1181 void* pluginsManager;
1182 const char* orthancVersion;
1183 OrthancPluginFree Free;
1184 OrthancPluginErrorCode (*InvokeService) (struct _OrthancPluginContext_t* context,
1185 _OrthancPluginService service,
1186 const void* params);
1187 } OrthancPluginContext;
1188
1189
1190
1194 typedef struct
1195 {
1196 uint16_t group;
1197 uint16_t element;
1198 OrthancPluginValueRepresentation vr;
1199 uint32_t minMultiplicity;
1200 uint32_t maxMultiplicity;
1201 } OrthancPluginDictionaryEntry;
1202
1203
1204
1213 ORTHANC_PLUGIN_INLINE void OrthancPluginFreeString(
1214 OrthancPluginContext* context,
1215 char* str)
1216 {
1217 if (str != NULL)
1218 {
1219 context->Free(str);
1220 }
1221 }
1222
1223
1237 ORTHANC_PLUGIN_INLINE int OrthancPluginCheckVersion(
1238 OrthancPluginContext* context)
1239 {
1240 int major, minor, revision;
1241
1242 if (sizeof(int32_t) != sizeof(OrthancPluginErrorCode) ||
1243 sizeof(int32_t) != sizeof(OrthancPluginHttpMethod) ||
1244 sizeof(int32_t) != sizeof(_OrthancPluginService) ||
1245 sizeof(int32_t) != sizeof(_OrthancPluginProperty) ||
1246 sizeof(int32_t) != sizeof(OrthancPluginPixelFormat) ||
1247 sizeof(int32_t) != sizeof(OrthancPluginContentType) ||
1248 sizeof(int32_t) != sizeof(OrthancPluginResourceType) ||
1249 sizeof(int32_t) != sizeof(OrthancPluginChangeType) ||
1250 sizeof(int32_t) != sizeof(OrthancPluginCompressionType) ||
1251 sizeof(int32_t) != sizeof(OrthancPluginImageFormat) ||
1252 sizeof(int32_t) != sizeof(OrthancPluginValueRepresentation) ||
1253 sizeof(int32_t) != sizeof(OrthancPluginDicomToJsonFormat) ||
1254 sizeof(int32_t) != sizeof(OrthancPluginDicomToJsonFlags) ||
1255 sizeof(int32_t) != sizeof(OrthancPluginCreateDicomFlags) ||
1256 sizeof(int32_t) != sizeof(OrthancPluginIdentifierConstraint) ||
1257 sizeof(int32_t) != sizeof(OrthancPluginInstanceOrigin))
1258 {
1259 /* Mismatch in the size of the enumerations */
1260 return 0;
1261 }
1262
1263 /* Assume compatibility with the mainline */
1264 if (!strcmp(context->orthancVersion, "mainline"))
1265 {
1266 return 1;
1267 }
1268
1269 /* Parse the version of the Orthanc core */
1270 if (
1271 #ifdef _MSC_VER
1272 sscanf_s
1273 #else
1274 sscanf
1275 #endif
1276 (context->orthancVersion, "%4d.%4d.%4d", &major, &minor, &revision) != 3)
1277 {
1278 return 0;
1279 }
1280
1281 /* Check the major number of the version */
1282
1283 if (major > ORTHANC_PLUGINS_MINIMAL_MAJOR_NUMBER)
1284 {
1285 return 1;
1286 }
1287
1288 if (major < ORTHANC_PLUGINS_MINIMAL_MAJOR_NUMBER)
1289 {
1290 return 0;
1291 }
1292
1293 /* Check the minor number of the version */
1294
1295 if (minor > ORTHANC_PLUGINS_MINIMAL_MINOR_NUMBER)
1296 {
1297 return 1;
1298 }
1299
1300 if (minor < ORTHANC_PLUGINS_MINIMAL_MINOR_NUMBER)
1301 {
1302 return 0;
1303 }
1304
1305 /* Check the revision number of the version */
1306
1307 if (revision >= ORTHANC_PLUGINS_MINIMAL_REVISION_NUMBER)
1308 {
1309 return 1;
1310 }
1311 else
1312 {
1313 return 0;
1314 }
1315 }
1316
1317
1326 ORTHANC_PLUGIN_INLINE void OrthancPluginFreeMemoryBuffer(
1327 OrthancPluginContext* context,
1328 OrthancPluginMemoryBuffer* buffer)
1329 {
1330 context->Free(buffer->data);
1331 }
1332
1333
1342 ORTHANC_PLUGIN_INLINE void OrthancPluginLogError(
1343 OrthancPluginContext* context,
1344 const char* message)
1345 {
1346 context->InvokeService(context, _OrthancPluginService_LogError, message);
1347 }
1348
1349
1358 ORTHANC_PLUGIN_INLINE void OrthancPluginLogWarning(
1359 OrthancPluginContext* context,
1360 const char* message)
1361 {
1362 context->InvokeService(context, _OrthancPluginService_LogWarning, message);
1363 }
1364
1365
1374 ORTHANC_PLUGIN_INLINE void OrthancPluginLogInfo(
1375 OrthancPluginContext* context,
1376 const char* message)
1377 {
1378 context->InvokeService(context, _OrthancPluginService_LogInfo, message);
1379 }
1380
1381
1382
1383 typedef struct
1384 {
1385 const char* pathRegularExpression;
1386 OrthancPluginRestCallback callback;
1387 } _OrthancPluginRestCallback;
1388
1405 ORTHANC_PLUGIN_INLINE void OrthancPluginRegisterRestCallback(
1406 OrthancPluginContext* context,
1407 const char* pathRegularExpression,
1408 OrthancPluginRestCallback callback)
1409 {
1410 _OrthancPluginRestCallback params;
1411 params.pathRegularExpression = pathRegularExpression;
1412 params.callback = callback;
1413 context->InvokeService(context, _OrthancPluginService_RegisterRestCallback, &params);
1414 }
1415
1416
1417
1439 ORTHANC_PLUGIN_INLINE void OrthancPluginRegisterRestCallbackNoLock(
1440 OrthancPluginContext* context,
1441 const char* pathRegularExpression,
1442 OrthancPluginRestCallback callback)
1443 {
1444 _OrthancPluginRestCallback params;
1445 params.pathRegularExpression = pathRegularExpression;
1446 params.callback = callback;
1447 context->InvokeService(context, _OrthancPluginService_RegisterRestCallbackNoLock, &params);
1448 }
1449
1450
1451
1452 typedef struct
1453 {
1454 OrthancPluginOnStoredInstanceCallback callback;
1455 } _OrthancPluginOnStoredInstanceCallback;
1456
1467 ORTHANC_PLUGIN_INLINE void OrthancPluginRegisterOnStoredInstanceCallback(
1468 OrthancPluginContext* context,
1469 OrthancPluginOnStoredInstanceCallback callback)
1470 {
1471 _OrthancPluginOnStoredInstanceCallback params;
1472 params.callback = callback;
1473
1474 context->InvokeService(context, _OrthancPluginService_RegisterOnStoredInstanceCallback, &params);
1475 }
1476
1477
1478
1479 typedef struct
1480 {
1481 OrthancPluginRestOutput* output;
1482 const char* answer;
1483 uint32_t answerSize;
1484 const char* mimeType;
1485 } _OrthancPluginAnswerBuffer;
1486
1499 ORTHANC_PLUGIN_INLINE void OrthancPluginAnswerBuffer(
1500 OrthancPluginContext* context,
1501 OrthancPluginRestOutput* output,
1502 const char* answer,
1503 uint32_t answerSize,
1504 const char* mimeType)
1505 {
1506 _OrthancPluginAnswerBuffer params;
1507 params.output = output;
1508 params.answer = answer;
1509 params.answerSize = answerSize;
1510 params.mimeType = mimeType;
1511 context->InvokeService(context, _OrthancPluginService_AnswerBuffer, &params);
1512 }
1513
1514
1515 typedef struct
1516 {
1517 OrthancPluginRestOutput* output;
1518 OrthancPluginPixelFormat format;
1519 uint32_t width;
1520 uint32_t height;
1521 uint32_t pitch;
1522 const void* buffer;
1523 } _OrthancPluginCompressAndAnswerPngImage;
1524
1525 typedef struct
1526 {
1527 OrthancPluginRestOutput* output;
1528 OrthancPluginImageFormat imageFormat;
1529 OrthancPluginPixelFormat pixelFormat;
1530 uint32_t width;
1531 uint32_t height;
1532 uint32_t pitch;
1533 const void* buffer;
1534 uint8_t quality;
1535 } _OrthancPluginCompressAndAnswerImage;
1536
1537
1556 ORTHANC_PLUGIN_INLINE void OrthancPluginCompressAndAnswerPngImage(
1557 OrthancPluginContext* context,
1558 OrthancPluginRestOutput* output,
1559 OrthancPluginPixelFormat format,
1560 uint32_t width,
1561 uint32_t height,
1562 uint32_t pitch,
1563 const void* buffer)
1564 {
1565 _OrthancPluginCompressAndAnswerImage params;
1566 params.output = output;
1567 params.imageFormat = OrthancPluginImageFormat_Png;
1568 params.pixelFormat = format;
1569 params.width = width;
1570 params.height = height;
1571 params.pitch = pitch;
1572 params.buffer = buffer;
1573 params.quality = 0; /* No quality for PNG */
1574 context->InvokeService(context, _OrthancPluginService_CompressAndAnswerImage, &params);
1575 }
1576
1577
1578
1579 typedef struct
1580 {
1581 OrthancPluginMemoryBuffer* target;
1582 const char* instanceId;
1583 } _OrthancPluginGetDicomForInstance;
1584
1597 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginGetDicomForInstance(
1598 OrthancPluginContext* context,
1599 OrthancPluginMemoryBuffer* target,
1600 const char* instanceId)
1601 {
1602 _OrthancPluginGetDicomForInstance params;
1603 params.target = target;
1604 params.instanceId = instanceId;
1605 return context->InvokeService(context, _OrthancPluginService_GetDicomForInstance, &params);
1606 }
1607
1608
1609
1610 typedef struct
1611 {
1612 OrthancPluginMemoryBuffer* target;
1613 const char* uri;
1614 } _OrthancPluginRestApiGet;
1615
1630 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRestApiGet(
1631 OrthancPluginContext* context,
1632 OrthancPluginMemoryBuffer* target,
1633 const char* uri)
1634 {
1635 _OrthancPluginRestApiGet params;
1636 params.target = target;
1637 params.uri = uri;
1638 return context->InvokeService(context, _OrthancPluginService_RestApiGet, &params);
1639 }
1640
1641
1642
1660 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRestApiGetAfterPlugins(
1661 OrthancPluginContext* context,
1662 OrthancPluginMemoryBuffer* target,
1663 const char* uri)
1664 {
1665 _OrthancPluginRestApiGet params;
1666 params.target = target;
1667 params.uri = uri;
1668 return context->InvokeService(context, _OrthancPluginService_RestApiGetAfterPlugins, &params);
1669 }
1670
1671
1672
1673 typedef struct
1674 {
1675 OrthancPluginMemoryBuffer* target;
1676 const char* uri;
1677 const char* body;
1678 uint32_t bodySize;
1679 } _OrthancPluginRestApiPostPut;
1680
1697 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRestApiPost(
1698 OrthancPluginContext* context,
1699 OrthancPluginMemoryBuffer* target,
1700 const char* uri,
1701 const char* body,
1702 uint32_t bodySize)
1703 {
1704 _OrthancPluginRestApiPostPut params;
1705 params.target = target;
1706 params.uri = uri;
1707 params.body = body;
1708 params.bodySize = bodySize;
1709 return context->InvokeService(context, _OrthancPluginService_RestApiPost, &params);
1710 }
1711
1712
1732 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRestApiPostAfterPlugins(
1733 OrthancPluginContext* context,
1734 OrthancPluginMemoryBuffer* target,
1735 const char* uri,
1736 const char* body,
1737 uint32_t bodySize)
1738 {
1739 _OrthancPluginRestApiPostPut params;
1740 params.target = target;
1741 params.uri = uri;
1742 params.body = body;
1743 params.bodySize = bodySize;
1744 return context->InvokeService(context, _OrthancPluginService_RestApiPostAfterPlugins, &params);
1745 }
1746
1747
1748
1761 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRestApiDelete(
1762 OrthancPluginContext* context,
1763 const char* uri)
1764 {
1765 return context->InvokeService(context, _OrthancPluginService_RestApiDelete, uri);
1766 }
1767
1768
1784 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRestApiDeleteAfterPlugins(
1785 OrthancPluginContext* context,
1786 const char* uri)
1787 {
1788 return context->InvokeService(context, _OrthancPluginService_RestApiDeleteAfterPlugins, uri);
1789 }
1790
1791
1792
1809 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRestApiPut(
1810 OrthancPluginContext* context,
1811 OrthancPluginMemoryBuffer* target,
1812 const char* uri,
1813 const char* body,
1814 uint32_t bodySize)
1815 {
1816 _OrthancPluginRestApiPostPut params;
1817 params.target = target;
1818 params.uri = uri;
1819 params.body = body;
1820 params.bodySize = bodySize;
1821 return context->InvokeService(context, _OrthancPluginService_RestApiPut, &params);
1822 }
1823
1824
1825
1845 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRestApiPutAfterPlugins(
1846 OrthancPluginContext* context,
1847 OrthancPluginMemoryBuffer* target,
1848 const char* uri,
1849 const char* body,
1850 uint32_t bodySize)
1851 {
1852 _OrthancPluginRestApiPostPut params;
1853 params.target = target;
1854 params.uri = uri;
1855 params.body = body;
1856 params.bodySize = bodySize;
1857 return context->InvokeService(context, _OrthancPluginService_RestApiPutAfterPlugins, &params);
1858 }
1859
1860
1861
1862 typedef struct
1863 {
1864 OrthancPluginRestOutput* output;
1865 const char* argument;
1866 } _OrthancPluginOutputPlusArgument;
1867
1879 ORTHANC_PLUGIN_INLINE void OrthancPluginRedirect(
1880 OrthancPluginContext* context,
1881 OrthancPluginRestOutput* output,
1882 const char* redirection)
1883 {
1884 _OrthancPluginOutputPlusArgument params;
1885 params.output = output;
1886 params.argument = redirection;
1887 context->InvokeService(context, _OrthancPluginService_Redirect, &params);
1888 }
1889
1890
1891
1892 typedef struct
1893 {
1894 char** result;
1895 const char* argument;
1896 } _OrthancPluginRetrieveDynamicString;
1897
1911 ORTHANC_PLUGIN_INLINE char* OrthancPluginLookupPatient(
1912 OrthancPluginContext* context,
1913 const char* patientID)
1914 {
1915 char* result;
1916
1917 _OrthancPluginRetrieveDynamicString params;
1918 params.result = &result;
1919 params.argument = patientID;
1920
1921 if (context->InvokeService(context, _OrthancPluginService_LookupPatient, &params) != OrthancPluginErrorCode_Success)
1922 {
1923 /* Error */
1924 return NULL;
1925 }
1926 else
1927 {
1928 return result;
1929 }
1930 }
1931
1932
1946 ORTHANC_PLUGIN_INLINE char* OrthancPluginLookupStudy(
1947 OrthancPluginContext* context,
1948 const char* studyUID)
1949 {
1950 char* result;
1951
1952 _OrthancPluginRetrieveDynamicString params;
1953 params.result = &result;
1954 params.argument = studyUID;
1955
1956 if (context->InvokeService(context, _OrthancPluginService_LookupStudy, &params) != OrthancPluginErrorCode_Success)
1957 {
1958 /* Error */
1959 return NULL;
1960 }
1961 else
1962 {
1963 return result;
1964 }
1965 }
1966
1967
1981 ORTHANC_PLUGIN_INLINE char* OrthancPluginLookupStudyWithAccessionNumber(
1982 OrthancPluginContext* context,
1983 const char* accessionNumber)
1984 {
1985 char* result;
1986
1987 _OrthancPluginRetrieveDynamicString params;
1988 params.result = &result;
1989 params.argument = accessionNumber;
1990
1991 if (context->InvokeService(context, _OrthancPluginService_LookupStudyWithAccessionNumber, &params) != OrthancPluginErrorCode_Success)
1992 {
1993 /* Error */
1994 return NULL;
1995 }
1996 else
1997 {
1998 return result;
1999 }
2000 }
2001
2002
2016 ORTHANC_PLUGIN_INLINE char* OrthancPluginLookupSeries(
2017 OrthancPluginContext* context,
2018 const char* seriesUID)
2019 {
2020 char* result;
2021
2022 _OrthancPluginRetrieveDynamicString params;
2023 params.result = &result;
2024 params.argument = seriesUID;
2025
2026 if (context->InvokeService(context, _OrthancPluginService_LookupSeries, &params) != OrthancPluginErrorCode_Success)
2027 {
2028 /* Error */
2029 return NULL;
2030 }
2031 else
2032 {
2033 return result;
2034 }
2035 }
2036
2037
2051 ORTHANC_PLUGIN_INLINE char* OrthancPluginLookupInstance(
2052 OrthancPluginContext* context,
2053 const char* sopInstanceUID)
2054 {
2055 char* result;
2056
2057 _OrthancPluginRetrieveDynamicString params;
2058 params.result = &result;
2059 params.argument = sopInstanceUID;
2060
2061 if (context->InvokeService(context, _OrthancPluginService_LookupInstance, &params) != OrthancPluginErrorCode_Success)
2062 {
2063 /* Error */
2064 return NULL;
2065 }
2066 else
2067 {
2068 return result;
2069 }
2070 }
2071
2072
2073
2074 typedef struct
2075 {
2076 OrthancPluginRestOutput* output;
2077 uint16_t status;
2078 } _OrthancPluginSendHttpStatusCode;
2079
2096 ORTHANC_PLUGIN_INLINE void OrthancPluginSendHttpStatusCode(
2097 OrthancPluginContext* context,
2098 OrthancPluginRestOutput* output,
2099 uint16_t status)
2100 {
2101 _OrthancPluginSendHttpStatusCode params;
2102 params.output = output;
2103 params.status = status;
2104 context->InvokeService(context, _OrthancPluginService_SendHttpStatusCode, &params);
2105 }
2106
2107
2119 ORTHANC_PLUGIN_INLINE void OrthancPluginSendUnauthorized(
2120 OrthancPluginContext* context,
2121 OrthancPluginRestOutput* output,
2122 const char* realm)
2123 {
2124 _OrthancPluginOutputPlusArgument params;
2125 params.output = output;
2126 params.argument = realm;
2127 context->InvokeService(context, _OrthancPluginService_SendUnauthorized, &params);
2128 }
2129
2130
2142 ORTHANC_PLUGIN_INLINE void OrthancPluginSendMethodNotAllowed(
2143 OrthancPluginContext* context,
2144 OrthancPluginRestOutput* output,
2145 const char* allowedMethods)
2146 {
2147 _OrthancPluginOutputPlusArgument params;
2148 params.output = output;
2149 params.argument = allowedMethods;
2150 context->InvokeService(context, _OrthancPluginService_SendMethodNotAllowed, &params);
2151 }
2152
2153
2154 typedef struct
2155 {
2156 OrthancPluginRestOutput* output;
2157 const char* key;
2158 const char* value;
2159 } _OrthancPluginSetHttpHeader;
2160
2172 ORTHANC_PLUGIN_INLINE void OrthancPluginSetCookie(
2173 OrthancPluginContext* context,
2174 OrthancPluginRestOutput* output,
2175 const char* cookie,
2176 const char* value)
2177 {
2178 _OrthancPluginSetHttpHeader params;
2179 params.output = output;
2180 params.key = cookie;
2181 params.value = value;
2182 context->InvokeService(context, _OrthancPluginService_SetCookie, &params);
2183 }
2184
2185
2197 ORTHANC_PLUGIN_INLINE void OrthancPluginSetHttpHeader(
2198 OrthancPluginContext* context,
2199 OrthancPluginRestOutput* output,
2200 const char* key,
2201 const char* value)
2202 {
2203 _OrthancPluginSetHttpHeader params;
2204 params.output = output;
2205 params.key = key;
2206 params.value = value;
2207 context->InvokeService(context, _OrthancPluginService_SetHttpHeader, &params);
2208 }
2209
2210
2211 typedef struct
2212 {
2213 char** resultStringToFree;
2214 const char** resultString;
2215 int64_t* resultInt64;
2216 const char* key;
2217 OrthancPluginDicomInstance* instance;
2218 OrthancPluginInstanceOrigin* resultOrigin; /* New in Orthanc 0.9.5 SDK */
2219 } _OrthancPluginAccessDicomInstance;
2220
2221
2233 ORTHANC_PLUGIN_INLINE const char* OrthancPluginGetInstanceRemoteAet(
2234 OrthancPluginContext* context,
2235 OrthancPluginDicomInstance* instance)
2236 {
2237 const char* result;
2238
2239 _OrthancPluginAccessDicomInstance params;
2240 memset(&params, 0, sizeof(params));
2241 params.resultString = &result;
2242 params.instance = instance;
2243
2244 if (context->InvokeService(context, _OrthancPluginService_GetInstanceRemoteAet, &params) != OrthancPluginErrorCode_Success)
2245 {
2246 /* Error */
2247 return NULL;
2248 }
2249 else
2250 {
2251 return result;
2252 }
2253 }
2254
2255
2266 ORTHANC_PLUGIN_INLINE int64_t OrthancPluginGetInstanceSize(
2267 OrthancPluginContext* context,
2268 OrthancPluginDicomInstance* instance)
2269 {
2270 int64_t size;
2271
2272 _OrthancPluginAccessDicomInstance params;
2273 memset(&params, 0, sizeof(params));
2274 params.resultInt64 = &size;
2275 params.instance = instance;
2276
2277 if (context->InvokeService(context, _OrthancPluginService_GetInstanceSize, &params) != OrthancPluginErrorCode_Success)
2278 {
2279 /* Error */
2280 return -1;
2281 }
2282 else
2283 {
2284 return size;
2285 }
2286 }
2287
2288
2299 ORTHANC_PLUGIN_INLINE const char* OrthancPluginGetInstanceData(
2300 OrthancPluginContext* context,
2301 OrthancPluginDicomInstance* instance)
2302 {
2303 const char* result;
2304
2305 _OrthancPluginAccessDicomInstance params;
2306 memset(&params, 0, sizeof(params));
2307 params.resultString = &result;
2308 params.instance = instance;
2309
2310 if (context->InvokeService(context, _OrthancPluginService_GetInstanceData, &params) != OrthancPluginErrorCode_Success)
2311 {
2312 /* Error */
2313 return NULL;
2314 }
2315 else
2316 {
2317 return result;
2318 }
2319 }
2320
2321
2335 ORTHANC_PLUGIN_INLINE char* OrthancPluginGetInstanceJson(
2336 OrthancPluginContext* context,
2337 OrthancPluginDicomInstance* instance)
2338 {
2339 char* result;
2340
2341 _OrthancPluginAccessDicomInstance params;
2342 memset(&params, 0, sizeof(params));
2343 params.resultStringToFree = &result;
2344 params.instance = instance;
2345
2346 if (context->InvokeService(context, _OrthancPluginService_GetInstanceJson, &params) != OrthancPluginErrorCode_Success)
2347 {
2348 /* Error */
2349 return NULL;
2350 }
2351 else
2352 {
2353 return result;
2354 }
2355 }
2356
2357
2373 ORTHANC_PLUGIN_INLINE char* OrthancPluginGetInstanceSimplifiedJson(
2374 OrthancPluginContext* context,
2375 OrthancPluginDicomInstance* instance)
2376 {
2377 char* result;
2378
2379 _OrthancPluginAccessDicomInstance params;
2380 memset(&params, 0, sizeof(params));
2381 params.resultStringToFree = &result;
2382 params.instance = instance;
2383
2384 if (context->InvokeService(context, _OrthancPluginService_GetInstanceSimplifiedJson, &params) != OrthancPluginErrorCode_Success)
2385 {
2386 /* Error */
2387 return NULL;
2388 }
2389 else
2390 {
2391 return result;
2392 }
2393 }
2394
2395
2412 ORTHANC_PLUGIN_INLINE int OrthancPluginHasInstanceMetadata(
2413 OrthancPluginContext* context,
2414 OrthancPluginDicomInstance* instance,
2415 const char* metadata)
2416 {
2417 int64_t result;
2418
2419 _OrthancPluginAccessDicomInstance params;
2420 memset(&params, 0, sizeof(params));
2421 params.resultInt64 = &result;
2422 params.instance = instance;
2423 params.key = metadata;
2424
2425 if (context->InvokeService(context, _OrthancPluginService_HasInstanceMetadata, &params) != OrthancPluginErrorCode_Success)
2426 {
2427 /* Error */
2428 return -1;
2429 }
2430 else
2431 {
2432 return (result != 0);
2433 }
2434 }
2435
2436
2450 ORTHANC_PLUGIN_INLINE const char* OrthancPluginGetInstanceMetadata(
2451 OrthancPluginContext* context,
2452 OrthancPluginDicomInstance* instance,
2453 const char* metadata)
2454 {
2455 const char* result;
2456
2457 _OrthancPluginAccessDicomInstance params;
2458 memset(&params, 0, sizeof(params));
2459 params.resultString = &result;
2460 params.instance = instance;
2461 params.key = metadata;
2462
2463 if (context->InvokeService(context, _OrthancPluginService_GetInstanceMetadata, &params) != OrthancPluginErrorCode_Success)
2464 {
2465 /* Error */
2466 return NULL;
2467 }
2468 else
2469 {
2470 return result;
2471 }
2472 }
2473
2474
2475
2476 typedef struct
2477 {
2478 OrthancPluginStorageCreate create;
2479 OrthancPluginStorageRead read;
2480 OrthancPluginStorageRemove remove;
2481 OrthancPluginFree free;
2482 } _OrthancPluginRegisterStorageArea;
2483
2498 ORTHANC_PLUGIN_INLINE void OrthancPluginRegisterStorageArea(
2499 OrthancPluginContext* context,
2500 OrthancPluginStorageCreate create,
2501 OrthancPluginStorageRead read,
2502 OrthancPluginStorageRemove remove)
2503 {
2504 _OrthancPluginRegisterStorageArea params;
2505 params.create = create;
2506 params.read = read;
2507 params.remove = remove;
2508
2509 #ifdef __cplusplus
2510 params.free = ::free;
2511 #else
2512 params.free = free;
2513 #endif
2514
2515 context->InvokeService(context, _OrthancPluginService_RegisterStorageArea, &params);
2516 }
2517
2518
2519
2530 ORTHANC_PLUGIN_INLINE char *OrthancPluginGetOrthancPath(OrthancPluginContext* context)
2531 {
2532 char* result;
2533
2534 _OrthancPluginRetrieveDynamicString params;
2535 params.result = &result;
2536 params.argument = NULL;
2537
2538 if (context->InvokeService(context, _OrthancPluginService_GetOrthancPath, &params) != OrthancPluginErrorCode_Success)
2539 {
2540 /* Error */
2541 return NULL;
2542 }
2543 else
2544 {
2545 return result;
2546 }
2547 }
2548
2549
2560 ORTHANC_PLUGIN_INLINE char *OrthancPluginGetOrthancDirectory(OrthancPluginContext* context)
2561 {
2562 char* result;
2563
2564 _OrthancPluginRetrieveDynamicString params;
2565 params.result = &result;
2566 params.argument = NULL;
2567
2568 if (context->InvokeService(context, _OrthancPluginService_GetOrthancDirectory, &params) != OrthancPluginErrorCode_Success)
2569 {
2570 /* Error */
2571 return NULL;
2572 }
2573 else
2574 {
2575 return result;
2576 }
2577 }
2578
2579
2595 ORTHANC_PLUGIN_INLINE char *OrthancPluginGetConfigurationPath(OrthancPluginContext* context)
2596 {
2597 char* result;
2598
2599 _OrthancPluginRetrieveDynamicString params;
2600 params.result = &result;
2601 params.argument = NULL;
2602
2603 if (context->InvokeService(context, _OrthancPluginService_GetConfigurationPath, &params) != OrthancPluginErrorCode_Success)
2604 {
2605 /* Error */
2606 return NULL;
2607 }
2608 else
2609 {
2610 return result;
2611 }
2612 }
2613
2614
2615
2616 typedef struct
2617 {
2618 OrthancPluginOnChangeCallback callback;
2619 } _OrthancPluginOnChangeCallback;
2620
2637 ORTHANC_PLUGIN_INLINE void OrthancPluginRegisterOnChangeCallback(
2638 OrthancPluginContext* context,
2639 OrthancPluginOnChangeCallback callback)
2640 {
2641 _OrthancPluginOnChangeCallback params;
2642 params.callback = callback;
2643
2644 context->InvokeService(context, _OrthancPluginService_RegisterOnChangeCallback, &params);
2645 }
2646
2647
2648
2649 typedef struct
2650 {
2651 const char* plugin;
2652 _OrthancPluginProperty property;
2653 const char* value;
2654 } _OrthancPluginSetPluginProperty;
2655
2656
2668 ORTHANC_PLUGIN_INLINE void OrthancPluginSetRootUri(
2669 OrthancPluginContext* context,
2670 const char* uri)
2671 {
2672 _OrthancPluginSetPluginProperty params;
2673 params.plugin = OrthancPluginGetName();
2674 params.property = _OrthancPluginProperty_RootUri;
2675 params.value = uri;
2676
2677 context->InvokeService(context, _OrthancPluginService_SetPluginProperty, &params);
2678 }
2679
2680
2690 ORTHANC_PLUGIN_INLINE void OrthancPluginSetDescription(
2691 OrthancPluginContext* context,
2692 const char* description)
2693 {
2694 _OrthancPluginSetPluginProperty params;
2695 params.plugin = OrthancPluginGetName();
2696 params.property = _OrthancPluginProperty_Description;
2697 params.value = description;
2698
2699 context->InvokeService(context, _OrthancPluginService_SetPluginProperty, &params);
2700 }
2701
2702
2712 ORTHANC_PLUGIN_INLINE void OrthancPluginExtendOrthancExplorer(
2713 OrthancPluginContext* context,
2714 const char* javascript)
2715 {
2716 _OrthancPluginSetPluginProperty params;
2717 params.plugin = OrthancPluginGetName();
2718 params.property = _OrthancPluginProperty_OrthancExplorer;
2719 params.value = javascript;
2720
2721 context->InvokeService(context, _OrthancPluginService_SetPluginProperty, &params);
2722 }
2723
2724
2725 typedef struct
2726 {
2727 char** result;
2728 int32_t property;
2729 const char* value;
2730 } _OrthancPluginGlobalProperty;
2731
2732
2746 ORTHANC_PLUGIN_INLINE char* OrthancPluginGetGlobalProperty(
2747 OrthancPluginContext* context,
2748 int32_t property,
2749 const char* defaultValue)
2750 {
2751 char* result;
2752
2753 _OrthancPluginGlobalProperty params;
2754 params.result = &result;
2755 params.property = property;
2756 params.value = defaultValue;
2757
2758 if (context->InvokeService(context, _OrthancPluginService_GetGlobalProperty, &params) != OrthancPluginErrorCode_Success)
2759 {
2760 /* Error */
2761 return NULL;
2762 }
2763 else
2764 {
2765 return result;
2766 }
2767 }
2768
2769
2785 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginSetGlobalProperty(
2786 OrthancPluginContext* context,
2787 int32_t property,
2788 const char* value)
2789 {
2790 _OrthancPluginGlobalProperty params;
2791 params.result = NULL;
2792 params.property = property;
2793 params.value = value;
2794
2795 return context->InvokeService(context, _OrthancPluginService_SetGlobalProperty, &params);
2796 }
2797
2798
2799
2800 typedef struct
2801 {
2802 int32_t *resultInt32;
2803 uint32_t *resultUint32;
2804 int64_t *resultInt64;
2805 uint64_t *resultUint64;
2806 } _OrthancPluginReturnSingleValue;
2807
2816 ORTHANC_PLUGIN_INLINE uint32_t OrthancPluginGetCommandLineArgumentsCount(
2817 OrthancPluginContext* context)
2818 {
2819 uint32_t count = 0;
2820
2821 _OrthancPluginReturnSingleValue params;
2822 memset(&params, 0, sizeof(params));
2823 params.resultUint32 = &count;
2824
2825 if (context->InvokeService(context, _OrthancPluginService_GetCommandLineArgumentsCount, &params) != OrthancPluginErrorCode_Success)
2826 {
2827 /* Error */
2828 return 0;
2829 }
2830 else
2831 {
2832 return count;
2833 }
2834 }
2835
2836
2837
2850 ORTHANC_PLUGIN_INLINE char* OrthancPluginGetCommandLineArgument(
2851 OrthancPluginContext* context,
2852 uint32_t argument)
2853 {
2854 char* result;
2855
2856 _OrthancPluginGlobalProperty params;
2857 params.result = &result;
2858 params.property = (int32_t) argument;
2859 params.value = NULL;
2860
2861 if (context->InvokeService(context, _OrthancPluginService_GetCommandLineArgument, &params) != OrthancPluginErrorCode_Success)
2862 {
2863 /* Error */
2864 return NULL;
2865 }
2866 else
2867 {
2868 return result;
2869 }
2870 }
2871
2872
2883 ORTHANC_PLUGIN_INLINE uint32_t OrthancPluginGetExpectedDatabaseVersion(
2884 OrthancPluginContext* context)
2885 {
2886 uint32_t count = 0;
2887
2888 _OrthancPluginReturnSingleValue params;
2889 memset(&params, 0, sizeof(params));
2890 params.resultUint32 = &count;
2891
2892 if (context->InvokeService(context, _OrthancPluginService_GetExpectedDatabaseVersion, &params) != OrthancPluginErrorCode_Success)
2893 {
2894 /* Error */
2895 return 0;
2896 }
2897 else
2898 {
2899 return count;
2900 }
2901 }
2902
2903
2904
2916 ORTHANC_PLUGIN_INLINE char *OrthancPluginGetConfiguration(OrthancPluginContext* context)
2917 {
2918 char* result;
2919
2920 _OrthancPluginRetrieveDynamicString params;
2921 params.result = &result;
2922 params.argument = NULL;
2923
2924 if (context->InvokeService(context, _OrthancPluginService_GetConfiguration, &params) != OrthancPluginErrorCode_Success)
2925 {
2926 /* Error */
2927 return NULL;
2928 }
2929 else
2930 {
2931 return result;
2932 }
2933 }
2934
2935
2936
2937 typedef struct
2938 {
2939 OrthancPluginRestOutput* output;
2940 const char* subType;
2941 const char* contentType;
2942 } _OrthancPluginStartMultipartAnswer;
2943
2957 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginStartMultipartAnswer(
2958 OrthancPluginContext* context,
2959 OrthancPluginRestOutput* output,
2960 const char* subType,
2961 const char* contentType)
2962 {
2963 _OrthancPluginStartMultipartAnswer params;
2964 params.output = output;
2965 params.subType = subType;
2966 params.contentType = contentType;
2967 return context->InvokeService(context, _OrthancPluginService_StartMultipartAnswer, &params);
2968 }
2969
2970
2986 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginSendMultipartItem(
2987 OrthancPluginContext* context,
2988 OrthancPluginRestOutput* output,
2989 const char* answer,
2990 uint32_t answerSize)
2991 {
2992 _OrthancPluginAnswerBuffer params;
2993 params.output = output;
2994 params.answer = answer;
2995 params.answerSize = answerSize;
2996 params.mimeType = NULL;
2997 return context->InvokeService(context, _OrthancPluginService_SendMultipartItem, &params);
2998 }
2999
3000
3001
3002 typedef struct
3003 {
3004 OrthancPluginMemoryBuffer* target;
3005 const void* source;
3006 uint32_t size;
3007 OrthancPluginCompressionType compression;
3008 uint8_t uncompress;
3009 } _OrthancPluginBufferCompression;
3010
3011
3028 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginBufferCompression(
3029 OrthancPluginContext* context,
3030 OrthancPluginMemoryBuffer* target,
3031 const void* source,
3032 uint32_t size,
3033 OrthancPluginCompressionType compression,
3034 uint8_t uncompress)
3035 {
3036 _OrthancPluginBufferCompression params;
3037 params.target = target;
3038 params.source = source;
3039 params.size = size;
3040 params.compression = compression;
3041 params.uncompress = uncompress;
3042
3043 return context->InvokeService(context, _OrthancPluginService_BufferCompression, &params);
3044 }
3045
3046
3047
3048 typedef struct
3049 {
3050 OrthancPluginMemoryBuffer* target;
3051 const char* path;
3052 } _OrthancPluginReadFile;
3053
3065 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginReadFile(
3066 OrthancPluginContext* context,
3067 OrthancPluginMemoryBuffer* target,
3068 const char* path)
3069 {
3070 _OrthancPluginReadFile params;
3071 params.target = target;
3072 params.path = path;
3073 return context->InvokeService(context, _OrthancPluginService_ReadFile, &params);
3074 }
3075
3076
3077
3078 typedef struct
3079 {
3080 const char* path;
3081 const void* data;
3082 uint32_t size;
3083 } _OrthancPluginWriteFile;
3084
3096 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginWriteFile(
3097 OrthancPluginContext* context,
3098 const char* path,
3099 const void* data,
3100 uint32_t size)
3101 {
3102 _OrthancPluginWriteFile params;
3103 params.path = path;
3104 params.data = data;
3105 params.size = size;
3106 return context->InvokeService(context, _OrthancPluginService_WriteFile, &params);
3107 }
3108
3109
3110
3111 typedef struct
3112 {
3113 const char** target;
3114 OrthancPluginErrorCode error;
3115 } _OrthancPluginGetErrorDescription;
3116
3127 ORTHANC_PLUGIN_INLINE const char* OrthancPluginGetErrorDescription(
3128 OrthancPluginContext* context,
3129 OrthancPluginErrorCode error)
3130 {
3131 const char* result = NULL;
3132
3133 _OrthancPluginGetErrorDescription params;
3134 params.target = &result;
3135 params.error = error;
3136
3137 if (context->InvokeService(context, _OrthancPluginService_GetErrorDescription, &params) != OrthancPluginErrorCode_Success ||
3138 result == NULL)
3139 {
3140 return "Unknown error code";
3141 }
3142 else
3143 {
3144 return result;
3145 }
3146 }
3147
3148
3149
3150 typedef struct
3151 {
3152 OrthancPluginRestOutput* output;
3153 uint16_t status;
3154 const char* body;
3155 uint32_t bodySize;
3156 } _OrthancPluginSendHttpStatus;
3157
3180 ORTHANC_PLUGIN_INLINE void OrthancPluginSendHttpStatus(
3181 OrthancPluginContext* context,
3182 OrthancPluginRestOutput* output,
3183 uint16_t status,
3184 const char* body,
3185 uint32_t bodySize)
3186 {
3187 _OrthancPluginSendHttpStatus params;
3188 params.output = output;
3189 params.status = status;
3190 params.body = body;
3191 params.bodySize = bodySize;
3192 context->InvokeService(context, _OrthancPluginService_SendHttpStatus, &params);
3193 }
3194
3195
3196
3197 typedef struct
3198 {
3199 const OrthancPluginImage* image;
3200 uint32_t* resultUint32;
3201 OrthancPluginPixelFormat* resultPixelFormat;
3202 void** resultBuffer;
3203 } _OrthancPluginGetImageInfo;
3204
3205
3216 ORTHANC_PLUGIN_INLINE OrthancPluginPixelFormat OrthancPluginGetImagePixelFormat(
3217 OrthancPluginContext* context,
3218 const OrthancPluginImage* image)
3219 {
3220 OrthancPluginPixelFormat target;
3221
3222 _OrthancPluginGetImageInfo params;
3223 memset(&params, 0, sizeof(params));
3224 params.image = image;
3225 params.resultPixelFormat = &target;
3226
3227 if (context->InvokeService(context, _OrthancPluginService_GetImagePixelFormat, &params) != OrthancPluginErrorCode_Success)
3228 {
3229 return OrthancPluginPixelFormat_Unknown;
3230 }
3231 else
3232 {
3233 return (OrthancPluginPixelFormat) target;
3234 }
3235 }
3236
3237
3238
3249 ORTHANC_PLUGIN_INLINE uint32_t OrthancPluginGetImageWidth(
3250 OrthancPluginContext* context,
3251 const OrthancPluginImage* image)
3252 {
3253 uint32_t width;
3254
3255 _OrthancPluginGetImageInfo params;
3256 memset(&params, 0, sizeof(params));
3257 params.image = image;
3258 params.resultUint32 = &width;
3259
3260 if (context->InvokeService(context, _OrthancPluginService_GetImageWidth, &params) != OrthancPluginErrorCode_Success)
3261 {
3262 return 0;
3263 }
3264 else
3265 {
3266 return width;
3267 }
3268 }
3269
3270
3271
3282 ORTHANC_PLUGIN_INLINE uint32_t OrthancPluginGetImageHeight(
3283 OrthancPluginContext* context,
3284 const OrthancPluginImage* image)
3285 {
3286 uint32_t height;
3287
3288 _OrthancPluginGetImageInfo params;
3289 memset(&params, 0, sizeof(params));
3290 params.image = image;
3291 params.resultUint32 = &height;
3292
3293 if (context->InvokeService(context, _OrthancPluginService_GetImageHeight, &params) != OrthancPluginErrorCode_Success)
3294 {
3295 return 0;
3296 }
3297 else
3298 {
3299 return height;
3300 }
3301 }
3302
3303
3304
3317 ORTHANC_PLUGIN_INLINE uint32_t OrthancPluginGetImagePitch(
3318 OrthancPluginContext* context,
3319 const OrthancPluginImage* image)
3320 {
3321 uint32_t pitch;
3322
3323 _OrthancPluginGetImageInfo params;
3324 memset(&params, 0, sizeof(params));
3325 params.image = image;
3326 params.resultUint32 = &pitch;
3327
3328 if (context->InvokeService(context, _OrthancPluginService_GetImagePitch, &params) != OrthancPluginErrorCode_Success)
3329 {
3330 return 0;
3331 }
3332 else
3333 {
3334 return pitch;
3335 }
3336 }
3337
3338
3339
3351 ORTHANC_PLUGIN_INLINE void* OrthancPluginGetImageBuffer(
3352 OrthancPluginContext* context,
3353 const OrthancPluginImage* image)
3354 {
3355 void* target = NULL;
3356
3357 _OrthancPluginGetImageInfo params;
3358 memset(&params, 0, sizeof(params));
3359 params.resultBuffer = &target;
3360 params.image = image;
3361
3362 if (context->InvokeService(context, _OrthancPluginService_GetImageBuffer, &params) != OrthancPluginErrorCode_Success)
3363 {
3364 return NULL;
3365 }
3366 else
3367 {
3368 return target;
3369 }
3370 }
3371
3372
3373 typedef struct
3374 {
3375 OrthancPluginImage** target;
3376 const void* data;
3377 uint32_t size;
3378 OrthancPluginImageFormat format;
3379 } _OrthancPluginUncompressImage;
3380
3381
3394 ORTHANC_PLUGIN_INLINE OrthancPluginImage *OrthancPluginUncompressImage(
3395 OrthancPluginContext* context,
3396 const void* data,
3397 uint32_t size,
3398 OrthancPluginImageFormat format)
3399 {
3400 OrthancPluginImage* target = NULL;
3401
3402 _OrthancPluginUncompressImage params;
3403 memset(&params, 0, sizeof(params));
3404 params.target = &target;
3405 params.data = data;
3406 params.size = size;
3407 params.format = format;
3408
3409 if (context->InvokeService(context, _OrthancPluginService_UncompressImage, &params) != OrthancPluginErrorCode_Success)
3410 {
3411 return NULL;
3412 }
3413 else
3414 {
3415 return target;
3416 }
3417 }
3418
3419
3420
3421
3422 typedef struct
3423 {
3424 OrthancPluginImage* image;
3425 } _OrthancPluginFreeImage;
3426
3436 ORTHANC_PLUGIN_INLINE void OrthancPluginFreeImage(
3437 OrthancPluginContext* context,
3438 OrthancPluginImage* image)
3439 {
3440 _OrthancPluginFreeImage params;
3441 params.image = image;
3442
3443 context->InvokeService(context, _OrthancPluginService_FreeImage, &params);
3444 }
3445
3446
3447
3448
3449 typedef struct
3450 {
3451 OrthancPluginMemoryBuffer* target;
3452 OrthancPluginImageFormat imageFormat;
3453 OrthancPluginPixelFormat pixelFormat;
3454 uint32_t width;
3455 uint32_t height;
3456 uint32_t pitch;
3457 const void* buffer;
3458 uint8_t quality;
3459 } _OrthancPluginCompressImage;
3460
3461
3481 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginCompressPngImage(
3482 OrthancPluginContext* context,
3483 OrthancPluginMemoryBuffer* target,
3484 OrthancPluginPixelFormat format,
3485 uint32_t width,
3486 uint32_t height,
3487 uint32_t pitch,
3488 const void* buffer)
3489 {
3490 _OrthancPluginCompressImage params;
3491 memset(&params, 0, sizeof(params));
3492 params.target = target;
3493 params.imageFormat = OrthancPluginImageFormat_Png;
3494 params.pixelFormat = format;
3495 params.width = width;
3496 params.height = height;
3497 params.pitch = pitch;
3498 params.buffer = buffer;
3499 params.quality = 0; /* Unused for PNG */
3500
3501 return context->InvokeService(context, _OrthancPluginService_CompressImage, &params);
3502 }
3503
3504
3526 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginCompressJpegImage(
3527 OrthancPluginContext* context,
3528 OrthancPluginMemoryBuffer* target,
3529 OrthancPluginPixelFormat format,
3530 uint32_t width,
3531 uint32_t height,
3532 uint32_t pitch,
3533 const void* buffer,
3534 uint8_t quality)
3535 {
3536 _OrthancPluginCompressImage params;
3537 memset(&params, 0, sizeof(params));
3538 params.target = target;
3539 params.imageFormat = OrthancPluginImageFormat_Jpeg;
3540 params.pixelFormat = format;
3541 params.width = width;
3542 params.height = height;
3543 params.pitch = pitch;
3544 params.buffer = buffer;
3545 params.quality = quality;
3546
3547 return context->InvokeService(context, _OrthancPluginService_CompressImage, &params);
3548 }
3549
3550
3551
3573 ORTHANC_PLUGIN_INLINE void OrthancPluginCompressAndAnswerJpegImage(
3574 OrthancPluginContext* context,
3575 OrthancPluginRestOutput* output,
3576 OrthancPluginPixelFormat format,
3577 uint32_t width,
3578 uint32_t height,
3579 uint32_t pitch,
3580 const void* buffer,
3581 uint8_t quality)
3582 {
3583 _OrthancPluginCompressAndAnswerImage params;
3584 params.output = output;
3585 params.imageFormat = OrthancPluginImageFormat_Jpeg;
3586 params.pixelFormat = format;
3587 params.width = width;
3588 params.height = height;
3589 params.pitch = pitch;
3590 params.buffer = buffer;
3591 params.quality = quality;
3592 context->InvokeService(context, _OrthancPluginService_CompressAndAnswerImage, &params);
3593 }
3594
3595
3596
3597
3598 typedef struct
3599 {
3600 OrthancPluginMemoryBuffer* target;
3601 OrthancPluginHttpMethod method;
3602 const char* url;
3603 const char* username;
3604 const char* password;
3605 const char* body;
3606 uint32_t bodySize;
3607 } _OrthancPluginCallHttpClient;
3608
3609
3625 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginHttpGet(
3626 OrthancPluginContext* context,
3627 OrthancPluginMemoryBuffer* target,
3628 const char* url,
3629 const char* username,
3630 const char* password)
3631 {
3632 _OrthancPluginCallHttpClient params;
3633 memset(&params, 0, sizeof(params));
3634
3635 params.target = target;
3636 params.method = OrthancPluginHttpMethod_Get;
3637 params.url = url;
3638 params.username = username;
3639 params.password = password;
3640
3641 return context->InvokeService(context, _OrthancPluginService_CallHttpClient, &params);
3642 }
3643
3644
3662 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginHttpPost(
3663 OrthancPluginContext* context,
3664 OrthancPluginMemoryBuffer* target,
3665 const char* url,
3666 const char* body,
3667 uint32_t bodySize,
3668 const char* username,
3669 const char* password)
3670 {
3671 _OrthancPluginCallHttpClient params;
3672 memset(&params, 0, sizeof(params));
3673
3674 params.target = target;
3675 params.method = OrthancPluginHttpMethod_Post;
3676 params.url = url;
3677 params.body = body;
3678 params.bodySize = bodySize;
3679 params.username = username;
3680 params.password = password;
3681
3682 return context->InvokeService(context, _OrthancPluginService_CallHttpClient, &params);
3683 }
3684
3685
3703 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginHttpPut(
3704 OrthancPluginContext* context,
3705 OrthancPluginMemoryBuffer* target,
3706 const char* url,
3707 const char* body,
3708 uint32_t bodySize,
3709 const char* username,
3710 const char* password)
3711 {
3712 _OrthancPluginCallHttpClient params;
3713 memset(&params, 0, sizeof(params));
3714
3715 params.target = target;
3716 params.method = OrthancPluginHttpMethod_Put;
3717 params.url = url;
3718 params.body = body;
3719 params.bodySize = bodySize;
3720 params.username = username;
3721 params.password = password;
3722
3723 return context->InvokeService(context, _OrthancPluginService_CallHttpClient, &params);
3724 }
3725
3726
3740 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginHttpDelete(
3741 OrthancPluginContext* context,
3742 const char* url,
3743 const char* username,
3744 const char* password)
3745 {
3746 _OrthancPluginCallHttpClient params;
3747 memset(&params, 0, sizeof(params));
3748
3749 params.method = OrthancPluginHttpMethod_Delete;
3750 params.url = url;
3751 params.username = username;
3752 params.password = password;
3753
3754 return context->InvokeService(context, _OrthancPluginService_CallHttpClient, &params);
3755 }
3756
3757
3758
3759 typedef struct
3760 {
3761 OrthancPluginImage** target;
3762 const OrthancPluginImage* source;
3763 OrthancPluginPixelFormat targetFormat;
3764 } _OrthancPluginConvertPixelFormat;
3765
3766
3778 ORTHANC_PLUGIN_INLINE OrthancPluginImage *OrthancPluginConvertPixelFormat(
3779 OrthancPluginContext* context,
3780 const OrthancPluginImage* source,
3781 OrthancPluginPixelFormat targetFormat)
3782 {
3783 OrthancPluginImage* target = NULL;
3784
3785 _OrthancPluginConvertPixelFormat params;
3786 params.target = &target;
3787 params.source = source;
3788 params.targetFormat = targetFormat;
3789
3790 if (context->InvokeService(context, _OrthancPluginService_ConvertPixelFormat, &params) != OrthancPluginErrorCode_Success)
3791 {
3792 return NULL;
3793 }
3794 else
3795 {
3796 return target;
3797 }
3798 }
3799
3800
3801
3813 ORTHANC_PLUGIN_INLINE uint32_t OrthancPluginGetFontsCount(
3814 OrthancPluginContext* context)
3815 {
3816 uint32_t count = 0;
3817
3818 _OrthancPluginReturnSingleValue params;
3819 memset(&params, 0, sizeof(params));
3820 params.resultUint32 = &count;
3821
3822 if (context->InvokeService(context, _OrthancPluginService_GetFontsCount, &params) != OrthancPluginErrorCode_Success)
3823 {
3824 /* Error */
3825 return 0;
3826 }
3827 else
3828 {
3829 return count;
3830 }
3831 }
3832
3833
3834
3835
3836 typedef struct
3837 {
3838 uint32_t fontIndex; /* in */
3839 const char** name; /* out */
3840 uint32_t* size; /* out */
3841 } _OrthancPluginGetFontInfo;
3842
3853 ORTHANC_PLUGIN_INLINE const char* OrthancPluginGetFontName(
3854 OrthancPluginContext* context,
3855 uint32_t fontIndex)
3856 {
3857 const char* result = NULL;
3858
3859 _OrthancPluginGetFontInfo params;
3860 memset(&params, 0, sizeof(params));
3861 params.name = &result;
3862 params.fontIndex = fontIndex;
3863
3864 if (context->InvokeService(context, _OrthancPluginService_GetFontInfo, &params) != OrthancPluginErrorCode_Success)
3865 {
3866 return NULL;
3867 }
3868 else
3869 {
3870 return result;
3871 }
3872 }
3873
3874
3885 ORTHANC_PLUGIN_INLINE uint32_t OrthancPluginGetFontSize(
3886 OrthancPluginContext* context,
3887 uint32_t fontIndex)
3888 {
3889 uint32_t result;
3890
3891 _OrthancPluginGetFontInfo params;
3892 memset(&params, 0, sizeof(params));
3893 params.size = &result;
3894 params.fontIndex = fontIndex;
3895
3896 if (context->InvokeService(context, _OrthancPluginService_GetFontInfo, &params) != OrthancPluginErrorCode_Success)
3897 {
3898 return 0;
3899 }
3900 else
3901 {
3902 return result;
3903 }
3904 }
3905
3906
3907
3908 typedef struct
3909 {
3910 OrthancPluginImage* image;
3911 uint32_t fontIndex;
3912 const char* utf8Text;
3913 int32_t x;
3914 int32_t y;
3915 uint8_t r;
3916 uint8_t g;
3917 uint8_t b;
3918 } _OrthancPluginDrawText;
3919
3920
3938 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginDrawText(
3939 OrthancPluginContext* context,
3940 OrthancPluginImage* image,
3941 uint32_t fontIndex,
3942 const char* utf8Text,
3943 int32_t x,
3944 int32_t y,
3945 uint8_t r,
3946 uint8_t g,
3947 uint8_t b)
3948 {
3949 _OrthancPluginDrawText params;
3950 memset(&params, 0, sizeof(params));
3951 params.image = image;
3952 params.fontIndex = fontIndex;
3953 params.utf8Text = utf8Text;
3954 params.x = x;
3955 params.y = y;
3956 params.r = r;
3957 params.g = g;
3958 params.b = b;
3959
3960 return context->InvokeService(context, _OrthancPluginService_DrawText, &params);
3961 }
3962
3963
3964
3965 typedef struct
3966 {
3967 OrthancPluginStorageArea* storageArea;
3968 const char* uuid;
3969 const void* content;
3970 uint64_t size;
3971 OrthancPluginContentType type;
3972 } _OrthancPluginStorageAreaCreate;
3973
3974
3990 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginStorageAreaCreate(
3991 OrthancPluginContext* context,
3992 OrthancPluginStorageArea* storageArea,
3993 const char* uuid,
3994 const void* content,
3995 uint64_t size,
3996 OrthancPluginContentType type)
3997 {
3998 _OrthancPluginStorageAreaCreate params;
3999 params.storageArea = storageArea;
4000 params.uuid = uuid;
4001 params.content = content;
4002 params.size = size;
4003 params.type = type;
4004
4005 return context->InvokeService(context, _OrthancPluginService_StorageAreaCreate, &params);
4006 }
4007
4008
4009 typedef struct
4010 {
4011 OrthancPluginMemoryBuffer* target;
4012 OrthancPluginStorageArea* storageArea;
4013 const char* uuid;
4014 OrthancPluginContentType type;
4015 } _OrthancPluginStorageAreaRead;
4016
4017
4032 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginStorageAreaRead(
4033 OrthancPluginContext* context,
4034 OrthancPluginMemoryBuffer* target,
4035 OrthancPluginStorageArea* storageArea,
4036 const char* uuid,
4037 OrthancPluginContentType type)
4038 {
4039 _OrthancPluginStorageAreaRead params;
4040 params.target = target;
4041 params.storageArea = storageArea;
4042 params.uuid = uuid;
4043 params.type = type;
4044
4045 return context->InvokeService(context, _OrthancPluginService_StorageAreaRead, &params);
4046 }
4047
4048
4049 typedef struct
4050 {
4051 OrthancPluginStorageArea* storageArea;
4052 const char* uuid;
4053 OrthancPluginContentType type;
4054 } _OrthancPluginStorageAreaRemove;
4055
4069 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginStorageAreaRemove(
4070 OrthancPluginContext* context,
4071 OrthancPluginStorageArea* storageArea,
4072 const char* uuid,
4073 OrthancPluginContentType type)
4074 {
4075 _OrthancPluginStorageAreaRemove params;
4076 params.storageArea = storageArea;
4077 params.uuid = uuid;
4078 params.type = type;
4079
4080 return context->InvokeService(context, _OrthancPluginService_StorageAreaRemove, &params);
4081 }
4082
4083
4084
4085 typedef struct
4086 {
4087 OrthancPluginErrorCode* target;
4088 int32_t code;
4089 uint16_t httpStatus;
4090 const char* message;
4091 } _OrthancPluginRegisterErrorCode;
4092
4108 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRegisterErrorCode(
4109 OrthancPluginContext* context,
4110 int32_t code,
4111 uint16_t httpStatus,
4112 const char* message)
4113 {
4114 OrthancPluginErrorCode target;
4115
4116 _OrthancPluginRegisterErrorCode params;
4117 params.target = &target;
4118 params.code = code;
4119 params.httpStatus = httpStatus;
4120 params.message = message;
4121
4122 if (context->InvokeService(context, _OrthancPluginService_RegisterErrorCode, &params) == OrthancPluginErrorCode_Success)
4123 {
4124 return target;
4125 }
4126 else
4127 {
4128 /* There was an error while assigned the error. Use a generic code. */
4129 return OrthancPluginErrorCode_Plugin;
4130 }
4131 }
4132
4133
4134
4135 typedef struct
4136 {
4137 uint16_t group;
4138 uint16_t element;
4139 OrthancPluginValueRepresentation vr;
4140 const char* name;
4141 uint32_t minMultiplicity;
4142 uint32_t maxMultiplicity;
4143 } _OrthancPluginRegisterDictionaryTag;
4144
4164 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRegisterDictionaryTag(
4165 OrthancPluginContext* context,
4166 uint16_t group,
4167 uint16_t element,
4168 OrthancPluginValueRepresentation vr,
4169 const char* name,
4170 uint32_t minMultiplicity,
4171 uint32_t maxMultiplicity)
4172 {
4173 _OrthancPluginRegisterDictionaryTag params;
4174 params.group = group;
4175 params.element = element;
4176 params.vr = vr;
4177 params.name = name;
4178 params.minMultiplicity = minMultiplicity;
4179 params.maxMultiplicity = maxMultiplicity;
4180
4181 return context->InvokeService(context, _OrthancPluginService_RegisterDictionaryTag, &params);
4182 }
4183
4184
4185
4186 typedef struct
4187 {
4188 uint16_t group;
4189 uint16_t element;
4190 OrthancPluginValueRepresentation vr;
4191 const char* name;
4192 uint32_t minMultiplicity;
4193 uint32_t maxMultiplicity;
4194 const char* privateCreator;
4195 } _OrthancPluginRegisterPrivateDictionaryTag;
4196
4217 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRegisterPrivateDictionaryTag(
4218 OrthancPluginContext* context,
4219 uint16_t group,
4220 uint16_t element,
4221 OrthancPluginValueRepresentation vr,
4222 const char* name,
4223 uint32_t minMultiplicity,
4224 uint32_t maxMultiplicity,
4225 const char* privateCreator)
4226 {
4227 _OrthancPluginRegisterPrivateDictionaryTag params;
4228 params.group = group;
4229 params.element = element;
4230 params.vr = vr;
4231 params.name = name;
4232 params.minMultiplicity = minMultiplicity;
4233 params.maxMultiplicity = maxMultiplicity;
4234 params.privateCreator = privateCreator;
4235
4236 return context->InvokeService(context, _OrthancPluginService_RegisterPrivateDictionaryTag, &params);
4237 }
4238
4239
4240
4241 typedef struct
4242 {
4243 OrthancPluginStorageArea* storageArea;
4244 OrthancPluginResourceType level;
4245 } _OrthancPluginReconstructMainDicomTags;
4246
4263 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginReconstructMainDicomTags(
4264 OrthancPluginContext* context,
4265 OrthancPluginStorageArea* storageArea,
4266 OrthancPluginResourceType level)
4267 {
4268 _OrthancPluginReconstructMainDicomTags params;
4269 params.level = level;
4270 params.storageArea = storageArea;
4271
4272 return context->InvokeService(context, _OrthancPluginService_ReconstructMainDicomTags, &params);
4273 }
4274
4275
4276 typedef struct
4277 {
4278 char** result;
4279 const char* instanceId;
4280 const void* buffer;
4281 uint32_t size;
4282 OrthancPluginDicomToJsonFormat format;
4283 OrthancPluginDicomToJsonFlags flags;
4284 uint32_t maxStringLength;
4285 } _OrthancPluginDicomToJson;
4286
4287
4307 ORTHANC_PLUGIN_INLINE char* OrthancPluginDicomBufferToJson(
4308 OrthancPluginContext* context,
4309 const void* buffer,
4310 uint32_t size,
4311 OrthancPluginDicomToJsonFormat format,
4312 OrthancPluginDicomToJsonFlags flags,
4313 uint32_t maxStringLength)
4314 {
4315 char* result;
4316
4317 _OrthancPluginDicomToJson params;
4318 memset(&params, 0, sizeof(params));
4319 params.result = &result;
4320 params.buffer = buffer;
4321 params.size = size;
4322 params.format = format;
4323 params.flags = flags;
4324 params.maxStringLength = maxStringLength;
4325
4326 if (context->InvokeService(context, _OrthancPluginService_DicomBufferToJson, &params) != OrthancPluginErrorCode_Success)
4327 {
4328 /* Error */
4329 return NULL;
4330 }
4331 else
4332 {
4333 return result;
4334 }
4335 }
4336
4337
4356 ORTHANC_PLUGIN_INLINE char* OrthancPluginDicomInstanceToJson(
4357 OrthancPluginContext* context,
4358 const char* instanceId,
4359 OrthancPluginDicomToJsonFormat format,
4360 OrthancPluginDicomToJsonFlags flags,
4361 uint32_t maxStringLength)
4362 {
4363 char* result;
4364
4365 _OrthancPluginDicomToJson params;
4366 memset(&params, 0, sizeof(params));
4367 params.result = &result;
4368 params.instanceId = instanceId;
4369 params.format = format;
4370 params.flags = flags;
4371 params.maxStringLength = maxStringLength;
4372
4373 if (context->InvokeService(context, _OrthancPluginService_DicomInstanceToJson, &params) != OrthancPluginErrorCode_Success)
4374 {
4375 /* Error */
4376 return NULL;
4377 }
4378 else
4379 {
4380 return result;
4381 }
4382 }
4383
4384
4385 typedef struct
4386 {
4387 OrthancPluginMemoryBuffer* target;
4388 const char* uri;
4389 uint32_t headersCount;
4390 const char* const* headersKeys;
4391 const char* const* headersValues;
4392 int32_t afterPlugins;
4393 } _OrthancPluginRestApiGet2;
4394
4414 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRestApiGet2(
4415 OrthancPluginContext* context,
4416 OrthancPluginMemoryBuffer* target,
4417 const char* uri,
4418 uint32_t headersCount,
4419 const char* const* headersKeys,
4420 const char* const* headersValues,
4421 int32_t afterPlugins)
4422 {
4423 _OrthancPluginRestApiGet2 params;
4424 params.target = target;
4425 params.uri = uri;
4426 params.headersCount = headersCount;
4427 params.headersKeys = headersKeys;
4428 params.headersValues = headersValues;
4429 params.afterPlugins = afterPlugins;
4430
4431 return context->InvokeService(context, _OrthancPluginService_RestApiGet2, &params);
4432 }
4433
4434
4435
4436 typedef struct
4437 {
4438 OrthancPluginWorklistCallback callback;
4439 } _OrthancPluginWorklistCallback;
4440
4452 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRegisterWorklistCallback(
4453 OrthancPluginContext* context,
4454 OrthancPluginWorklistCallback callback)
4455 {
4456 _OrthancPluginWorklistCallback params;
4457 params.callback = callback;
4458
4459 return context->InvokeService(context, _OrthancPluginService_RegisterWorklistCallback, &params);
4460 }
4461
4462
4463
4464 typedef struct
4465 {
4466 OrthancPluginWorklistAnswers* answers;
4467 const OrthancPluginWorklistQuery* query;
4468 const void* dicom;
4469 uint32_t size;
4470 } _OrthancPluginWorklistAnswersOperation;
4471
4488 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginWorklistAddAnswer(
4489 OrthancPluginContext* context,
4490 OrthancPluginWorklistAnswers* answers,
4491 const OrthancPluginWorklistQuery* query,
4492 const void* dicom,
4493 uint32_t size)
4494 {
4495 _OrthancPluginWorklistAnswersOperation params;
4496 params.answers = answers;
4497 params.query = query;
4498 params.dicom = dicom;
4499 params.size = size;
4500
4501 return context->InvokeService(context, _OrthancPluginService_WorklistAddAnswer, &params);
4502 }
4503
4504
4518 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginWorklistMarkIncomplete(
4519 OrthancPluginContext* context,
4520 OrthancPluginWorklistAnswers* answers)
4521 {
4522 _OrthancPluginWorklistAnswersOperation params;
4523 params.answers = answers;
4524 params.query = NULL;
4525 params.dicom = NULL;
4526 params.size = 0;
4527
4528 return context->InvokeService(context, _OrthancPluginService_WorklistMarkIncomplete, &params);
4529 }
4530
4531
4532 typedef struct
4533 {
4534 const OrthancPluginWorklistQuery* query;
4535 const void* dicom;
4536 uint32_t size;
4537 int32_t* isMatch;
4538 OrthancPluginMemoryBuffer* target;
4539 } _OrthancPluginWorklistQueryOperation;
4540
4556 ORTHANC_PLUGIN_INLINE int32_t OrthancPluginWorklistIsMatch(
4557 OrthancPluginContext* context,
4558 const OrthancPluginWorklistQuery* query,
4559 const void* dicom,
4560 uint32_t size)
4561 {
4562 int32_t isMatch = 0;
4563
4564 _OrthancPluginWorklistQueryOperation params;
4565 params.query = query;
4566 params.dicom = dicom;
4567 params.size = size;
4568 params.isMatch = &isMatch;
4569 params.target = NULL;
4570
4571 if (context->InvokeService(context, _OrthancPluginService_WorklistIsMatch, &params) == OrthancPluginErrorCode_Success)
4572 {
4573 return isMatch;
4574 }
4575 else
4576 {
4577 /* Error: Assume non-match */
4578 return 0;
4579 }
4580 }
4581
4582
4595 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginWorklistGetDicomQuery(
4596 OrthancPluginContext* context,
4597 OrthancPluginMemoryBuffer* target,
4598 const OrthancPluginWorklistQuery* query)
4599 {
4600 _OrthancPluginWorklistQueryOperation params;
4601 params.query = query;
4602 params.dicom = NULL;
4603 params.size = 0;
4604 params.isMatch = NULL;
4605 params.target = target;
4606
4607 return context->InvokeService(context, _OrthancPluginService_WorklistGetDicomQuery, &params);
4608 }
4609
4610
4621 ORTHANC_PLUGIN_INLINE OrthancPluginInstanceOrigin OrthancPluginGetInstanceOrigin(
4622 OrthancPluginContext* context,
4623 OrthancPluginDicomInstance* instance)
4624 {
4625 OrthancPluginInstanceOrigin origin;
4626
4627 _OrthancPluginAccessDicomInstance params;
4628 memset(&params, 0, sizeof(params));
4629 params.resultOrigin = &origin;
4630 params.instance = instance;
4631
4632 if (context->InvokeService(context, _OrthancPluginService_GetInstanceOrigin, &params) != OrthancPluginErrorCode_Success)
4633 {
4634 /* Error */
4635 return OrthancPluginInstanceOrigin_Unknown;
4636 }
4637 else
4638 {
4639 return origin;
4640 }
4641 }
4642
4643
4644 typedef struct
4645 {
4646 OrthancPluginMemoryBuffer* target;
4647 const char* json;
4648 const OrthancPluginImage* pixelData;
4649 OrthancPluginCreateDicomFlags flags;
4650 } _OrthancPluginCreateDicom;
4651
4670 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginCreateDicom(
4671 OrthancPluginContext* context,
4672 OrthancPluginMemoryBuffer* target,
4673 const char* json,
4674 const OrthancPluginImage* pixelData,
4675 OrthancPluginCreateDicomFlags flags)
4676 {
4677 _OrthancPluginCreateDicom params;
4678 params.target = target;
4679 params.json = json;
4680 params.pixelData = pixelData;
4681 params.flags = flags;
4682
4683 return context->InvokeService(context, _OrthancPluginService_CreateDicom, &params);
4684 }
4685
4686
4687 typedef struct
4688 {
4689 OrthancPluginDecodeImageCallback callback;
4690 } _OrthancPluginDecodeImageCallback;
4691
4703 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRegisterDecodeImageCallback(
4704 OrthancPluginContext* context,
4705 OrthancPluginDecodeImageCallback callback)
4706 {
4707 _OrthancPluginDecodeImageCallback params;
4708 params.callback = callback;
4709
4710 return context->InvokeService(context, _OrthancPluginService_RegisterDecodeImageCallback, &params);
4711 }
4712
4713
4714
4715 typedef struct
4716 {
4717 OrthancPluginImage** target;
4718 OrthancPluginPixelFormat format;
4719 uint32_t width;
4720 uint32_t height;
4721 uint32_t pitch;
4722 void* buffer;
4723 const void* constBuffer;
4724 uint32_t bufferSize;
4725 uint32_t frameIndex;
4726 } _OrthancPluginCreateImage;
4727
4728
4741 ORTHANC_PLUGIN_INLINE OrthancPluginImage* OrthancPluginCreateImage(
4742 OrthancPluginContext* context,
4743 OrthancPluginPixelFormat format,
4744 uint32_t width,
4745 uint32_t height)
4746 {
4747 OrthancPluginImage* target = NULL;
4748
4749 _OrthancPluginCreateImage params;
4750 memset(&params, 0, sizeof(params));
4751 params.target = &target;
4752 params.format = format;
4753 params.width = width;
4754 params.height = height;
4755
4756 if (context->InvokeService(context, _OrthancPluginService_CreateImage, &params) != OrthancPluginErrorCode_Success)
4757 {
4758 return NULL;
4759 }
4760 else
4761 {
4762 return target;
4763 }
4764 }
4765
4766
4784 ORTHANC_PLUGIN_INLINE OrthancPluginImage* OrthancPluginCreateImageAccessor(
4785 OrthancPluginContext* context,
4786 OrthancPluginPixelFormat format,
4787 uint32_t width,
4788 uint32_t height,
4789 uint32_t pitch,
4790 void* buffer)
4791 {
4792 OrthancPluginImage* target = NULL;
4793
4794 _OrthancPluginCreateImage params;
4795 memset(&params, 0, sizeof(params));
4796 params.target = &target;
4797 params.format = format;
4798 params.width = width;
4799 params.height = height;
4800 params.pitch = pitch;
4801 params.buffer = buffer;
4802
4803 if (context->InvokeService(context, _OrthancPluginService_CreateImageAccessor, &params) != OrthancPluginErrorCode_Success)
4804 {
4805 return NULL;
4806 }
4807 else
4808 {
4809 return target;
4810 }
4811 }
4812
4813
4814
4829 ORTHANC_PLUGIN_INLINE OrthancPluginImage* OrthancPluginDecodeDicomImage(
4830 OrthancPluginContext* context,
4831 const void* buffer,
4832 uint32_t bufferSize,
4833 uint32_t frameIndex)
4834 {
4835 OrthancPluginImage* target = NULL;
4836
4837 _OrthancPluginCreateImage params;
4838 memset(&params, 0, sizeof(params));
4839 params.target = &target;
4840 params.constBuffer = buffer;
4841 params.bufferSize = bufferSize;
4842 params.frameIndex = frameIndex;
4843
4844 if (context->InvokeService(context, _OrthancPluginService_DecodeDicomImage, &params) != OrthancPluginErrorCode_Success)
4845 {
4846 return NULL;
4847 }
4848 else
4849 {
4850 return target;
4851 }
4852 }
4853
4854
4855
4856 typedef struct
4857 {
4858 char** result;
4859 const void* buffer;
4860 uint32_t size;
4861 } _OrthancPluginComputeHash;
4862
4875 ORTHANC_PLUGIN_INLINE char* OrthancPluginComputeMd5(
4876 OrthancPluginContext* context,
4877 const void* buffer,
4878 uint32_t size)
4879 {
4880 char* result;
4881
4882 _OrthancPluginComputeHash params;
4883 params.result = &result;
4884 params.buffer = buffer;
4885 params.size = size;
4886
4887 if (context->InvokeService(context, _OrthancPluginService_ComputeMd5, &params) != OrthancPluginErrorCode_Success)
4888 {
4889 /* Error */
4890 return NULL;
4891 }
4892 else
4893 {
4894 return result;
4895 }
4896 }
4897
4898
4911 ORTHANC_PLUGIN_INLINE char* OrthancPluginComputeSha1(
4912 OrthancPluginContext* context,
4913 const void* buffer,
4914 uint32_t size)
4915 {
4916 char* result;
4917
4918 _OrthancPluginComputeHash params;
4919 params.result = &result;
4920 params.buffer = buffer;
4921 params.size = size;
4922
4923 if (context->InvokeService(context, _OrthancPluginService_ComputeSha1, &params) != OrthancPluginErrorCode_Success)
4924 {
4925 /* Error */
4926 return NULL;
4927 }
4928 else
4929 {
4930 return result;
4931 }
4932 }
4933
4934
4935
4936 typedef struct
4937 {
4938 OrthancPluginDictionaryEntry* target;
4939 const char* name;
4940 } _OrthancPluginLookupDictionary;
4941
4957 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginLookupDictionary(
4958 OrthancPluginContext* context,
4959 OrthancPluginDictionaryEntry* target,
4960 const char* name)
4961 {
4962 _OrthancPluginLookupDictionary params;
4963 params.target = target;
4964 params.name = name;
4965 return context->InvokeService(context, _OrthancPluginService_LookupDictionary, &params);
4966 }
4967
4968
4969
4970 typedef struct
4971 {
4972 OrthancPluginRestOutput* output;
4973 const char* answer;
4974 uint32_t answerSize;
4975 uint32_t headersCount;
4976 const char* const* headersKeys;
4977 const char* const* headersValues;
4978 } _OrthancPluginSendMultipartItem2;
4979
5000 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginSendMultipartItem2(
5001 OrthancPluginContext* context,
5002 OrthancPluginRestOutput* output,
5003 const char* answer,
5004 uint32_t answerSize,
5005 uint32_t headersCount,
5006 const char* const* headersKeys,
5007 const char* const* headersValues)
5008 {
5009 _OrthancPluginSendMultipartItem2 params;
5010 params.output = output;
5011 params.answer = answer;
5012 params.answerSize = answerSize;
5013 params.headersCount = headersCount;
5014 params.headersKeys = headersKeys;
5015 params.headersValues = headersValues;
5016
5017 return context->InvokeService(context, _OrthancPluginService_SendMultipartItem2, &params);
5018 }
5019
5020
5021 typedef struct
5022 {
5023 OrthancPluginIncomingHttpRequestFilter callback;
5024 } _OrthancPluginIncomingHttpRequestFilter;
5025
5038 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRegisterIncomingHttpRequestFilter(
5039 OrthancPluginContext* context,
5040 OrthancPluginIncomingHttpRequestFilter callback)
5041 {
5042 _OrthancPluginIncomingHttpRequestFilter params;
5043 params.callback = callback;
5044
5045 return context->InvokeService(context, _OrthancPluginService_RegisterIncomingHttpRequestFilter, &params);
5046 }
5047
5048
5049
5050 typedef struct
5051 {
5052 OrthancPluginMemoryBuffer* answerBody;
5053 OrthancPluginMemoryBuffer* answerHeaders;
5054 uint16_t* httpStatus;
5055 OrthancPluginHttpMethod method;
5056 const char* url;
5057 uint32_t headersCount;
5058 const char* const* headersKeys;
5059 const char* const* headersValues;
5060 const char* body;
5061 uint32_t bodySize;
5062 const char* username;
5063 const char* password;
5064 uint32_t timeout;
5065 const char* certificateFile;
5066 const char* certificateKeyFile;
5067 const char* certificateKeyPassword;
5068 uint8_t pkcs11;
5069 } _OrthancPluginCallHttpClient2;
5070
5071
5072
5110 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginHttpClient(
5111 OrthancPluginContext* context,
5112 OrthancPluginMemoryBuffer* answerBody,
5113 OrthancPluginMemoryBuffer* answerHeaders,
5114 uint16_t* httpStatus,
5115 OrthancPluginHttpMethod method,
5116 const char* url,
5117 uint32_t headersCount,
5118 const char* const* headersKeys,
5119 const char* const* headersValues,
5120 const char* body,
5121 uint32_t bodySize,
5122 const char* username,
5123 const char* password,
5124 uint32_t timeout,
5125 const char* certificateFile,
5126 const char* certificateKeyFile,
5127 const char* certificateKeyPassword,
5128 uint8_t pkcs11)
5129 {
5130 _OrthancPluginCallHttpClient2 params;
5131 memset(&params, 0, sizeof(params));
5132
5133 params.answerBody = answerBody;
5134 params.answerHeaders = answerHeaders;
5135 params.httpStatus = httpStatus;
5136 params.method = method;
5137 params.url = url;
5138 params.headersCount = headersCount;
5139 params.headersKeys = headersKeys;
5140 params.headersValues = headersValues;
5141 params.body = body;
5142 params.bodySize = bodySize;
5143 params.username = username;
5144 params.password = password;
5145 params.timeout = timeout;
5146 params.certificateFile = certificateFile;
5147 params.certificateKeyFile = certificateKeyFile;
5148 params.certificateKeyPassword = certificateKeyPassword;
5149 params.pkcs11 = pkcs11;
5150
5151 return context->InvokeService(context, _OrthancPluginService_CallHttpClient2, &params);
5152 }
5153
5154
5165 ORTHANC_PLUGIN_INLINE char* OrthancPluginGenerateUuid(
5166 OrthancPluginContext* context)
5167 {
5168 char* result;
5169
5170 _OrthancPluginRetrieveDynamicString params;
5171 params.result = &result;
5172 params.argument = NULL;
5173
5174 if (context->InvokeService(context, _OrthancPluginService_GenerateUuid, &params) != OrthancPluginErrorCode_Success)
5175 {
5176 /* Error */
5177 return NULL;
5178 }
5179 else
5180 {
5181 return result;
5182 }
5183 }
5184
5185
5186
5187
5188 typedef struct
5189 {
5190 OrthancPluginFindCallback callback;
5191 } _OrthancPluginFindCallback;
5192
5204 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRegisterFindCallback(
5205 OrthancPluginContext* context,
5206 OrthancPluginFindCallback callback)
5207 {
5208 _OrthancPluginFindCallback params;
5209 params.callback = callback;
5210
5211 return context->InvokeService(context, _OrthancPluginService_RegisterFindCallback, &params);
5212 }
5213
5214
5215 typedef struct
5216 {
5217 OrthancPluginFindAnswers *answers;
5218 const OrthancPluginFindQuery *query;
5219 const void *dicom;
5220 uint32_t size;
5221 uint32_t index;
5222 uint32_t *resultUint32;
5223 uint16_t *resultGroup;
5224 uint16_t *resultElement;
5225 char **resultString;
5226 } _OrthancPluginFindOperation;
5227
5243 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginFindAddAnswer(
5244 OrthancPluginContext* context,
5245 OrthancPluginFindAnswers* answers,
5246 const void* dicom,
5247 uint32_t size)
5248 {
5249 _OrthancPluginFindOperation params;
5250 memset(&params, 0, sizeof(params));
5251 params.answers = answers;
5252 params.dicom = dicom;
5253 params.size = size;
5254
5255 return context->InvokeService(context, _OrthancPluginService_FindAddAnswer, &params);
5256 }
5257
5258
5272 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginFindMarkIncomplete(
5273 OrthancPluginContext* context,
5274 OrthancPluginFindAnswers* answers)
5275 {
5276 _OrthancPluginFindOperation params;
5277 memset(&params, 0, sizeof(params));
5278 params.answers = answers;
5279
5280 return context->InvokeService(context, _OrthancPluginService_FindMarkIncomplete, &params);
5281 }
5282
5283
5284
5296 ORTHANC_PLUGIN_INLINE uint32_t OrthancPluginGetFindQuerySize(
5297 OrthancPluginContext* context,
5298 const OrthancPluginFindQuery* query)
5299 {
5300 uint32_t count = 0;
5301
5302 _OrthancPluginFindOperation params;
5303 memset(&params, 0, sizeof(params));
5304 params.query = query;
5305 params.resultUint32 = &count;
5306
5307 if (context->InvokeService(context, _OrthancPluginService_GetFindQuerySize, &params) != OrthancPluginErrorCode_Success)
5308 {
5309 /* Error */
5310 return 0;
5311 }
5312 else
5313 {
5314 return count;
5315 }
5316 }
5317
5318
5333 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginGetFindQueryTag(
5334 OrthancPluginContext* context,
5335 uint16_t* group,
5336 uint16_t* element,
5337 const OrthancPluginFindQuery* query,
5338 uint32_t index)
5339 {
5340 _OrthancPluginFindOperation params;
5341 memset(&params, 0, sizeof(params));
5342 params.query = query;
5343 params.index = index;
5344 params.resultGroup = group;
5345 params.resultElement = element;
5346
5347 return context->InvokeService(context, _OrthancPluginService_GetFindQueryTag, &params);
5348 }
5349
5350
5364 ORTHANC_PLUGIN_INLINE char* OrthancPluginGetFindQueryTagName(
5365 OrthancPluginContext* context,
5366 const OrthancPluginFindQuery* query,
5367 uint32_t index)
5368 {
5369 char* result;
5370
5371 _OrthancPluginFindOperation params;
5372 memset(&params, 0, sizeof(params));
5373 params.query = query;
5374 params.index = index;
5375 params.resultString = &result;
5376
5377 if (context->InvokeService(context, _OrthancPluginService_GetFindQueryTagName, &params) != OrthancPluginErrorCode_Success)
5378 {
5379 /* Error */
5380 return NULL;
5381 }
5382 else
5383 {
5384 return result;
5385 }
5386 }
5387
5388
5402 ORTHANC_PLUGIN_INLINE char* OrthancPluginGetFindQueryValue(
5403 OrthancPluginContext* context,
5404 const OrthancPluginFindQuery* query,
5405 uint32_t index)
5406 {
5407 char* result;
5408
5409 _OrthancPluginFindOperation params;
5410 memset(&params, 0, sizeof(params));
5411 params.query = query;
5412 params.index = index;
5413 params.resultString = &result;
5414
5415 if (context->InvokeService(context, _OrthancPluginService_GetFindQueryValue, &params) != OrthancPluginErrorCode_Success)
5416 {
5417 /* Error */
5418 return NULL;
5419 }
5420 else
5421 {
5422 return result;
5423 }
5424 }
5425
5426
5427
5428
5429 typedef struct
5430 {
5431 OrthancPluginMoveCallback callback;
5432 OrthancPluginGetMoveSize getMoveSize;
5433 OrthancPluginApplyMove applyMove;
5434 OrthancPluginFreeMove freeMove;
5435 } _OrthancPluginMoveCallback;
5436
5450 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRegisterMoveCallback(
5451 OrthancPluginContext* context,
5452 OrthancPluginMoveCallback callback,
5453 OrthancPluginGetMoveSize getMoveSize,
5454 OrthancPluginApplyMove applyMove,
5455 OrthancPluginFreeMove freeMove)
5456 {
5457 _OrthancPluginMoveCallback params;
5458 params.callback = callback;
5459 params.getMoveSize = getMoveSize;
5460 params.applyMove = applyMove;
5461 params.freeMove = freeMove;
5462
5463 return context->InvokeService(context, _OrthancPluginService_RegisterMoveCallback, &params);
5464 }
5465
5466
5467
5468 typedef struct
5469 {
5470 OrthancPluginFindMatcher** target;
5471 const void* query;
5472 uint32_t size;
5473 } _OrthancPluginCreateFindMatcher;
5474
5475
5489 ORTHANC_PLUGIN_INLINE OrthancPluginFindMatcher* OrthancPluginCreateFindMatcher(
5490 OrthancPluginContext* context,
5491 const void* query,
5492 uint32_t size)
5493 {
5494 OrthancPluginFindMatcher* target = NULL;
5495
5496 _OrthancPluginCreateFindMatcher params;
5497 memset(&params, 0, sizeof(params));
5498 params.target = &target;
5499 params.query = query;
5500 params.size = size;
5501
5502 if (context->InvokeService(context, _OrthancPluginService_CreateFindMatcher, &params) != OrthancPluginErrorCode_Success)
5503 {
5504 return NULL;
5505 }
5506 else
5507 {
5508 return target;
5509 }
5510 }
5511
5512
5513 typedef struct
5514 {
5515 OrthancPluginFindMatcher* matcher;
5516 } _OrthancPluginFreeFindMatcher;
5517
5527 ORTHANC_PLUGIN_INLINE void OrthancPluginFreeFindMatcher(
5528 OrthancPluginContext* context,
5529 OrthancPluginFindMatcher* matcher)
5530 {
5531 _OrthancPluginFreeFindMatcher params;
5532 params.matcher = matcher;
5533
5534 context->InvokeService(context, _OrthancPluginService_FreeFindMatcher, &params);
5535 }
5536
5537
5538 typedef struct
5539 {
5540 const OrthancPluginFindMatcher* matcher;
5541 const void* dicom;
5542 uint32_t size;
5543 int32_t* isMatch;
5544 } _OrthancPluginFindMatcherIsMatch;
5545
5560 ORTHANC_PLUGIN_INLINE int32_t OrthancPluginFindMatcherIsMatch(
5561 OrthancPluginContext* context,
5562 const OrthancPluginFindMatcher* matcher,
5563 const void* dicom,
5564 uint32_t size)
5565 {
5566 int32_t isMatch = 0;
5567
5568 _OrthancPluginFindMatcherIsMatch params;
5569 params.matcher = matcher;
5570 params.dicom = dicom;
5571 params.size = size;
5572 params.isMatch = &isMatch;
5573
5574 if (context->InvokeService(context, _OrthancPluginService_FindMatcherIsMatch, &params) == OrthancPluginErrorCode_Success)
5575 {
5576 return isMatch;
5577 }
5578 else
5579 {
5580 /* Error: Assume non-match */
5581 return 0;
5582 }
5583 }
5584
5585
5586 typedef struct
5587 {
5588 OrthancPluginIncomingHttpRequestFilter2 callback;
5589 } _OrthancPluginIncomingHttpRequestFilter2;
5590
5602 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRegisterIncomingHttpRequestFilter2(
5603 OrthancPluginContext* context,
5604 OrthancPluginIncomingHttpRequestFilter2 callback)
5605 {
5606 _OrthancPluginIncomingHttpRequestFilter2 params;
5607 params.callback = callback;
5608
5609 return context->InvokeService(context, _OrthancPluginService_RegisterIncomingHttpRequestFilter2, &params);
5610 }
5611
5612 #ifdef __cplusplus
5613 }
5614 #endif
5615
5616
OrthancPluginOnStoredInstanceCallback
OrthancPluginErrorCode(* OrthancPluginOnStoredInstanceCallback)(OrthancPluginDicomInstance *instance, const char *instanceId)
Signature of a callback function that is triggered when Orthanc receives a DICOM instance.
Definition: OrthancCPlugin.h:888
OrthancPluginGetInstanceMetadata
const char * OrthancPluginGetInstanceMetadata(OrthancPluginContext *context, OrthancPluginDicomInstance *instance, const char *metadata)
Get the value of some metadata associated with a given DICOM instance.
Definition: OrthancCPlugin.h:2450
OrthancPluginGetInstanceOrigin
OrthancPluginInstanceOrigin OrthancPluginGetInstanceOrigin(OrthancPluginContext *context, OrthancPluginDicomInstance *instance)
Get the origin of a DICOM file.
Definition: OrthancCPlugin.h:4621
OrthancPluginRegisterStorageArea
void OrthancPluginRegisterStorageArea(OrthancPluginContext *context, OrthancPluginStorageCreate create, OrthancPluginStorageRead read, OrthancPluginStorageRemove remove)
Register a custom storage area.
Definition: OrthancCPlugin.h:2498
OrthancPluginRegisterOnStoredInstanceCallback
void OrthancPluginRegisterOnStoredInstanceCallback(OrthancPluginContext *context, OrthancPluginOnStoredInstanceCallback callback)
Register a callback for received instances.
Definition: OrthancCPlugin.h:1467
OrthancPluginRegisterDecodeImageCallback
OrthancPluginErrorCode OrthancPluginRegisterDecodeImageCallback(OrthancPluginContext *context, OrthancPluginDecodeImageCallback callback)
Register a callback to handle the decoding of DICOM images.
Definition: OrthancCPlugin.h:4703
OrthancPluginChangeType
OrthancPluginChangeType
Definition: OrthancCPlugin.h:613
OrthancPluginCheckVersion
int OrthancPluginCheckVersion(OrthancPluginContext *context)
Check the compatibility of the plugin wrt. the version of its hosting Orthanc.
Definition: OrthancCPlugin.h:1237
OrthancPluginDecodeImageCallback
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:909
OrthancPluginStorageAreaRemove
OrthancPluginErrorCode OrthancPluginStorageAreaRemove(OrthancPluginContext *context, OrthancPluginStorageArea *storageArea, const char *uuid, OrthancPluginContentType type)
Remove a file from the storage area.
Definition: OrthancCPlugin.h:4069
OrthancPluginRegisterIncomingHttpRequestFilter2
OrthancPluginErrorCode OrthancPluginRegisterIncomingHttpRequestFilter2(OrthancPluginContext *context, OrthancPluginIncomingHttpRequestFilter2 callback)
Register a callback to filter incoming HTTP requests.
Definition: OrthancCPlugin.h:5602
OrthancPluginStorageRead
OrthancPluginErrorCode(* OrthancPluginStorageRead)(void **content, int64_t *size, const char *uuid, OrthancPluginContentType type)
Callback for reading from the storage area.
Definition: OrthancCPlugin.h:956
OrthancPluginRegisterRestCallback
void OrthancPluginRegisterRestCallback(OrthancPluginContext *context, const char *pathRegularExpression, OrthancPluginRestCallback callback)
Register a REST callback.
Definition: OrthancCPlugin.h:1405
OrthancPluginGetExpectedDatabaseVersion
uint32_t OrthancPluginGetExpectedDatabaseVersion(OrthancPluginContext *context)
Get the expected version of the database schema.
Definition: OrthancCPlugin.h:2883
OrthancPluginRegisterOnChangeCallback
void OrthancPluginRegisterOnChangeCallback(OrthancPluginContext *context, OrthancPluginOnChangeCallback callback)
Register a callback to monitor changes.
Definition: OrthancCPlugin.h:2637
OrthancPluginGetInstanceSimplifiedJson
char * OrthancPluginGetInstanceSimplifiedJson(OrthancPluginContext *context, OrthancPluginDicomInstance *instance)
Get the DICOM tag hierarchy as a JSON file (with simplification).
Definition: OrthancCPlugin.h:2373
OrthancPluginRestCallback
OrthancPluginErrorCode(* OrthancPluginRestCallback)(OrthancPluginRestOutput *output, const char *url, const OrthancPluginHttpRequest *request)
Signature of a callback function that answers to a REST request.
Definition: OrthancCPlugin.h:877
OrthancPluginGetInstanceJson
char * OrthancPluginGetInstanceJson(OrthancPluginContext *context, OrthancPluginDicomInstance *instance)
Get the DICOM tag hierarchy as a JSON file.
Definition: OrthancCPlugin.h:2335
OrthancPluginGetInstanceRemoteAet
const char * OrthancPluginGetInstanceRemoteAet(OrthancPluginContext *context, OrthancPluginDicomInstance *instance)
Get the AET of a DICOM instance.
Definition: OrthancCPlugin.h:2233
OrthancPluginReconstructMainDicomTags
OrthancPluginErrorCode OrthancPluginReconstructMainDicomTags(OrthancPluginContext *context, OrthancPluginStorageArea *storageArea, OrthancPluginResourceType level)
Reconstruct the main DICOM tags.
Definition: OrthancCPlugin.h:4263
OrthancPluginStorageRemove
OrthancPluginErrorCode(* OrthancPluginStorageRemove)(const char *uuid, OrthancPluginContentType type)
Callback for removing a file from the storage area.
Definition: OrthancCPlugin.h:974
OrthancPluginStorageCreate
OrthancPluginErrorCode(* OrthancPluginStorageCreate)(const char *uuid, const void *content, int64_t size, OrthancPluginContentType type)
Callback for writing to the storage area.
Definition: OrthancCPlugin.h:936
OrthancPluginOnChangeCallback
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:898
OrthancPluginGetInstanceSize
int64_t OrthancPluginGetInstanceSize(OrthancPluginContext *context, OrthancPluginDicomInstance *instance)
Get the size of a DICOM file.
Definition: OrthancCPlugin.h:2266
OrthancPluginGetInstanceData
const char * OrthancPluginGetInstanceData(OrthancPluginContext *context, OrthancPluginDicomInstance *instance)
Get the data of a DICOM file.
Definition: OrthancCPlugin.h:2299
OrthancPluginHasInstanceMetadata
int OrthancPluginHasInstanceMetadata(OrthancPluginContext *context, OrthancPluginDicomInstance *instance, const char *metadata)
Check whether a DICOM instance is associated with some metadata.
Definition: OrthancCPlugin.h:2412
OrthancPluginRegisterRestCallbackNoLock
void OrthancPluginRegisterRestCallbackNoLock(OrthancPluginContext *context, const char *pathRegularExpression, OrthancPluginRestCallback callback)
Register a REST callback, without locking.
Definition: OrthancCPlugin.h:1439
OrthancPluginStorageAreaRead
OrthancPluginErrorCode OrthancPluginStorageAreaRead(OrthancPluginContext *context, OrthancPluginMemoryBuffer *target, OrthancPluginStorageArea *storageArea, const char *uuid, OrthancPluginContentType type)
Read a file from the storage area.
Definition: OrthancCPlugin.h:4032
OrthancPluginRegisterIncomingHttpRequestFilter
OrthancPluginErrorCode OrthancPluginRegisterIncomingHttpRequestFilter(OrthancPluginContext *context, OrthancPluginIncomingHttpRequestFilter callback)
Register a callback to filter incoming HTTP requests.
Definition: OrthancCPlugin.h:5038
OrthancPluginStorageAreaCreate
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:3990
OrthancPluginChangeType_OrthancStopped
@ OrthancPluginChangeType_OrthancStopped
Definition: OrthancCPlugin.h:625
OrthancPluginChangeType_OrthancStarted
@ OrthancPluginChangeType_OrthancStarted
Definition: OrthancCPlugin.h:624
OrthancPluginChangeType_Deleted
@ OrthancPluginChangeType_Deleted
Definition: OrthancCPlugin.h:615
OrthancPluginChangeType_NewInstance
@ OrthancPluginChangeType_NewInstance
Definition: OrthancCPlugin.h:617
OrthancPluginChangeType_NewPatient
@ OrthancPluginChangeType_NewPatient
Definition: OrthancCPlugin.h:618
OrthancPluginChangeType_NewSeries
@ OrthancPluginChangeType_NewSeries
Definition: OrthancCPlugin.h:619
OrthancPluginChangeType_StablePatient
@ OrthancPluginChangeType_StablePatient
Definition: OrthancCPlugin.h:621
OrthancPluginChangeType_StableStudy
@ OrthancPluginChangeType_StableStudy
Definition: OrthancCPlugin.h:623
OrthancPluginChangeType_CompletedSeries
@ OrthancPluginChangeType_CompletedSeries
Definition: OrthancCPlugin.h:614
OrthancPluginChangeType_NewChildInstance
@ OrthancPluginChangeType_NewChildInstance
Definition: OrthancCPlugin.h:616
OrthancPluginChangeType_UpdatedAttachment
@ OrthancPluginChangeType_UpdatedAttachment
Definition: OrthancCPlugin.h:626
OrthancPluginChangeType_UpdatedMetadata
@ OrthancPluginChangeType_UpdatedMetadata
Definition: OrthancCPlugin.h:627
OrthancPluginChangeType_StableSeries
@ OrthancPluginChangeType_StableSeries
Definition: OrthancCPlugin.h:622
OrthancPluginChangeType_NewStudy
@ OrthancPluginChangeType_NewStudy
Definition: OrthancCPlugin.h:620
OrthancPluginPixelFormat
OrthancPluginPixelFormat
Definition: OrthancCPlugin.h:530
OrthancPluginDrawText
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:3938
OrthancPluginCompressJpegImage
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:3526
OrthancPluginGetImagePitch
uint32_t OrthancPluginGetImagePitch(OrthancPluginContext *context, const OrthancPluginImage *image)
Return the pitch of an image.
Definition: OrthancCPlugin.h:3317
OrthancPluginConvertPixelFormat
OrthancPluginImage * OrthancPluginConvertPixelFormat(OrthancPluginContext *context, const OrthancPluginImage *source, OrthancPluginPixelFormat targetFormat)
Change the pixel format of an image.
Definition: OrthancCPlugin.h:3778
OrthancPluginGetImagePixelFormat
OrthancPluginPixelFormat OrthancPluginGetImagePixelFormat(OrthancPluginContext *context, const OrthancPluginImage *image)
Return the pixel format of an image.
Definition: OrthancCPlugin.h:3216
OrthancPluginGetFontsCount
uint32_t OrthancPluginGetFontsCount(OrthancPluginContext *context)
Return the number of available fonts.
Definition: OrthancCPlugin.h:3813
OrthancPluginGetImageHeight
uint32_t OrthancPluginGetImageHeight(OrthancPluginContext *context, const OrthancPluginImage *image)
Return the height of an image.
Definition: OrthancCPlugin.h:3282
OrthancPluginFreeImage
void OrthancPluginFreeImage(OrthancPluginContext *context, OrthancPluginImage *image)
Free an image.
Definition: OrthancCPlugin.h:3436
OrthancPluginCompressPngImage
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:3481
OrthancPluginCreateImage
OrthancPluginImage * OrthancPluginCreateImage(OrthancPluginContext *context, OrthancPluginPixelFormat format, uint32_t width, uint32_t height)
Create an image.
Definition: OrthancCPlugin.h:4741
OrthancPluginUncompressImage
OrthancPluginImage * OrthancPluginUncompressImage(OrthancPluginContext *context, const void *data, uint32_t size, OrthancPluginImageFormat format)
Decode a compressed image.
Definition: OrthancCPlugin.h:3394
OrthancPluginGetFontName
const char * OrthancPluginGetFontName(OrthancPluginContext *context, uint32_t fontIndex)
Return the name of a font.
Definition: OrthancCPlugin.h:3853
OrthancPluginGetImageBuffer
void * OrthancPluginGetImageBuffer(OrthancPluginContext *context, const OrthancPluginImage *image)
Return a pointer to the content of an image.
Definition: OrthancCPlugin.h:3351
OrthancPluginCreateImageAccessor
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:4784
OrthancPluginImageFormat
OrthancPluginImageFormat
Definition: OrthancCPlugin.h:653
OrthancPluginStorageArea
struct _OrthancPluginStorageArea_t OrthancPluginStorageArea
Opaque structure that represents the storage area that is actually used by Orthanc.
Definition: OrthancCPlugin.h:829
OrthancPluginCompressionType
OrthancPluginCompressionType
Definition: OrthancCPlugin.h:638
OrthancPluginGetImageWidth
uint32_t OrthancPluginGetImageWidth(OrthancPluginContext *context, const OrthancPluginImage *image)
Return the width of an image.
Definition: OrthancCPlugin.h:3249
OrthancPluginBufferCompression
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:3028
OrthancPluginDecodeDicomImage
OrthancPluginImage * OrthancPluginDecodeDicomImage(OrthancPluginContext *context, const void *buffer, uint32_t bufferSize, uint32_t frameIndex)
Decode one frame from a DICOM instance.
Definition: OrthancCPlugin.h:4829
OrthancPluginGetFontSize
uint32_t OrthancPluginGetFontSize(OrthancPluginContext *context, uint32_t fontIndex)
Return the size of a font.
Definition: OrthancCPlugin.h:3885
OrthancPluginImage
struct _OrthancPluginImage_t OrthancPluginImage
Opaque structure that represents an image that is uncompressed in memory.
Definition: OrthancCPlugin.h:821
OrthancPluginPixelFormat_RGBA32
@ OrthancPluginPixelFormat_RGBA32
Color image in RGBA32 format.
Definition: OrthancCPlugin.h:569
OrthancPluginPixelFormat_Grayscale8
@ OrthancPluginPixelFormat_Grayscale8
Graylevel 8bpp image.
Definition: OrthancCPlugin.h:537
OrthancPluginPixelFormat_SignedGrayscale16
@ OrthancPluginPixelFormat_SignedGrayscale16
Graylevel, signed 16bpp image.
Definition: OrthancCPlugin.h:553
OrthancPluginPixelFormat_RGB24
@ OrthancPluginPixelFormat_RGB24
Color image in RGB24 format.
Definition: OrthancCPlugin.h:561
OrthancPluginPixelFormat_Unknown
@ OrthancPluginPixelFormat_Unknown
Definition: OrthancCPlugin.h:571
OrthancPluginPixelFormat_Grayscale16
@ OrthancPluginPixelFormat_Grayscale16
Graylevel, unsigned 16bpp image.
Definition: OrthancCPlugin.h:545
OrthancPluginImageFormat_Png
@ OrthancPluginImageFormat_Png
Definition: OrthancCPlugin.h:654
OrthancPluginImageFormat_Jpeg
@ OrthancPluginImageFormat_Jpeg
Definition: OrthancCPlugin.h:655
OrthancPluginImageFormat_Dicom
@ OrthancPluginImageFormat_Dicom
Definition: OrthancCPlugin.h:656
OrthancPluginCompressionType_Gzip
@ OrthancPluginCompressionType_Gzip
Definition: OrthancCPlugin.h:641
OrthancPluginCompressionType_ZlibWithSize
@ OrthancPluginCompressionType_ZlibWithSize
Definition: OrthancCPlugin.h:640
OrthancPluginCompressionType_Zlib
@ OrthancPluginCompressionType_Zlib
Definition: OrthancCPlugin.h:639
OrthancPluginCompressionType_GzipWithSize
@ OrthancPluginCompressionType_GzipWithSize
Definition: OrthancCPlugin.h:642
OrthancPluginLookupStudy
char * OrthancPluginLookupStudy(OrthancPluginContext *context, const char *studyUID)
Look for a study.
Definition: OrthancCPlugin.h:1946
OrthancPluginSetGlobalProperty
OrthancPluginErrorCode OrthancPluginSetGlobalProperty(OrthancPluginContext *context, int32_t property, const char *value)
Set the value of a global property.
Definition: OrthancCPlugin.h:2785
OrthancPluginGetGlobalProperty
char * OrthancPluginGetGlobalProperty(OrthancPluginContext *context, int32_t property, const char *defaultValue)
Get the value of a global property.
Definition: OrthancCPlugin.h:2746
OrthancPluginRestApiPostAfterPlugins
OrthancPluginErrorCode OrthancPluginRestApiPostAfterPlugins(OrthancPluginContext *context, OrthancPluginMemoryBuffer *target, const char *uri, const char *body, uint32_t bodySize)
Make a POST call to the REST API, as tainted by the plugins.
Definition: OrthancCPlugin.h:1732
OrthancPluginLookupSeries
char * OrthancPluginLookupSeries(OrthancPluginContext *context, const char *seriesUID)
Look for a series.
Definition: OrthancCPlugin.h:2016
OrthancPluginRestApiPutAfterPlugins
OrthancPluginErrorCode OrthancPluginRestApiPutAfterPlugins(OrthancPluginContext *context, OrthancPluginMemoryBuffer *target, const char *uri, const char *body, uint32_t bodySize)
Make a PUT call to the REST API, as tainted by the plugins.
Definition: OrthancCPlugin.h:1845
OrthancPluginLookupStudyWithAccessionNumber
char * OrthancPluginLookupStudyWithAccessionNumber(OrthancPluginContext *context, const char *accessionNumber)
Look for a study, using the accession number.
Definition: OrthancCPlugin.h:1981
OrthancPluginRestApiGet
OrthancPluginErrorCode OrthancPluginRestApiGet(OrthancPluginContext *context, OrthancPluginMemoryBuffer *target, const char *uri)
Make a GET call to the built-in Orthanc REST API.
Definition: OrthancCPlugin.h:1630
OrthancPluginLookupInstance
char * OrthancPluginLookupInstance(OrthancPluginContext *context, const char *sopInstanceUID)
Look for an instance.
Definition: OrthancCPlugin.h:2051
OrthancPluginRestApiPost
OrthancPluginErrorCode OrthancPluginRestApiPost(OrthancPluginContext *context, OrthancPluginMemoryBuffer *target, const char *uri, const char *body, uint32_t bodySize)
Make a POST call to the built-in Orthanc REST API.
Definition: OrthancCPlugin.h:1697
OrthancPluginRestApiGetAfterPlugins
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:1660
OrthancPluginRestApiPut
OrthancPluginErrorCode OrthancPluginRestApiPut(OrthancPluginContext *context, OrthancPluginMemoryBuffer *target, const char *uri, const char *body, uint32_t bodySize)
Make a PUT call to the built-in Orthanc REST API.
Definition: OrthancCPlugin.h:1809
OrthancPluginLookupPatient
char * OrthancPluginLookupPatient(OrthancPluginContext *context, const char *patientID)
Look for a patient.
Definition: OrthancCPlugin.h:1911
OrthancPluginRestApiDelete
OrthancPluginErrorCode OrthancPluginRestApiDelete(OrthancPluginContext *context, const char *uri)
Make a DELETE call to the built-in Orthanc REST API.
Definition: OrthancCPlugin.h:1761
OrthancPluginRestApiDeleteAfterPlugins
OrthancPluginErrorCode OrthancPluginRestApiDeleteAfterPlugins(OrthancPluginContext *context, const char *uri)
Make a DELETE call to the REST API, as tainted by the plugins.
Definition: OrthancCPlugin.h:1784
OrthancPluginRestApiGet2
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:4414
OrthancPluginGetDicomForInstance
OrthancPluginErrorCode OrthancPluginGetDicomForInstance(OrthancPluginContext *context, OrthancPluginMemoryBuffer *target, const char *instanceId)
Retrieve a DICOM instance using its Orthanc identifier.
Definition: OrthancCPlugin.h:1597
OrthancPluginCompressAndAnswerPngImage
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:1556
OrthancPluginSendUnauthorized
void OrthancPluginSendUnauthorized(OrthancPluginContext *context, OrthancPluginRestOutput *output, const char *realm)
Signal that a REST request is not authorized.
Definition: OrthancCPlugin.h:2119
OrthancPluginSendMethodNotAllowed
void OrthancPluginSendMethodNotAllowed(OrthancPluginContext *context, OrthancPluginRestOutput *output, const char *allowedMethods)
Signal that this URI does not support this HTTP method.
Definition: OrthancCPlugin.h:2142
OrthancPluginAnswerBuffer
void OrthancPluginAnswerBuffer(OrthancPluginContext *context, OrthancPluginRestOutput *output, const char *answer, uint32_t answerSize, const char *mimeType)
Answer to a REST request.
Definition: OrthancCPlugin.h:1499
OrthancPluginSendHttpStatusCode
void OrthancPluginSendHttpStatusCode(OrthancPluginContext *context, OrthancPluginRestOutput *output, uint16_t status)
Send a HTTP status code.
Definition: OrthancCPlugin.h:2096
OrthancPluginSetHttpHeader
void OrthancPluginSetHttpHeader(OrthancPluginContext *context, OrthancPluginRestOutput *output, const char *key, const char *value)
Set some HTTP header.
Definition: OrthancCPlugin.h:2197
OrthancPluginSetCookie
void OrthancPluginSetCookie(OrthancPluginContext *context, OrthancPluginRestOutput *output, const char *cookie, const char *value)
Set a cookie.
Definition: OrthancCPlugin.h:2172
OrthancPluginRedirect
void OrthancPluginRedirect(OrthancPluginContext *context, OrthancPluginRestOutput *output, const char *redirection)
Redirect a REST request.
Definition: OrthancCPlugin.h:1879
OrthancPluginCompressAndAnswerJpegImage
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:3573
OrthancPluginSendMultipartItem
OrthancPluginErrorCode OrthancPluginSendMultipartItem(OrthancPluginContext *context, OrthancPluginRestOutput *output, const char *answer, uint32_t answerSize)
Send an item as a part of some HTTP multipart answer.
Definition: OrthancCPlugin.h:2986
OrthancPluginStartMultipartAnswer
OrthancPluginErrorCode OrthancPluginStartMultipartAnswer(OrthancPluginContext *context, OrthancPluginRestOutput *output, const char *subType, const char *contentType)
Start an HTTP multipart answer.
Definition: OrthancCPlugin.h:2957
OrthancPluginSendHttpStatus
void OrthancPluginSendHttpStatus(OrthancPluginContext *context, OrthancPluginRestOutput *output, uint16_t status, const char *body, uint32_t bodySize)
Send a HTTP status, with a custom body.
Definition: OrthancCPlugin.h:3180
OrthancPluginSendMultipartItem2
OrthancPluginErrorCode OrthancPluginSendMultipartItem2(OrthancPluginContext *context, OrthancPluginRestOutput *output, const char *answer, uint32_t answerSize, uint32_t headersCount, const char *const *headersKeys, const char *const *headersValues)
Send an item as a part of some HTTP multipart answer, with custom headers.
Definition: OrthancCPlugin.h:5000
OrthancPluginGetFindQuerySize
uint32_t OrthancPluginGetFindQuerySize(OrthancPluginContext *context, const OrthancPluginFindQuery *query)
Get the number of tags in a C-Find query.
Definition: OrthancCPlugin.h:5296
OrthancPluginFindQuery
struct _OrthancPluginFindQuery_t OrthancPluginFindQuery
Opaque structure to an object that represents a C-Find query.
Definition: OrthancCPlugin.h:853
OrthancPluginApplyMove
OrthancPluginErrorCode(* OrthancPluginApplyMove)(void *moveDriver)
Callback to apply one C-Move suboperation.
Definition: OrthancCPlugin.h:1159
OrthancPluginLogInfo
void OrthancPluginLogInfo(OrthancPluginContext *context, const char *message)
Log an information.
Definition: OrthancCPlugin.h:1374
OrthancPluginFreeFindMatcher
void OrthancPluginFreeFindMatcher(OrthancPluginContext *context, OrthancPluginFindMatcher *matcher)
Free a C-Find matcher.
Definition: OrthancCPlugin.h:5527
OrthancPluginFindMarkIncomplete
OrthancPluginErrorCode OrthancPluginFindMarkIncomplete(OrthancPluginContext *context, OrthancPluginFindAnswers *answers)
Mark the set of C-Find answers as incomplete.
Definition: OrthancCPlugin.h:5272
OrthancPluginGetFindQueryTagName
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:5364
OrthancPluginDicomInstance
struct _OrthancPluginDicomInstance_t OrthancPluginDicomInstance
Opaque structure that represents a DICOM instance received by Orthanc.
Definition: OrthancCPlugin.h:813
OrthancPluginRegisterPrivateDictionaryTag
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:4217
OrthancPluginWorklistCallback
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:993
OrthancPluginIdentifierConstraint
OrthancPluginIdentifierConstraint
Definition: OrthancCPlugin.h:754
OrthancPluginRegisterDictionaryTag
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:4164
OrthancPluginResourceType
OrthancPluginResourceType
Definition: OrthancCPlugin.h:596
OrthancPluginWriteFile
OrthancPluginErrorCode OrthancPluginWriteFile(OrthancPluginContext *context, const char *path, const void *data, uint32_t size)
Write a file.
Definition: OrthancCPlugin.h:3096
OrthancPluginGetCommandLineArgumentsCount
uint32_t OrthancPluginGetCommandLineArgumentsCount(OrthancPluginContext *context)
Get the number of command-line arguments.
Definition: OrthancCPlugin.h:2816
OrthancPluginRegisterMoveCallback
OrthancPluginErrorCode OrthancPluginRegisterMoveCallback(OrthancPluginContext *context, OrthancPluginMoveCallback callback, OrthancPluginGetMoveSize getMoveSize, OrthancPluginApplyMove applyMove, OrthancPluginFreeMove freeMove)
Register a callback to handle C-Move requests.
Definition: OrthancCPlugin.h:5450
OrthancPluginErrorCode
OrthancPluginErrorCode
Definition: OrthancCPlugin.h:189
OrthancPluginRegisterErrorCode
OrthancPluginErrorCode OrthancPluginRegisterErrorCode(OrthancPluginContext *context, int32_t code, uint16_t httpStatus, const char *message)
Declare a custom error code for this plugin.
Definition: OrthancCPlugin.h:4108
OrthancPluginRegisterFindCallback
OrthancPluginErrorCode OrthancPluginRegisterFindCallback(OrthancPluginContext *context, OrthancPluginFindCallback callback)
Register a callback to handle C-Find requests.
Definition: OrthancCPlugin.h:5204
OrthancPluginDicomInstanceToJson
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:4356
OrthancPluginWorklistGetDicomQuery
OrthancPluginErrorCode OrthancPluginWorklistGetDicomQuery(OrthancPluginContext *context, OrthancPluginMemoryBuffer *target, const OrthancPluginWorklistQuery *query)
Retrieve the worklist query as a DICOM file.
Definition: OrthancCPlugin.h:4595
OrthancPluginDicomToJsonFlags
OrthancPluginDicomToJsonFlags
Definition: OrthancCPlugin.h:721
OrthancPluginCreateDicomFlags
OrthancPluginCreateDicomFlags
Definition: OrthancCPlugin.h:740
OrthancPluginFindMatcherIsMatch
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:5560
OrthancPluginExtendOrthancExplorer
void OrthancPluginExtendOrthancExplorer(OrthancPluginContext *context, const char *javascript)
Extend the JavaScript code of Orthanc Explorer.
Definition: OrthancCPlugin.h:2712
OrthancPluginLogWarning
void OrthancPluginLogWarning(OrthancPluginContext *context, const char *message)
Log a warning.
Definition: OrthancCPlugin.h:1358
OrthancPluginWorklistIsMatch
int32_t OrthancPluginWorklistIsMatch(OrthancPluginContext *context, const OrthancPluginWorklistQuery *query, const void *dicom, uint32_t size)
Test whether a worklist matches the query.
Definition: OrthancCPlugin.h:4556
OrthancPluginReadFile
OrthancPluginErrorCode OrthancPluginReadFile(OrthancPluginContext *context, OrthancPluginMemoryBuffer *target, const char *path)
Read a file.
Definition: OrthancCPlugin.h:3065
OrthancPluginFindAddAnswer
OrthancPluginErrorCode OrthancPluginFindAddAnswer(OrthancPluginContext *context, OrthancPluginFindAnswers *answers, const void *dicom, uint32_t size)
Add one answer to some C-Find request.
Definition: OrthancCPlugin.h:5243
OrthancPluginRestOutput
struct _OrthancPluginRestOutput_t OrthancPluginRestOutput
Opaque structure that represents the HTTP connection to the client application.
Definition: OrthancCPlugin.h:806
OrthancPluginMoveCallback
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:1121
OrthancPluginGetCommandLineArgument
char * OrthancPluginGetCommandLineArgument(OrthancPluginContext *context, uint32_t argument)
Get the value of a command-line argument.
Definition: OrthancCPlugin.h:2850
OrthancPluginGetErrorDescription
const char * OrthancPluginGetErrorDescription(OrthancPluginContext *context, OrthancPluginErrorCode error)
Get the description of a given error code.
Definition: OrthancCPlugin.h:3127
OrthancPluginCreateDicom
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:4670
OrthancPluginIncomingHttpRequestFilter2
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:1051
OrthancPluginGenerateUuid
char * OrthancPluginGenerateUuid(OrthancPluginContext *context)
Generate an UUID.
Definition: OrthancCPlugin.h:5165
OrthancPluginHttpPut
OrthancPluginErrorCode OrthancPluginHttpPut(OrthancPluginContext *context, OrthancPluginMemoryBuffer *target, const char *url, const char *body, uint32_t bodySize, const char *username, const char *password)
Issue a HTTP PUT call.
Definition: OrthancCPlugin.h:3703
OrthancPluginFindAnswers
struct _OrthancPluginFindAnswers_t OrthancPluginFindAnswers
Opaque structure to an object that represents the answers to a C-Find query for worklists.
Definition: OrthancCPlugin.h:861
OrthancPluginWorklistAnswers
struct _OrthancPluginWorklistAnswers_t OrthancPluginWorklistAnswers
Opaque structure to an object that represents the answers to a C-Find query for worklists.
Definition: OrthancCPlugin.h:845
OrthancPluginFindCallback
OrthancPluginErrorCode(* OrthancPluginFindCallback)(OrthancPluginFindAnswers *answers, const OrthancPluginFindQuery *query, const char *issuerAet, const char *calledAet)
Callback to handle incoming C-Find SCP requests.
Definition: OrthancCPlugin.h:1078
OrthancPluginGetMoveSize
uint32_t(* OrthancPluginGetMoveSize)(void *moveDriver)
Callback to read the size of a C-Move driver.
Definition: OrthancCPlugin.h:1145
OrthancPluginRegisterWorklistCallback
OrthancPluginErrorCode OrthancPluginRegisterWorklistCallback(OrthancPluginContext *context, OrthancPluginWorklistCallback callback)
Register a callback to handle modality worklists requests.
Definition: OrthancCPlugin.h:4452
OrthancPluginHttpDelete
OrthancPluginErrorCode OrthancPluginHttpDelete(OrthancPluginContext *context, const char *url, const char *username, const char *password)
Issue a HTTP DELETE call.
Definition: OrthancCPlugin.h:3740
OrthancPluginComputeMd5
char * OrthancPluginComputeMd5(OrthancPluginContext *context, const void *buffer, uint32_t size)
Compute an MD5 hash.
Definition: OrthancCPlugin.h:4875
OrthancPluginFindMatcher
struct _OrthancPluginFindAnswers_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:869
OrthancPluginDicomBufferToJson
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:4307
OrthancPluginFreeMemoryBuffer
void OrthancPluginFreeMemoryBuffer(OrthancPluginContext *context, OrthancPluginMemoryBuffer *buffer)
Free a memory buffer.
Definition: OrthancCPlugin.h:1326
OrthancPluginWorklistMarkIncomplete
OrthancPluginErrorCode OrthancPluginWorklistMarkIncomplete(OrthancPluginContext *context, OrthancPluginWorklistAnswers *answers)
Mark the set of worklist answers as incomplete.
Definition: OrthancCPlugin.h:4518
OrthancPluginGetFindQueryValue
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:5402
OrthancPluginGetFindQueryTag
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:5333
OrthancPluginValueRepresentation
OrthancPluginValueRepresentation
Definition: OrthancCPlugin.h:667
OrthancPluginHttpClient
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 char *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:5110
OrthancPluginGetConfigurationPath
char * OrthancPluginGetConfigurationPath(OrthancPluginContext *context)
Return the path to the configuration file(s).
Definition: OrthancCPlugin.h:2595
OrthancPluginHttpGet
OrthancPluginErrorCode OrthancPluginHttpGet(OrthancPluginContext *context, OrthancPluginMemoryBuffer *target, const char *url, const char *username, const char *password)
Issue a HTTP GET call.
Definition: OrthancCPlugin.h:3625
OrthancPluginFreeMove
void(* OrthancPluginFreeMove)(void *moveDriver)
Callback to free one C-Move driver.
Definition: OrthancCPlugin.h:1172
OrthancPluginGetOrthancDirectory
char * OrthancPluginGetOrthancDirectory(OrthancPluginContext *context)
Return the directory containing the Orthanc.
Definition: OrthancCPlugin.h:2560
OrthancPluginCreateFindMatcher
OrthancPluginFindMatcher * OrthancPluginCreateFindMatcher(OrthancPluginContext *context, const void *query, uint32_t size)
Create a C-Find matcher.
Definition: OrthancCPlugin.h:5489
OrthancPluginDicomToJsonFormat
OrthancPluginDicomToJsonFormat
Definition: OrthancCPlugin.h:706
OrthancPluginWorklistQuery
struct _OrthancPluginWorklistQuery_t OrthancPluginWorklistQuery
Opaque structure to an object that represents a C-Find query for worklists.
Definition: OrthancCPlugin.h:837
OrthancPluginLogError
void OrthancPluginLogError(OrthancPluginContext *context, const char *message)
Log an error.
Definition: OrthancCPlugin.h:1342
OrthancPluginHttpMethod
OrthancPluginHttpMethod
Definition: OrthancCPlugin.h:302
OrthancPluginGetConfiguration
char * OrthancPluginGetConfiguration(OrthancPluginContext *context)
Return the content of the configuration file(s).
Definition: OrthancCPlugin.h:2916
OrthancPluginIncomingHttpRequestFilter
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:1020
OrthancPluginSetRootUri
void OrthancPluginSetRootUri(OrthancPluginContext *context, const char *uri)
Set the URI where the plugin provides its Web interface.
Definition: OrthancCPlugin.h:2668
OrthancPluginWorklistAddAnswer
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:4488
OrthancPluginHttpPost
OrthancPluginErrorCode OrthancPluginHttpPost(OrthancPluginContext *context, OrthancPluginMemoryBuffer *target, const char *url, const char *body, uint32_t bodySize, const char *username, const char *password)
Issue a HTTP POST call.
Definition: OrthancCPlugin.h:3662
OrthancPluginLookupDictionary
OrthancPluginErrorCode OrthancPluginLookupDictionary(OrthancPluginContext *context, OrthancPluginDictionaryEntry *target, const char *name)
Get information about the given DICOM tag.
Definition: OrthancCPlugin.h:4957
OrthancPluginComputeSha1
char * OrthancPluginComputeSha1(OrthancPluginContext *context, const void *buffer, uint32_t size)
Compute a SHA-1 hash.
Definition: OrthancCPlugin.h:4911
OrthancPluginFree
void(* OrthancPluginFree)(void *buffer)
Signature of a function to free dynamic memory.
Definition: OrthancCPlugin.h:920
OrthancPluginInstanceOrigin
OrthancPluginInstanceOrigin
Definition: OrthancCPlugin.h:768
OrthancPluginFreeString
void OrthancPluginFreeString(OrthancPluginContext *context, char *str)
Free a string.
Definition: OrthancCPlugin.h:1213
OrthancPluginGetOrthancPath
char * OrthancPluginGetOrthancPath(OrthancPluginContext *context)
Return the path to the Orthanc executable.
Definition: OrthancCPlugin.h:2530
OrthancPluginContext
struct _OrthancPluginContext_t OrthancPluginContext
Data structure that contains information about the Orthanc core.
OrthancPluginContentType
OrthancPluginContentType
Definition: OrthancCPlugin.h:582
OrthancPluginSetDescription
void OrthancPluginSetDescription(OrthancPluginContext *context, const char *description)
Set a description for this plugin.
Definition: OrthancCPlugin.h:2690
OrthancPluginIdentifierConstraint_Wildcard
@ OrthancPluginIdentifierConstraint_Wildcard
Definition: OrthancCPlugin.h:758
OrthancPluginIdentifierConstraint_Equal
@ OrthancPluginIdentifierConstraint_Equal
Definition: OrthancCPlugin.h:755
OrthancPluginIdentifierConstraint_SmallerOrEqual
@ OrthancPluginIdentifierConstraint_SmallerOrEqual
Definition: OrthancCPlugin.h:756
OrthancPluginIdentifierConstraint_GreaterOrEqual
@ OrthancPluginIdentifierConstraint_GreaterOrEqual
Definition: OrthancCPlugin.h:757
OrthancPluginResourceType_Instance
@ OrthancPluginResourceType_Instance
Definition: OrthancCPlugin.h:600
OrthancPluginResourceType_None
@ OrthancPluginResourceType_None
Definition: OrthancCPlugin.h:601
OrthancPluginResourceType_Series
@ OrthancPluginResourceType_Series
Definition: OrthancCPlugin.h:599
OrthancPluginResourceType_Study
@ OrthancPluginResourceType_Study
Definition: OrthancCPlugin.h:598
OrthancPluginResourceType_Patient
@ OrthancPluginResourceType_Patient
Definition: OrthancCPlugin.h:597
OrthancPluginErrorCode_CreateDicomBadParent
@ OrthancPluginErrorCode_CreateDicomBadParent
Definition: OrthancCPlugin.h:267
OrthancPluginErrorCode_SQLiteFlush
@ OrthancPluginErrorCode_SQLiteFlush
Definition: OrthancCPlugin.h:235
OrthancPluginErrorCode_IncompatibleDatabaseVersion
@ OrthancPluginErrorCode_IncompatibleDatabaseVersion
Definition: OrthancCPlugin.h:209
OrthancPluginErrorCode_BadSequenceOfCalls
@ OrthancPluginErrorCode_BadSequenceOfCalls
Definition: OrthancCPlugin.h:197
OrthancPluginErrorCode_SharedLibrary
@ OrthancPluginErrorCode_SharedLibrary
Definition: OrthancCPlugin.h:216
OrthancPluginErrorCode_NullPointer
@ OrthancPluginErrorCode_NullPointer
Definition: OrthancCPlugin.h:226
OrthancPluginErrorCode_NotLuaPredicate
@ OrthancPluginErrorCode_NotLuaPredicate
Definition: OrthancCPlugin.h:277
OrthancPluginErrorCode_LuaAlreadyExecuted
@ OrthancPluginErrorCode_LuaAlreadyExecuted
Definition: OrthancCPlugin.h:275
OrthancPluginErrorCode_NotAcceptable
@ OrthancPluginErrorCode_NotAcceptable
Definition: OrthancCPlugin.h:225
OrthancPluginErrorCode_FullStorage
@ OrthancPluginErrorCode_FullStorage
Definition: OrthancCPlugin.h:210
OrthancPluginErrorCode_DatabaseBackendAlreadyRegistered
@ OrthancPluginErrorCode_DatabaseBackendAlreadyRegistered
Definition: OrthancCPlugin.h:280
OrthancPluginErrorCode_InexistentFile
@ OrthancPluginErrorCode_InexistentFile
Definition: OrthancCPlugin.h:204
OrthancPluginErrorCode_CreateDicomParentEncoding
@ OrthancPluginErrorCode_CreateDicomParentEncoding
Definition: OrthancCPlugin.h:269
OrthancPluginErrorCode_CannotOrderSlices
@ OrthancPluginErrorCode_CannotOrderSlices
Definition: OrthancCPlugin.h:283
OrthancPluginErrorCode_InternalError
@ OrthancPluginErrorCode_InternalError
Definition: OrthancCPlugin.h:190
OrthancPluginErrorCode_NoCFindHandler
@ OrthancPluginErrorCode_NoCFindHandler
Definition: OrthancCPlugin.h:253
OrthancPluginErrorCode_SQLiteCommitWithoutTransaction
@ OrthancPluginErrorCode_SQLiteCommitWithoutTransaction
Definition: OrthancCPlugin.h:233
OrthancPluginErrorCode_DatabasePlugin
@ OrthancPluginErrorCode_DatabasePlugin
Definition: OrthancCPlugin.h:222
OrthancPluginErrorCode_SQLiteStatementAlreadyUsed
@ OrthancPluginErrorCode_SQLiteStatementAlreadyUsed
Definition: OrthancCPlugin.h:230
OrthancPluginErrorCode_SQLiteCannotRun
@ OrthancPluginErrorCode_SQLiteCannotRun
Definition: OrthancCPlugin.h:236
OrthancPluginErrorCode_UnknownPluginService
@ OrthancPluginErrorCode_UnknownPluginService
Definition: OrthancCPlugin.h:217
OrthancPluginErrorCode_JsonToLuaTable
@ OrthancPluginErrorCode_JsonToLuaTable
Definition: OrthancCPlugin.h:272
OrthancPluginErrorCode_CreateDicomOverrideTag
@ OrthancPluginErrorCode_CreateDicomOverrideTag
Definition: OrthancCPlugin.h:263
OrthancPluginErrorCode_SQLiteBindOutOfRange
@ OrthancPluginErrorCode_SQLiteBindOutOfRange
Definition: OrthancCPlugin.h:238
OrthancPluginErrorCode_ParameterOutOfRange
@ OrthancPluginErrorCode_ParameterOutOfRange
Definition: OrthancCPlugin.h:194
OrthancPluginErrorCode_SQLiteRegisterFunction
@ OrthancPluginErrorCode_SQLiteRegisterFunction
Definition: OrthancCPlugin.h:234
OrthancPluginErrorCode_SQLiteTransactionBegin
@ OrthancPluginErrorCode_SQLiteTransactionBegin
Definition: OrthancCPlugin.h:242
OrthancPluginErrorCode_CreateDicomNoPayload
@ OrthancPluginErrorCode_CreateDicomNoPayload
Definition: OrthancCPlugin.h:265
OrthancPluginErrorCode_Unauthorized
@ OrthancPluginErrorCode_Unauthorized
Definition: OrthancCPlugin.h:220
OrthancPluginErrorCode_RegularFileExpected
@ OrthancPluginErrorCode_RegularFileExpected
Definition: OrthancCPlugin.h:249
OrthancPluginErrorCode_DicomPortInUse
@ OrthancPluginErrorCode_DicomPortInUse
Definition: OrthancCPlugin.h:247
OrthancPluginErrorCode_BadApplicationEntityTitle
@ OrthancPluginErrorCode_BadApplicationEntityTitle
Definition: OrthancCPlugin.h:252
OrthancPluginErrorCode_NoCStoreHandler
@ OrthancPluginErrorCode_NoCStoreHandler
Definition: OrthancCPlugin.h:255
OrthancPluginErrorCode_PathToExecutable
@ OrthancPluginErrorCode_PathToExecutable
Definition: OrthancCPlugin.h:250
OrthancPluginErrorCode_NoSopClassOrInstance
@ OrthancPluginErrorCode_NoSopClassOrInstance
Definition: OrthancCPlugin.h:257
OrthancPluginErrorCode_BadFont
@ OrthancPluginErrorCode_BadFont
Definition: OrthancCPlugin.h:221
OrthancPluginErrorCode_CannotCreateLua
@ OrthancPluginErrorCode_CannotCreateLua
Definition: OrthancCPlugin.h:273
OrthancPluginErrorCode_SQLiteExecute
@ OrthancPluginErrorCode_SQLiteExecute
Definition: OrthancCPlugin.h:231
OrthancPluginErrorCode_UriSyntax
@ OrthancPluginErrorCode_UriSyntax
Definition: OrthancCPlugin.h:203
OrthancPluginErrorCode_DirectoryOverFile
@ OrthancPluginErrorCode_DirectoryOverFile
Definition: OrthancCPlugin.h:243
OrthancPluginErrorCode_InexistentTag
@ OrthancPluginErrorCode_InexistentTag
Definition: OrthancCPlugin.h:212
OrthancPluginErrorCode_IncompatibleImageFormat
@ OrthancPluginErrorCode_IncompatibleImageFormat
Definition: OrthancCPlugin.h:214
OrthancPluginErrorCode_DicomFindUnavailable
@ OrthancPluginErrorCode_DicomFindUnavailable
Definition: OrthancCPlugin.h:259
OrthancPluginErrorCode_SQLiteCannotStep
@ OrthancPluginErrorCode_SQLiteCannotStep
Definition: OrthancCPlugin.h:237
OrthancPluginErrorCode_CreateDicomParentIsInstance
@ OrthancPluginErrorCode_CreateDicomParentIsInstance
Definition: OrthancCPlugin.h:268
OrthancPluginErrorCode_StorageAreaAlreadyRegistered
@ OrthancPluginErrorCode_StorageAreaAlreadyRegistered
Definition: OrthancCPlugin.h:279
OrthancPluginErrorCode_LuaReturnsNoString
@ OrthancPluginErrorCode_LuaReturnsNoString
Definition: OrthancCPlugin.h:278
OrthancPluginErrorCode_UnknownResource
@ OrthancPluginErrorCode_UnknownResource
Definition: OrthancCPlugin.h:208
OrthancPluginErrorCode_CreateDicomNotString
@ OrthancPluginErrorCode_CreateDicomNotString
Definition: OrthancCPlugin.h:262
OrthancPluginErrorCode_HttpPortInUse
@ OrthancPluginErrorCode_HttpPortInUse
Definition: OrthancCPlugin.h:246
OrthancPluginErrorCode_SslDisabled
@ OrthancPluginErrorCode_SslDisabled
Definition: OrthancCPlugin.h:282
OrthancPluginErrorCode_UnknownModality
@ OrthancPluginErrorCode_UnknownModality
Definition: OrthancCPlugin.h:270
OrthancPluginErrorCode_BadHttpStatusInRest
@ OrthancPluginErrorCode_BadHttpStatusInRest
Definition: OrthancCPlugin.h:248
OrthancPluginErrorCode_AlreadyExistingTag
@ OrthancPluginErrorCode_AlreadyExistingTag
Definition: OrthancCPlugin.h:285
OrthancPluginErrorCode_FileStorageCannotWrite
@ OrthancPluginErrorCode_FileStorageCannotWrite
Definition: OrthancCPlugin.h:244
OrthancPluginErrorCode_CreateDicomUseDataUriScheme
@ OrthancPluginErrorCode_CreateDicomUseDataUriScheme
Definition: OrthancCPlugin.h:266
OrthancPluginErrorCode_DirectoryExpected
@ OrthancPluginErrorCode_DirectoryExpected
Definition: OrthancCPlugin.h:245
OrthancPluginErrorCode_NoCMoveHandler
@ OrthancPluginErrorCode_NoCMoveHandler
Definition: OrthancCPlugin.h:254
OrthancPluginErrorCode_SQLitePrepareStatement
@ OrthancPluginErrorCode_SQLitePrepareStatement
Definition: OrthancCPlugin.h:239
OrthancPluginErrorCode_CorruptedFile
@ OrthancPluginErrorCode_CorruptedFile
Definition: OrthancCPlugin.h:211
OrthancPluginErrorCode_StorageAreaPlugin
@ OrthancPluginErrorCode_StorageAreaPlugin
Definition: OrthancCPlugin.h:223
OrthancPluginErrorCode_BadJobOrdering
@ OrthancPluginErrorCode_BadJobOrdering
Definition: OrthancCPlugin.h:271
OrthancPluginErrorCode_NotImplemented
@ OrthancPluginErrorCode_NotImplemented
Definition: OrthancCPlugin.h:193
OrthancPluginErrorCode_IncompatibleImageSize
@ OrthancPluginErrorCode_IncompatibleImageSize
Definition: OrthancCPlugin.h:215
OrthancPluginErrorCode_BadFileFormat
@ OrthancPluginErrorCode_BadFileFormat
Definition: OrthancCPlugin.h:206
OrthancPluginErrorCode_BadRequest
@ OrthancPluginErrorCode_BadRequest
Definition: OrthancCPlugin.h:199
OrthancPluginErrorCode_SystemCommand
@ OrthancPluginErrorCode_SystemCommand
Definition: OrthancCPlugin.h:201
OrthancPluginErrorCode_SQLiteAlreadyOpened
@ OrthancPluginErrorCode_SQLiteAlreadyOpened
Definition: OrthancCPlugin.h:228
OrthancPluginErrorCode_Plugin
@ OrthancPluginErrorCode_Plugin
Definition: OrthancCPlugin.h:192
OrthancPluginErrorCode_CannotExecuteLua
@ OrthancPluginErrorCode_CannotExecuteLua
Definition: OrthancCPlugin.h:274
OrthancPluginErrorCode_SQLiteRollbackWithoutTransaction
@ OrthancPluginErrorCode_SQLiteRollbackWithoutTransaction
Definition: OrthancCPlugin.h:232
OrthancPluginErrorCode_UnknownDicomTag
@ OrthancPluginErrorCode_UnknownDicomTag
Definition: OrthancCPlugin.h:218
OrthancPluginErrorCode_NoPresentationContext
@ OrthancPluginErrorCode_NoPresentationContext
Definition: OrthancCPlugin.h:258
OrthancPluginErrorCode_EmptyRequest
@ OrthancPluginErrorCode_EmptyRequest
Definition: OrthancCPlugin.h:224
OrthancPluginErrorCode_DatabaseNotInitialized
@ OrthancPluginErrorCode_DatabaseNotInitialized
Definition: OrthancCPlugin.h:281
OrthancPluginErrorCode_DicomMoveUnavailable
@ OrthancPluginErrorCode_DicomMoveUnavailable
Definition: OrthancCPlugin.h:260
OrthancPluginErrorCode_SQLiteTransactionCommit
@ OrthancPluginErrorCode_SQLiteTransactionCommit
Definition: OrthancCPlugin.h:241
OrthancPluginErrorCode_BadJson
@ OrthancPluginErrorCode_BadJson
Definition: OrthancCPlugin.h:219
OrthancPluginErrorCode_Success
@ OrthancPluginErrorCode_Success
Definition: OrthancCPlugin.h:191
OrthancPluginErrorCode_NetworkProtocol
@ OrthancPluginErrorCode_NetworkProtocol
Definition: OrthancCPlugin.h:200
OrthancPluginErrorCode_NoApplicationEntityFilter
@ OrthancPluginErrorCode_NoApplicationEntityFilter
Definition: OrthancCPlugin.h:256
OrthancPluginErrorCode_InexistentItem
@ OrthancPluginErrorCode_InexistentItem
Definition: OrthancCPlugin.h:198
OrthancPluginErrorCode_Timeout
@ OrthancPluginErrorCode_Timeout
Definition: OrthancCPlugin.h:207
OrthancPluginErrorCode_LuaBadOutput
@ OrthancPluginErrorCode_LuaBadOutput
Definition: OrthancCPlugin.h:276
OrthancPluginErrorCode_SQLiteTransactionAlreadyStarted
@ OrthancPluginErrorCode_SQLiteTransactionAlreadyStarted
Definition: OrthancCPlugin.h:240
OrthancPluginErrorCode_SQLiteNotOpened
@ OrthancPluginErrorCode_SQLiteNotOpened
Definition: OrthancCPlugin.h:227
OrthancPluginErrorCode_ReadOnly
@ OrthancPluginErrorCode_ReadOnly
Definition: OrthancCPlugin.h:213
OrthancPluginErrorCode_CannotStoreInstance
@ OrthancPluginErrorCode_CannotStoreInstance
Definition: OrthancCPlugin.h:261
OrthancPluginErrorCode_CannotWriteFile
@ OrthancPluginErrorCode_CannotWriteFile
Definition: OrthancCPlugin.h:205
OrthancPluginErrorCode_BadParameterType
@ OrthancPluginErrorCode_BadParameterType
Definition: OrthancCPlugin.h:196
OrthancPluginErrorCode_NotEnoughMemory
@ OrthancPluginErrorCode_NotEnoughMemory
Definition: OrthancCPlugin.h:195
OrthancPluginErrorCode_CreateDicomUseContent
@ OrthancPluginErrorCode_CreateDicomUseContent
Definition: OrthancCPlugin.h:264
OrthancPluginErrorCode_Database
@ OrthancPluginErrorCode_Database
Definition: OrthancCPlugin.h:202
OrthancPluginErrorCode_SQLiteCannotOpen
@ OrthancPluginErrorCode_SQLiteCannotOpen
Definition: OrthancCPlugin.h:229
OrthancPluginErrorCode_MakeDirectory
@ OrthancPluginErrorCode_MakeDirectory
Definition: OrthancCPlugin.h:251
OrthancPluginErrorCode_NoWorklistHandler
@ OrthancPluginErrorCode_NoWorklistHandler
Definition: OrthancCPlugin.h:284
OrthancPluginDicomToJsonFlags_ConvertBinaryToAscii
@ OrthancPluginDicomToJsonFlags_ConvertBinaryToAscii
Definition: OrthancCPlugin.h:727
OrthancPluginDicomToJsonFlags_IncludeBinary
@ OrthancPluginDicomToJsonFlags_IncludeBinary
Definition: OrthancCPlugin.h:723
OrthancPluginDicomToJsonFlags_IncludePixelData
@ OrthancPluginDicomToJsonFlags_IncludePixelData
Definition: OrthancCPlugin.h:726
OrthancPluginDicomToJsonFlags_IncludeUnknownTags
@ OrthancPluginDicomToJsonFlags_IncludeUnknownTags
Definition: OrthancCPlugin.h:725
OrthancPluginDicomToJsonFlags_ConvertBinaryToNull
@ OrthancPluginDicomToJsonFlags_ConvertBinaryToNull
Definition: OrthancCPlugin.h:728
OrthancPluginDicomToJsonFlags_IncludePrivateTags
@ OrthancPluginDicomToJsonFlags_IncludePrivateTags
Definition: OrthancCPlugin.h:724
OrthancPluginCreateDicomFlags_DecodeDataUriScheme
@ OrthancPluginCreateDicomFlags_DecodeDataUriScheme
Definition: OrthancCPlugin.h:742
OrthancPluginCreateDicomFlags_GenerateIdentifiers
@ OrthancPluginCreateDicomFlags_GenerateIdentifiers
Definition: OrthancCPlugin.h:743
OrthancPluginValueRepresentation_PN
@ OrthancPluginValueRepresentation_PN
Definition: OrthancCPlugin.h:683
OrthancPluginValueRepresentation_UL
@ OrthancPluginValueRepresentation_UL
Definition: OrthancCPlugin.h:691
OrthancPluginValueRepresentation_UN
@ OrthancPluginValueRepresentation_UN
Definition: OrthancCPlugin.h:692
OrthancPluginValueRepresentation_DA
@ OrthancPluginValueRepresentation_DA
Definition: OrthancCPlugin.h:672
OrthancPluginValueRepresentation_OF
@ OrthancPluginValueRepresentation_OF
Definition: OrthancCPlugin.h:681
OrthancPluginValueRepresentation_OW
@ OrthancPluginValueRepresentation_OW
Definition: OrthancCPlugin.h:682
OrthancPluginValueRepresentation_CS
@ OrthancPluginValueRepresentation_CS
Definition: OrthancCPlugin.h:671
OrthancPluginValueRepresentation_US
@ OrthancPluginValueRepresentation_US
Definition: OrthancCPlugin.h:693
OrthancPluginValueRepresentation_SH
@ OrthancPluginValueRepresentation_SH
Definition: OrthancCPlugin.h:684
OrthancPluginValueRepresentation_FL
@ OrthancPluginValueRepresentation_FL
Definition: OrthancCPlugin.h:676
OrthancPluginValueRepresentation_DT
@ OrthancPluginValueRepresentation_DT
Definition: OrthancCPlugin.h:674
OrthancPluginValueRepresentation_TM
@ OrthancPluginValueRepresentation_TM
Definition: OrthancCPlugin.h:689
OrthancPluginValueRepresentation_SQ
@ OrthancPluginValueRepresentation_SQ
Definition: OrthancCPlugin.h:686
OrthancPluginValueRepresentation_DS
@ OrthancPluginValueRepresentation_DS
Definition: OrthancCPlugin.h:673
OrthancPluginValueRepresentation_OB
@ OrthancPluginValueRepresentation_OB
Definition: OrthancCPlugin.h:680
OrthancPluginValueRepresentation_SL
@ OrthancPluginValueRepresentation_SL
Definition: OrthancCPlugin.h:685
OrthancPluginValueRepresentation_ST
@ OrthancPluginValueRepresentation_ST
Definition: OrthancCPlugin.h:688
OrthancPluginValueRepresentation_IS
@ OrthancPluginValueRepresentation_IS
Definition: OrthancCPlugin.h:677
OrthancPluginValueRepresentation_LT
@ OrthancPluginValueRepresentation_LT
Definition: OrthancCPlugin.h:679
OrthancPluginValueRepresentation_SS
@ OrthancPluginValueRepresentation_SS
Definition: OrthancCPlugin.h:687
OrthancPluginValueRepresentation_UT
@ OrthancPluginValueRepresentation_UT
Definition: OrthancCPlugin.h:694
OrthancPluginValueRepresentation_LO
@ OrthancPluginValueRepresentation_LO
Definition: OrthancCPlugin.h:678
OrthancPluginValueRepresentation_AE
@ OrthancPluginValueRepresentation_AE
Definition: OrthancCPlugin.h:668
OrthancPluginValueRepresentation_FD
@ OrthancPluginValueRepresentation_FD
Definition: OrthancCPlugin.h:675
OrthancPluginValueRepresentation_UI
@ OrthancPluginValueRepresentation_UI
Definition: OrthancCPlugin.h:690
OrthancPluginValueRepresentation_AS
@ OrthancPluginValueRepresentation_AS
Definition: OrthancCPlugin.h:669
OrthancPluginValueRepresentation_AT
@ OrthancPluginValueRepresentation_AT
Definition: OrthancCPlugin.h:670
OrthancPluginDicomToJsonFormat_Full
@ OrthancPluginDicomToJsonFormat_Full
Definition: OrthancCPlugin.h:707
OrthancPluginDicomToJsonFormat_Human
@ OrthancPluginDicomToJsonFormat_Human
Definition: OrthancCPlugin.h:709
OrthancPluginDicomToJsonFormat_Short
@ OrthancPluginDicomToJsonFormat_Short
Definition: OrthancCPlugin.h:708
OrthancPluginHttpMethod_Delete
@ OrthancPluginHttpMethod_Delete
Definition: OrthancCPlugin.h:306
OrthancPluginHttpMethod_Post
@ OrthancPluginHttpMethod_Post
Definition: OrthancCPlugin.h:304
OrthancPluginHttpMethod_Put
@ OrthancPluginHttpMethod_Put
Definition: OrthancCPlugin.h:305
OrthancPluginHttpMethod_Get
@ OrthancPluginHttpMethod_Get
Definition: OrthancCPlugin.h:303
OrthancPluginInstanceOrigin_Unknown
@ OrthancPluginInstanceOrigin_Unknown
Definition: OrthancCPlugin.h:769
OrthancPluginInstanceOrigin_RestApi
@ OrthancPluginInstanceOrigin_RestApi
Definition: OrthancCPlugin.h:771
OrthancPluginInstanceOrigin_Lua
@ OrthancPluginInstanceOrigin_Lua
Definition: OrthancCPlugin.h:773
OrthancPluginInstanceOrigin_DicomProtocol
@ OrthancPluginInstanceOrigin_DicomProtocol
Definition: OrthancCPlugin.h:770
OrthancPluginInstanceOrigin_Plugin
@ OrthancPluginInstanceOrigin_Plugin
Definition: OrthancCPlugin.h:772
OrthancPluginContentType_Dicom
@ OrthancPluginContentType_Dicom
Definition: OrthancCPlugin.h:584
OrthancPluginContentType_DicomAsJson
@ OrthancPluginContentType_DicomAsJson
Definition: OrthancCPlugin.h:585
OrthancPluginContentType_Unknown
@ OrthancPluginContentType_Unknown
Definition: OrthancCPlugin.h:583
OrthancPluginDictionaryEntry
An entry in the dictionary of DICOM tags.
Definition: OrthancCPlugin.h:1195
OrthancPluginDictionaryEntry::minMultiplicity
uint32_t minMultiplicity
Definition: OrthancCPlugin.h:1199
OrthancPluginDictionaryEntry::maxMultiplicity
uint32_t maxMultiplicity
Definition: OrthancCPlugin.h:1200
OrthancPluginDictionaryEntry::vr
OrthancPluginValueRepresentation vr
Definition: OrthancCPlugin.h:1198
OrthancPluginDictionaryEntry::element
uint16_t element
Definition: OrthancCPlugin.h:1197
OrthancPluginDictionaryEntry::group
uint16_t group
Definition: OrthancCPlugin.h:1196
OrthancPluginHttpRequest
The parameters of a REST request.
Definition: OrthancCPlugin.h:317
OrthancPluginHttpRequest::getValues
const char *const * getValues
For a GET request, the values of the GET parameters.
Definition: OrthancCPlugin.h:346
OrthancPluginHttpRequest::groups
const char *const * groups
The matched values for the groups of the regular expression.
Definition: OrthancCPlugin.h:331
OrthancPluginHttpRequest::bodySize
uint32_t bodySize
For a PUT or POST request, the number of bytes of the body.
Definition: OrthancCPlugin.h:356
OrthancPluginHttpRequest::groupsCount
uint32_t groupsCount
The number of groups of the regular expression.
Definition: OrthancCPlugin.h:326
OrthancPluginHttpRequest::headersKeys
const char *const * headersKeys
The keys of the HTTP headers (always converted to low-case).
Definition: OrthancCPlugin.h:371
OrthancPluginHttpRequest::getKeys
const char *const * getKeys
For a GET request, the keys of the GET parameters.
Definition: OrthancCPlugin.h:341
OrthancPluginHttpRequest::headersCount
uint32_t headersCount
The number of HTTP headers.
Definition: OrthancCPlugin.h:366
OrthancPluginHttpRequest::method
OrthancPluginHttpMethod method
The HTTP method.
Definition: OrthancCPlugin.h:321
OrthancPluginHttpRequest::getCount
uint32_t getCount
For a GET request, the number of GET parameters.
Definition: OrthancCPlugin.h:336
OrthancPluginHttpRequest::headersValues
const char *const * headersValues
The values of the HTTP headers.
Definition: OrthancCPlugin.h:376
OrthancPluginHttpRequest::body
const char * body
For a PUT or POST request, the content of the body.
Definition: OrthancCPlugin.h:351
OrthancPluginMemoryBuffer
A memory buffer allocated by the core system of Orthanc.
Definition: OrthancCPlugin.h:787
OrthancPluginMemoryBuffer::size
uint32_t size
The number of bytes in the buffer.
Definition: OrthancCPlugin.h:796
OrthancPluginMemoryBuffer::data
void * data
The content of the buffer.
Definition: OrthancCPlugin.h:791