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

OrthancCPlugin.h
1
52
53
54
74
75
76
81
82
83
105
106
107
108#pragma once
109
110
111#include <stdio.h>
112#include <string.h>
113
114#ifdef _WIN32
115# define ORTHANC_PLUGINS_API __declspec(dllexport)
116#elif __GNUC__ >= 4
117# define ORTHANC_PLUGINS_API __attribute__ ((visibility ("default")))
118#else
119# define ORTHANC_PLUGINS_API
120#endif
121
122#define ORTHANC_PLUGINS_MINIMAL_MAJOR_NUMBER 1
123#define ORTHANC_PLUGINS_MINIMAL_MINOR_NUMBER 12
124#define ORTHANC_PLUGINS_MINIMAL_REVISION_NUMBER 6
125
126
127#if !defined(ORTHANC_PLUGINS_VERSION_IS_ABOVE)
128#define ORTHANC_PLUGINS_VERSION_IS_ABOVE(major, minor, revision) \
129 (ORTHANC_PLUGINS_MINIMAL_MAJOR_NUMBER > major || \
130 (ORTHANC_PLUGINS_MINIMAL_MAJOR_NUMBER == major && \
131 (ORTHANC_PLUGINS_MINIMAL_MINOR_NUMBER > minor || \
132 (ORTHANC_PLUGINS_MINIMAL_MINOR_NUMBER == minor && \
133 ORTHANC_PLUGINS_MINIMAL_REVISION_NUMBER >= revision))))
134#endif
135
136
137
138/********************************************************************
139 ** Check that function inlining is properly supported. The use of
140 ** inlining is required, to avoid the duplication of object code
141 ** between two compilation modules that would use the Orthanc Plugin
142 ** API.
143 ********************************************************************/
144
145/* If the auto-detection of the "inline" keyword below does not work
146 automatically and that your compiler is known to properly support
147 inlining, uncomment the following #define and adapt the definition
148 of "static inline". */
149
150/* #define ORTHANC_PLUGIN_INLINE static inline */
151
152#ifndef ORTHANC_PLUGIN_INLINE
153# if __STDC_VERSION__ >= 199901L
154/* This is C99 or above: http://predef.sourceforge.net/prestd.html */
155# define ORTHANC_PLUGIN_INLINE static inline
156# elif defined(__cplusplus)
157/* This is C++ */
158# define ORTHANC_PLUGIN_INLINE static inline
159# elif defined(__GNUC__)
160/* This is GCC running in C89 mode */
161# define ORTHANC_PLUGIN_INLINE static __inline
162# elif defined(_MSC_VER)
163/* This is Visual Studio running in C89 mode */
164# define ORTHANC_PLUGIN_INLINE static __inline
165# else
166# error Your compiler is not known to support the "inline" keyword
167# endif
168#endif
169
170
171#ifndef ORTHANC_PLUGIN_DEPRECATED
172# if defined(_MSC_VER)
173# define ORTHANC_PLUGIN_DEPRECATED __declspec(deprecated)
174# elif __GNUC__ >= 4
175# define ORTHANC_PLUGIN_DEPRECATED __attribute__ ((deprecated))
176# elif defined(__clang__)
177# define ORTHANC_PLUGIN_DEPRECATED __attribute__ ((deprecated))
178# else
179# pragma message("WARNING: You need to implement ORTHANC_PLUGINS_DEPRECATED for this compiler")
180# define ORTHANC_PLUGIN_DEPRECATED
181# endif
182#endif
183
184
185
186/********************************************************************
187 ** Inclusion of standard libraries.
188 ********************************************************************/
189
195#include <stdint.h>
196
197#include <stdlib.h>
198
199
200
201/********************************************************************
202 ** Definition of the Orthanc Plugin API.
203 ********************************************************************/
204
206
207#ifdef __cplusplus
208 extern "C"
209{
210#endif
211
215 typedef enum
216 {
217 OrthancPluginErrorCode_InternalError = -1 ,
218 OrthancPluginErrorCode_Success = 0 ,
219 OrthancPluginErrorCode_Plugin = 1 ,
220 OrthancPluginErrorCode_NotImplemented = 2 ,
221 OrthancPluginErrorCode_ParameterOutOfRange = 3 ,
222 OrthancPluginErrorCode_NotEnoughMemory = 4 ,
223 OrthancPluginErrorCode_BadParameterType = 5 ,
224 OrthancPluginErrorCode_BadSequenceOfCalls = 6 ,
225 OrthancPluginErrorCode_InexistentItem = 7 ,
226 OrthancPluginErrorCode_BadRequest = 8 ,
227 OrthancPluginErrorCode_NetworkProtocol = 9 ,
228 OrthancPluginErrorCode_SystemCommand = 10 ,
229 OrthancPluginErrorCode_Database = 11 ,
230 OrthancPluginErrorCode_UriSyntax = 12 ,
231 OrthancPluginErrorCode_InexistentFile = 13 ,
232 OrthancPluginErrorCode_CannotWriteFile = 14 ,
233 OrthancPluginErrorCode_BadFileFormat = 15 ,
234 OrthancPluginErrorCode_Timeout = 16 ,
235 OrthancPluginErrorCode_UnknownResource = 17 ,
236 OrthancPluginErrorCode_IncompatibleDatabaseVersion = 18 ,
237 OrthancPluginErrorCode_FullStorage = 19 ,
238 OrthancPluginErrorCode_CorruptedFile = 20 ,
239 OrthancPluginErrorCode_InexistentTag = 21 ,
240 OrthancPluginErrorCode_ReadOnly = 22 ,
241 OrthancPluginErrorCode_IncompatibleImageFormat = 23 ,
242 OrthancPluginErrorCode_IncompatibleImageSize = 24 ,
243 OrthancPluginErrorCode_SharedLibrary = 25 ,
244 OrthancPluginErrorCode_UnknownPluginService = 26 ,
245 OrthancPluginErrorCode_UnknownDicomTag = 27 ,
246 OrthancPluginErrorCode_BadJson = 28 ,
247 OrthancPluginErrorCode_Unauthorized = 29 ,
248 OrthancPluginErrorCode_BadFont = 30 ,
249 OrthancPluginErrorCode_DatabasePlugin = 31 ,
250 OrthancPluginErrorCode_StorageAreaPlugin = 32 ,
251 OrthancPluginErrorCode_EmptyRequest = 33 ,
252 OrthancPluginErrorCode_NotAcceptable = 34 ,
253 OrthancPluginErrorCode_NullPointer = 35 ,
254 OrthancPluginErrorCode_DatabaseUnavailable = 36 ,
255 OrthancPluginErrorCode_CanceledJob = 37 ,
256 OrthancPluginErrorCode_BadGeometry = 38 ,
257 OrthancPluginErrorCode_SslInitialization = 39 ,
258 OrthancPluginErrorCode_DiscontinuedAbi = 40 ,
259 OrthancPluginErrorCode_BadRange = 41 ,
260 OrthancPluginErrorCode_DatabaseCannotSerialize = 42 ,
261 OrthancPluginErrorCode_Revision = 43 ,
262 OrthancPluginErrorCode_MainDicomTagsMultiplyDefined = 44 ,
263 OrthancPluginErrorCode_ForbiddenAccess = 45 ,
264 OrthancPluginErrorCode_DuplicateResource = 46 ,
265 OrthancPluginErrorCode_IncompatibleConfigurations = 47 ,
266 OrthancPluginErrorCode_SQLiteNotOpened = 1000 ,
267 OrthancPluginErrorCode_SQLiteAlreadyOpened = 1001 ,
268 OrthancPluginErrorCode_SQLiteCannotOpen = 1002 ,
269 OrthancPluginErrorCode_SQLiteStatementAlreadyUsed = 1003 ,
270 OrthancPluginErrorCode_SQLiteExecute = 1004 ,
271 OrthancPluginErrorCode_SQLiteRollbackWithoutTransaction = 1005 ,
272 OrthancPluginErrorCode_SQLiteCommitWithoutTransaction = 1006 ,
273 OrthancPluginErrorCode_SQLiteRegisterFunction = 1007 ,
274 OrthancPluginErrorCode_SQLiteFlush = 1008 ,
275 OrthancPluginErrorCode_SQLiteCannotRun = 1009 ,
276 OrthancPluginErrorCode_SQLiteCannotStep = 1010 ,
277 OrthancPluginErrorCode_SQLiteBindOutOfRange = 1011 ,
278 OrthancPluginErrorCode_SQLitePrepareStatement = 1012 ,
279 OrthancPluginErrorCode_SQLiteTransactionAlreadyStarted = 1013 ,
280 OrthancPluginErrorCode_SQLiteTransactionCommit = 1014 ,
281 OrthancPluginErrorCode_SQLiteTransactionBegin = 1015 ,
282 OrthancPluginErrorCode_DirectoryOverFile = 2000 ,
283 OrthancPluginErrorCode_FileStorageCannotWrite = 2001 ,
284 OrthancPluginErrorCode_DirectoryExpected = 2002 ,
285 OrthancPluginErrorCode_HttpPortInUse = 2003 ,
286 OrthancPluginErrorCode_DicomPortInUse = 2004 ,
287 OrthancPluginErrorCode_BadHttpStatusInRest = 2005 ,
288 OrthancPluginErrorCode_RegularFileExpected = 2006 ,
289 OrthancPluginErrorCode_PathToExecutable = 2007 ,
290 OrthancPluginErrorCode_MakeDirectory = 2008 ,
291 OrthancPluginErrorCode_BadApplicationEntityTitle = 2009 ,
292 OrthancPluginErrorCode_NoCFindHandler = 2010 ,
293 OrthancPluginErrorCode_NoCMoveHandler = 2011 ,
294 OrthancPluginErrorCode_NoCStoreHandler = 2012 ,
295 OrthancPluginErrorCode_NoApplicationEntityFilter = 2013 ,
296 OrthancPluginErrorCode_NoSopClassOrInstance = 2014 ,
297 OrthancPluginErrorCode_NoPresentationContext = 2015 ,
298 OrthancPluginErrorCode_DicomFindUnavailable = 2016 ,
299 OrthancPluginErrorCode_DicomMoveUnavailable = 2017 ,
300 OrthancPluginErrorCode_CannotStoreInstance = 2018 ,
301 OrthancPluginErrorCode_CreateDicomNotString = 2019 ,
302 OrthancPluginErrorCode_CreateDicomOverrideTag = 2020 ,
303 OrthancPluginErrorCode_CreateDicomUseContent = 2021 ,
304 OrthancPluginErrorCode_CreateDicomNoPayload = 2022 ,
305 OrthancPluginErrorCode_CreateDicomUseDataUriScheme = 2023 ,
306 OrthancPluginErrorCode_CreateDicomBadParent = 2024 ,
307 OrthancPluginErrorCode_CreateDicomParentIsInstance = 2025 ,
308 OrthancPluginErrorCode_CreateDicomParentEncoding = 2026 ,
309 OrthancPluginErrorCode_UnknownModality = 2027 ,
310 OrthancPluginErrorCode_BadJobOrdering = 2028 ,
311 OrthancPluginErrorCode_JsonToLuaTable = 2029 ,
312 OrthancPluginErrorCode_CannotCreateLua = 2030 ,
313 OrthancPluginErrorCode_CannotExecuteLua = 2031 ,
314 OrthancPluginErrorCode_LuaAlreadyExecuted = 2032 ,
315 OrthancPluginErrorCode_LuaBadOutput = 2033 ,
316 OrthancPluginErrorCode_NotLuaPredicate = 2034 ,
317 OrthancPluginErrorCode_LuaReturnsNoString = 2035 ,
318 OrthancPluginErrorCode_StorageAreaAlreadyRegistered = 2036 ,
319 OrthancPluginErrorCode_DatabaseBackendAlreadyRegistered = 2037 ,
320 OrthancPluginErrorCode_DatabaseNotInitialized = 2038 ,
321 OrthancPluginErrorCode_SslDisabled = 2039 ,
322 OrthancPluginErrorCode_CannotOrderSlices = 2040 ,
323 OrthancPluginErrorCode_NoWorklistHandler = 2041 ,
324 OrthancPluginErrorCode_AlreadyExistingTag = 2042 ,
325 OrthancPluginErrorCode_NoStorageCommitmentHandler = 2043 ,
326 OrthancPluginErrorCode_NoCGetHandler = 2044 ,
327 OrthancPluginErrorCode_DicomGetUnavailable = 2045 ,
328 OrthancPluginErrorCode_UnsupportedMediaType = 3000 ,
329
330 _OrthancPluginErrorCode_INTERNAL = 0x7fffffff
331 } OrthancPluginErrorCode;
332
333
338 ORTHANC_PLUGINS_API const char* OrthancPluginGetName();
339
340
344 typedef enum
345 {
346 OrthancPluginHttpMethod_Get = 1,
347 OrthancPluginHttpMethod_Post = 2,
348 OrthancPluginHttpMethod_Put = 3,
349 OrthancPluginHttpMethod_Delete = 4,
350
351 _OrthancPluginHttpMethod_INTERNAL = 0x7fffffff
352 } OrthancPluginHttpMethod;
353
354
359 typedef struct
360 {
364 OrthancPluginHttpMethod method;
365
369 uint32_t groupsCount;
370
374 const char* const* groups;
375
379 uint32_t getCount;
380
384 const char* const* getKeys;
385
389 const char* const* getValues;
390
394 const void* body;
395
399 uint32_t bodySize;
400
401
402 /* --------------------------------------------------
403 New in version 0.8.1
404 -------------------------------------------------- */
405
409 uint32_t headersCount;
410
414 const char* const* headersKeys;
415
419 const char* const* headersValues;
420
421 } OrthancPluginHttpRequest;
422
423
424 typedef enum
425 {
426 /* Generic services */
427 _OrthancPluginService_LogInfo = 1,
428 _OrthancPluginService_LogWarning = 2,
429 _OrthancPluginService_LogError = 3,
430 _OrthancPluginService_GetOrthancPath = 4,
431 _OrthancPluginService_GetOrthancDirectory = 5,
432 _OrthancPluginService_GetConfigurationPath = 6,
433 _OrthancPluginService_SetPluginProperty = 7,
434 _OrthancPluginService_GetGlobalProperty = 8,
435 _OrthancPluginService_SetGlobalProperty = 9,
436 _OrthancPluginService_GetCommandLineArgumentsCount = 10,
437 _OrthancPluginService_GetCommandLineArgument = 11,
438 _OrthancPluginService_GetExpectedDatabaseVersion = 12,
439 _OrthancPluginService_GetConfiguration = 13,
440 _OrthancPluginService_BufferCompression = 14,
441 _OrthancPluginService_ReadFile = 15,
442 _OrthancPluginService_WriteFile = 16,
443 _OrthancPluginService_GetErrorDescription = 17,
444 _OrthancPluginService_CallHttpClient = 18,
445 _OrthancPluginService_RegisterErrorCode = 19,
446 _OrthancPluginService_RegisterDictionaryTag = 20,
447 _OrthancPluginService_DicomBufferToJson = 21,
448 _OrthancPluginService_DicomInstanceToJson = 22,
449 _OrthancPluginService_CreateDicom = 23,
450 _OrthancPluginService_ComputeMd5 = 24,
451 _OrthancPluginService_ComputeSha1 = 25,
452 _OrthancPluginService_LookupDictionary = 26,
453 _OrthancPluginService_CallHttpClient2 = 27,
454 _OrthancPluginService_GenerateUuid = 28,
455 _OrthancPluginService_RegisterPrivateDictionaryTag = 29,
456 _OrthancPluginService_AutodetectMimeType = 30,
457 _OrthancPluginService_SetMetricsValue = 31,
458 _OrthancPluginService_EncodeDicomWebJson = 32,
459 _OrthancPluginService_EncodeDicomWebXml = 33,
460 _OrthancPluginService_ChunkedHttpClient = 34, /* New in Orthanc 1.5.7 */
461 _OrthancPluginService_GetTagName = 35, /* New in Orthanc 1.5.7 */
462 _OrthancPluginService_EncodeDicomWebJson2 = 36, /* New in Orthanc 1.7.0 */
463 _OrthancPluginService_EncodeDicomWebXml2 = 37, /* New in Orthanc 1.7.0 */
464 _OrthancPluginService_CreateMemoryBuffer = 38, /* New in Orthanc 1.7.0 */
465 _OrthancPluginService_GenerateRestApiAuthorizationToken = 39, /* New in Orthanc 1.8.1 */
466 _OrthancPluginService_CreateMemoryBuffer64 = 40, /* New in Orthanc 1.9.0 */
467 _OrthancPluginService_CreateDicom2 = 41, /* New in Orthanc 1.9.0 */
468 _OrthancPluginService_GetDatabaseServerIdentifier = 42, /* New in Orthanc 1.11.1 */
469 _OrthancPluginService_SetMetricsIntegerValue = 43, /* New in Orthanc 1.12.1 */
470 _OrthancPluginService_SetCurrentThreadName = 44, /* New in Orthanc 1.12.2 */
471 _OrthancPluginService_LogMessage = 45, /* New in Orthanc 1.12.4 */
472
473
474 /* Registration of callbacks */
475 _OrthancPluginService_RegisterRestCallback = 1000,
476 _OrthancPluginService_RegisterOnStoredInstanceCallback = 1001,
477 _OrthancPluginService_RegisterStorageArea = 1002,
478 _OrthancPluginService_RegisterOnChangeCallback = 1003,
479 _OrthancPluginService_RegisterRestCallbackNoLock = 1004,
480 _OrthancPluginService_RegisterWorklistCallback = 1005,
481 _OrthancPluginService_RegisterDecodeImageCallback = 1006,
482 _OrthancPluginService_RegisterIncomingHttpRequestFilter = 1007,
483 _OrthancPluginService_RegisterFindCallback = 1008,
484 _OrthancPluginService_RegisterMoveCallback = 1009,
485 _OrthancPluginService_RegisterIncomingHttpRequestFilter2 = 1010,
486 _OrthancPluginService_RegisterRefreshMetricsCallback = 1011,
487 _OrthancPluginService_RegisterChunkedRestCallback = 1012, /* New in Orthanc 1.5.7 */
488 _OrthancPluginService_RegisterStorageCommitmentScpCallback = 1013,
489 _OrthancPluginService_RegisterIncomingDicomInstanceFilter = 1014,
490 _OrthancPluginService_RegisterTranscoderCallback = 1015, /* New in Orthanc 1.7.0 */
491 _OrthancPluginService_RegisterStorageArea2 = 1016, /* New in Orthanc 1.9.0 */
492 _OrthancPluginService_RegisterIncomingCStoreInstanceFilter = 1017, /* New in Orthanc 1.10.0 */
493 _OrthancPluginService_RegisterReceivedInstanceCallback = 1018, /* New in Orthanc 1.10.0 */
494 _OrthancPluginService_RegisterWebDavCollection = 1019, /* New in Orthanc 1.10.1 */
495
496 /* Sending answers to REST calls */
497 _OrthancPluginService_AnswerBuffer = 2000,
498 _OrthancPluginService_CompressAndAnswerPngImage = 2001, /* Unused as of Orthanc 0.9.4 */
499 _OrthancPluginService_Redirect = 2002,
500 _OrthancPluginService_SendHttpStatusCode = 2003,
501 _OrthancPluginService_SendUnauthorized = 2004,
502 _OrthancPluginService_SendMethodNotAllowed = 2005,
503 _OrthancPluginService_SetCookie = 2006,
504 _OrthancPluginService_SetHttpHeader = 2007,
505 _OrthancPluginService_StartMultipartAnswer = 2008,
506 _OrthancPluginService_SendMultipartItem = 2009,
507 _OrthancPluginService_SendHttpStatus = 2010,
508 _OrthancPluginService_CompressAndAnswerImage = 2011,
509 _OrthancPluginService_SendMultipartItem2 = 2012,
510 _OrthancPluginService_SetHttpErrorDetails = 2013,
511 _OrthancPluginService_StartStreamAnswer = 2014,
512 _OrthancPluginService_SendStreamChunk = 2015,
513
514 /* Access to the Orthanc database and API */
515 _OrthancPluginService_GetDicomForInstance = 3000,
516 _OrthancPluginService_RestApiGet = 3001,
517 _OrthancPluginService_RestApiPost = 3002,
518 _OrthancPluginService_RestApiDelete = 3003,
519 _OrthancPluginService_RestApiPut = 3004,
520 _OrthancPluginService_LookupPatient = 3005,
521 _OrthancPluginService_LookupStudy = 3006,
522 _OrthancPluginService_LookupSeries = 3007,
523 _OrthancPluginService_LookupInstance = 3008,
524 _OrthancPluginService_LookupStudyWithAccessionNumber = 3009,
525 _OrthancPluginService_RestApiGetAfterPlugins = 3010,
526 _OrthancPluginService_RestApiPostAfterPlugins = 3011,
527 _OrthancPluginService_RestApiDeleteAfterPlugins = 3012,
528 _OrthancPluginService_RestApiPutAfterPlugins = 3013,
529 _OrthancPluginService_ReconstructMainDicomTags = 3014,
530 _OrthancPluginService_RestApiGet2 = 3015,
531 _OrthancPluginService_CallRestApi = 3016, /* New in Orthanc 1.9.2 */
532
533 /* Access to DICOM instances */
534 _OrthancPluginService_GetInstanceRemoteAet = 4000,
535 _OrthancPluginService_GetInstanceSize = 4001,
536 _OrthancPluginService_GetInstanceData = 4002,
537 _OrthancPluginService_GetInstanceJson = 4003,
538 _OrthancPluginService_GetInstanceSimplifiedJson = 4004,
539 _OrthancPluginService_HasInstanceMetadata = 4005,
540 _OrthancPluginService_GetInstanceMetadata = 4006,
541 _OrthancPluginService_GetInstanceOrigin = 4007,
542 _OrthancPluginService_GetInstanceTransferSyntaxUid = 4008,
543 _OrthancPluginService_HasInstancePixelData = 4009,
544 _OrthancPluginService_CreateDicomInstance = 4010, /* New in Orthanc 1.7.0 */
545 _OrthancPluginService_FreeDicomInstance = 4011, /* New in Orthanc 1.7.0 */
546 _OrthancPluginService_GetInstanceFramesCount = 4012, /* New in Orthanc 1.7.0 */
547 _OrthancPluginService_GetInstanceRawFrame = 4013, /* New in Orthanc 1.7.0 */
548 _OrthancPluginService_GetInstanceDecodedFrame = 4014, /* New in Orthanc 1.7.0 */
549 _OrthancPluginService_TranscodeDicomInstance = 4015, /* New in Orthanc 1.7.0 */
550 _OrthancPluginService_SerializeDicomInstance = 4016, /* New in Orthanc 1.7.0 */
551 _OrthancPluginService_GetInstanceAdvancedJson = 4017, /* New in Orthanc 1.7.0 */
552 _OrthancPluginService_GetInstanceDicomWebJson = 4018, /* New in Orthanc 1.7.0 */
553 _OrthancPluginService_GetInstanceDicomWebXml = 4019, /* New in Orthanc 1.7.0 */
554 _OrthancPluginService_LoadDicomInstance = 4020, /* New in Orthanc 1.12.1 */
555
556 /* Services for plugins implementing a database back-end */
557 _OrthancPluginService_RegisterDatabaseBackend = 5000, /* New in Orthanc 0.8.6 */
558 _OrthancPluginService_DatabaseAnswer = 5001,
559 _OrthancPluginService_RegisterDatabaseBackendV2 = 5002, /* New in Orthanc 0.9.4 */
560 _OrthancPluginService_StorageAreaCreate = 5003,
561 _OrthancPluginService_StorageAreaRead = 5004,
562 _OrthancPluginService_StorageAreaRemove = 5005,
563 _OrthancPluginService_RegisterDatabaseBackendV3 = 5006, /* New in Orthanc 1.9.2 */
564 _OrthancPluginService_RegisterDatabaseBackendV4 = 5007, /* New in Orthanc 1.12.0 */
565
566 /* Primitives for handling images */
567 _OrthancPluginService_GetImagePixelFormat = 6000,
568 _OrthancPluginService_GetImageWidth = 6001,
569 _OrthancPluginService_GetImageHeight = 6002,
570 _OrthancPluginService_GetImagePitch = 6003,
571 _OrthancPluginService_GetImageBuffer = 6004,
572 _OrthancPluginService_UncompressImage = 6005,
573 _OrthancPluginService_FreeImage = 6006,
574 _OrthancPluginService_CompressImage = 6007,
575 _OrthancPluginService_ConvertPixelFormat = 6008,
576 _OrthancPluginService_GetFontsCount = 6009,
577 _OrthancPluginService_GetFontInfo = 6010,
578 _OrthancPluginService_DrawText = 6011,
579 _OrthancPluginService_CreateImage = 6012,
580 _OrthancPluginService_CreateImageAccessor = 6013,
581 _OrthancPluginService_DecodeDicomImage = 6014,
582
583 /* Primitives for handling C-Find, C-Move and worklists */
584 _OrthancPluginService_WorklistAddAnswer = 7000,
585 _OrthancPluginService_WorklistMarkIncomplete = 7001,
586 _OrthancPluginService_WorklistIsMatch = 7002,
587 _OrthancPluginService_WorklistGetDicomQuery = 7003,
588 _OrthancPluginService_FindAddAnswer = 7004,
589 _OrthancPluginService_FindMarkIncomplete = 7005,
590 _OrthancPluginService_GetFindQuerySize = 7006,
591 _OrthancPluginService_GetFindQueryTag = 7007,
592 _OrthancPluginService_GetFindQueryTagName = 7008,
593 _OrthancPluginService_GetFindQueryValue = 7009,
594 _OrthancPluginService_CreateFindMatcher = 7010,
595 _OrthancPluginService_FreeFindMatcher = 7011,
596 _OrthancPluginService_FindMatcherIsMatch = 7012,
597
598 /* Primitives for accessing Orthanc Peers (new in 1.4.2) */
599 _OrthancPluginService_GetPeers = 8000,
600 _OrthancPluginService_FreePeers = 8001,
601 _OrthancPluginService_GetPeersCount = 8003,
602 _OrthancPluginService_GetPeerName = 8004,
603 _OrthancPluginService_GetPeerUrl = 8005,
604 _OrthancPluginService_CallPeerApi = 8006,
605 _OrthancPluginService_GetPeerUserProperty = 8007,
606
607 /* Primitives for handling jobs (new in 1.4.2) */
608 _OrthancPluginService_CreateJob = 9000, /* Deprecated since SDK 1.11.3 */
609 _OrthancPluginService_FreeJob = 9001,
610 _OrthancPluginService_SubmitJob = 9002,
611 _OrthancPluginService_RegisterJobsUnserializer = 9003,
612 _OrthancPluginService_CreateJob2 = 9004, /* New in SDK 1.11.3 */
613
614 _OrthancPluginService_INTERNAL = 0x7fffffff
615 } _OrthancPluginService;
616
617
618 typedef enum
619 {
620 _OrthancPluginProperty_Description = 1,
621 _OrthancPluginProperty_RootUri = 2,
622 _OrthancPluginProperty_OrthancExplorer = 3,
623
624 _OrthancPluginProperty_INTERNAL = 0x7fffffff
625 } _OrthancPluginProperty;
626
627
628
633 typedef enum
634 {
641 OrthancPluginPixelFormat_Grayscale8 = 1,
642
649 OrthancPluginPixelFormat_Grayscale16 = 2,
650
657 OrthancPluginPixelFormat_SignedGrayscale16 = 3,
658
665 OrthancPluginPixelFormat_RGB24 = 4,
666
673 OrthancPluginPixelFormat_RGBA32 = 5,
674
675 OrthancPluginPixelFormat_Unknown = 6,
676
683 OrthancPluginPixelFormat_RGB48 = 7,
684
691 OrthancPluginPixelFormat_Grayscale32 = 8,
692
699 OrthancPluginPixelFormat_Float32 = 9,
700
707 OrthancPluginPixelFormat_BGRA32 = 10,
708
715 OrthancPluginPixelFormat_Grayscale64 = 11,
716
717 _OrthancPluginPixelFormat_INTERNAL = 0x7fffffff
718 } OrthancPluginPixelFormat;
719
720
721
725 typedef enum
726 {
727 OrthancPluginContentType_Unknown = 0,
728 OrthancPluginContentType_Dicom = 1,
729 OrthancPluginContentType_DicomAsJson = 2,
730 OrthancPluginContentType_DicomUntilPixelData = 3,
731
732 _OrthancPluginContentType_INTERNAL = 0x7fffffff
733 } OrthancPluginContentType;
734
735
736
740 typedef enum
741 {
742 OrthancPluginResourceType_Patient = 0,
743 OrthancPluginResourceType_Study = 1,
744 OrthancPluginResourceType_Series = 2,
745 OrthancPluginResourceType_Instance = 3,
746 OrthancPluginResourceType_None = 4,
747
748 _OrthancPluginResourceType_INTERNAL = 0x7fffffff
749 } OrthancPluginResourceType;
750
751
752
758 typedef enum
759 {
760 OrthancPluginChangeType_CompletedSeries = 0,
761 OrthancPluginChangeType_Deleted = 1,
762 OrthancPluginChangeType_NewChildInstance = 2,
763 OrthancPluginChangeType_NewInstance = 3,
764 OrthancPluginChangeType_NewPatient = 4,
765 OrthancPluginChangeType_NewSeries = 5,
766 OrthancPluginChangeType_NewStudy = 6,
767 OrthancPluginChangeType_StablePatient = 7,
768 OrthancPluginChangeType_StableSeries = 8,
769 OrthancPluginChangeType_StableStudy = 9,
770 OrthancPluginChangeType_OrthancStarted = 10,
771 OrthancPluginChangeType_OrthancStopped = 11,
772 OrthancPluginChangeType_UpdatedAttachment = 12,
773 OrthancPluginChangeType_UpdatedMetadata = 13,
774 OrthancPluginChangeType_UpdatedPeers = 14,
775 OrthancPluginChangeType_UpdatedModalities = 15,
776 OrthancPluginChangeType_JobSubmitted = 16,
777 OrthancPluginChangeType_JobSuccess = 17,
778 OrthancPluginChangeType_JobFailure = 18,
779
780 _OrthancPluginChangeType_INTERNAL = 0x7fffffff
781 } OrthancPluginChangeType;
782
783
788 typedef enum
789 {
790 OrthancPluginCompressionType_Zlib = 0,
791 OrthancPluginCompressionType_ZlibWithSize = 1,
792 OrthancPluginCompressionType_Gzip = 2,
793 OrthancPluginCompressionType_GzipWithSize = 3,
794
795 _OrthancPluginCompressionType_INTERNAL = 0x7fffffff
796 } OrthancPluginCompressionType;
797
798
803 typedef enum
804 {
805 OrthancPluginImageFormat_Png = 0,
806 OrthancPluginImageFormat_Jpeg = 1,
807 OrthancPluginImageFormat_Dicom = 2,
808
809 _OrthancPluginImageFormat_INTERNAL = 0x7fffffff
810 } OrthancPluginImageFormat;
811
812
817 typedef enum
818 {
819 OrthancPluginValueRepresentation_AE = 1,
820 OrthancPluginValueRepresentation_AS = 2,
821 OrthancPluginValueRepresentation_AT = 3,
822 OrthancPluginValueRepresentation_CS = 4,
823 OrthancPluginValueRepresentation_DA = 5,
824 OrthancPluginValueRepresentation_DS = 6,
825 OrthancPluginValueRepresentation_DT = 7,
826 OrthancPluginValueRepresentation_FD = 8,
827 OrthancPluginValueRepresentation_FL = 9,
828 OrthancPluginValueRepresentation_IS = 10,
829 OrthancPluginValueRepresentation_LO = 11,
830 OrthancPluginValueRepresentation_LT = 12,
831 OrthancPluginValueRepresentation_OB = 13,
832 OrthancPluginValueRepresentation_OF = 14,
833 OrthancPluginValueRepresentation_OW = 15,
834 OrthancPluginValueRepresentation_PN = 16,
835 OrthancPluginValueRepresentation_SH = 17,
836 OrthancPluginValueRepresentation_SL = 18,
837 OrthancPluginValueRepresentation_SQ = 19,
838 OrthancPluginValueRepresentation_SS = 20,
839 OrthancPluginValueRepresentation_ST = 21,
840 OrthancPluginValueRepresentation_TM = 22,
841 OrthancPluginValueRepresentation_UI = 23,
842 OrthancPluginValueRepresentation_UL = 24,
843 OrthancPluginValueRepresentation_UN = 25,
844 OrthancPluginValueRepresentation_US = 26,
845 OrthancPluginValueRepresentation_UT = 27,
846
847 _OrthancPluginValueRepresentation_INTERNAL = 0x7fffffff
848 } OrthancPluginValueRepresentation;
849
850
856 typedef enum
857 {
858 OrthancPluginDicomToJsonFormat_Full = 1,
859 OrthancPluginDicomToJsonFormat_Short = 2,
860 OrthancPluginDicomToJsonFormat_Human = 3,
861
862 _OrthancPluginDicomToJsonFormat_INTERNAL = 0x7fffffff
863 } OrthancPluginDicomToJsonFormat;
864
865
871 typedef enum
872 {
873 OrthancPluginDicomToJsonFlags_None = 0,
874 OrthancPluginDicomToJsonFlags_IncludeBinary = (1 << 0),
875 OrthancPluginDicomToJsonFlags_IncludePrivateTags = (1 << 1),
876 OrthancPluginDicomToJsonFlags_IncludeUnknownTags = (1 << 2),
877 OrthancPluginDicomToJsonFlags_IncludePixelData = (1 << 3),
878 OrthancPluginDicomToJsonFlags_ConvertBinaryToAscii = (1 << 4),
879 OrthancPluginDicomToJsonFlags_ConvertBinaryToNull = (1 << 5),
880 OrthancPluginDicomToJsonFlags_StopAfterPixelData = (1 << 6),
881 OrthancPluginDicomToJsonFlags_SkipGroupLengths = (1 << 7),
882
883 _OrthancPluginDicomToJsonFlags_INTERNAL = 0x7fffffff
884 } OrthancPluginDicomToJsonFlags;
885
886
892 typedef enum
893 {
894 OrthancPluginCreateDicomFlags_None = 0,
895 OrthancPluginCreateDicomFlags_DecodeDataUriScheme = (1 << 0),
896 OrthancPluginCreateDicomFlags_GenerateIdentifiers = (1 << 1),
897
898 _OrthancPluginCreateDicomFlags_INTERNAL = 0x7fffffff
899 } OrthancPluginCreateDicomFlags;
900
901
907 typedef enum
908 {
909 OrthancPluginIdentifierConstraint_Equal = 1,
910 OrthancPluginIdentifierConstraint_SmallerOrEqual = 2,
911 OrthancPluginIdentifierConstraint_GreaterOrEqual = 3,
912 OrthancPluginIdentifierConstraint_Wildcard = 4,
913
914 _OrthancPluginIdentifierConstraint_INTERNAL = 0x7fffffff
915 } OrthancPluginIdentifierConstraint;
916
917
922 typedef enum
923 {
924 OrthancPluginConstraintType_Equal = 1,
925 OrthancPluginConstraintType_SmallerOrEqual = 2,
926 OrthancPluginConstraintType_GreaterOrEqual = 3,
927 OrthancPluginConstraintType_Wildcard = 4,
928 OrthancPluginConstraintType_List = 5,
929
930 _OrthancPluginConstraintType_INTERNAL = 0x7fffffff
931 } OrthancPluginConstraintType;
932
933
937 typedef enum
938 {
939 OrthancPluginInstanceOrigin_Unknown = 1,
940 OrthancPluginInstanceOrigin_DicomProtocol = 2,
941 OrthancPluginInstanceOrigin_RestApi = 3,
942 OrthancPluginInstanceOrigin_Plugin = 4,
943 OrthancPluginInstanceOrigin_Lua = 5,
944 OrthancPluginInstanceOrigin_WebDav = 6,
945
946 _OrthancPluginInstanceOrigin_INTERNAL = 0x7fffffff
947 } OrthancPluginInstanceOrigin;
948
949
953 typedef enum
954 {
955 OrthancPluginJobStepStatus_Success = 1,
956 OrthancPluginJobStepStatus_Failure = 2,
957 OrthancPluginJobStepStatus_Continue = 3
958 } OrthancPluginJobStepStatus;
959
960
967 typedef enum
968 {
969 OrthancPluginJobStopReason_Success = 1,
970 OrthancPluginJobStopReason_Paused = 2,
971 OrthancPluginJobStopReason_Failure = 3,
972 OrthancPluginJobStopReason_Canceled = 4
973 } OrthancPluginJobStopReason;
974
975
979 typedef enum
980 {
981 OrthancPluginMetricsType_Default = 0,
982
988 OrthancPluginMetricsType_Timer = 1
989 } OrthancPluginMetricsType;
990
991
996 typedef enum
997 {
998 OrthancPluginDicomWebBinaryMode_Ignore = 0,
999 OrthancPluginDicomWebBinaryMode_InlineBinary = 1,
1000 OrthancPluginDicomWebBinaryMode_BulkDataUri = 2
1001 } OrthancPluginDicomWebBinaryMode;
1002
1003
1009 typedef enum
1010 {
1014 OrthancPluginStorageCommitmentFailureReason_Success = 0,
1015
1019 OrthancPluginStorageCommitmentFailureReason_ProcessingFailure = 1,
1020
1025 OrthancPluginStorageCommitmentFailureReason_NoSuchObjectInstance = 2,
1026
1031 OrthancPluginStorageCommitmentFailureReason_ResourceLimitation = 3,
1032
1037 OrthancPluginStorageCommitmentFailureReason_ReferencedSOPClassNotSupported = 4,
1038
1044 OrthancPluginStorageCommitmentFailureReason_ClassInstanceConflict = 5,
1045
1050 OrthancPluginStorageCommitmentFailureReason_DuplicateTransactionUID = 6
1051 } OrthancPluginStorageCommitmentFailureReason;
1052
1053
1057 typedef enum
1058 {
1059 OrthancPluginReceivedInstanceAction_KeepAsIs = 1,
1060 OrthancPluginReceivedInstanceAction_Modify = 2,
1061 OrthancPluginReceivedInstanceAction_Discard = 3,
1062
1063 _OrthancPluginReceivedInstanceAction_INTERNAL = 0x7fffffff
1064 } OrthancPluginReceivedInstanceAction;
1065
1066
1071 typedef enum
1072 {
1076 OrthancPluginLoadDicomInstanceMode_WholeDicom = 1,
1077
1082 OrthancPluginLoadDicomInstanceMode_UntilPixelData = 2,
1083
1089 OrthancPluginLoadDicomInstanceMode_EmptyPixelData = 3,
1090
1091 _OrthancPluginLoadDicomInstanceMode_INTERNAL = 0x7fffffff
1092 } OrthancPluginLoadDicomInstanceMode;
1093
1094
1101 typedef enum
1102 {
1103 OrthancPluginLogLevel_Error = 0,
1104 OrthancPluginLogLevel_Warning = 1,
1105 OrthancPluginLogLevel_Info = 2,
1106 OrthancPluginLogLevel_Trace = 3,
1107
1108 _OrthancPluginLogLevel_INTERNAL = 0x7fffffff
1109 } OrthancPluginLogLevel;
1110
1111
1118 typedef enum
1119 {
1120 OrthancPluginLogCategory_Generic = (1 << 0),
1121 OrthancPluginLogCategory_Plugins = (1 << 1),
1122 OrthancPluginLogCategory_Http = (1 << 2),
1123 OrthancPluginLogCategory_Sqlite = (1 << 3),
1124 OrthancPluginLogCategory_Dicom = (1 << 4),
1125 OrthancPluginLogCategory_Jobs = (1 << 5),
1126 OrthancPluginLogCategory_Lua = (1 << 6),
1127
1128 _OrthancPluginLogCategory_INTERNAL = 0x7fffffff
1129 } OrthancPluginLogCategory;
1130
1131
1139 typedef struct
1140 {
1144 void* data;
1145
1149 uint32_t size;
1150 } OrthancPluginMemoryBuffer;
1151
1152
1153
1161 typedef struct
1162 {
1166 void* data;
1167
1171 uint64_t size;
1172 } OrthancPluginMemoryBuffer64;
1173
1174
1175
1176
1181 typedef struct _OrthancPluginRestOutput_t OrthancPluginRestOutput;
1182
1183
1184
1189 typedef struct _OrthancPluginDicomInstance_t OrthancPluginDicomInstance;
1190
1191
1192
1197 typedef struct _OrthancPluginImage_t OrthancPluginImage;
1198
1199
1200
1205 typedef struct _OrthancPluginStorageArea_t OrthancPluginStorageArea;
1206
1207
1208
1213 typedef struct _OrthancPluginWorklistQuery_t OrthancPluginWorklistQuery;
1214
1215
1216
1221 typedef struct _OrthancPluginWorklistAnswers_t OrthancPluginWorklistAnswers;
1222
1223
1224
1229 typedef struct _OrthancPluginFindQuery_t OrthancPluginFindQuery;
1230
1231
1232
1237 typedef struct _OrthancPluginFindAnswers_t OrthancPluginFindAnswers;
1238
1239
1240
1245 typedef struct _OrthancPluginFindMatcher_t OrthancPluginFindMatcher;
1246
1247
1248
1253 typedef struct _OrthancPluginPeers_t OrthancPluginPeers;
1254
1255
1256
1261 typedef struct _OrthancPluginJob_t OrthancPluginJob;
1262
1263
1264
1270 typedef struct _OrthancPluginDicomWebNode_t OrthancPluginDicomWebNode;
1271
1272
1273
1278 typedef OrthancPluginErrorCode (*OrthancPluginRestCallback) (
1279 OrthancPluginRestOutput* output,
1280 const char* url,
1281 const OrthancPluginHttpRequest* request);
1282
1283
1284
1289 typedef OrthancPluginErrorCode (*OrthancPluginOnStoredInstanceCallback) (
1290 const OrthancPluginDicomInstance* instance,
1291 const char* instanceId);
1292
1293
1294
1299 typedef OrthancPluginErrorCode (*OrthancPluginOnChangeCallback) (
1300 OrthancPluginChangeType changeType,
1301 OrthancPluginResourceType resourceType,
1302 const char* resourceId);
1303
1304
1305
1310 typedef OrthancPluginErrorCode (*OrthancPluginDecodeImageCallback) (
1311 OrthancPluginImage** target,
1312 const void* dicom,
1313 const uint32_t size,
1314 uint32_t frameIndex);
1315
1316
1317
1322 typedef void (*OrthancPluginFree) (void* buffer);
1323
1324
1325
1332 typedef void (*OrthancPluginDicomWebSetBinaryNode) (
1333 OrthancPluginDicomWebNode* node,
1334 OrthancPluginDicomWebBinaryMode mode,
1335 const char* bulkDataUri);
1336
1337
1338
1351 typedef OrthancPluginErrorCode (*OrthancPluginStorageCreate) (
1352 const char* uuid,
1353 const void* content,
1354 int64_t size,
1355 OrthancPluginContentType type);
1356
1357
1358
1378 typedef OrthancPluginErrorCode (*OrthancPluginStorageRead) (
1379 void** content,
1380 int64_t* size,
1381 const char* uuid,
1382 OrthancPluginContentType type);
1383
1384
1385
1398 typedef OrthancPluginErrorCode (*OrthancPluginStorageReadWhole) (
1399 OrthancPluginMemoryBuffer64* target,
1400 const char* uuid,
1401 OrthancPluginContentType type);
1402
1403
1404
1421 typedef OrthancPluginErrorCode (*OrthancPluginStorageReadRange) (
1422 OrthancPluginMemoryBuffer64* target,
1423 const char* uuid,
1424 OrthancPluginContentType type,
1425 uint64_t rangeStart);
1426
1427
1428
1439 typedef OrthancPluginErrorCode (*OrthancPluginStorageRemove) (
1440 const char* uuid,
1441 OrthancPluginContentType type);
1442
1443
1444
1458 typedef OrthancPluginErrorCode (*OrthancPluginWorklistCallback) (
1459 OrthancPluginWorklistAnswers* answers,
1460 const OrthancPluginWorklistQuery* query,
1461 const char* issuerAet,
1462 const char* calledAet);
1463
1464
1465
1489 typedef int32_t (*OrthancPluginIncomingHttpRequestFilter) (
1490 OrthancPluginHttpMethod method,
1491 const char* uri,
1492 const char* ip,
1493 uint32_t headersCount,
1494 const char* const* headersKeys,
1495 const char* const* headersValues);
1496
1497
1498
1524 typedef int32_t (*OrthancPluginIncomingHttpRequestFilter2) (
1525 OrthancPluginHttpMethod method,
1526 const char* uri,
1527 const char* ip,
1528 uint32_t headersCount,
1529 const char* const* headersKeys,
1530 const char* const* headersValues,
1531 uint32_t getArgumentsCount,
1532 const char* const* getArgumentsKeys,
1533 const char* const* getArgumentsValues);
1534
1535
1536
1551 typedef OrthancPluginErrorCode (*OrthancPluginFindCallback) (
1552 OrthancPluginFindAnswers* answers,
1553 const OrthancPluginFindQuery* query,
1554 const char* issuerAet,
1555 const char* calledAet);
1556
1557
1558
1594 typedef void* (*OrthancPluginMoveCallback) (
1595 OrthancPluginResourceType resourceType,
1596 const char* patientId,
1597 const char* accessionNumber,
1598 const char* studyInstanceUid,
1599 const char* seriesInstanceUid,
1600 const char* sopInstanceUid,
1601 const char* originatorAet,
1602 const char* sourceAet,
1603 const char* targetAet,
1604 uint16_t originatorId);
1605
1606
1619 typedef uint32_t (*OrthancPluginGetMoveSize) (void* moveDriver);
1620
1621
1634 typedef OrthancPluginErrorCode (*OrthancPluginApplyMove) (void* moveDriver);
1635
1636
1648 typedef void (*OrthancPluginFreeMove) (void* moveDriver);
1649
1650
1661 typedef void (*OrthancPluginJobFinalize) (void* job);
1662
1663
1674 typedef float (*OrthancPluginJobGetProgress) (void* job);
1675
1676
1690 typedef const char* (*OrthancPluginJobGetContent) (void* job);
1691
1692
1708 typedef OrthancPluginErrorCode (*OrthancPluginJobGetContent2) (OrthancPluginMemoryBuffer* target,
1709 void* job);
1710
1711
1728 typedef const char* (*OrthancPluginJobGetSerialized) (void* job);
1729
1730
1748 typedef int32_t (*OrthancPluginJobGetSerialized2) (OrthancPluginMemoryBuffer* target,
1749 void* job);
1750
1751
1764 typedef OrthancPluginJobStepStatus (*OrthancPluginJobStep) (void* job);
1765
1766
1788 typedef OrthancPluginErrorCode (*OrthancPluginJobStop) (void* job,
1789 OrthancPluginJobStopReason reason);
1790
1791
1805 typedef OrthancPluginErrorCode (*OrthancPluginJobReset) (void* job);
1806
1807
1821 typedef OrthancPluginJob* (*OrthancPluginJobsUnserializer) (const char* jobType,
1822 const char* serialized);
1823
1824
1825
1840 typedef void (*OrthancPluginRefreshMetricsCallback) ();
1841
1842
1843
1868 typedef void (*OrthancPluginDicomWebBinaryCallback) (
1869 OrthancPluginDicomWebNode* node,
1870 OrthancPluginDicomWebSetBinaryNode setter,
1871 uint32_t levelDepth,
1872 const uint16_t* levelTagGroup,
1873 const uint16_t* levelTagElement,
1874 const uint32_t* levelIndex,
1875 uint16_t tagGroup,
1876 uint16_t tagElement,
1877 OrthancPluginValueRepresentation vr);
1878
1879
1880
1906 typedef void (*OrthancPluginDicomWebBinaryCallback2) (
1907 OrthancPluginDicomWebNode* node,
1908 OrthancPluginDicomWebSetBinaryNode setter,
1909 uint32_t levelDepth,
1910 const uint16_t* levelTagGroup,
1911 const uint16_t* levelTagElement,
1912 const uint32_t* levelIndex,
1913 uint16_t tagGroup,
1914 uint16_t tagElement,
1915 OrthancPluginValueRepresentation vr,
1916 void* payload);
1917
1918
1919
1923 typedef struct _OrthancPluginContext_t
1924 {
1925 void* pluginsManager;
1926 const char* orthancVersion;
1927 OrthancPluginFree Free;
1928 OrthancPluginErrorCode (*InvokeService) (struct _OrthancPluginContext_t* context,
1929 _OrthancPluginService service,
1930 const void* params);
1931 } OrthancPluginContext;
1932
1933
1934
1938 typedef struct
1939 {
1940 uint16_t group;
1941 uint16_t element;
1942 OrthancPluginValueRepresentation vr;
1943 uint32_t minMultiplicity;
1944 uint32_t maxMultiplicity;
1945 } OrthancPluginDictionaryEntry;
1946
1947
1948
1957 ORTHANC_PLUGIN_INLINE void OrthancPluginFreeString(
1958 OrthancPluginContext* context,
1959 char* str)
1960 {
1961 if (str != NULL)
1962 {
1963 context->Free(str);
1964 }
1965 }
1966
1967
1987 ORTHANC_PLUGIN_INLINE int32_t OrthancPluginCheckVersionAdvanced(
1988 OrthancPluginContext* context,
1989 int32_t expectedMajor,
1990 int32_t expectedMinor,
1991 int32_t expectedRevision)
1992 {
1993 int32_t major, minor, revision;
1994
1995 if (sizeof(int) != sizeof(int32_t) || /* Ensure binary compatibility with Orthanc SDK <= 1.12.1 */
1996 sizeof(int32_t) != sizeof(OrthancPluginErrorCode) ||
1997 sizeof(int32_t) != sizeof(OrthancPluginHttpMethod) ||
1998 sizeof(int32_t) != sizeof(_OrthancPluginService) ||
1999 sizeof(int32_t) != sizeof(_OrthancPluginProperty) ||
2000 sizeof(int32_t) != sizeof(OrthancPluginPixelFormat) ||
2001 sizeof(int32_t) != sizeof(OrthancPluginContentType) ||
2002 sizeof(int32_t) != sizeof(OrthancPluginResourceType) ||
2003 sizeof(int32_t) != sizeof(OrthancPluginChangeType) ||
2004 sizeof(int32_t) != sizeof(OrthancPluginCompressionType) ||
2005 sizeof(int32_t) != sizeof(OrthancPluginImageFormat) ||
2006 sizeof(int32_t) != sizeof(OrthancPluginValueRepresentation) ||
2007 sizeof(int32_t) != sizeof(OrthancPluginDicomToJsonFormat) ||
2008 sizeof(int32_t) != sizeof(OrthancPluginDicomToJsonFlags) ||
2009 sizeof(int32_t) != sizeof(OrthancPluginCreateDicomFlags) ||
2010 sizeof(int32_t) != sizeof(OrthancPluginIdentifierConstraint) ||
2011 sizeof(int32_t) != sizeof(OrthancPluginInstanceOrigin) ||
2012 sizeof(int32_t) != sizeof(OrthancPluginJobStepStatus) ||
2013 sizeof(int32_t) != sizeof(OrthancPluginConstraintType) ||
2014 sizeof(int32_t) != sizeof(OrthancPluginMetricsType) ||
2015 sizeof(int32_t) != sizeof(OrthancPluginDicomWebBinaryMode) ||
2016 sizeof(int32_t) != sizeof(OrthancPluginStorageCommitmentFailureReason) ||
2017 sizeof(int32_t) != sizeof(OrthancPluginLoadDicomInstanceMode) ||
2018 sizeof(int32_t) != sizeof(OrthancPluginLogLevel) ||
2019 sizeof(int32_t) != sizeof(OrthancPluginLogCategory))
2020 {
2021 /* Mismatch in the size of the enumerations */
2022 return 0;
2023 }
2024
2025 /* Assume compatibility with the mainline */
2026 if (!strcmp(context->orthancVersion, "mainline"))
2027 {
2028 return 1;
2029 }
2030
2031 /* Parse the version of the Orthanc core */
2032 if (
2033#ifdef _MSC_VER
2034 sscanf_s
2035#else
2036 sscanf
2037#endif
2038 (context->orthancVersion, "%4d.%4d.%4d", &major, &minor, &revision) != 3)
2039 {
2040 return 0;
2041 }
2042
2043 /* Check the major number of the version */
2044
2045 if (major > expectedMajor)
2046 {
2047 return 1;
2048 }
2049
2050 if (major < expectedMajor)
2051 {
2052 return 0;
2053 }
2054
2055 /* Check the minor number of the version */
2056
2057 if (minor > expectedMinor)
2058 {
2059 return 1;
2060 }
2061
2062 if (minor < expectedMinor)
2063 {
2064 return 0;
2065 }
2066
2067 /* Check the revision number of the version */
2068
2069 if (revision >= expectedRevision)
2070 {
2071 return 1;
2072 }
2073 else
2074 {
2075 return 0;
2076 }
2077 }
2078
2079
2096 ORTHANC_PLUGIN_INLINE int32_t OrthancPluginCheckVersion(
2097 OrthancPluginContext* context)
2098 {
2099 return OrthancPluginCheckVersionAdvanced(
2100 context,
2101 ORTHANC_PLUGINS_MINIMAL_MAJOR_NUMBER,
2102 ORTHANC_PLUGINS_MINIMAL_MINOR_NUMBER,
2103 ORTHANC_PLUGINS_MINIMAL_REVISION_NUMBER);
2104 }
2105
2106
2115 ORTHANC_PLUGIN_INLINE void OrthancPluginFreeMemoryBuffer(
2116 OrthancPluginContext* context,
2117 OrthancPluginMemoryBuffer* buffer)
2118 {
2119 context->Free(buffer->data);
2120 }
2121
2122
2131 ORTHANC_PLUGIN_INLINE void OrthancPluginFreeMemoryBuffer64(
2132 OrthancPluginContext* context,
2133 OrthancPluginMemoryBuffer64* buffer)
2134 {
2135 context->Free(buffer->data);
2136 }
2137
2138
2147 ORTHANC_PLUGIN_INLINE void OrthancPluginLogError(
2148 OrthancPluginContext* context,
2149 const char* message)
2150 {
2151 context->InvokeService(context, _OrthancPluginService_LogError, message);
2152 }
2153
2154
2163 ORTHANC_PLUGIN_INLINE void OrthancPluginLogWarning(
2164 OrthancPluginContext* context,
2165 const char* message)
2166 {
2167 context->InvokeService(context, _OrthancPluginService_LogWarning, message);
2168 }
2169
2170
2179 ORTHANC_PLUGIN_INLINE void OrthancPluginLogInfo(
2180 OrthancPluginContext* context,
2181 const char* message)
2182 {
2183 context->InvokeService(context, _OrthancPluginService_LogInfo, message);
2184 }
2185
2186
2187
2188 typedef struct
2189 {
2190 const char* pathRegularExpression;
2191 OrthancPluginRestCallback callback;
2192 } _OrthancPluginRestCallback;
2193
2215 ORTHANC_PLUGIN_INLINE void OrthancPluginRegisterRestCallback(
2216 OrthancPluginContext* context,
2217 const char* pathRegularExpression,
2218 OrthancPluginRestCallback callback)
2219 {
2220 _OrthancPluginRestCallback params;
2221 params.pathRegularExpression = pathRegularExpression;
2222 params.callback = callback;
2223 context->InvokeService(context, _OrthancPluginService_RegisterRestCallback, &params);
2224 }
2225
2226
2227
2255 ORTHANC_PLUGIN_INLINE void OrthancPluginRegisterRestCallbackNoLock(
2256 OrthancPluginContext* context,
2257 const char* pathRegularExpression,
2258 OrthancPluginRestCallback callback)
2259 {
2260 _OrthancPluginRestCallback params;
2261 params.pathRegularExpression = pathRegularExpression;
2262 params.callback = callback;
2263 context->InvokeService(context, _OrthancPluginService_RegisterRestCallbackNoLock, &params);
2264 }
2265
2266
2267
2268 typedef struct
2269 {
2270 OrthancPluginOnStoredInstanceCallback callback;
2271 } _OrthancPluginOnStoredInstanceCallback;
2272
2293 ORTHANC_PLUGIN_INLINE void OrthancPluginRegisterOnStoredInstanceCallback(
2294 OrthancPluginContext* context,
2295 OrthancPluginOnStoredInstanceCallback callback)
2296 {
2297 _OrthancPluginOnStoredInstanceCallback params;
2298 params.callback = callback;
2299
2300 context->InvokeService(context, _OrthancPluginService_RegisterOnStoredInstanceCallback, &params);
2301 }
2302
2303
2304
2305 typedef struct
2306 {
2307 OrthancPluginRestOutput* output;
2308 const void* answer;
2309 uint32_t answerSize;
2310 const char* mimeType;
2311 } _OrthancPluginAnswerBuffer;
2312
2325 ORTHANC_PLUGIN_INLINE void OrthancPluginAnswerBuffer(
2326 OrthancPluginContext* context,
2327 OrthancPluginRestOutput* output,
2328 const void* answer,
2329 uint32_t answerSize,
2330 const char* mimeType)
2331 {
2332 _OrthancPluginAnswerBuffer params;
2333 params.output = output;
2334 params.answer = answer;
2335 params.answerSize = answerSize;
2336 params.mimeType = mimeType;
2337 context->InvokeService(context, _OrthancPluginService_AnswerBuffer, &params);
2338 }
2339
2340
2341 typedef struct
2342 {
2343 OrthancPluginRestOutput* output;
2344 OrthancPluginPixelFormat format;
2345 uint32_t width;
2346 uint32_t height;
2347 uint32_t pitch;
2348 const void* buffer;
2349 } _OrthancPluginCompressAndAnswerPngImage;
2350
2351 typedef struct
2352 {
2353 OrthancPluginRestOutput* output;
2354 OrthancPluginImageFormat imageFormat;
2355 OrthancPluginPixelFormat pixelFormat;
2356 uint32_t width;
2357 uint32_t height;
2358 uint32_t pitch;
2359 const void* buffer;
2360 uint8_t quality;
2361 } _OrthancPluginCompressAndAnswerImage;
2362
2363
2382 ORTHANC_PLUGIN_INLINE void OrthancPluginCompressAndAnswerPngImage(
2383 OrthancPluginContext* context,
2384 OrthancPluginRestOutput* output,
2385 OrthancPluginPixelFormat format,
2386 uint32_t width,
2387 uint32_t height,
2388 uint32_t pitch,
2389 const void* buffer)
2390 {
2391 _OrthancPluginCompressAndAnswerImage params;
2392 params.output = output;
2393 params.imageFormat = OrthancPluginImageFormat_Png;
2394 params.pixelFormat = format;
2395 params.width = width;
2396 params.height = height;
2397 params.pitch = pitch;
2398 params.buffer = buffer;
2399 params.quality = 0; /* No quality for PNG */
2400 context->InvokeService(context, _OrthancPluginService_CompressAndAnswerImage, &params);
2401 }
2402
2403
2404
2405 typedef struct
2406 {
2407 OrthancPluginMemoryBuffer* target;
2408 const char* instanceId;
2409 } _OrthancPluginGetDicomForInstance;
2410
2423 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginGetDicomForInstance(
2424 OrthancPluginContext* context,
2425 OrthancPluginMemoryBuffer* target,
2426 const char* instanceId)
2427 {
2428 _OrthancPluginGetDicomForInstance params;
2429 params.target = target;
2430 params.instanceId = instanceId;
2431 return context->InvokeService(context, _OrthancPluginService_GetDicomForInstance, &params);
2432 }
2433
2434
2435
2436 typedef struct
2437 {
2438 OrthancPluginMemoryBuffer* target;
2439 const char* uri;
2440 } _OrthancPluginRestApiGet;
2441
2456 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRestApiGet(
2457 OrthancPluginContext* context,
2458 OrthancPluginMemoryBuffer* target,
2459 const char* uri)
2460 {
2461 _OrthancPluginRestApiGet params;
2462 params.target = target;
2463 params.uri = uri;
2464 return context->InvokeService(context, _OrthancPluginService_RestApiGet, &params);
2465 }
2466
2467
2468
2486 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRestApiGetAfterPlugins(
2487 OrthancPluginContext* context,
2488 OrthancPluginMemoryBuffer* target,
2489 const char* uri)
2490 {
2491 _OrthancPluginRestApiGet params;
2492 params.target = target;
2493 params.uri = uri;
2494 return context->InvokeService(context, _OrthancPluginService_RestApiGetAfterPlugins, &params);
2495 }
2496
2497
2498
2499 typedef struct
2500 {
2501 OrthancPluginMemoryBuffer* target;
2502 const char* uri;
2503 const void* body;
2504 uint32_t bodySize;
2505 } _OrthancPluginRestApiPostPut;
2506
2523 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRestApiPost(
2524 OrthancPluginContext* context,
2525 OrthancPluginMemoryBuffer* target,
2526 const char* uri,
2527 const void* body,
2528 uint32_t bodySize)
2529 {
2530 _OrthancPluginRestApiPostPut params;
2531 params.target = target;
2532 params.uri = uri;
2533 params.body = body;
2534 params.bodySize = bodySize;
2535 return context->InvokeService(context, _OrthancPluginService_RestApiPost, &params);
2536 }
2537
2538
2558 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRestApiPostAfterPlugins(
2559 OrthancPluginContext* context,
2560 OrthancPluginMemoryBuffer* target,
2561 const char* uri,
2562 const void* body,
2563 uint32_t bodySize)
2564 {
2565 _OrthancPluginRestApiPostPut params;
2566 params.target = target;
2567 params.uri = uri;
2568 params.body = body;
2569 params.bodySize = bodySize;
2570 return context->InvokeService(context, _OrthancPluginService_RestApiPostAfterPlugins, &params);
2571 }
2572
2573
2574
2587 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRestApiDelete(
2588 OrthancPluginContext* context,
2589 const char* uri)
2590 {
2591 return context->InvokeService(context, _OrthancPluginService_RestApiDelete, uri);
2592 }
2593
2594
2610 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRestApiDeleteAfterPlugins(
2611 OrthancPluginContext* context,
2612 const char* uri)
2613 {
2614 return context->InvokeService(context, _OrthancPluginService_RestApiDeleteAfterPlugins, uri);
2615 }
2616
2617
2618
2635 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRestApiPut(
2636 OrthancPluginContext* context,
2637 OrthancPluginMemoryBuffer* target,
2638 const char* uri,
2639 const void* body,
2640 uint32_t bodySize)
2641 {
2642 _OrthancPluginRestApiPostPut params;
2643 params.target = target;
2644 params.uri = uri;
2645 params.body = body;
2646 params.bodySize = bodySize;
2647 return context->InvokeService(context, _OrthancPluginService_RestApiPut, &params);
2648 }
2649
2650
2651
2671 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRestApiPutAfterPlugins(
2672 OrthancPluginContext* context,
2673 OrthancPluginMemoryBuffer* target,
2674 const char* uri,
2675 const void* body,
2676 uint32_t bodySize)
2677 {
2678 _OrthancPluginRestApiPostPut params;
2679 params.target = target;
2680 params.uri = uri;
2681 params.body = body;
2682 params.bodySize = bodySize;
2683 return context->InvokeService(context, _OrthancPluginService_RestApiPutAfterPlugins, &params);
2684 }
2685
2686
2687
2688 typedef struct
2689 {
2690 OrthancPluginRestOutput* output;
2691 const char* argument;
2692 } _OrthancPluginOutputPlusArgument;
2693
2705 ORTHANC_PLUGIN_INLINE void OrthancPluginRedirect(
2706 OrthancPluginContext* context,
2707 OrthancPluginRestOutput* output,
2708 const char* redirection)
2709 {
2710 _OrthancPluginOutputPlusArgument params;
2711 params.output = output;
2712 params.argument = redirection;
2713 context->InvokeService(context, _OrthancPluginService_Redirect, &params);
2714 }
2715
2716
2717
2718 typedef struct
2719 {
2720 char** result;
2721 const char* argument;
2722 } _OrthancPluginRetrieveDynamicString;
2723
2737 ORTHANC_PLUGIN_INLINE char* OrthancPluginLookupPatient(
2738 OrthancPluginContext* context,
2739 const char* patientID)
2740 {
2741 char* result;
2742
2743 _OrthancPluginRetrieveDynamicString params;
2744 params.result = &result;
2745 params.argument = patientID;
2746
2747 if (context->InvokeService(context, _OrthancPluginService_LookupPatient, &params) != OrthancPluginErrorCode_Success)
2748 {
2749 /* Error */
2750 return NULL;
2751 }
2752 else
2753 {
2754 return result;
2755 }
2756 }
2757
2758
2772 ORTHANC_PLUGIN_INLINE char* OrthancPluginLookupStudy(
2773 OrthancPluginContext* context,
2774 const char* studyUID)
2775 {
2776 char* result;
2777
2778 _OrthancPluginRetrieveDynamicString params;
2779 params.result = &result;
2780 params.argument = studyUID;
2781
2782 if (context->InvokeService(context, _OrthancPluginService_LookupStudy, &params) != OrthancPluginErrorCode_Success)
2783 {
2784 /* Error */
2785 return NULL;
2786 }
2787 else
2788 {
2789 return result;
2790 }
2791 }
2792
2793
2807 ORTHANC_PLUGIN_INLINE char* OrthancPluginLookupStudyWithAccessionNumber(
2808 OrthancPluginContext* context,
2809 const char* accessionNumber)
2810 {
2811 char* result;
2812
2813 _OrthancPluginRetrieveDynamicString params;
2814 params.result = &result;
2815 params.argument = accessionNumber;
2816
2817 if (context->InvokeService(context, _OrthancPluginService_LookupStudyWithAccessionNumber, &params) != OrthancPluginErrorCode_Success)
2818 {
2819 /* Error */
2820 return NULL;
2821 }
2822 else
2823 {
2824 return result;
2825 }
2826 }
2827
2828
2842 ORTHANC_PLUGIN_INLINE char* OrthancPluginLookupSeries(
2843 OrthancPluginContext* context,
2844 const char* seriesUID)
2845 {
2846 char* result;
2847
2848 _OrthancPluginRetrieveDynamicString params;
2849 params.result = &result;
2850 params.argument = seriesUID;
2851
2852 if (context->InvokeService(context, _OrthancPluginService_LookupSeries, &params) != OrthancPluginErrorCode_Success)
2853 {
2854 /* Error */
2855 return NULL;
2856 }
2857 else
2858 {
2859 return result;
2860 }
2861 }
2862
2863
2877 ORTHANC_PLUGIN_INLINE char* OrthancPluginLookupInstance(
2878 OrthancPluginContext* context,
2879 const char* sopInstanceUID)
2880 {
2881 char* result;
2882
2883 _OrthancPluginRetrieveDynamicString params;
2884 params.result = &result;
2885 params.argument = sopInstanceUID;
2886
2887 if (context->InvokeService(context, _OrthancPluginService_LookupInstance, &params) != OrthancPluginErrorCode_Success)
2888 {
2889 /* Error */
2890 return NULL;
2891 }
2892 else
2893 {
2894 return result;
2895 }
2896 }
2897
2898
2899
2900 typedef struct
2901 {
2902 OrthancPluginRestOutput* output;
2903 uint16_t status;
2904 } _OrthancPluginSendHttpStatusCode;
2905
2922 ORTHANC_PLUGIN_INLINE void OrthancPluginSendHttpStatusCode(
2923 OrthancPluginContext* context,
2924 OrthancPluginRestOutput* output,
2925 uint16_t status)
2926 {
2927 _OrthancPluginSendHttpStatusCode params;
2928 params.output = output;
2929 params.status = status;
2930 context->InvokeService(context, _OrthancPluginService_SendHttpStatusCode, &params);
2931 }
2932
2933
2945 ORTHANC_PLUGIN_INLINE void OrthancPluginSendUnauthorized(
2946 OrthancPluginContext* context,
2947 OrthancPluginRestOutput* output,
2948 const char* realm)
2949 {
2950 _OrthancPluginOutputPlusArgument params;
2951 params.output = output;
2952 params.argument = realm;
2953 context->InvokeService(context, _OrthancPluginService_SendUnauthorized, &params);
2954 }
2955
2956
2968 ORTHANC_PLUGIN_INLINE void OrthancPluginSendMethodNotAllowed(
2969 OrthancPluginContext* context,
2970 OrthancPluginRestOutput* output,
2971 const char* allowedMethods)
2972 {
2973 _OrthancPluginOutputPlusArgument params;
2974 params.output = output;
2975 params.argument = allowedMethods;
2976 context->InvokeService(context, _OrthancPluginService_SendMethodNotAllowed, &params);
2977 }
2978
2979
2980 typedef struct
2981 {
2982 OrthancPluginRestOutput* output;
2983 const char* key;
2984 const char* value;
2985 } _OrthancPluginSetHttpHeader;
2986
2998 ORTHANC_PLUGIN_INLINE void OrthancPluginSetCookie(
2999 OrthancPluginContext* context,
3000 OrthancPluginRestOutput* output,
3001 const char* cookie,
3002 const char* value)
3003 {
3004 _OrthancPluginSetHttpHeader params;
3005 params.output = output;
3006 params.key = cookie;
3007 params.value = value;
3008 context->InvokeService(context, _OrthancPluginService_SetCookie, &params);
3009 }
3010
3011
3023 ORTHANC_PLUGIN_INLINE void OrthancPluginSetHttpHeader(
3024 OrthancPluginContext* context,
3025 OrthancPluginRestOutput* output,
3026 const char* key,
3027 const char* value)
3028 {
3029 _OrthancPluginSetHttpHeader params;
3030 params.output = output;
3031 params.key = key;
3032 params.value = value;
3033 context->InvokeService(context, _OrthancPluginService_SetHttpHeader, &params);
3034 }
3035
3036
3037 typedef struct
3038 {
3039 char** resultStringToFree;
3040 const char** resultString;
3041 int64_t* resultInt64;
3042 const char* key;
3043 const OrthancPluginDicomInstance* instance;
3044 OrthancPluginInstanceOrigin* resultOrigin; /* New in Orthanc 0.9.5 SDK */
3045 } _OrthancPluginAccessDicomInstance;
3046
3047
3059 ORTHANC_PLUGIN_INLINE const char* OrthancPluginGetInstanceRemoteAet(
3060 OrthancPluginContext* context,
3061 const OrthancPluginDicomInstance* instance)
3062 {
3063 const char* result;
3064
3065 _OrthancPluginAccessDicomInstance params;
3066 memset(&params, 0, sizeof(params));
3067 params.resultString = &result;
3068 params.instance = instance;
3069
3070 if (context->InvokeService(context, _OrthancPluginService_GetInstanceRemoteAet, &params) != OrthancPluginErrorCode_Success)
3071 {
3072 /* Error */
3073 return NULL;
3074 }
3075 else
3076 {
3077 return result;
3078 }
3079 }
3080
3081
3092 ORTHANC_PLUGIN_INLINE int64_t OrthancPluginGetInstanceSize(
3093 OrthancPluginContext* context,
3094 const OrthancPluginDicomInstance* instance)
3095 {
3096 int64_t size;
3097
3098 _OrthancPluginAccessDicomInstance params;
3099 memset(&params, 0, sizeof(params));
3100 params.resultInt64 = &size;
3101 params.instance = instance;
3102
3103 if (context->InvokeService(context, _OrthancPluginService_GetInstanceSize, &params) != OrthancPluginErrorCode_Success)
3104 {
3105 /* Error */
3106 return -1;
3107 }
3108 else
3109 {
3110 return size;
3111 }
3112 }
3113
3114
3125 ORTHANC_PLUGIN_INLINE const void* OrthancPluginGetInstanceData(
3126 OrthancPluginContext* context,
3127 const OrthancPluginDicomInstance* instance)
3128 {
3129 const char* result;
3130
3131 _OrthancPluginAccessDicomInstance params;
3132 memset(&params, 0, sizeof(params));
3133 params.resultString = &result;
3134 params.instance = instance;
3135
3136 if (context->InvokeService(context, _OrthancPluginService_GetInstanceData, &params) != OrthancPluginErrorCode_Success)
3137 {
3138 /* Error */
3139 return NULL;
3140 }
3141 else
3142 {
3143 return result;
3144 }
3145 }
3146
3147
3161 ORTHANC_PLUGIN_INLINE char* OrthancPluginGetInstanceJson(
3162 OrthancPluginContext* context,
3163 const OrthancPluginDicomInstance* instance)
3164 {
3165 char* result;
3166
3167 _OrthancPluginAccessDicomInstance params;
3168 memset(&params, 0, sizeof(params));
3169 params.resultStringToFree = &result;
3170 params.instance = instance;
3171
3172 if (context->InvokeService(context, _OrthancPluginService_GetInstanceJson, &params) != OrthancPluginErrorCode_Success)
3173 {
3174 /* Error */
3175 return NULL;
3176 }
3177 else
3178 {
3179 return result;
3180 }
3181 }
3182
3183
3199 ORTHANC_PLUGIN_INLINE char* OrthancPluginGetInstanceSimplifiedJson(
3200 OrthancPluginContext* context,
3201 const OrthancPluginDicomInstance* instance)
3202 {
3203 char* result;
3204
3205 _OrthancPluginAccessDicomInstance params;
3206 memset(&params, 0, sizeof(params));
3207 params.resultStringToFree = &result;
3208 params.instance = instance;
3209
3210 if (context->InvokeService(context, _OrthancPluginService_GetInstanceSimplifiedJson, &params) != OrthancPluginErrorCode_Success)
3211 {
3212 /* Error */
3213 return NULL;
3214 }
3215 else
3216 {
3217 return result;
3218 }
3219 }
3220
3221
3238 ORTHANC_PLUGIN_INLINE int32_t OrthancPluginHasInstanceMetadata(
3239 OrthancPluginContext* context,
3240 const OrthancPluginDicomInstance* instance,
3241 const char* metadata)
3242 {
3243 int64_t result;
3244
3245 _OrthancPluginAccessDicomInstance params;
3246 memset(&params, 0, sizeof(params));
3247 params.resultInt64 = &result;
3248 params.instance = instance;
3249 params.key = metadata;
3250
3251 if (context->InvokeService(context, _OrthancPluginService_HasInstanceMetadata, &params) != OrthancPluginErrorCode_Success)
3252 {
3253 /* Error */
3254 return -1;
3255 }
3256 else
3257 {
3258 return (result != 0);
3259 }
3260 }
3261
3262
3279 ORTHANC_PLUGIN_INLINE const char* OrthancPluginGetInstanceMetadata(
3280 OrthancPluginContext* context,
3281 const OrthancPluginDicomInstance* instance,
3282 const char* metadata)
3283 {
3284 const char* result;
3285
3286 _OrthancPluginAccessDicomInstance params;
3287 memset(&params, 0, sizeof(params));
3288 params.resultString = &result;
3289 params.instance = instance;
3290 params.key = metadata;
3291
3292 if (context->InvokeService(context, _OrthancPluginService_GetInstanceMetadata, &params) != OrthancPluginErrorCode_Success)
3293 {
3294 /* Error */
3295 return NULL;
3296 }
3297 else
3298 {
3299 return result;
3300 }
3301 }
3302
3303
3304
3305 typedef struct
3306 {
3307 OrthancPluginStorageCreate create;
3308 OrthancPluginStorageRead read;
3309 OrthancPluginStorageRemove remove;
3310 OrthancPluginFree free;
3311 } _OrthancPluginRegisterStorageArea;
3312
3328 ORTHANC_PLUGIN_DEPRECATED ORTHANC_PLUGIN_INLINE void OrthancPluginRegisterStorageArea(
3329 OrthancPluginContext* context,
3330 OrthancPluginStorageCreate create,
3331 OrthancPluginStorageRead read,
3332 OrthancPluginStorageRemove remove)
3333 {
3334 _OrthancPluginRegisterStorageArea params;
3335 params.create = create;
3336 params.read = read;
3337 params.remove = remove;
3338
3339#ifdef __cplusplus
3340 params.free = ::free;
3341#else
3342 params.free = free;
3343#endif
3344
3345 context->InvokeService(context, _OrthancPluginService_RegisterStorageArea, &params);
3346 }
3347
3348
3349
3360 ORTHANC_PLUGIN_INLINE char *OrthancPluginGetOrthancPath(OrthancPluginContext* context)
3361 {
3362 char* result;
3363
3364 _OrthancPluginRetrieveDynamicString params;
3365 params.result = &result;
3366 params.argument = NULL;
3367
3368 if (context->InvokeService(context, _OrthancPluginService_GetOrthancPath, &params) != OrthancPluginErrorCode_Success)
3369 {
3370 /* Error */
3371 return NULL;
3372 }
3373 else
3374 {
3375 return result;
3376 }
3377 }
3378
3379
3390 ORTHANC_PLUGIN_INLINE char *OrthancPluginGetOrthancDirectory(OrthancPluginContext* context)
3391 {
3392 char* result;
3393
3394 _OrthancPluginRetrieveDynamicString params;
3395 params.result = &result;
3396 params.argument = NULL;
3397
3398 if (context->InvokeService(context, _OrthancPluginService_GetOrthancDirectory, &params) != OrthancPluginErrorCode_Success)
3399 {
3400 /* Error */
3401 return NULL;
3402 }
3403 else
3404 {
3405 return result;
3406 }
3407 }
3408
3409
3425 ORTHANC_PLUGIN_DEPRECATED ORTHANC_PLUGIN_INLINE char *OrthancPluginGetConfigurationPath(OrthancPluginContext* context)
3426 {
3427 char* result;
3428
3429 _OrthancPluginRetrieveDynamicString params;
3430 params.result = &result;
3431 params.argument = NULL;
3432
3433 if (context->InvokeService(context, _OrthancPluginService_GetConfigurationPath, &params) != OrthancPluginErrorCode_Success)
3434 {
3435 /* Error */
3436 return NULL;
3437 }
3438 else
3439 {
3440 return result;
3441 }
3442 }
3443
3444
3445
3446 typedef struct
3447 {
3448 OrthancPluginOnChangeCallback callback;
3449 } _OrthancPluginOnChangeCallback;
3450
3471 ORTHANC_PLUGIN_INLINE void OrthancPluginRegisterOnChangeCallback(
3472 OrthancPluginContext* context,
3473 OrthancPluginOnChangeCallback callback)
3474 {
3475 _OrthancPluginOnChangeCallback params;
3476 params.callback = callback;
3477
3478 context->InvokeService(context, _OrthancPluginService_RegisterOnChangeCallback, &params);
3479 }
3480
3481
3482
3483 typedef struct
3484 {
3485 const char* plugin;
3486 _OrthancPluginProperty property;
3487 const char* value;
3488 } _OrthancPluginSetPluginProperty;
3489
3490
3506 ORTHANC_PLUGIN_DEPRECATED ORTHANC_PLUGIN_INLINE void OrthancPluginSetRootUri(
3507 OrthancPluginContext* context,
3508 const char* uri)
3509 {
3510 _OrthancPluginSetPluginProperty params;
3511 params.plugin = OrthancPluginGetName();
3512 params.property = _OrthancPluginProperty_RootUri;
3513 params.value = uri;
3514
3515 context->InvokeService(context, _OrthancPluginService_SetPluginProperty, &params);
3516 }
3517
3518
3531 ORTHANC_PLUGIN_INLINE void OrthancPluginSetRootUri2(
3532 OrthancPluginContext* context,
3533 const char* plugin,
3534 const char* uri)
3535 {
3536 _OrthancPluginSetPluginProperty params;
3537 params.plugin = plugin;
3538 params.property = _OrthancPluginProperty_RootUri;
3539 params.value = uri;
3540
3541 context->InvokeService(context, _OrthancPluginService_SetPluginProperty, &params);
3542 }
3543
3544
3558 ORTHANC_PLUGIN_DEPRECATED ORTHANC_PLUGIN_INLINE void OrthancPluginSetDescription(
3559 OrthancPluginContext* context,
3560 const char* description)
3561 {
3562 _OrthancPluginSetPluginProperty params;
3563 params.plugin = OrthancPluginGetName();
3564 params.property = _OrthancPluginProperty_Description;
3565 params.value = description;
3566
3567 context->InvokeService(context, _OrthancPluginService_SetPluginProperty, &params);
3568 }
3569
3570
3581 ORTHANC_PLUGIN_INLINE void OrthancPluginSetDescription2(
3582 OrthancPluginContext* context,
3583 const char* plugin,
3584 const char* description)
3585 {
3586 _OrthancPluginSetPluginProperty params;
3587 params.plugin = plugin;
3588 params.property = _OrthancPluginProperty_Description;
3589 params.value = description;
3590
3591 context->InvokeService(context, _OrthancPluginService_SetPluginProperty, &params);
3592 }
3593
3594
3608 ORTHANC_PLUGIN_DEPRECATED ORTHANC_PLUGIN_INLINE void OrthancPluginExtendOrthancExplorer(
3609 OrthancPluginContext* context,
3610 const char* javascript)
3611 {
3612 _OrthancPluginSetPluginProperty params;
3613 params.plugin = OrthancPluginGetName();
3614 params.property = _OrthancPluginProperty_OrthancExplorer;
3615 params.value = javascript;
3616
3617 context->InvokeService(context, _OrthancPluginService_SetPluginProperty, &params);
3618 }
3619
3620
3631 ORTHANC_PLUGIN_INLINE void OrthancPluginExtendOrthancExplorer2(
3632 OrthancPluginContext* context,
3633 const char* plugin,
3634 const char* javascript)
3635 {
3636 _OrthancPluginSetPluginProperty params;
3637 params.plugin = plugin;
3638 params.property = _OrthancPluginProperty_OrthancExplorer;
3639 params.value = javascript;
3640
3641 context->InvokeService(context, _OrthancPluginService_SetPluginProperty, &params);
3642 }
3643
3644
3645 typedef struct
3646 {
3647 char** result;
3648 int32_t property;
3649 const char* value;
3650 } _OrthancPluginGlobalProperty;
3651
3652
3666 ORTHANC_PLUGIN_INLINE char* OrthancPluginGetGlobalProperty(
3667 OrthancPluginContext* context,
3668 int32_t property,
3669 const char* defaultValue)
3670 {
3671 char* result;
3672
3673 _OrthancPluginGlobalProperty params;
3674 params.result = &result;
3675 params.property = property;
3676 params.value = defaultValue;
3677
3678 if (context->InvokeService(context, _OrthancPluginService_GetGlobalProperty, &params) != OrthancPluginErrorCode_Success)
3679 {
3680 /* Error */
3681 return NULL;
3682 }
3683 else
3684 {
3685 return result;
3686 }
3687 }
3688
3689
3705 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginSetGlobalProperty(
3706 OrthancPluginContext* context,
3707 int32_t property,
3708 const char* value)
3709 {
3710 _OrthancPluginGlobalProperty params;
3711 params.result = NULL;
3712 params.property = property;
3713 params.value = value;
3714
3715 return context->InvokeService(context, _OrthancPluginService_SetGlobalProperty, &params);
3716 }
3717
3718
3719
3720 typedef struct
3721 {
3722 int32_t *resultInt32;
3723 uint32_t *resultUint32;
3724 int64_t *resultInt64;
3725 uint64_t *resultUint64;
3726 } _OrthancPluginReturnSingleValue;
3727
3736 ORTHANC_PLUGIN_INLINE uint32_t OrthancPluginGetCommandLineArgumentsCount(
3737 OrthancPluginContext* context)
3738 {
3739 uint32_t count = 0;
3740
3741 _OrthancPluginReturnSingleValue params;
3742 memset(&params, 0, sizeof(params));
3743 params.resultUint32 = &count;
3744
3745 if (context->InvokeService(context, _OrthancPluginService_GetCommandLineArgumentsCount, &params) != OrthancPluginErrorCode_Success)
3746 {
3747 /* Error */
3748 return 0;
3749 }
3750 else
3751 {
3752 return count;
3753 }
3754 }
3755
3756
3757
3770 ORTHANC_PLUGIN_INLINE char* OrthancPluginGetCommandLineArgument(
3771 OrthancPluginContext* context,
3772 uint32_t argument)
3773 {
3774 char* result;
3775
3776 _OrthancPluginGlobalProperty params;
3777 params.result = &result;
3778 params.property = (int32_t) argument;
3779 params.value = NULL;
3780
3781 if (context->InvokeService(context, _OrthancPluginService_GetCommandLineArgument, &params) != OrthancPluginErrorCode_Success)
3782 {
3783 /* Error */
3784 return NULL;
3785 }
3786 else
3787 {
3788 return result;
3789 }
3790 }
3791
3792
3802 ORTHANC_PLUGIN_INLINE uint32_t OrthancPluginGetExpectedDatabaseVersion(
3803 OrthancPluginContext* context)
3804 {
3805 uint32_t count = 0;
3806
3807 _OrthancPluginReturnSingleValue params;
3808 memset(&params, 0, sizeof(params));
3809 params.resultUint32 = &count;
3810
3811 if (context->InvokeService(context, _OrthancPluginService_GetExpectedDatabaseVersion, &params) != OrthancPluginErrorCode_Success)
3812 {
3813 /* Error */
3814 return 0;
3815 }
3816 else
3817 {
3818 return count;
3819 }
3820 }
3821
3822
3823
3835 ORTHANC_PLUGIN_INLINE char *OrthancPluginGetConfiguration(OrthancPluginContext* context)
3836 {
3837 char* result;
3838
3839 _OrthancPluginRetrieveDynamicString params;
3840 params.result = &result;
3841 params.argument = NULL;
3842
3843 if (context->InvokeService(context, _OrthancPluginService_GetConfiguration, &params) != OrthancPluginErrorCode_Success)
3844 {
3845 /* Error */
3846 return NULL;
3847 }
3848 else
3849 {
3850 return result;
3851 }
3852 }
3853
3854
3855
3856 typedef struct
3857 {
3858 OrthancPluginRestOutput* output;
3859 const char* subType;
3860 const char* contentType;
3861 } _OrthancPluginStartMultipartAnswer;
3862
3876 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginStartMultipartAnswer(
3877 OrthancPluginContext* context,
3878 OrthancPluginRestOutput* output,
3879 const char* subType,
3880 const char* contentType)
3881 {
3882 _OrthancPluginStartMultipartAnswer params;
3883 params.output = output;
3884 params.subType = subType;
3885 params.contentType = contentType;
3886 return context->InvokeService(context, _OrthancPluginService_StartMultipartAnswer, &params);
3887 }
3888
3889
3905 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginSendMultipartItem(
3906 OrthancPluginContext* context,
3907 OrthancPluginRestOutput* output,
3908 const void* answer,
3909 uint32_t answerSize)
3910 {
3911 _OrthancPluginAnswerBuffer params;
3912 params.output = output;
3913 params.answer = answer;
3914 params.answerSize = answerSize;
3915 params.mimeType = NULL;
3916 return context->InvokeService(context, _OrthancPluginService_SendMultipartItem, &params);
3917 }
3918
3919
3920
3921 typedef struct
3922 {
3923 OrthancPluginMemoryBuffer* target;
3924 const void* source;
3925 uint32_t size;
3926 OrthancPluginCompressionType compression;
3927 uint8_t uncompress;
3928 } _OrthancPluginBufferCompression;
3929
3930
3947 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginBufferCompression(
3948 OrthancPluginContext* context,
3949 OrthancPluginMemoryBuffer* target,
3950 const void* source,
3951 uint32_t size,
3952 OrthancPluginCompressionType compression,
3953 uint8_t uncompress)
3954 {
3955 _OrthancPluginBufferCompression params;
3956 params.target = target;
3957 params.source = source;
3958 params.size = size;
3959 params.compression = compression;
3960 params.uncompress = uncompress;
3961
3962 return context->InvokeService(context, _OrthancPluginService_BufferCompression, &params);
3963 }
3964
3965
3966
3967 typedef struct
3968 {
3969 OrthancPluginMemoryBuffer* target;
3970 const char* path;
3971 } _OrthancPluginReadFile;
3972
3984 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginReadFile(
3985 OrthancPluginContext* context,
3986 OrthancPluginMemoryBuffer* target,
3987 const char* path)
3988 {
3989 _OrthancPluginReadFile params;
3990 params.target = target;
3991 params.path = path;
3992 return context->InvokeService(context, _OrthancPluginService_ReadFile, &params);
3993 }
3994
3995
3996
3997 typedef struct
3998 {
3999 const char* path;
4000 const void* data;
4001 uint32_t size;
4002 } _OrthancPluginWriteFile;
4003
4015 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginWriteFile(
4016 OrthancPluginContext* context,
4017 const char* path,
4018 const void* data,
4019 uint32_t size)
4020 {
4021 _OrthancPluginWriteFile params;
4022 params.path = path;
4023 params.data = data;
4024 params.size = size;
4025 return context->InvokeService(context, _OrthancPluginService_WriteFile, &params);
4026 }
4027
4028
4029
4030 typedef struct
4031 {
4032 const char** target;
4033 OrthancPluginErrorCode error;
4034 } _OrthancPluginGetErrorDescription;
4035
4046 ORTHANC_PLUGIN_INLINE const char* OrthancPluginGetErrorDescription(
4047 OrthancPluginContext* context,
4048 OrthancPluginErrorCode error)
4049 {
4050 const char* result = NULL;
4051
4052 _OrthancPluginGetErrorDescription params;
4053 params.target = &result;
4054 params.error = error;
4055
4056 if (context->InvokeService(context, _OrthancPluginService_GetErrorDescription, &params) != OrthancPluginErrorCode_Success ||
4057 result == NULL)
4058 {
4059 return "Unknown error code";
4060 }
4061 else
4062 {
4063 return result;
4064 }
4065 }
4066
4067
4068
4069 typedef struct
4070 {
4071 OrthancPluginRestOutput* output;
4072 uint16_t status;
4073 const void* body;
4074 uint32_t bodySize;
4075 } _OrthancPluginSendHttpStatus;
4076
4099 ORTHANC_PLUGIN_INLINE void OrthancPluginSendHttpStatus(
4100 OrthancPluginContext* context,
4101 OrthancPluginRestOutput* output,
4102 uint16_t status,
4103 const void* body,
4104 uint32_t bodySize)
4105 {
4106 _OrthancPluginSendHttpStatus params;
4107 params.output = output;
4108 params.status = status;
4109 params.body = body;
4110 params.bodySize = bodySize;
4111 context->InvokeService(context, _OrthancPluginService_SendHttpStatus, &params);
4112 }
4113
4114
4115
4116 typedef struct
4117 {
4118 const OrthancPluginImage* image;
4119 uint32_t* resultUint32;
4120 OrthancPluginPixelFormat* resultPixelFormat;
4121 void** resultBuffer;
4122 } _OrthancPluginGetImageInfo;
4123
4124
4135 ORTHANC_PLUGIN_INLINE OrthancPluginPixelFormat OrthancPluginGetImagePixelFormat(
4136 OrthancPluginContext* context,
4137 const OrthancPluginImage* image)
4138 {
4139 OrthancPluginPixelFormat target;
4140
4141 _OrthancPluginGetImageInfo params;
4142 memset(&params, 0, sizeof(params));
4143 params.image = image;
4144 params.resultPixelFormat = &target;
4145
4146 if (context->InvokeService(context, _OrthancPluginService_GetImagePixelFormat, &params) != OrthancPluginErrorCode_Success)
4147 {
4148 return OrthancPluginPixelFormat_Unknown;
4149 }
4150 else
4151 {
4152 return (OrthancPluginPixelFormat) target;
4153 }
4154 }
4155
4156
4157
4168 ORTHANC_PLUGIN_INLINE uint32_t OrthancPluginGetImageWidth(
4169 OrthancPluginContext* context,
4170 const OrthancPluginImage* image)
4171 {
4172 uint32_t width;
4173
4174 _OrthancPluginGetImageInfo params;
4175 memset(&params, 0, sizeof(params));
4176 params.image = image;
4177 params.resultUint32 = &width;
4178
4179 if (context->InvokeService(context, _OrthancPluginService_GetImageWidth, &params) != OrthancPluginErrorCode_Success)
4180 {
4181 return 0;
4182 }
4183 else
4184 {
4185 return width;
4186 }
4187 }
4188
4189
4190
4201 ORTHANC_PLUGIN_INLINE uint32_t OrthancPluginGetImageHeight(
4202 OrthancPluginContext* context,
4203 const OrthancPluginImage* image)
4204 {
4205 uint32_t height;
4206
4207 _OrthancPluginGetImageInfo params;
4208 memset(&params, 0, sizeof(params));
4209 params.image = image;
4210 params.resultUint32 = &height;
4211
4212 if (context->InvokeService(context, _OrthancPluginService_GetImageHeight, &params) != OrthancPluginErrorCode_Success)
4213 {
4214 return 0;
4215 }
4216 else
4217 {
4218 return height;
4219 }
4220 }
4221
4222
4223
4236 ORTHANC_PLUGIN_INLINE uint32_t OrthancPluginGetImagePitch(
4237 OrthancPluginContext* context,
4238 const OrthancPluginImage* image)
4239 {
4240 uint32_t pitch;
4241
4242 _OrthancPluginGetImageInfo params;
4243 memset(&params, 0, sizeof(params));
4244 params.image = image;
4245 params.resultUint32 = &pitch;
4246
4247 if (context->InvokeService(context, _OrthancPluginService_GetImagePitch, &params) != OrthancPluginErrorCode_Success)
4248 {
4249 return 0;
4250 }
4251 else
4252 {
4253 return pitch;
4254 }
4255 }
4256
4257
4258
4270 ORTHANC_PLUGIN_INLINE void* OrthancPluginGetImageBuffer(
4271 OrthancPluginContext* context,
4272 const OrthancPluginImage* image)
4273 {
4274 void* target = NULL;
4275
4276 _OrthancPluginGetImageInfo params;
4277 memset(&params, 0, sizeof(params));
4278 params.resultBuffer = &target;
4279 params.image = image;
4280
4281 if (context->InvokeService(context, _OrthancPluginService_GetImageBuffer, &params) != OrthancPluginErrorCode_Success)
4282 {
4283 return NULL;
4284 }
4285 else
4286 {
4287 return target;
4288 }
4289 }
4290
4291
4292 typedef struct
4293 {
4294 OrthancPluginImage** target;
4295 const void* data;
4296 uint32_t size;
4297 OrthancPluginImageFormat format;
4298 } _OrthancPluginUncompressImage;
4299
4300
4313 ORTHANC_PLUGIN_INLINE OrthancPluginImage *OrthancPluginUncompressImage(
4314 OrthancPluginContext* context,
4315 const void* data,
4316 uint32_t size,
4317 OrthancPluginImageFormat format)
4318 {
4319 OrthancPluginImage* target = NULL;
4320
4321 _OrthancPluginUncompressImage params;
4322 memset(&params, 0, sizeof(params));
4323 params.target = &target;
4324 params.data = data;
4325 params.size = size;
4326 params.format = format;
4327
4328 if (context->InvokeService(context, _OrthancPluginService_UncompressImage, &params) != OrthancPluginErrorCode_Success)
4329 {
4330 return NULL;
4331 }
4332 else
4333 {
4334 return target;
4335 }
4336 }
4337
4338
4339
4340
4341 typedef struct
4342 {
4343 OrthancPluginImage* image;
4344 } _OrthancPluginFreeImage;
4345
4355 ORTHANC_PLUGIN_INLINE void OrthancPluginFreeImage(
4356 OrthancPluginContext* context,
4357 OrthancPluginImage* image)
4358 {
4359 _OrthancPluginFreeImage params;
4360 params.image = image;
4361
4362 context->InvokeService(context, _OrthancPluginService_FreeImage, &params);
4363 }
4364
4365
4366
4367
4368 typedef struct
4369 {
4370 OrthancPluginMemoryBuffer* target;
4371 OrthancPluginImageFormat imageFormat;
4372 OrthancPluginPixelFormat pixelFormat;
4373 uint32_t width;
4374 uint32_t height;
4375 uint32_t pitch;
4376 const void* buffer;
4377 uint8_t quality;
4378 } _OrthancPluginCompressImage;
4379
4380
4400 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginCompressPngImage(
4401 OrthancPluginContext* context,
4402 OrthancPluginMemoryBuffer* target,
4403 OrthancPluginPixelFormat format,
4404 uint32_t width,
4405 uint32_t height,
4406 uint32_t pitch,
4407 const void* buffer)
4408 {
4409 _OrthancPluginCompressImage params;
4410 memset(&params, 0, sizeof(params));
4411 params.target = target;
4412 params.imageFormat = OrthancPluginImageFormat_Png;
4413 params.pixelFormat = format;
4414 params.width = width;
4415 params.height = height;
4416 params.pitch = pitch;
4417 params.buffer = buffer;
4418 params.quality = 0; /* Unused for PNG */
4419
4420 return context->InvokeService(context, _OrthancPluginService_CompressImage, &params);
4421 }
4422
4423
4445 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginCompressJpegImage(
4446 OrthancPluginContext* context,
4447 OrthancPluginMemoryBuffer* target,
4448 OrthancPluginPixelFormat format,
4449 uint32_t width,
4450 uint32_t height,
4451 uint32_t pitch,
4452 const void* buffer,
4453 uint8_t quality)
4454 {
4455 _OrthancPluginCompressImage params;
4456 memset(&params, 0, sizeof(params));
4457 params.target = target;
4458 params.imageFormat = OrthancPluginImageFormat_Jpeg;
4459 params.pixelFormat = format;
4460 params.width = width;
4461 params.height = height;
4462 params.pitch = pitch;
4463 params.buffer = buffer;
4464 params.quality = quality;
4465
4466 return context->InvokeService(context, _OrthancPluginService_CompressImage, &params);
4467 }
4468
4469
4470
4492 ORTHANC_PLUGIN_INLINE void OrthancPluginCompressAndAnswerJpegImage(
4493 OrthancPluginContext* context,
4494 OrthancPluginRestOutput* output,
4495 OrthancPluginPixelFormat format,
4496 uint32_t width,
4497 uint32_t height,
4498 uint32_t pitch,
4499 const void* buffer,
4500 uint8_t quality)
4501 {
4502 _OrthancPluginCompressAndAnswerImage params;
4503 params.output = output;
4504 params.imageFormat = OrthancPluginImageFormat_Jpeg;
4505 params.pixelFormat = format;
4506 params.width = width;
4507 params.height = height;
4508 params.pitch = pitch;
4509 params.buffer = buffer;
4510 params.quality = quality;
4511 context->InvokeService(context, _OrthancPluginService_CompressAndAnswerImage, &params);
4512 }
4513
4514
4515
4516
4517 typedef struct
4518 {
4519 OrthancPluginMemoryBuffer* target;
4520 OrthancPluginHttpMethod method;
4521 const char* url;
4522 const char* username;
4523 const char* password;
4524 const void* body;
4525 uint32_t bodySize;
4526 } _OrthancPluginCallHttpClient;
4527
4528
4545 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginHttpGet(
4546 OrthancPluginContext* context,
4547 OrthancPluginMemoryBuffer* target,
4548 const char* url,
4549 const char* username,
4550 const char* password)
4551 {
4552 _OrthancPluginCallHttpClient params;
4553 memset(&params, 0, sizeof(params));
4554
4555 params.target = target;
4556 params.method = OrthancPluginHttpMethod_Get;
4557 params.url = url;
4558 params.username = username;
4559 params.password = password;
4560
4561 return context->InvokeService(context, _OrthancPluginService_CallHttpClient, &params);
4562 }
4563
4564
4583 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginHttpPost(
4584 OrthancPluginContext* context,
4585 OrthancPluginMemoryBuffer* target,
4586 const char* url,
4587 const void* body,
4588 uint32_t bodySize,
4589 const char* username,
4590 const char* password)
4591 {
4592 _OrthancPluginCallHttpClient params;
4593 memset(&params, 0, sizeof(params));
4594
4595 params.target = target;
4596 params.method = OrthancPluginHttpMethod_Post;
4597 params.url = url;
4598 params.body = body;
4599 params.bodySize = bodySize;
4600 params.username = username;
4601 params.password = password;
4602
4603 return context->InvokeService(context, _OrthancPluginService_CallHttpClient, &params);
4604 }
4605
4606
4625 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginHttpPut(
4626 OrthancPluginContext* context,
4627 OrthancPluginMemoryBuffer* target,
4628 const char* url,
4629 const void* body,
4630 uint32_t bodySize,
4631 const char* username,
4632 const char* password)
4633 {
4634 _OrthancPluginCallHttpClient params;
4635 memset(&params, 0, sizeof(params));
4636
4637 params.target = target;
4638 params.method = OrthancPluginHttpMethod_Put;
4639 params.url = url;
4640 params.body = body;
4641 params.bodySize = bodySize;
4642 params.username = username;
4643 params.password = password;
4644
4645 return context->InvokeService(context, _OrthancPluginService_CallHttpClient, &params);
4646 }
4647
4648
4663 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginHttpDelete(
4664 OrthancPluginContext* context,
4665 const char* url,
4666 const char* username,
4667 const char* password)
4668 {
4669 _OrthancPluginCallHttpClient params;
4670 memset(&params, 0, sizeof(params));
4671
4672 params.method = OrthancPluginHttpMethod_Delete;
4673 params.url = url;
4674 params.username = username;
4675 params.password = password;
4676
4677 return context->InvokeService(context, _OrthancPluginService_CallHttpClient, &params);
4678 }
4679
4680
4681
4682 typedef struct
4683 {
4684 OrthancPluginImage** target;
4685 const OrthancPluginImage* source;
4686 OrthancPluginPixelFormat targetFormat;
4687 } _OrthancPluginConvertPixelFormat;
4688
4689
4701 ORTHANC_PLUGIN_INLINE OrthancPluginImage *OrthancPluginConvertPixelFormat(
4702 OrthancPluginContext* context,
4703 const OrthancPluginImage* source,
4704 OrthancPluginPixelFormat targetFormat)
4705 {
4706 OrthancPluginImage* target = NULL;
4707
4708 _OrthancPluginConvertPixelFormat params;
4709 params.target = &target;
4710 params.source = source;
4711 params.targetFormat = targetFormat;
4712
4713 if (context->InvokeService(context, _OrthancPluginService_ConvertPixelFormat, &params) != OrthancPluginErrorCode_Success)
4714 {
4715 return NULL;
4716 }
4717 else
4718 {
4719 return target;
4720 }
4721 }
4722
4723
4724
4736 ORTHANC_PLUGIN_INLINE uint32_t OrthancPluginGetFontsCount(
4737 OrthancPluginContext* context)
4738 {
4739 uint32_t count = 0;
4740
4741 _OrthancPluginReturnSingleValue params;
4742 memset(&params, 0, sizeof(params));
4743 params.resultUint32 = &count;
4744
4745 if (context->InvokeService(context, _OrthancPluginService_GetFontsCount, &params) != OrthancPluginErrorCode_Success)
4746 {
4747 /* Error */
4748 return 0;
4749 }
4750 else
4751 {
4752 return count;
4753 }
4754 }
4755
4756
4757
4758
4759 typedef struct
4760 {
4761 uint32_t fontIndex; /* in */
4762 const char** name; /* out */
4763 uint32_t* size; /* out */
4764 } _OrthancPluginGetFontInfo;
4765
4776 ORTHANC_PLUGIN_INLINE const char* OrthancPluginGetFontName(
4777 OrthancPluginContext* context,
4778 uint32_t fontIndex)
4779 {
4780 const char* result = NULL;
4781
4782 _OrthancPluginGetFontInfo params;
4783 memset(&params, 0, sizeof(params));
4784 params.name = &result;
4785 params.fontIndex = fontIndex;
4786
4787 if (context->InvokeService(context, _OrthancPluginService_GetFontInfo, &params) != OrthancPluginErrorCode_Success)
4788 {
4789 return NULL;
4790 }
4791 else
4792 {
4793 return result;
4794 }
4795 }
4796
4797
4808 ORTHANC_PLUGIN_INLINE uint32_t OrthancPluginGetFontSize(
4809 OrthancPluginContext* context,
4810 uint32_t fontIndex)
4811 {
4812 uint32_t result;
4813
4814 _OrthancPluginGetFontInfo params;
4815 memset(&params, 0, sizeof(params));
4816 params.size = &result;
4817 params.fontIndex = fontIndex;
4818
4819 if (context->InvokeService(context, _OrthancPluginService_GetFontInfo, &params) != OrthancPluginErrorCode_Success)
4820 {
4821 return 0;
4822 }
4823 else
4824 {
4825 return result;
4826 }
4827 }
4828
4829
4830
4831 typedef struct
4832 {
4833 OrthancPluginImage* image;
4834 uint32_t fontIndex;
4835 const char* utf8Text;
4836 int32_t x;
4837 int32_t y;
4838 uint8_t r;
4839 uint8_t g;
4840 uint8_t b;
4841 } _OrthancPluginDrawText;
4842
4843
4861 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginDrawText(
4862 OrthancPluginContext* context,
4863 OrthancPluginImage* image,
4864 uint32_t fontIndex,
4865 const char* utf8Text,
4866 int32_t x,
4867 int32_t y,
4868 uint8_t r,
4869 uint8_t g,
4870 uint8_t b)
4871 {
4872 _OrthancPluginDrawText params;
4873 memset(&params, 0, sizeof(params));
4874 params.image = image;
4875 params.fontIndex = fontIndex;
4876 params.utf8Text = utf8Text;
4877 params.x = x;
4878 params.y = y;
4879 params.r = r;
4880 params.g = g;
4881 params.b = b;
4882
4883 return context->InvokeService(context, _OrthancPluginService_DrawText, &params);
4884 }
4885
4886
4887
4888 typedef struct
4889 {
4890 OrthancPluginStorageArea* storageArea;
4891 const char* uuid;
4892 const void* content;
4893 uint64_t size;
4894 OrthancPluginContentType type;
4895 } _OrthancPluginStorageAreaCreate;
4896
4897
4915 ORTHANC_PLUGIN_DEPRECATED ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginStorageAreaCreate(
4916 OrthancPluginContext* context,
4917 OrthancPluginStorageArea* storageArea,
4918 const char* uuid,
4919 const void* content,
4920 uint64_t size,
4921 OrthancPluginContentType type)
4922 {
4923 _OrthancPluginStorageAreaCreate params;
4924 params.storageArea = storageArea;
4925 params.uuid = uuid;
4926 params.content = content;
4927 params.size = size;
4928 params.type = type;
4929
4930 return context->InvokeService(context, _OrthancPluginService_StorageAreaCreate, &params);
4931 }
4932
4933
4934 typedef struct
4935 {
4936 OrthancPluginMemoryBuffer* target;
4937 OrthancPluginStorageArea* storageArea;
4938 const char* uuid;
4939 OrthancPluginContentType type;
4940 } _OrthancPluginStorageAreaRead;
4941
4942
4959 ORTHANC_PLUGIN_DEPRECATED ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginStorageAreaRead(
4960 OrthancPluginContext* context,
4961 OrthancPluginMemoryBuffer* target,
4962 OrthancPluginStorageArea* storageArea,
4963 const char* uuid,
4964 OrthancPluginContentType type)
4965 {
4966 _OrthancPluginStorageAreaRead params;
4967 params.target = target;
4968 params.storageArea = storageArea;
4969 params.uuid = uuid;
4970 params.type = type;
4971
4972 return context->InvokeService(context, _OrthancPluginService_StorageAreaRead, &params);
4973 }
4974
4975
4976 typedef struct
4977 {
4978 OrthancPluginStorageArea* storageArea;
4979 const char* uuid;
4980 OrthancPluginContentType type;
4981 } _OrthancPluginStorageAreaRemove;
4982
4998 ORTHANC_PLUGIN_DEPRECATED ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginStorageAreaRemove(
4999 OrthancPluginContext* context,
5000 OrthancPluginStorageArea* storageArea,
5001 const char* uuid,
5002 OrthancPluginContentType type)
5003 {
5004 _OrthancPluginStorageAreaRemove params;
5005 params.storageArea = storageArea;
5006 params.uuid = uuid;
5007 params.type = type;
5008
5009 return context->InvokeService(context, _OrthancPluginService_StorageAreaRemove, &params);
5010 }
5011
5012
5013
5014 typedef struct
5015 {
5016 OrthancPluginErrorCode* target;
5017 int32_t code;
5018 uint16_t httpStatus;
5019 const char* message;
5020 } _OrthancPluginRegisterErrorCode;
5021
5037 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRegisterErrorCode(
5038 OrthancPluginContext* context,
5039 int32_t code,
5040 uint16_t httpStatus,
5041 const char* message)
5042 {
5043 OrthancPluginErrorCode target;
5044
5045 _OrthancPluginRegisterErrorCode params;
5046 params.target = &target;
5047 params.code = code;
5048 params.httpStatus = httpStatus;
5049 params.message = message;
5050
5051 if (context->InvokeService(context, _OrthancPluginService_RegisterErrorCode, &params) == OrthancPluginErrorCode_Success)
5052 {
5053 return target;
5054 }
5055 else
5056 {
5057 /* There was an error while assigned the error. Use a generic code. */
5058 return OrthancPluginErrorCode_Plugin;
5059 }
5060 }
5061
5062
5063
5064 typedef struct
5065 {
5066 uint16_t group;
5067 uint16_t element;
5068 OrthancPluginValueRepresentation vr;
5069 const char* name;
5070 uint32_t minMultiplicity;
5071 uint32_t maxMultiplicity;
5072 } _OrthancPluginRegisterDictionaryTag;
5073
5093 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRegisterDictionaryTag(
5094 OrthancPluginContext* context,
5095 uint16_t group,
5096 uint16_t element,
5097 OrthancPluginValueRepresentation vr,
5098 const char* name,
5099 uint32_t minMultiplicity,
5100 uint32_t maxMultiplicity)
5101 {
5102 _OrthancPluginRegisterDictionaryTag params;
5103 params.group = group;
5104 params.element = element;
5105 params.vr = vr;
5106 params.name = name;
5107 params.minMultiplicity = minMultiplicity;
5108 params.maxMultiplicity = maxMultiplicity;
5109
5110 return context->InvokeService(context, _OrthancPluginService_RegisterDictionaryTag, &params);
5111 }
5112
5113
5114
5115 typedef struct
5116 {
5117 uint16_t group;
5118 uint16_t element;
5119 OrthancPluginValueRepresentation vr;
5120 const char* name;
5121 uint32_t minMultiplicity;
5122 uint32_t maxMultiplicity;
5123 const char* privateCreator;
5124 } _OrthancPluginRegisterPrivateDictionaryTag;
5125
5146 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRegisterPrivateDictionaryTag(
5147 OrthancPluginContext* context,
5148 uint16_t group,
5149 uint16_t element,
5150 OrthancPluginValueRepresentation vr,
5151 const char* name,
5152 uint32_t minMultiplicity,
5153 uint32_t maxMultiplicity,
5154 const char* privateCreator)
5155 {
5156 _OrthancPluginRegisterPrivateDictionaryTag params;
5157 params.group = group;
5158 params.element = element;
5159 params.vr = vr;
5160 params.name = name;
5161 params.minMultiplicity = minMultiplicity;
5162 params.maxMultiplicity = maxMultiplicity;
5163 params.privateCreator = privateCreator;
5164
5165 return context->InvokeService(context, _OrthancPluginService_RegisterPrivateDictionaryTag, &params);
5166 }
5167
5168
5169
5170 typedef struct
5171 {
5172 OrthancPluginStorageArea* storageArea;
5173 OrthancPluginResourceType level;
5174 } _OrthancPluginReconstructMainDicomTags;
5175
5190 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginReconstructMainDicomTags(
5191 OrthancPluginContext* context,
5192 OrthancPluginStorageArea* storageArea,
5193 OrthancPluginResourceType level)
5194 {
5195 _OrthancPluginReconstructMainDicomTags params;
5196 params.level = level;
5197 params.storageArea = storageArea;
5198
5199 return context->InvokeService(context, _OrthancPluginService_ReconstructMainDicomTags, &params);
5200 }
5201
5202
5203 typedef struct
5204 {
5205 char** result;
5206 const char* instanceId;
5207 const void* buffer;
5208 uint32_t size;
5209 OrthancPluginDicomToJsonFormat format;
5210 OrthancPluginDicomToJsonFlags flags;
5211 uint32_t maxStringLength;
5212 } _OrthancPluginDicomToJson;
5213
5214
5234 ORTHANC_PLUGIN_INLINE char* OrthancPluginDicomBufferToJson(
5235 OrthancPluginContext* context,
5236 const void* buffer,
5237 uint32_t size,
5238 OrthancPluginDicomToJsonFormat format,
5239 OrthancPluginDicomToJsonFlags flags,
5240 uint32_t maxStringLength)
5241 {
5242 char* result;
5243
5244 _OrthancPluginDicomToJson params;
5245 memset(&params, 0, sizeof(params));
5246 params.result = &result;
5247 params.buffer = buffer;
5248 params.size = size;
5249 params.format = format;
5250 params.flags = flags;
5251 params.maxStringLength = maxStringLength;
5252
5253 if (context->InvokeService(context, _OrthancPluginService_DicomBufferToJson, &params) != OrthancPluginErrorCode_Success)
5254 {
5255 /* Error */
5256 return NULL;
5257 }
5258 else
5259 {
5260 return result;
5261 }
5262 }
5263
5264
5283 ORTHANC_PLUGIN_INLINE char* OrthancPluginDicomInstanceToJson(
5284 OrthancPluginContext* context,
5285 const char* instanceId,
5286 OrthancPluginDicomToJsonFormat format,
5287 OrthancPluginDicomToJsonFlags flags,
5288 uint32_t maxStringLength)
5289 {
5290 char* result;
5291
5292 _OrthancPluginDicomToJson params;
5293 memset(&params, 0, sizeof(params));
5294 params.result = &result;
5295 params.instanceId = instanceId;
5296 params.format = format;
5297 params.flags = flags;
5298 params.maxStringLength = maxStringLength;
5299
5300 if (context->InvokeService(context, _OrthancPluginService_DicomInstanceToJson, &params) != OrthancPluginErrorCode_Success)
5301 {
5302 /* Error */
5303 return NULL;
5304 }
5305 else
5306 {
5307 return result;
5308 }
5309 }
5310
5311
5312 typedef struct
5313 {
5314 OrthancPluginMemoryBuffer* target;
5315 const char* uri;
5316 uint32_t headersCount;
5317 const char* const* headersKeys;
5318 const char* const* headersValues;
5319 int32_t afterPlugins;
5320 } _OrthancPluginRestApiGet2;
5321
5341 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRestApiGet2(
5342 OrthancPluginContext* context,
5343 OrthancPluginMemoryBuffer* target,
5344 const char* uri,
5345 uint32_t headersCount,
5346 const char* const* headersKeys,
5347 const char* const* headersValues,
5348 int32_t afterPlugins)
5349 {
5350 _OrthancPluginRestApiGet2 params;
5351 params.target = target;
5352 params.uri = uri;
5353 params.headersCount = headersCount;
5354 params.headersKeys = headersKeys;
5355 params.headersValues = headersValues;
5356 params.afterPlugins = afterPlugins;
5357
5358 return context->InvokeService(context, _OrthancPluginService_RestApiGet2, &params);
5359 }
5360
5361
5362
5363 typedef struct
5364 {
5365 OrthancPluginWorklistCallback callback;
5366 } _OrthancPluginWorklistCallback;
5367
5379 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRegisterWorklistCallback(
5380 OrthancPluginContext* context,
5381 OrthancPluginWorklistCallback callback)
5382 {
5383 _OrthancPluginWorklistCallback params;
5384 params.callback = callback;
5385
5386 return context->InvokeService(context, _OrthancPluginService_RegisterWorklistCallback, &params);
5387 }
5388
5389
5390
5391 typedef struct
5392 {
5393 OrthancPluginWorklistAnswers* answers;
5394 const OrthancPluginWorklistQuery* query;
5395 const void* dicom;
5396 uint32_t size;
5397 } _OrthancPluginWorklistAnswersOperation;
5398
5415 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginWorklistAddAnswer(
5416 OrthancPluginContext* context,
5417 OrthancPluginWorklistAnswers* answers,
5418 const OrthancPluginWorklistQuery* query,
5419 const void* dicom,
5420 uint32_t size)
5421 {
5422 _OrthancPluginWorklistAnswersOperation params;
5423 params.answers = answers;
5424 params.query = query;
5425 params.dicom = dicom;
5426 params.size = size;
5427
5428 return context->InvokeService(context, _OrthancPluginService_WorklistAddAnswer, &params);
5429 }
5430
5431
5445 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginWorklistMarkIncomplete(
5446 OrthancPluginContext* context,
5447 OrthancPluginWorklistAnswers* answers)
5448 {
5449 _OrthancPluginWorklistAnswersOperation params;
5450 params.answers = answers;
5451 params.query = NULL;
5452 params.dicom = NULL;
5453 params.size = 0;
5454
5455 return context->InvokeService(context, _OrthancPluginService_WorklistMarkIncomplete, &params);
5456 }
5457
5458
5459 typedef struct
5460 {
5461 const OrthancPluginWorklistQuery* query;
5462 const void* dicom;
5463 uint32_t size;
5464 int32_t* isMatch;
5465 OrthancPluginMemoryBuffer* target;
5466 } _OrthancPluginWorklistQueryOperation;
5467
5483 ORTHANC_PLUGIN_INLINE int32_t OrthancPluginWorklistIsMatch(
5484 OrthancPluginContext* context,
5485 const OrthancPluginWorklistQuery* query,
5486 const void* dicom,
5487 uint32_t size)
5488 {
5489 int32_t isMatch = 0;
5490
5491 _OrthancPluginWorklistQueryOperation params;
5492 params.query = query;
5493 params.dicom = dicom;
5494 params.size = size;
5495 params.isMatch = &isMatch;
5496 params.target = NULL;
5497
5498 if (context->InvokeService(context, _OrthancPluginService_WorklistIsMatch, &params) == OrthancPluginErrorCode_Success)
5499 {
5500 return isMatch;
5501 }
5502 else
5503 {
5504 /* Error: Assume non-match */
5505 return 0;
5506 }
5507 }
5508
5509
5522 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginWorklistGetDicomQuery(
5523 OrthancPluginContext* context,
5524 OrthancPluginMemoryBuffer* target,
5525 const OrthancPluginWorklistQuery* query)
5526 {
5527 _OrthancPluginWorklistQueryOperation params;
5528 params.query = query;
5529 params.dicom = NULL;
5530 params.size = 0;
5531 params.isMatch = NULL;
5532 params.target = target;
5533
5534 return context->InvokeService(context, _OrthancPluginService_WorklistGetDicomQuery, &params);
5535 }
5536
5537
5548 ORTHANC_PLUGIN_INLINE OrthancPluginInstanceOrigin OrthancPluginGetInstanceOrigin(
5549 OrthancPluginContext* context,
5550 const OrthancPluginDicomInstance* instance)
5551 {
5552 OrthancPluginInstanceOrigin origin;
5553
5554 _OrthancPluginAccessDicomInstance params;
5555 memset(&params, 0, sizeof(params));
5556 params.resultOrigin = &origin;
5557 params.instance = instance;
5558
5559 if (context->InvokeService(context, _OrthancPluginService_GetInstanceOrigin, &params) != OrthancPluginErrorCode_Success)
5560 {
5561 /* Error */
5562 return OrthancPluginInstanceOrigin_Unknown;
5563 }
5564 else
5565 {
5566 return origin;
5567 }
5568 }
5569
5570
5571 typedef struct
5572 {
5573 OrthancPluginMemoryBuffer* target;
5574 const char* json;
5575 const OrthancPluginImage* pixelData;
5576 OrthancPluginCreateDicomFlags flags;
5577 } _OrthancPluginCreateDicom;
5578
5604 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginCreateDicom(
5605 OrthancPluginContext* context,
5606 OrthancPluginMemoryBuffer* target,
5607 const char* json,
5608 const OrthancPluginImage* pixelData,
5609 OrthancPluginCreateDicomFlags flags)
5610 {
5611 _OrthancPluginCreateDicom params;
5612 params.target = target;
5613 params.json = json;
5614 params.pixelData = pixelData;
5615 params.flags = flags;
5616
5617 return context->InvokeService(context, _OrthancPluginService_CreateDicom, &params);
5618 }
5619
5620
5621 typedef struct
5622 {
5623 OrthancPluginDecodeImageCallback callback;
5624 } _OrthancPluginDecodeImageCallback;
5625
5640 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRegisterDecodeImageCallback(
5641 OrthancPluginContext* context,
5642 OrthancPluginDecodeImageCallback callback)
5643 {
5644 _OrthancPluginDecodeImageCallback params;
5645 params.callback = callback;
5646
5647 return context->InvokeService(context, _OrthancPluginService_RegisterDecodeImageCallback, &params);
5648 }
5649
5650
5651
5652 typedef struct
5653 {
5654 OrthancPluginImage** target;
5655 OrthancPluginPixelFormat format;
5656 uint32_t width;
5657 uint32_t height;
5658 uint32_t pitch;
5659 void* buffer;
5660 const void* constBuffer;
5661 uint32_t bufferSize;
5662 uint32_t frameIndex;
5663 } _OrthancPluginCreateImage;
5664
5665
5678 ORTHANC_PLUGIN_INLINE OrthancPluginImage* OrthancPluginCreateImage(
5679 OrthancPluginContext* context,
5680 OrthancPluginPixelFormat format,
5681 uint32_t width,
5682 uint32_t height)
5683 {
5684 OrthancPluginImage* target = NULL;
5685
5686 _OrthancPluginCreateImage params;
5687 memset(&params, 0, sizeof(params));
5688 params.target = &target;
5689 params.format = format;
5690 params.width = width;
5691 params.height = height;
5692
5693 if (context->InvokeService(context, _OrthancPluginService_CreateImage, &params) != OrthancPluginErrorCode_Success)
5694 {
5695 return NULL;
5696 }
5697 else
5698 {
5699 return target;
5700 }
5701 }
5702
5703
5721 ORTHANC_PLUGIN_INLINE OrthancPluginImage* OrthancPluginCreateImageAccessor(
5722 OrthancPluginContext* context,
5723 OrthancPluginPixelFormat format,
5724 uint32_t width,
5725 uint32_t height,
5726 uint32_t pitch,
5727 void* buffer)
5728 {
5729 OrthancPluginImage* target = NULL;
5730
5731 _OrthancPluginCreateImage params;
5732 memset(&params, 0, sizeof(params));
5733 params.target = &target;
5734 params.format = format;
5735 params.width = width;
5736 params.height = height;
5737 params.pitch = pitch;
5738 params.buffer = buffer;
5739
5740 if (context->InvokeService(context, _OrthancPluginService_CreateImageAccessor, &params) != OrthancPluginErrorCode_Success)
5741 {
5742 return NULL;
5743 }
5744 else
5745 {
5746 return target;
5747 }
5748 }
5749
5750
5751
5767 ORTHANC_PLUGIN_INLINE OrthancPluginImage* OrthancPluginDecodeDicomImage(
5768 OrthancPluginContext* context,
5769 const void* buffer,
5770 uint32_t bufferSize,
5771 uint32_t frameIndex)
5772 {
5773 OrthancPluginImage* target = NULL;
5774
5775 _OrthancPluginCreateImage params;
5776 memset(&params, 0, sizeof(params));
5777 params.target = &target;
5778 params.constBuffer = buffer;
5779 params.bufferSize = bufferSize;
5780 params.frameIndex = frameIndex;
5781
5782 if (context->InvokeService(context, _OrthancPluginService_DecodeDicomImage, &params) != OrthancPluginErrorCode_Success)
5783 {
5784 return NULL;
5785 }
5786 else
5787 {
5788 return target;
5789 }
5790 }
5791
5792
5793
5794 typedef struct
5795 {
5796 char** result;
5797 const void* buffer;
5798 uint32_t size;
5799 } _OrthancPluginComputeHash;
5800
5813 ORTHANC_PLUGIN_INLINE char* OrthancPluginComputeMd5(
5814 OrthancPluginContext* context,
5815 const void* buffer,
5816 uint32_t size)
5817 {
5818 char* result;
5819
5820 _OrthancPluginComputeHash params;
5821 params.result = &result;
5822 params.buffer = buffer;
5823 params.size = size;
5824
5825 if (context->InvokeService(context, _OrthancPluginService_ComputeMd5, &params) != OrthancPluginErrorCode_Success)
5826 {
5827 /* Error */
5828 return NULL;
5829 }
5830 else
5831 {
5832 return result;
5833 }
5834 }
5835
5836
5849 ORTHANC_PLUGIN_INLINE char* OrthancPluginComputeSha1(
5850 OrthancPluginContext* context,
5851 const void* buffer,
5852 uint32_t size)
5853 {
5854 char* result;
5855
5856 _OrthancPluginComputeHash params;
5857 params.result = &result;
5858 params.buffer = buffer;
5859 params.size = size;
5860
5861 if (context->InvokeService(context, _OrthancPluginService_ComputeSha1, &params) != OrthancPluginErrorCode_Success)
5862 {
5863 /* Error */
5864 return NULL;
5865 }
5866 else
5867 {
5868 return result;
5869 }
5870 }
5871
5872
5873
5874 typedef struct
5875 {
5876 OrthancPluginDictionaryEntry* target;
5877 const char* name;
5878 } _OrthancPluginLookupDictionary;
5879
5895 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginLookupDictionary(
5896 OrthancPluginContext* context,
5897 OrthancPluginDictionaryEntry* target,
5898 const char* name)
5899 {
5900 _OrthancPluginLookupDictionary params;
5901 params.target = target;
5902 params.name = name;
5903 return context->InvokeService(context, _OrthancPluginService_LookupDictionary, &params);
5904 }
5905
5906
5907
5908 typedef struct
5909 {
5910 OrthancPluginRestOutput* output;
5911 const void* answer;
5912 uint32_t answerSize;
5913 uint32_t headersCount;
5914 const char* const* headersKeys;
5915 const char* const* headersValues;
5916 } _OrthancPluginSendMultipartItem2;
5917
5938 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginSendMultipartItem2(
5939 OrthancPluginContext* context,
5940 OrthancPluginRestOutput* output,
5941 const void* answer,
5942 uint32_t answerSize,
5943 uint32_t headersCount,
5944 const char* const* headersKeys,
5945 const char* const* headersValues)
5946 {
5947 _OrthancPluginSendMultipartItem2 params;
5948 params.output = output;
5949 params.answer = answer;
5950 params.answerSize = answerSize;
5951 params.headersCount = headersCount;
5952 params.headersKeys = headersKeys;
5953 params.headersValues = headersValues;
5954
5955 return context->InvokeService(context, _OrthancPluginService_SendMultipartItem2, &params);
5956 }
5957
5958
5959 typedef struct
5960 {
5961 OrthancPluginIncomingHttpRequestFilter callback;
5962 } _OrthancPluginIncomingHttpRequestFilter;
5963
5976 ORTHANC_PLUGIN_DEPRECATED ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRegisterIncomingHttpRequestFilter(
5977 OrthancPluginContext* context,
5978 OrthancPluginIncomingHttpRequestFilter callback)
5979 {
5980 _OrthancPluginIncomingHttpRequestFilter params;
5981 params.callback = callback;
5982
5983 return context->InvokeService(context, _OrthancPluginService_RegisterIncomingHttpRequestFilter, &params);
5984 }
5985
5986
5987
5988 typedef struct
5989 {
5990 OrthancPluginMemoryBuffer* answerBody;
5991 OrthancPluginMemoryBuffer* answerHeaders;
5992 uint16_t* httpStatus;
5993 OrthancPluginHttpMethod method;
5994 const char* url;
5995 uint32_t headersCount;
5996 const char* const* headersKeys;
5997 const char* const* headersValues;
5998 const void* body;
5999 uint32_t bodySize;
6000 const char* username;
6001 const char* password;
6002 uint32_t timeout;
6003 const char* certificateFile;
6004 const char* certificateKeyFile;
6005 const char* certificateKeyPassword;
6006 uint8_t pkcs11;
6007 } _OrthancPluginCallHttpClient2;
6008
6009
6010
6051 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginHttpClient(
6052 OrthancPluginContext* context,
6053 OrthancPluginMemoryBuffer* answerBody,
6054 OrthancPluginMemoryBuffer* answerHeaders,
6055 uint16_t* httpStatus,
6056 OrthancPluginHttpMethod method,
6057 const char* url,
6058 uint32_t headersCount,
6059 const char* const* headersKeys,
6060 const char* const* headersValues,
6061 const void* body,
6062 uint32_t bodySize,
6063 const char* username,
6064 const char* password,
6065 uint32_t timeout,
6066 const char* certificateFile,
6067 const char* certificateKeyFile,
6068 const char* certificateKeyPassword,
6069 uint8_t pkcs11)
6070 {
6071 _OrthancPluginCallHttpClient2 params;
6072 memset(&params, 0, sizeof(params));
6073
6074 params.answerBody = answerBody;
6075 params.answerHeaders = answerHeaders;
6076 params.httpStatus = httpStatus;
6077 params.method = method;
6078 params.url = url;
6079 params.headersCount = headersCount;
6080 params.headersKeys = headersKeys;
6081 params.headersValues = headersValues;
6082 params.body = body;
6083 params.bodySize = bodySize;
6084 params.username = username;
6085 params.password = password;
6086 params.timeout = timeout;
6087 params.certificateFile = certificateFile;
6088 params.certificateKeyFile = certificateKeyFile;
6089 params.certificateKeyPassword = certificateKeyPassword;
6090 params.pkcs11 = pkcs11;
6091
6092 return context->InvokeService(context, _OrthancPluginService_CallHttpClient2, &params);
6093 }
6094
6095
6106 ORTHANC_PLUGIN_INLINE char* OrthancPluginGenerateUuid(
6107 OrthancPluginContext* context)
6108 {
6109 char* result;
6110
6111 _OrthancPluginRetrieveDynamicString params;
6112 params.result = &result;
6113 params.argument = NULL;
6114
6115 if (context->InvokeService(context, _OrthancPluginService_GenerateUuid, &params) != OrthancPluginErrorCode_Success)
6116 {
6117 /* Error */
6118 return NULL;
6119 }
6120 else
6121 {
6122 return result;
6123 }
6124 }
6125
6126
6127
6128
6129 typedef struct
6130 {
6131 OrthancPluginFindCallback callback;
6132 } _OrthancPluginFindCallback;
6133
6145 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRegisterFindCallback(
6146 OrthancPluginContext* context,
6147 OrthancPluginFindCallback callback)
6148 {
6149 _OrthancPluginFindCallback params;
6150 params.callback = callback;
6151
6152 return context->InvokeService(context, _OrthancPluginService_RegisterFindCallback, &params);
6153 }
6154
6155
6156 typedef struct
6157 {
6158 OrthancPluginFindAnswers *answers;
6159 const OrthancPluginFindQuery *query;
6160 const void *dicom;
6161 uint32_t size;
6162 uint32_t index;
6163 uint32_t *resultUint32;
6164 uint16_t *resultGroup;
6165 uint16_t *resultElement;
6166 char **resultString;
6167 } _OrthancPluginFindOperation;
6168
6184 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginFindAddAnswer(
6185 OrthancPluginContext* context,
6186 OrthancPluginFindAnswers* answers,
6187 const void* dicom,
6188 uint32_t size)
6189 {
6190 _OrthancPluginFindOperation params;
6191 memset(&params, 0, sizeof(params));
6192 params.answers = answers;
6193 params.dicom = dicom;
6194 params.size = size;
6195
6196 return context->InvokeService(context, _OrthancPluginService_FindAddAnswer, &params);
6197 }
6198
6199
6213 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginFindMarkIncomplete(
6214 OrthancPluginContext* context,
6215 OrthancPluginFindAnswers* answers)
6216 {
6217 _OrthancPluginFindOperation params;
6218 memset(&params, 0, sizeof(params));
6219 params.answers = answers;
6220
6221 return context->InvokeService(context, _OrthancPluginService_FindMarkIncomplete, &params);
6222 }
6223
6224
6225
6237 ORTHANC_PLUGIN_INLINE uint32_t OrthancPluginGetFindQuerySize(
6238 OrthancPluginContext* context,
6239 const OrthancPluginFindQuery* query)
6240 {
6241 uint32_t count = 0;
6242
6243 _OrthancPluginFindOperation params;
6244 memset(&params, 0, sizeof(params));
6245 params.query = query;
6246 params.resultUint32 = &count;
6247
6248 if (context->InvokeService(context, _OrthancPluginService_GetFindQuerySize, &params) != OrthancPluginErrorCode_Success)
6249 {
6250 /* Error */
6251 return 0;
6252 }
6253 else
6254 {
6255 return count;
6256 }
6257 }
6258
6259
6274 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginGetFindQueryTag(
6275 OrthancPluginContext* context,
6276 uint16_t* group,
6277 uint16_t* element,
6278 const OrthancPluginFindQuery* query,
6279 uint32_t index)
6280 {
6281 _OrthancPluginFindOperation params;
6282 memset(&params, 0, sizeof(params));
6283 params.query = query;
6284 params.index = index;
6285 params.resultGroup = group;
6286 params.resultElement = element;
6287
6288 return context->InvokeService(context, _OrthancPluginService_GetFindQueryTag, &params);
6289 }
6290
6291
6305 ORTHANC_PLUGIN_INLINE char* OrthancPluginGetFindQueryTagName(
6306 OrthancPluginContext* context,
6307 const OrthancPluginFindQuery* query,
6308 uint32_t index)
6309 {
6310 char* result;
6311
6312 _OrthancPluginFindOperation params;
6313 memset(&params, 0, sizeof(params));
6314 params.query = query;
6315 params.index = index;
6316 params.resultString = &result;
6317
6318 if (context->InvokeService(context, _OrthancPluginService_GetFindQueryTagName, &params) != OrthancPluginErrorCode_Success)
6319 {
6320 /* Error */
6321 return NULL;
6322 }
6323 else
6324 {
6325 return result;
6326 }
6327 }
6328
6329
6343 ORTHANC_PLUGIN_INLINE char* OrthancPluginGetFindQueryValue(
6344 OrthancPluginContext* context,
6345 const OrthancPluginFindQuery* query,
6346 uint32_t index)
6347 {
6348 char* result;
6349
6350 _OrthancPluginFindOperation params;
6351 memset(&params, 0, sizeof(params));
6352 params.query = query;
6353 params.index = index;
6354 params.resultString = &result;
6355
6356 if (context->InvokeService(context, _OrthancPluginService_GetFindQueryValue, &params) != OrthancPluginErrorCode_Success)
6357 {
6358 /* Error */
6359 return NULL;
6360 }
6361 else
6362 {
6363 return result;
6364 }
6365 }
6366
6367
6368
6369
6370 typedef struct
6371 {
6372 OrthancPluginMoveCallback callback;
6373 OrthancPluginGetMoveSize getMoveSize;
6374 OrthancPluginApplyMove applyMove;
6375 OrthancPluginFreeMove freeMove;
6376 } _OrthancPluginMoveCallback;
6377
6391 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRegisterMoveCallback(
6392 OrthancPluginContext* context,
6393 OrthancPluginMoveCallback callback,
6394 OrthancPluginGetMoveSize getMoveSize,
6395 OrthancPluginApplyMove applyMove,
6396 OrthancPluginFreeMove freeMove)
6397 {
6398 _OrthancPluginMoveCallback params;
6399 params.callback = callback;
6400 params.getMoveSize = getMoveSize;
6401 params.applyMove = applyMove;
6402 params.freeMove = freeMove;
6403
6404 return context->InvokeService(context, _OrthancPluginService_RegisterMoveCallback, &params);
6405 }
6406
6407
6408
6409 typedef struct
6410 {
6411 OrthancPluginFindMatcher** target;
6412 const void* query;
6413 uint32_t size;
6414 } _OrthancPluginCreateFindMatcher;
6415
6416
6430 ORTHANC_PLUGIN_INLINE OrthancPluginFindMatcher* OrthancPluginCreateFindMatcher(
6431 OrthancPluginContext* context,
6432 const void* query,
6433 uint32_t size)
6434 {
6435 OrthancPluginFindMatcher* target = NULL;
6436
6437 _OrthancPluginCreateFindMatcher params;
6438 memset(&params, 0, sizeof(params));
6439 params.target = &target;
6440 params.query = query;
6441 params.size = size;
6442
6443 if (context->InvokeService(context, _OrthancPluginService_CreateFindMatcher, &params) != OrthancPluginErrorCode_Success)
6444 {
6445 return NULL;
6446 }
6447 else
6448 {
6449 return target;
6450 }
6451 }
6452
6453
6454 typedef struct
6455 {
6456 OrthancPluginFindMatcher* matcher;
6457 } _OrthancPluginFreeFindMatcher;
6458
6468 ORTHANC_PLUGIN_INLINE void OrthancPluginFreeFindMatcher(
6469 OrthancPluginContext* context,
6470 OrthancPluginFindMatcher* matcher)
6471 {
6472 _OrthancPluginFreeFindMatcher params;
6473 params.matcher = matcher;
6474
6475 context->InvokeService(context, _OrthancPluginService_FreeFindMatcher, &params);
6476 }
6477
6478
6479 typedef struct
6480 {
6481 const OrthancPluginFindMatcher* matcher;
6482 const void* dicom;
6483 uint32_t size;
6484 int32_t* isMatch;
6485 } _OrthancPluginFindMatcherIsMatch;
6486
6501 ORTHANC_PLUGIN_INLINE int32_t OrthancPluginFindMatcherIsMatch(
6502 OrthancPluginContext* context,
6503 const OrthancPluginFindMatcher* matcher,
6504 const void* dicom,
6505 uint32_t size)
6506 {
6507 int32_t isMatch = 0;
6508
6509 _OrthancPluginFindMatcherIsMatch params;
6510 params.matcher = matcher;
6511 params.dicom = dicom;
6512 params.size = size;
6513 params.isMatch = &isMatch;
6514
6515 if (context->InvokeService(context, _OrthancPluginService_FindMatcherIsMatch, &params) == OrthancPluginErrorCode_Success)
6516 {
6517 return isMatch;
6518 }
6519 else
6520 {
6521 /* Error: Assume non-match */
6522 return 0;
6523 }
6524 }
6525
6526
6527 typedef struct
6528 {
6529 OrthancPluginIncomingHttpRequestFilter2 callback;
6530 } _OrthancPluginIncomingHttpRequestFilter2;
6531
6543 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRegisterIncomingHttpRequestFilter2(
6544 OrthancPluginContext* context,
6545 OrthancPluginIncomingHttpRequestFilter2 callback)
6546 {
6547 _OrthancPluginIncomingHttpRequestFilter2 params;
6548 params.callback = callback;
6549
6550 return context->InvokeService(context, _OrthancPluginService_RegisterIncomingHttpRequestFilter2, &params);
6551 }
6552
6553
6554
6555 typedef struct
6556 {
6557 OrthancPluginPeers** peers;
6558 } _OrthancPluginGetPeers;
6559
6571 ORTHANC_PLUGIN_INLINE OrthancPluginPeers* OrthancPluginGetPeers(
6572 OrthancPluginContext* context)
6573 {
6574 OrthancPluginPeers* peers = NULL;
6575
6576 _OrthancPluginGetPeers params;
6577 memset(&params, 0, sizeof(params));
6578 params.peers = &peers;
6579
6580 if (context->InvokeService(context, _OrthancPluginService_GetPeers, &params) != OrthancPluginErrorCode_Success)
6581 {
6582 return NULL;
6583 }
6584 else
6585 {
6586 return peers;
6587 }
6588 }
6589
6590
6591 typedef struct
6592 {
6593 OrthancPluginPeers* peers;
6594 } _OrthancPluginFreePeers;
6595
6605 ORTHANC_PLUGIN_INLINE void OrthancPluginFreePeers(
6606 OrthancPluginContext* context,
6607 OrthancPluginPeers* peers)
6608 {
6609 _OrthancPluginFreePeers params;
6610 params.peers = peers;
6611
6612 context->InvokeService(context, _OrthancPluginService_FreePeers, &params);
6613 }
6614
6615
6616 typedef struct
6617 {
6618 uint32_t* target;
6619 const OrthancPluginPeers* peers;
6620 } _OrthancPluginGetPeersCount;
6621
6635 ORTHANC_PLUGIN_INLINE uint32_t OrthancPluginGetPeersCount(
6636 OrthancPluginContext* context,
6637 const OrthancPluginPeers* peers)
6638 {
6639 uint32_t target = 0;
6640
6641 _OrthancPluginGetPeersCount params;
6642 memset(&params, 0, sizeof(params));
6643 params.target = &target;
6644 params.peers = peers;
6645
6646 if (context->InvokeService(context, _OrthancPluginService_GetPeersCount, &params) != OrthancPluginErrorCode_Success)
6647 {
6648 /* Error */
6649 return 0;
6650 }
6651 else
6652 {
6653 return target;
6654 }
6655 }
6656
6657
6658 typedef struct
6659 {
6660 const char** target;
6661 const OrthancPluginPeers* peers;
6662 uint32_t peerIndex;
6663 const char* userProperty;
6664 } _OrthancPluginGetPeerProperty;
6665
6683 ORTHANC_PLUGIN_INLINE const char* OrthancPluginGetPeerName(
6684 OrthancPluginContext* context,
6685 const OrthancPluginPeers* peers,
6686 uint32_t peerIndex)
6687 {
6688 const char* target = NULL;
6689
6690 _OrthancPluginGetPeerProperty params;
6691 memset(&params, 0, sizeof(params));
6692 params.target = &target;
6693 params.peers = peers;
6694 params.peerIndex = peerIndex;
6695 params.userProperty = NULL;
6696
6697 if (context->InvokeService(context, _OrthancPluginService_GetPeerName, &params) != OrthancPluginErrorCode_Success)
6698 {
6699 /* Error */
6700 return NULL;
6701 }
6702 else
6703 {
6704 return target;
6705 }
6706 }
6707
6708
6724 ORTHANC_PLUGIN_INLINE const char* OrthancPluginGetPeerUrl(
6725 OrthancPluginContext* context,
6726 const OrthancPluginPeers* peers,
6727 uint32_t peerIndex)
6728 {
6729 const char* target = NULL;
6730
6731 _OrthancPluginGetPeerProperty params;
6732 memset(&params, 0, sizeof(params));
6733 params.target = &target;
6734 params.peers = peers;
6735 params.peerIndex = peerIndex;
6736 params.userProperty = NULL;
6737
6738 if (context->InvokeService(context, _OrthancPluginService_GetPeerUrl, &params) != OrthancPluginErrorCode_Success)
6739 {
6740 /* Error */
6741 return NULL;
6742 }
6743 else
6744 {
6745 return target;
6746 }
6747 }
6748
6749
6750
6770 ORTHANC_PLUGIN_INLINE const char* OrthancPluginGetPeerUserProperty(
6771 OrthancPluginContext* context,
6772 const OrthancPluginPeers* peers,
6773 uint32_t peerIndex,
6774 const char* userProperty)
6775 {
6776 const char* target = NULL;
6777
6778 _OrthancPluginGetPeerProperty params;
6779 memset(&params, 0, sizeof(params));
6780 params.target = &target;
6781 params.peers = peers;
6782 params.peerIndex = peerIndex;
6783 params.userProperty = userProperty;
6784
6785 if (context->InvokeService(context, _OrthancPluginService_GetPeerUserProperty, &params) != OrthancPluginErrorCode_Success)
6786 {
6787 /* No such user property */
6788 return NULL;
6789 }
6790 else
6791 {
6792 return target;
6793 }
6794 }
6795
6796
6797
6798 typedef struct
6799 {
6800 OrthancPluginMemoryBuffer* answerBody;
6801 OrthancPluginMemoryBuffer* answerHeaders;
6802 uint16_t* httpStatus;
6803 const OrthancPluginPeers* peers;
6804 uint32_t peerIndex;
6805 OrthancPluginHttpMethod method;
6806 const char* uri;
6807 uint32_t additionalHeadersCount;
6808 const char* const* additionalHeadersKeys;
6809 const char* const* additionalHeadersValues;
6810 const void* body;
6811 uint32_t bodySize;
6812 uint32_t timeout;
6813 } _OrthancPluginCallPeerApi;
6814
6851 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginCallPeerApi(
6852 OrthancPluginContext* context,
6853 OrthancPluginMemoryBuffer* answerBody,
6854 OrthancPluginMemoryBuffer* answerHeaders,
6855 uint16_t* httpStatus,
6856 const OrthancPluginPeers* peers,
6857 uint32_t peerIndex,
6858 OrthancPluginHttpMethod method,
6859 const char* uri,
6860 uint32_t additionalHeadersCount,
6861 const char* const* additionalHeadersKeys,
6862 const char* const* additionalHeadersValues,
6863 const void* body,
6864 uint32_t bodySize,
6865 uint32_t timeout)
6866 {
6867 _OrthancPluginCallPeerApi params;
6868 memset(&params, 0, sizeof(params));
6869
6870 params.answerBody = answerBody;
6871 params.answerHeaders = answerHeaders;
6872 params.httpStatus = httpStatus;
6873 params.peers = peers;
6874 params.peerIndex = peerIndex;
6875 params.method = method;
6876 params.uri = uri;
6877 params.additionalHeadersCount = additionalHeadersCount;
6878 params.additionalHeadersKeys = additionalHeadersKeys;
6879 params.additionalHeadersValues = additionalHeadersValues;
6880 params.body = body;
6881 params.bodySize = bodySize;
6882 params.timeout = timeout;
6883
6884 return context->InvokeService(context, _OrthancPluginService_CallPeerApi, &params);
6885 }
6886
6887
6888
6889
6890
6891 typedef struct
6892 {
6893 OrthancPluginJob** target;
6894 void *job;
6895 OrthancPluginJobFinalize finalize;
6896 const char *type;
6897 OrthancPluginJobGetProgress getProgress;
6898 OrthancPluginJobGetContent getContent;
6899 OrthancPluginJobGetSerialized getSerialized;
6900 OrthancPluginJobStep step;
6901 OrthancPluginJobStop stop;
6902 OrthancPluginJobReset reset;
6903 } _OrthancPluginCreateJob;
6904
6937 ORTHANC_PLUGIN_DEPRECATED ORTHANC_PLUGIN_INLINE OrthancPluginJob *OrthancPluginCreateJob(
6938 OrthancPluginContext *context,
6939 void *job,
6940 OrthancPluginJobFinalize finalize,
6941 const char *type,
6942 OrthancPluginJobGetProgress getProgress,
6943 OrthancPluginJobGetContent getContent,
6944 OrthancPluginJobGetSerialized getSerialized,
6945 OrthancPluginJobStep step,
6946 OrthancPluginJobStop stop,
6947 OrthancPluginJobReset reset)
6948 {
6949 OrthancPluginJob* target = NULL;
6950
6951 _OrthancPluginCreateJob params;
6952 memset(&params, 0, sizeof(params));
6953
6954 params.target = &target;
6955 params.job = job;
6956 params.finalize = finalize;
6957 params.type = type;
6958 params.getProgress = getProgress;
6959 params.getContent = getContent;
6960 params.getSerialized = getSerialized;
6961 params.step = step;
6962 params.stop = stop;
6963 params.reset = reset;
6964
6965 if (context->InvokeService(context, _OrthancPluginService_CreateJob, &params) != OrthancPluginErrorCode_Success ||
6966 target == NULL)
6967 {
6968 /* Error */
6969 return NULL;
6970 }
6971 else
6972 {
6973 return target;
6974 }
6975 }
6976
6977
6978 typedef struct
6979 {
6980 OrthancPluginJob** target;
6981 void *job;
6982 OrthancPluginJobFinalize finalize;
6983 const char *type;
6984 OrthancPluginJobGetProgress getProgress;
6985 OrthancPluginJobGetContent2 getContent;
6986 OrthancPluginJobGetSerialized2 getSerialized;
6987 OrthancPluginJobStep step;
6988 OrthancPluginJobStop stop;
6989 OrthancPluginJobReset reset;
6990 } _OrthancPluginCreateJob2;
6991
7023 ORTHANC_PLUGIN_INLINE OrthancPluginJob *OrthancPluginCreateJob2(
7024 OrthancPluginContext *context,
7025 void *job,
7026 OrthancPluginJobFinalize finalize,
7027 const char *type,
7028 OrthancPluginJobGetProgress getProgress,
7029 OrthancPluginJobGetContent2 getContent,
7030 OrthancPluginJobGetSerialized2 getSerialized,
7031 OrthancPluginJobStep step,
7032 OrthancPluginJobStop stop,
7033 OrthancPluginJobReset reset)
7034 {
7035 OrthancPluginJob* target = NULL;
7036
7037 _OrthancPluginCreateJob2 params;
7038 memset(&params, 0, sizeof(params));
7039
7040 params.target = &target;
7041 params.job = job;
7042 params.finalize = finalize;
7043 params.type = type;
7044 params.getProgress = getProgress;
7045 params.getContent = getContent;
7046 params.getSerialized = getSerialized;
7047 params.step = step;
7048 params.stop = stop;
7049 params.reset = reset;
7050
7051 if (context->InvokeService(context, _OrthancPluginService_CreateJob2, &params) != OrthancPluginErrorCode_Success ||
7052 target == NULL)
7053 {
7054 /* Error */
7055 return NULL;
7056 }
7057 else
7058 {
7059 return target;
7060 }
7061 }
7062
7063
7064 typedef struct
7065 {
7066 OrthancPluginJob* job;
7067 } _OrthancPluginFreeJob;
7068
7078 ORTHANC_PLUGIN_INLINE void OrthancPluginFreeJob(
7079 OrthancPluginContext* context,
7080 OrthancPluginJob* job)
7081 {
7082 _OrthancPluginFreeJob params;
7083 params.job = job;
7084
7085 context->InvokeService(context, _OrthancPluginService_FreeJob, &params);
7086 }
7087
7088
7089
7090 typedef struct
7091 {
7092 char** resultId;
7093 OrthancPluginJob *job;
7094 int32_t priority;
7095 } _OrthancPluginSubmitJob;
7096
7110 ORTHANC_PLUGIN_INLINE char *OrthancPluginSubmitJob(
7111 OrthancPluginContext *context,
7112 OrthancPluginJob *job,
7113 int32_t priority)
7114 {
7115 char* resultId = NULL;
7116
7117 _OrthancPluginSubmitJob params;
7118 memset(&params, 0, sizeof(params));
7119
7120 params.resultId = &resultId;
7121 params.job = job;
7122 params.priority = priority;
7123
7124 if (context->InvokeService(context, _OrthancPluginService_SubmitJob, &params) != OrthancPluginErrorCode_Success ||
7125 resultId == NULL)
7126 {
7127 /* Error */
7128 return NULL;
7129 }
7130 else
7131 {
7132 return resultId;
7133 }
7134 }
7135
7136
7137
7138 typedef struct
7139 {
7140 OrthancPluginJobsUnserializer unserializer;
7141 } _OrthancPluginJobsUnserializer;
7142
7155 ORTHANC_PLUGIN_INLINE void OrthancPluginRegisterJobsUnserializer(
7156 OrthancPluginContext* context,
7157 OrthancPluginJobsUnserializer unserializer)
7158 {
7159 _OrthancPluginJobsUnserializer params;
7160 params.unserializer = unserializer;
7161
7162 context->InvokeService(context, _OrthancPluginService_RegisterJobsUnserializer, &params);
7163 }
7164
7165
7166
7167 typedef struct
7168 {
7169 OrthancPluginRestOutput* output;
7170 const char* details;
7171 uint8_t log;
7172 } _OrthancPluginSetHttpErrorDetails;
7173
7191 ORTHANC_PLUGIN_INLINE void OrthancPluginSetHttpErrorDetails(
7192 OrthancPluginContext* context,
7193 OrthancPluginRestOutput* output,
7194 const char* details,
7195 uint8_t log)
7196 {
7197 _OrthancPluginSetHttpErrorDetails params;
7198 params.output = output;
7199 params.details = details;
7200 params.log = log;
7201 context->InvokeService(context, _OrthancPluginService_SetHttpErrorDetails, &params);
7202 }
7203
7204
7205
7206 typedef struct
7207 {
7208 const char** result;
7209 const char* argument;
7210 } _OrthancPluginRetrieveStaticString;
7211
7223 ORTHANC_PLUGIN_INLINE const char* OrthancPluginAutodetectMimeType(
7224 OrthancPluginContext* context,
7225 const char* path)
7226 {
7227 const char* result = NULL;
7228
7229 _OrthancPluginRetrieveStaticString params;
7230 params.result = &result;
7231 params.argument = path;
7232
7233 if (context->InvokeService(context, _OrthancPluginService_AutodetectMimeType, &params) != OrthancPluginErrorCode_Success)
7234 {
7235 /* Error */
7236 return NULL;
7237 }
7238 else
7239 {
7240 return result;
7241 }
7242 }
7243
7244
7245
7246 typedef struct
7247 {
7248 const char* name;
7249 float value;
7250 OrthancPluginMetricsType type;
7251 } _OrthancPluginSetMetricsValue;
7252
7269 ORTHANC_PLUGIN_INLINE void OrthancPluginSetMetricsValue(
7270 OrthancPluginContext* context,
7271 const char* name,
7272 float value,
7273 OrthancPluginMetricsType type)
7274 {
7275 _OrthancPluginSetMetricsValue params;
7276 params.name = name;
7277 params.value = value;
7278 params.type = type;
7279 context->InvokeService(context, _OrthancPluginService_SetMetricsValue, &params);
7280 }
7281
7282
7283
7284 typedef struct
7285 {
7286 OrthancPluginRefreshMetricsCallback callback;
7287 } _OrthancPluginRegisterRefreshMetricsCallback;
7288
7300 ORTHANC_PLUGIN_INLINE void OrthancPluginRegisterRefreshMetricsCallback(
7301 OrthancPluginContext* context,
7302 OrthancPluginRefreshMetricsCallback callback)
7303 {
7304 _OrthancPluginRegisterRefreshMetricsCallback params;
7305 params.callback = callback;
7306 context->InvokeService(context, _OrthancPluginService_RegisterRefreshMetricsCallback, &params);
7307 }
7308
7309
7310
7311
7312 typedef struct
7313 {
7314 char** target;
7315 const void* dicom;
7316 uint32_t dicomSize;
7317 OrthancPluginDicomWebBinaryCallback callback;
7318 } _OrthancPluginEncodeDicomWeb;
7319
7336 ORTHANC_PLUGIN_DEPRECATED ORTHANC_PLUGIN_INLINE char* OrthancPluginEncodeDicomWebJson(
7337 OrthancPluginContext* context,
7338 const void* dicom,
7339 uint32_t dicomSize,
7340 OrthancPluginDicomWebBinaryCallback callback)
7341 {
7342 char* target = NULL;
7343
7344 _OrthancPluginEncodeDicomWeb params;
7345 params.target = &target;
7346 params.dicom = dicom;
7347 params.dicomSize = dicomSize;
7348 params.callback = callback;
7349
7350 if (context->InvokeService(context, _OrthancPluginService_EncodeDicomWebJson, &params) != OrthancPluginErrorCode_Success)
7351 {
7352 /* Error */
7353 return NULL;
7354 }
7355 else
7356 {
7357 return target;
7358 }
7359 }
7360
7361
7378 ORTHANC_PLUGIN_DEPRECATED ORTHANC_PLUGIN_INLINE char* OrthancPluginEncodeDicomWebXml(
7379 OrthancPluginContext* context,
7380 const void* dicom,
7381 uint32_t dicomSize,
7382 OrthancPluginDicomWebBinaryCallback callback)
7383 {
7384 char* target = NULL;
7385
7386 _OrthancPluginEncodeDicomWeb params;
7387 params.target = &target;
7388 params.dicom = dicom;
7389 params.dicomSize = dicomSize;
7390 params.callback = callback;
7391
7392 if (context->InvokeService(context, _OrthancPluginService_EncodeDicomWebXml, &params) != OrthancPluginErrorCode_Success)
7393 {
7394 /* Error */
7395 return NULL;
7396 }
7397 else
7398 {
7399 return target;
7400 }
7401 }
7402
7403
7404
7405 typedef struct
7406 {
7407 char** target;
7408 const void* dicom;
7409 uint32_t dicomSize;
7410 OrthancPluginDicomWebBinaryCallback2 callback;
7411 void* payload;
7412 } _OrthancPluginEncodeDicomWeb2;
7413
7430 ORTHANC_PLUGIN_INLINE char* OrthancPluginEncodeDicomWebJson2(
7431 OrthancPluginContext* context,
7432 const void* dicom,
7433 uint32_t dicomSize,
7434 OrthancPluginDicomWebBinaryCallback2 callback,
7435 void* payload)
7436 {
7437 char* target = NULL;
7438
7439 _OrthancPluginEncodeDicomWeb2 params;
7440 params.target = &target;
7441 params.dicom = dicom;
7442 params.dicomSize = dicomSize;
7443 params.callback = callback;
7444 params.payload = payload;
7445
7446 if (context->InvokeService(context, _OrthancPluginService_EncodeDicomWebJson2, &params) != OrthancPluginErrorCode_Success)
7447 {
7448 /* Error */
7449 return NULL;
7450 }
7451 else
7452 {
7453 return target;
7454 }
7455 }
7456
7457
7474 ORTHANC_PLUGIN_INLINE char* OrthancPluginEncodeDicomWebXml2(
7475 OrthancPluginContext* context,
7476 const void* dicom,
7477 uint32_t dicomSize,
7478 OrthancPluginDicomWebBinaryCallback2 callback,
7479 void* payload)
7480 {
7481 char* target = NULL;
7482
7483 _OrthancPluginEncodeDicomWeb2 params;
7484 params.target = &target;
7485 params.dicom = dicom;
7486 params.dicomSize = dicomSize;
7487 params.callback = callback;
7488 params.payload = payload;
7489
7490 if (context->InvokeService(context, _OrthancPluginService_EncodeDicomWebXml2, &params) != OrthancPluginErrorCode_Success)
7491 {
7492 /* Error */
7493 return NULL;
7494 }
7495 else
7496 {
7497 return target;
7498 }
7499 }
7500
7501
7502
7518 typedef OrthancPluginErrorCode (*OrthancPluginChunkedClientAnswerAddHeader) (
7519 void* answer,
7520 const char* key,
7521 const char* value);
7522
7523
7539 typedef OrthancPluginErrorCode (*OrthancPluginChunkedClientAnswerAddChunk) (
7540 void* answer,
7541 const void* data,
7542 uint32_t size);
7543
7544
7559 typedef uint8_t (*OrthancPluginChunkedClientRequestIsDone) (void* request);
7560
7561
7576 typedef OrthancPluginErrorCode (*OrthancPluginChunkedClientRequestNext) (void* request);
7577
7578
7592 typedef const void* (*OrthancPluginChunkedClientRequestGetChunkData) (void* request);
7593
7594
7608 typedef uint32_t (*OrthancPluginChunkedClientRequestGetChunkSize) (void* request);
7609
7610
7611 typedef struct
7612 {
7613 void* answer;
7614 OrthancPluginChunkedClientAnswerAddChunk answerAddChunk;
7615 OrthancPluginChunkedClientAnswerAddHeader answerAddHeader;
7616 uint16_t* httpStatus;
7617 OrthancPluginHttpMethod method;
7618 const char* url;
7619 uint32_t headersCount;
7620 const char* const* headersKeys;
7621 const char* const* headersValues;
7622 void* request;
7623 OrthancPluginChunkedClientRequestIsDone requestIsDone;
7624 OrthancPluginChunkedClientRequestGetChunkData requestChunkData;
7625 OrthancPluginChunkedClientRequestGetChunkSize requestChunkSize;
7626 OrthancPluginChunkedClientRequestNext requestNext;
7627 const char* username;
7628 const char* password;
7629 uint32_t timeout;
7630 const char* certificateFile;
7631 const char* certificateKeyFile;
7632 const char* certificateKeyPassword;
7633 uint8_t pkcs11;
7634 } _OrthancPluginChunkedHttpClient;
7635
7636
7687 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginChunkedHttpClient(
7688 OrthancPluginContext* context,
7689 void* answer,
7690 OrthancPluginChunkedClientAnswerAddChunk answerAddChunk,
7691 OrthancPluginChunkedClientAnswerAddHeader answerAddHeader,
7692 uint16_t* httpStatus,
7693 OrthancPluginHttpMethod method,
7694 const char* url,
7695 uint32_t headersCount,
7696 const char* const* headersKeys,
7697 const char* const* headersValues,
7698 void* request,
7699 OrthancPluginChunkedClientRequestIsDone requestIsDone,
7700 OrthancPluginChunkedClientRequestGetChunkData requestChunkData,
7701 OrthancPluginChunkedClientRequestGetChunkSize requestChunkSize,
7702 OrthancPluginChunkedClientRequestNext requestNext,
7703 const char* username,
7704 const char* password,
7705 uint32_t timeout,
7706 const char* certificateFile,
7707 const char* certificateKeyFile,
7708 const char* certificateKeyPassword,
7709 uint8_t pkcs11)
7710 {
7711 _OrthancPluginChunkedHttpClient params;
7712 memset(&params, 0, sizeof(params));
7713
7714 /* In common with OrthancPluginHttpClient() */
7715 params.httpStatus = httpStatus;
7716 params.method = method;
7717 params.url = url;
7718 params.headersCount = headersCount;
7719 params.headersKeys = headersKeys;
7720 params.headersValues = headersValues;
7721 params.username = username;
7722 params.password = password;
7723 params.timeout = timeout;
7724 params.certificateFile = certificateFile;
7725 params.certificateKeyFile = certificateKeyFile;
7726 params.certificateKeyPassword = certificateKeyPassword;
7727 params.pkcs11 = pkcs11;
7728
7729 /* For chunked body/answer */
7730 params.answer = answer;
7731 params.answerAddChunk = answerAddChunk;
7732 params.answerAddHeader = answerAddHeader;
7733 params.request = request;
7734 params.requestIsDone = requestIsDone;
7735 params.requestChunkData = requestChunkData;
7736 params.requestChunkSize = requestChunkSize;
7737 params.requestNext = requestNext;
7738
7739 return context->InvokeService(context, _OrthancPluginService_ChunkedHttpClient, &params);
7740 }
7741
7742
7743
7748 typedef struct _OrthancPluginServerChunkedRequestReader_t OrthancPluginServerChunkedRequestReader;
7749
7750
7751
7767 typedef OrthancPluginErrorCode (*OrthancPluginServerChunkedRequestReaderFactory) (
7768 OrthancPluginServerChunkedRequestReader** reader,
7769 const char* url,
7770 const OrthancPluginHttpRequest* request);
7771
7772
7786 typedef OrthancPluginErrorCode (*OrthancPluginServerChunkedRequestReaderAddChunk) (
7787 OrthancPluginServerChunkedRequestReader* reader,
7788 const void* data,
7789 uint32_t size);
7790
7791
7806 typedef OrthancPluginErrorCode (*OrthancPluginServerChunkedRequestReaderExecute) (
7807 OrthancPluginServerChunkedRequestReader* reader,
7808 OrthancPluginRestOutput* output);
7809
7810
7824 typedef void (*OrthancPluginServerChunkedRequestReaderFinalize) (
7825 OrthancPluginServerChunkedRequestReader* reader);
7826
7827 typedef struct
7828 {
7829 const char* pathRegularExpression;
7830 OrthancPluginRestCallback getHandler;
7831 OrthancPluginServerChunkedRequestReaderFactory postHandler;
7832 OrthancPluginRestCallback deleteHandler;
7833 OrthancPluginServerChunkedRequestReaderFactory putHandler;
7834 OrthancPluginServerChunkedRequestReaderAddChunk addChunk;
7835 OrthancPluginServerChunkedRequestReaderExecute execute;
7836 OrthancPluginServerChunkedRequestReaderFinalize finalize;
7837 } _OrthancPluginChunkedRestCallback;
7838
7839
7869 ORTHANC_PLUGIN_INLINE void OrthancPluginRegisterChunkedRestCallback(
7870 OrthancPluginContext* context,
7871 const char* pathRegularExpression,
7872 OrthancPluginRestCallback getHandler,
7873 OrthancPluginServerChunkedRequestReaderFactory postHandler,
7874 OrthancPluginRestCallback deleteHandler,
7875 OrthancPluginServerChunkedRequestReaderFactory putHandler,
7876 OrthancPluginServerChunkedRequestReaderAddChunk addChunk,
7877 OrthancPluginServerChunkedRequestReaderExecute execute,
7878 OrthancPluginServerChunkedRequestReaderFinalize finalize)
7879 {
7880 _OrthancPluginChunkedRestCallback params;
7881 params.pathRegularExpression = pathRegularExpression;
7882 params.getHandler = getHandler;
7883 params.postHandler = postHandler;
7884 params.deleteHandler = deleteHandler;
7885 params.putHandler = putHandler;
7886 params.addChunk = addChunk;
7887 params.execute = execute;
7888 params.finalize = finalize;
7889
7890 context->InvokeService(context, _OrthancPluginService_RegisterChunkedRestCallback, &params);
7891 }
7892
7893
7894
7895
7896
7897 typedef struct
7898 {
7899 char** result;
7900 uint16_t group;
7901 uint16_t element;
7902 const char* privateCreator;
7903 } _OrthancPluginGetTagName;
7904
7920 ORTHANC_PLUGIN_INLINE char* OrthancPluginGetTagName(
7921 OrthancPluginContext* context,
7922 uint16_t group,
7923 uint16_t element,
7924 const char* privateCreator)
7925 {
7926 char* result;
7927
7928 _OrthancPluginGetTagName params;
7929 params.result = &result;
7930 params.group = group;
7931 params.element = element;
7932 params.privateCreator = privateCreator;
7933
7934 if (context->InvokeService(context, _OrthancPluginService_GetTagName, &params) != OrthancPluginErrorCode_Success)
7935 {
7936 /* Error */
7937 return NULL;
7938 }
7939 else
7940 {
7941 return result;
7942 }
7943 }
7944
7945
7946
7975 typedef OrthancPluginErrorCode (*OrthancPluginStorageCommitmentFactory) (
7976 void** handler /* out */,
7977 const char* jobId,
7978 const char* transactionUid,
7979 const char* const* sopClassUids,
7980 const char* const* sopInstanceUids,
7981 uint32_t countInstances,
7982 const char* remoteAet,
7983 const char* calledAet);
7984
7985
7997 typedef void (*OrthancPluginStorageCommitmentDestructor) (void* handler);
7998
7999
8018 typedef OrthancPluginErrorCode (*OrthancPluginStorageCommitmentLookup) (
8019 OrthancPluginStorageCommitmentFailureReason* target,
8020 void* handler,
8021 const char* sopClassUid,
8022 const char* sopInstanceUid);
8023
8024
8025 typedef struct
8026 {
8027 OrthancPluginStorageCommitmentFactory factory;
8028 OrthancPluginStorageCommitmentDestructor destructor;
8029 OrthancPluginStorageCommitmentLookup lookup;
8030 } _OrthancPluginRegisterStorageCommitmentScpCallback;
8031
8045 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRegisterStorageCommitmentScpCallback(
8046 OrthancPluginContext* context,
8047 OrthancPluginStorageCommitmentFactory factory,
8048 OrthancPluginStorageCommitmentDestructor destructor,
8049 OrthancPluginStorageCommitmentLookup lookup)
8050 {
8051 _OrthancPluginRegisterStorageCommitmentScpCallback params;
8052 params.factory = factory;
8053 params.destructor = destructor;
8054 params.lookup = lookup;
8055 return context->InvokeService(context, _OrthancPluginService_RegisterStorageCommitmentScpCallback, &params);
8056 }
8057
8058
8059
8085 typedef int32_t (*OrthancPluginIncomingDicomInstanceFilter) (
8086 const OrthancPluginDicomInstance* instance);
8087
8088
8089 typedef struct
8090 {
8091 OrthancPluginIncomingDicomInstanceFilter callback;
8092 } _OrthancPluginIncomingDicomInstanceFilter;
8093
8106 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRegisterIncomingDicomInstanceFilter(
8107 OrthancPluginContext* context,
8108 OrthancPluginIncomingDicomInstanceFilter callback)
8109 {
8110 _OrthancPluginIncomingDicomInstanceFilter params;
8111 params.callback = callback;
8112
8113 return context->InvokeService(context, _OrthancPluginService_RegisterIncomingDicomInstanceFilter, &params);
8114 }
8115
8116
8147 typedef int32_t (*OrthancPluginIncomingCStoreInstanceFilter) (
8148 uint16_t* dimseStatus /* out */,
8149 const OrthancPluginDicomInstance* instance);
8150
8151
8152 typedef struct
8153 {
8154 OrthancPluginIncomingCStoreInstanceFilter callback;
8155 } _OrthancPluginIncomingCStoreInstanceFilter;
8156
8169 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRegisterIncomingCStoreInstanceFilter(
8170 OrthancPluginContext* context,
8171 OrthancPluginIncomingCStoreInstanceFilter callback)
8172 {
8173 _OrthancPluginIncomingCStoreInstanceFilter params;
8174 params.callback = callback;
8175
8176 return context->InvokeService(context, _OrthancPluginService_RegisterIncomingCStoreInstanceFilter, &params);
8177 }
8178
8214 typedef OrthancPluginReceivedInstanceAction (*OrthancPluginReceivedInstanceCallback) (
8215 OrthancPluginMemoryBuffer64* modifiedDicomBuffer,
8216 const void* receivedDicomBuffer,
8217 uint64_t receivedDicomBufferSize,
8218 OrthancPluginInstanceOrigin origin);
8219
8220
8221 typedef struct
8222 {
8223 OrthancPluginReceivedInstanceCallback callback;
8224 } _OrthancPluginReceivedInstanceCallback;
8225
8246 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRegisterReceivedInstanceCallback(
8247 OrthancPluginContext* context,
8248 OrthancPluginReceivedInstanceCallback callback)
8249 {
8250 _OrthancPluginReceivedInstanceCallback params;
8251 params.callback = callback;
8252
8253 return context->InvokeService(context, _OrthancPluginService_RegisterReceivedInstanceCallback, &params);
8254 }
8255
8269 ORTHANC_PLUGIN_INLINE char* OrthancPluginGetInstanceTransferSyntaxUid(
8270 OrthancPluginContext* context,
8271 const OrthancPluginDicomInstance* instance)
8272 {
8273 char* result;
8274
8275 _OrthancPluginAccessDicomInstance params;
8276 memset(&params, 0, sizeof(params));
8277 params.resultStringToFree = &result;
8278 params.instance = instance;
8279
8280 if (context->InvokeService(context, _OrthancPluginService_GetInstanceTransferSyntaxUid, &params) != OrthancPluginErrorCode_Success)
8281 {
8282 /* Error */
8283 return NULL;
8284 }
8285 else
8286 {
8287 return result;
8288 }
8289 }
8290
8291
8304 ORTHANC_PLUGIN_INLINE int32_t OrthancPluginHasInstancePixelData(
8305 OrthancPluginContext* context,
8306 const OrthancPluginDicomInstance* instance)
8307 {
8308 int64_t hasPixelData;
8309
8310 _OrthancPluginAccessDicomInstance params;
8311 memset(&params, 0, sizeof(params));
8312 params.resultInt64 = &hasPixelData;
8313 params.instance = instance;
8314
8315 if (context->InvokeService(context, _OrthancPluginService_HasInstancePixelData, &params) != OrthancPluginErrorCode_Success ||
8316 hasPixelData < 0 ||
8317 hasPixelData > 1)
8318 {
8319 /* Error */
8320 return -1;
8321 }
8322 else
8323 {
8324 return (hasPixelData != 0);
8325 }
8326 }
8327
8328
8329
8330
8331
8332
8333 typedef struct
8334 {
8335 OrthancPluginDicomInstance** target;
8336 const void* buffer;
8337 uint32_t size;
8338 const char* transferSyntax;
8339 } _OrthancPluginCreateDicomInstance;
8340
8354 ORTHANC_PLUGIN_INLINE OrthancPluginDicomInstance* OrthancPluginCreateDicomInstance(
8355 OrthancPluginContext* context,
8356 const void* buffer,
8357 uint32_t size)
8358 {
8359 OrthancPluginDicomInstance* target = NULL;
8360
8361 _OrthancPluginCreateDicomInstance params;
8362 params.target = &target;
8363 params.buffer = buffer;
8364 params.size = size;
8365
8366 if (context->InvokeService(context, _OrthancPluginService_CreateDicomInstance, &params) != OrthancPluginErrorCode_Success)
8367 {
8368 /* Error */
8369 return NULL;
8370 }
8371 else
8372 {
8373 return target;
8374 }
8375 }
8376
8377 typedef struct
8378 {
8379 OrthancPluginDicomInstance* dicom;
8380 } _OrthancPluginFreeDicomInstance;
8381
8392 ORTHANC_PLUGIN_INLINE void OrthancPluginFreeDicomInstance(
8393 OrthancPluginContext* context,
8394 OrthancPluginDicomInstance* dicom)
8395 {
8396 _OrthancPluginFreeDicomInstance params;
8397 params.dicom = dicom;
8398
8399 context->InvokeService(context, _OrthancPluginService_FreeDicomInstance, &params);
8400 }
8401
8402
8403 typedef struct
8404 {
8405 uint32_t* targetUint32;
8406 OrthancPluginMemoryBuffer* targetBuffer;
8407 OrthancPluginImage** targetImage;
8408 char** targetStringToFree;
8409 const OrthancPluginDicomInstance* instance;
8410 uint32_t frameIndex;
8411 OrthancPluginDicomToJsonFormat format;
8412 OrthancPluginDicomToJsonFlags flags;
8413 uint32_t maxStringLength;
8414 OrthancPluginDicomWebBinaryCallback2 dicomWebCallback;
8415 void* dicomWebPayload;
8416 } _OrthancPluginAccessDicomInstance2;
8417
8429 ORTHANC_PLUGIN_INLINE uint32_t OrthancPluginGetInstanceFramesCount(
8430 OrthancPluginContext* context,
8431 const OrthancPluginDicomInstance* instance)
8432 {
8433 uint32_t count;
8434
8435 _OrthancPluginAccessDicomInstance2 params;
8436 memset(&params, 0, sizeof(params));
8437 params.targetUint32 = &count;
8438 params.instance = instance;
8439
8440 if (context->InvokeService(context, _OrthancPluginService_GetInstanceFramesCount, &params) != OrthancPluginErrorCode_Success)
8441 {
8442 /* Error */
8443 return 0;
8444 }
8445 else
8446 {
8447 return count;
8448 }
8449 }
8450
8451
8469 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginGetInstanceRawFrame(
8470 OrthancPluginContext* context,
8471 OrthancPluginMemoryBuffer* target,
8472 const OrthancPluginDicomInstance* instance,
8473 uint32_t frameIndex)
8474 {
8475 _OrthancPluginAccessDicomInstance2 params;
8476 memset(&params, 0, sizeof(params));
8477 params.targetBuffer = target;
8478 params.instance = instance;
8479 params.frameIndex = frameIndex;
8480
8481 return context->InvokeService(context, _OrthancPluginService_GetInstanceRawFrame, &params);
8482 }
8483
8484
8497 ORTHANC_PLUGIN_INLINE OrthancPluginImage* OrthancPluginGetInstanceDecodedFrame(
8498 OrthancPluginContext* context,
8499 const OrthancPluginDicomInstance* instance,
8500 uint32_t frameIndex)
8501 {
8502 OrthancPluginImage* target = NULL;
8503
8504 _OrthancPluginAccessDicomInstance2 params;
8505 memset(&params, 0, sizeof(params));
8506 params.targetImage = &target;
8507 params.instance = instance;
8508 params.frameIndex = frameIndex;
8509
8510 if (context->InvokeService(context, _OrthancPluginService_GetInstanceDecodedFrame, &params) != OrthancPluginErrorCode_Success)
8511 {
8512 return NULL;
8513 }
8514 else
8515 {
8516 return target;
8517 }
8518 }
8519
8520
8536 ORTHANC_PLUGIN_INLINE OrthancPluginDicomInstance* OrthancPluginTranscodeDicomInstance(
8537 OrthancPluginContext* context,
8538 const void* buffer,
8539 uint32_t size,
8540 const char* transferSyntax)
8541 {
8542 OrthancPluginDicomInstance* target = NULL;
8543
8544 _OrthancPluginCreateDicomInstance params;
8545 params.target = &target;
8546 params.buffer = buffer;
8547 params.size = size;
8548 params.transferSyntax = transferSyntax;
8549
8550 if (context->InvokeService(context, _OrthancPluginService_TranscodeDicomInstance, &params) != OrthancPluginErrorCode_Success)
8551 {
8552 /* Error */
8553 return NULL;
8554 }
8555 else
8556 {
8557 return target;
8558 }
8559 }
8560
8574 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginSerializeDicomInstance(
8575 OrthancPluginContext* context,
8576 OrthancPluginMemoryBuffer* target,
8577 const OrthancPluginDicomInstance* instance)
8578 {
8579 _OrthancPluginAccessDicomInstance2 params;
8580 memset(&params, 0, sizeof(params));
8581 params.targetBuffer = target;
8582 params.instance = instance;
8583
8584 return context->InvokeService(context, _OrthancPluginService_SerializeDicomInstance, &params);
8585 }
8586
8587
8606 ORTHANC_PLUGIN_INLINE char* OrthancPluginGetInstanceAdvancedJson(
8607 OrthancPluginContext* context,
8608 const OrthancPluginDicomInstance* instance,
8609 OrthancPluginDicomToJsonFormat format,
8610 OrthancPluginDicomToJsonFlags flags,
8611 uint32_t maxStringLength)
8612 {
8613 char* result = NULL;
8614
8615 _OrthancPluginAccessDicomInstance2 params;
8616 memset(&params, 0, sizeof(params));
8617 params.targetStringToFree = &result;
8618 params.instance = instance;
8619 params.format = format;
8620 params.flags = flags;
8621 params.maxStringLength = maxStringLength;
8622
8623 if (context->InvokeService(context, _OrthancPluginService_GetInstanceAdvancedJson, &params) != OrthancPluginErrorCode_Success)
8624 {
8625 /* Error */
8626 return NULL;
8627 }
8628 else
8629 {
8630 return result;
8631 }
8632 }
8633
8634
8649 ORTHANC_PLUGIN_INLINE char* OrthancPluginGetInstanceDicomWebJson(
8650 OrthancPluginContext* context,
8651 const OrthancPluginDicomInstance* instance,
8652 OrthancPluginDicomWebBinaryCallback2 callback,
8653 void* payload)
8654 {
8655 char* target = NULL;
8656
8657 _OrthancPluginAccessDicomInstance2 params;
8658 params.targetStringToFree = &target;
8659 params.instance = instance;
8660 params.dicomWebCallback = callback;
8661 params.dicomWebPayload = payload;
8662
8663 if (context->InvokeService(context, _OrthancPluginService_GetInstanceDicomWebJson, &params) != OrthancPluginErrorCode_Success)
8664 {
8665 /* Error */
8666 return NULL;
8667 }
8668 else
8669 {
8670 return target;
8671 }
8672 }
8673
8674
8689 ORTHANC_PLUGIN_INLINE char* OrthancPluginGetInstanceDicomWebXml(
8690 OrthancPluginContext* context,
8691 const OrthancPluginDicomInstance* instance,
8692 OrthancPluginDicomWebBinaryCallback2 callback,
8693 void* payload)
8694 {
8695 char* target = NULL;
8696
8697 _OrthancPluginAccessDicomInstance2 params;
8698 params.targetStringToFree = &target;
8699 params.instance = instance;
8700 params.dicomWebCallback = callback;
8701 params.dicomWebPayload = payload;
8702
8703 if (context->InvokeService(context, _OrthancPluginService_GetInstanceDicomWebXml, &params) != OrthancPluginErrorCode_Success)
8704 {
8705 /* Error */
8706 return NULL;
8707 }
8708 else
8709 {
8710 return target;
8711 }
8712 }
8713
8714
8715
8734 typedef OrthancPluginErrorCode (*OrthancPluginTranscoderCallback) (
8735 OrthancPluginMemoryBuffer* transcoded /* out */,
8736 const void* buffer,
8737 uint64_t size,
8738 const char* const* allowedSyntaxes,
8739 uint32_t countSyntaxes,
8740 uint8_t allowNewSopInstanceUid);
8741
8742
8743 typedef struct
8744 {
8745 OrthancPluginTranscoderCallback callback;
8746 } _OrthancPluginTranscoderCallback;
8747
8761 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRegisterTranscoderCallback(
8762 OrthancPluginContext* context,
8763 OrthancPluginTranscoderCallback callback)
8764 {
8765 _OrthancPluginTranscoderCallback params;
8766 params.callback = callback;
8767
8768 return context->InvokeService(context, _OrthancPluginService_RegisterTranscoderCallback, &params);
8769 }
8770
8771
8772
8773 typedef struct
8774 {
8775 OrthancPluginMemoryBuffer* target;
8776 uint32_t size;
8777 } _OrthancPluginCreateMemoryBuffer;
8778
8796 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginCreateMemoryBuffer(
8797 OrthancPluginContext* context,
8798 OrthancPluginMemoryBuffer* target,
8799 uint32_t size)
8800 {
8801 _OrthancPluginCreateMemoryBuffer params;
8802 params.target = target;
8803 params.size = size;
8804
8805 return context->InvokeService(context, _OrthancPluginService_CreateMemoryBuffer, &params);
8806 }
8807
8808
8834 ORTHANC_PLUGIN_INLINE char* OrthancPluginGenerateRestApiAuthorizationToken(
8835 OrthancPluginContext* context)
8836 {
8837 char* result;
8838
8839 _OrthancPluginRetrieveDynamicString params;
8840 params.result = &result;
8841 params.argument = NULL;
8842
8843 if (context->InvokeService(context, _OrthancPluginService_GenerateRestApiAuthorizationToken,
8844 &params) != OrthancPluginErrorCode_Success)
8845 {
8846 /* Error */
8847 return NULL;
8848 }
8849 else
8850 {
8851 return result;
8852 }
8853 }
8854
8855
8856
8857 typedef struct
8858 {
8859 OrthancPluginMemoryBuffer64* target;
8860 uint64_t size;
8861 } _OrthancPluginCreateMemoryBuffer64;
8862
8880 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginCreateMemoryBuffer64(
8881 OrthancPluginContext* context,
8882 OrthancPluginMemoryBuffer64* target,
8883 uint64_t size)
8884 {
8885 _OrthancPluginCreateMemoryBuffer64 params;
8886 params.target = target;
8887 params.size = size;
8888
8889 return context->InvokeService(context, _OrthancPluginService_CreateMemoryBuffer64, &params);
8890 }
8891
8892
8893 typedef struct
8894 {
8895 OrthancPluginStorageCreate create;
8896 OrthancPluginStorageReadWhole readWhole;
8897 OrthancPluginStorageReadRange readRange;
8898 OrthancPluginStorageRemove remove;
8899 } _OrthancPluginRegisterStorageArea2;
8900
8917 ORTHANC_PLUGIN_INLINE void OrthancPluginRegisterStorageArea2(
8918 OrthancPluginContext* context,
8919 OrthancPluginStorageCreate create,
8920 OrthancPluginStorageReadWhole readWhole,
8921 OrthancPluginStorageReadRange readRange,
8922 OrthancPluginStorageRemove remove)
8923 {
8924 _OrthancPluginRegisterStorageArea2 params;
8925 params.create = create;
8926 params.readWhole = readWhole;
8927 params.readRange = readRange;
8928 params.remove = remove;
8929 context->InvokeService(context, _OrthancPluginService_RegisterStorageArea2, &params);
8930 }
8931
8932
8933
8934 typedef struct
8935 {
8936 _OrthancPluginCreateDicom createDicom;
8937 const char* privateCreator;
8938 } _OrthancPluginCreateDicom2;
8939
8964 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginCreateDicom2(
8965 OrthancPluginContext* context,
8966 OrthancPluginMemoryBuffer* target,
8967 const char* json,
8968 const OrthancPluginImage* pixelData,
8969 OrthancPluginCreateDicomFlags flags,
8970 const char* privateCreator)
8971 {
8972 _OrthancPluginCreateDicom2 params;
8973 params.createDicom.target = target;
8974 params.createDicom.json = json;
8975 params.createDicom.pixelData = pixelData;
8976 params.createDicom.flags = flags;
8977 params.privateCreator = privateCreator;
8978
8979 return context->InvokeService(context, _OrthancPluginService_CreateDicom2, &params);
8980 }
8981
8982
8983
8984
8985
8986
8987 typedef struct
8988 {
8989 OrthancPluginMemoryBuffer* answerBody;
8990 OrthancPluginMemoryBuffer* answerHeaders;
8991 uint16_t* httpStatus;
8992 OrthancPluginHttpMethod method;
8993 const char* uri;
8994 uint32_t headersCount;
8995 const char* const* headersKeys;
8996 const char* const* headersValues;
8997 const void* body;
8998 uint32_t bodySize;
8999 uint8_t afterPlugins;
9000 } _OrthancPluginCallRestApi;
9001
9032 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginCallRestApi(
9033 OrthancPluginContext* context,
9034 OrthancPluginMemoryBuffer* answerBody,
9035 OrthancPluginMemoryBuffer* answerHeaders,
9036 uint16_t* httpStatus,
9037 OrthancPluginHttpMethod method,
9038 const char* uri,
9039 uint32_t headersCount,
9040 const char* const* headersKeys,
9041 const char* const* headersValues,
9042 const void* body,
9043 uint32_t bodySize,
9044 uint8_t afterPlugins)
9045 {
9046 _OrthancPluginCallRestApi params;
9047 memset(&params, 0, sizeof(params));
9048
9049 params.answerBody = answerBody;
9050 params.answerHeaders = answerHeaders;
9051 params.httpStatus = httpStatus;
9052 params.method = method;
9053 params.uri = uri;
9054 params.headersCount = headersCount;
9055 params.headersKeys = headersKeys;
9056 params.headersValues = headersValues;
9057 params.body = body;
9058 params.bodySize = bodySize;
9059 params.afterPlugins = afterPlugins;
9060
9061 return context->InvokeService(context, _OrthancPluginService_CallRestApi, &params);
9062 }
9063
9064
9065
9070 typedef struct _OrthancPluginWebDavCollection_t OrthancPluginWebDavCollection;
9071
9072
9089 typedef OrthancPluginErrorCode (*OrthancPluginWebDavAddFile) (
9090 OrthancPluginWebDavCollection* collection,
9091 const char* name,
9092 uint64_t size,
9093 const char* mimeType,
9094 const char* dateTime);
9095
9096
9110 typedef OrthancPluginErrorCode (*OrthancPluginWebDavAddFolder) (
9111 OrthancPluginWebDavCollection* collection,
9112 const char* name,
9113 const char* dateTime);
9114
9115
9137 typedef OrthancPluginErrorCode (*OrthancPluginWebDavRetrieveFile) (
9138 OrthancPluginWebDavCollection* collection,
9139 const void* data,
9140 uint64_t size,
9141 const char* mimeType,
9142 const char* dateTime);
9143
9144
9158 typedef OrthancPluginErrorCode (*OrthancPluginWebDavIsExistingFolderCallback) (
9159 uint8_t* isExisting, /* out */
9160 uint32_t pathSize,
9161 const char* const* pathItems,
9162 void* payload);
9163
9164
9183 typedef OrthancPluginErrorCode (*OrthancPluginWebDavListFolderCallback) (
9184 uint8_t* isExisting, /* out */
9185 OrthancPluginWebDavCollection* collection,
9186 OrthancPluginWebDavAddFile addFile,
9187 OrthancPluginWebDavAddFolder addFolder,
9188 uint32_t pathSize,
9189 const char* const* pathItems,
9190 void* payload);
9191
9192
9209 typedef OrthancPluginErrorCode (*OrthancPluginWebDavRetrieveFileCallback) (
9210 OrthancPluginWebDavCollection* collection,
9211 OrthancPluginWebDavRetrieveFile retrieveFile,
9212 uint32_t pathSize,
9213 const char* const* pathItems,
9214 void* payload);
9215
9216
9232 typedef OrthancPluginErrorCode (*OrthancPluginWebDavStoreFileCallback) (
9233 uint8_t* isReadOnly, /* out */
9234 uint32_t pathSize,
9235 const char* const* pathItems,
9236 const void* data,
9237 uint64_t size,
9238 void* payload);
9239
9240
9254 typedef OrthancPluginErrorCode (*OrthancPluginWebDavCreateFolderCallback) (
9255 uint8_t* isReadOnly, /* out */
9256 uint32_t pathSize,
9257 const char* const* pathItems,
9258 void* payload);
9259
9260
9274 typedef OrthancPluginErrorCode (*OrthancPluginWebDavDeleteItemCallback) (
9275 uint8_t* isReadOnly, /* out */
9276 uint32_t pathSize,
9277 const char* const* pathItems,
9278 void* payload);
9279
9280
9281 typedef struct
9282 {
9283 const char* uri;
9284 OrthancPluginWebDavIsExistingFolderCallback isExistingFolder;
9285 OrthancPluginWebDavListFolderCallback listFolder;
9286 OrthancPluginWebDavRetrieveFileCallback retrieveFile;
9287 OrthancPluginWebDavStoreFileCallback storeFile;
9288 OrthancPluginWebDavCreateFolderCallback createFolder;
9289 OrthancPluginWebDavDeleteItemCallback deleteItem;
9290 void* payload;
9291 } _OrthancPluginRegisterWebDavCollection;
9292
9313 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRegisterWebDavCollection(
9314 OrthancPluginContext* context,
9315 const char* uri,
9316 OrthancPluginWebDavIsExistingFolderCallback isExistingFolder,
9317 OrthancPluginWebDavListFolderCallback listFolder,
9318 OrthancPluginWebDavRetrieveFileCallback retrieveFile,
9319 OrthancPluginWebDavStoreFileCallback storeFile,
9320 OrthancPluginWebDavCreateFolderCallback createFolder,
9321 OrthancPluginWebDavDeleteItemCallback deleteItem,
9322 void* payload)
9323 {
9324 _OrthancPluginRegisterWebDavCollection params;
9325 params.uri = uri;
9326 params.isExistingFolder = isExistingFolder;
9327 params.listFolder = listFolder;
9328 params.retrieveFile = retrieveFile;
9329 params.storeFile = storeFile;
9330 params.createFolder = createFolder;
9331 params.deleteItem = deleteItem;
9332 params.payload = payload;
9333
9334 return context->InvokeService(context, _OrthancPluginService_RegisterWebDavCollection, &params);
9335 }
9336
9337
9346 ORTHANC_PLUGIN_INLINE const char* OrthancPluginGetDatabaseServerIdentifier(
9347 OrthancPluginContext* context)
9348 {
9349 const char* result;
9350
9351 _OrthancPluginRetrieveStaticString params;
9352 params.result = &result;
9353 params.argument = NULL;
9354
9355 if (context->InvokeService(context, _OrthancPluginService_GetDatabaseServerIdentifier, &params) != OrthancPluginErrorCode_Success)
9356 {
9357 /* Error */
9358 return NULL;
9359 }
9360 else
9361 {
9362 return result;
9363 }
9364 }
9365
9366
9373 typedef OrthancPluginErrorCode (*OrthancPluginCallDatabaseBackendV4) (
9374 OrthancPluginMemoryBuffer64* response,
9375 void* backend,
9376 const void* request,
9377 uint64_t requestSize);
9378
9384 typedef void (*OrthancPluginFinalizeDatabaseBackendV4) (void* backend);
9385
9386 typedef struct
9387 {
9388 void* backend;
9389 uint32_t maxDatabaseRetries;
9390 OrthancPluginCallDatabaseBackendV4 operations;
9391 OrthancPluginFinalizeDatabaseBackendV4 finalize;
9392 } _OrthancPluginRegisterDatabaseBackendV4;
9393
9411 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRegisterDatabaseBackendV4(
9412 OrthancPluginContext* context,
9413 void* backend,
9414 uint32_t maxDatabaseRetries,
9415 OrthancPluginCallDatabaseBackendV4 operations,
9416 OrthancPluginFinalizeDatabaseBackendV4 finalize)
9417 {
9418 _OrthancPluginRegisterDatabaseBackendV4 params;
9419 params.backend = backend;
9420 params.maxDatabaseRetries = maxDatabaseRetries;
9421 params.operations = operations;
9422 params.finalize = finalize;
9423
9424 return context->InvokeService(context, _OrthancPluginService_RegisterDatabaseBackendV4, &params);
9425 }
9426
9427
9428 typedef struct
9429 {
9430 OrthancPluginDicomInstance** target;
9431 const char* instanceId;
9432 OrthancPluginLoadDicomInstanceMode mode;
9433 } _OrthancPluginLoadDicomInstance;
9434
9448 ORTHANC_PLUGIN_INLINE OrthancPluginDicomInstance* OrthancPluginLoadDicomInstance(
9449 OrthancPluginContext* context,
9450 const char* instanceId,
9451 OrthancPluginLoadDicomInstanceMode mode)
9452 {
9453 OrthancPluginDicomInstance* target = NULL;
9454
9455 _OrthancPluginLoadDicomInstance params;
9456 params.target = &target;
9457 params.instanceId = instanceId;
9458 params.mode = mode;
9459
9460 if (context->InvokeService(context, _OrthancPluginService_LoadDicomInstance, &params) != OrthancPluginErrorCode_Success)
9461 {
9462 /* Error */
9463 return NULL;
9464 }
9465 else
9466 {
9467 return target;
9468 }
9469 }
9470
9471
9472 typedef struct
9473 {
9474 const char* name;
9475 int64_t value;
9476 OrthancPluginMetricsType type;
9477 } _OrthancPluginSetMetricsIntegerValue;
9478
9494 ORTHANC_PLUGIN_INLINE void OrthancPluginSetMetricsIntegerValue(
9495 OrthancPluginContext* context,
9496 const char* name,
9497 int64_t value,
9498 OrthancPluginMetricsType type)
9499 {
9500 _OrthancPluginSetMetricsIntegerValue params;
9501 params.name = name;
9502 params.value = value;
9503 params.type = type;
9504 context->InvokeService(context, _OrthancPluginService_SetMetricsIntegerValue, &params);
9505 }
9506
9507
9521 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginSetCurrentThreadName(
9522 OrthancPluginContext* context,
9523 const char* threadName)
9524 {
9525 return context->InvokeService(context, _OrthancPluginService_SetCurrentThreadName, threadName);
9526 }
9527
9528
9529 typedef struct
9530 {
9531 /* Note: This structure is also defined in Logging.h and it must be binary compatible */
9532 const char* message;
9533 const char* plugin;
9534 const char* file;
9535 uint32_t line;
9536 OrthancPluginLogCategory category;
9537 OrthancPluginLogLevel level;
9538 } _OrthancPluginLogMessage;
9539
9540
9554 ORTHANC_PLUGIN_INLINE void OrthancPluginLogMessage(
9555 OrthancPluginContext* context,
9556 const char* message,
9557 const char* plugin,
9558 const char* file,
9559 uint32_t line,
9560 OrthancPluginLogCategory category,
9561 OrthancPluginLogLevel level)
9562 {
9563 _OrthancPluginLogMessage m;
9564 m.message = message;
9565 m.plugin = plugin;
9566 m.file = file;
9567 m.line = line;
9568 m.category = category;
9569 m.level = level;
9570 context->InvokeService(context, _OrthancPluginService_LogMessage, &m);
9571 }
9572
9573
9574 typedef struct
9575 {
9576 OrthancPluginRestOutput* output;
9577 const char* contentType;
9578 } _OrthancPluginStartStreamAnswer;
9579
9592 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginStartStreamAnswer(
9593 OrthancPluginContext* context,
9594 OrthancPluginRestOutput* output,
9595 const char* contentType)
9596 {
9597 _OrthancPluginStartStreamAnswer params;
9598 params.output = output;
9599 params.contentType = contentType;
9600 return context->InvokeService(context, _OrthancPluginService_StartStreamAnswer, &params);
9601 }
9602
9603
9619 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginSendStreamChunk(
9620 OrthancPluginContext* context,
9621 OrthancPluginRestOutput* output,
9622 const void* answer,
9623 uint32_t answerSize)
9624 {
9625 _OrthancPluginAnswerBuffer params;
9626 params.output = output;
9627 params.answer = answer;
9628 params.answerSize = answerSize;
9629 params.mimeType = NULL;
9630 return context->InvokeService(context, _OrthancPluginService_SendStreamChunk, &params);
9631 }
9632
9633
9634#ifdef __cplusplus
9635}
9636#endif
9637
9638
9640
OrthancPluginRegisterDatabaseBackendV4
OrthancPluginErrorCode OrthancPluginRegisterDatabaseBackendV4(OrthancPluginContext *context, void *backend, uint32_t maxDatabaseRetries, OrthancPluginCallDatabaseBackendV4 operations, OrthancPluginFinalizeDatabaseBackendV4 finalize)
Register a custom database back-end.
Definition OrthancCPlugin.h:9411
OrthancPluginCallDatabaseBackendV4
OrthancPluginErrorCode(* OrthancPluginCallDatabaseBackendV4)(OrthancPluginMemoryBuffer64 *response, void *backend, const void *request, uint64_t requestSize)
Signature of a callback function that is triggered when the Orthanc core requests an operation from t...
Definition OrthancCPlugin.h:9373
OrthancPluginReceivedInstanceCallback
OrthancPluginReceivedInstanceAction(* OrthancPluginReceivedInstanceCallback)(OrthancPluginMemoryBuffer64 *modifiedDicomBuffer, const void *receivedDicomBuffer, uint64_t receivedDicomBufferSize, OrthancPluginInstanceOrigin origin)
Callback to keep/discard/modify a DICOM instance received by Orthanc from any source (C-STORE or REST...
Definition OrthancCPlugin.h:8214
OrthancPluginWebDavAddFile
OrthancPluginErrorCode(* OrthancPluginWebDavAddFile)(OrthancPluginWebDavCollection *collection, const char *name, uint64_t size, const char *mimeType, const char *dateTime)
Declare a file while returning the content of a folder.
Definition OrthancCPlugin.h:9089
OrthancPluginRegisterStorageArea
void OrthancPluginRegisterStorageArea(OrthancPluginContext *context, OrthancPluginStorageCreate create, OrthancPluginStorageRead read, OrthancPluginStorageRemove remove)
Register a custom storage area.
Definition OrthancCPlugin.h:3328
OrthancPluginRegisterOnStoredInstanceCallback
void OrthancPluginRegisterOnStoredInstanceCallback(OrthancPluginContext *context, OrthancPluginOnStoredInstanceCallback callback)
Register a callback for received instances.
Definition OrthancCPlugin.h:2293
OrthancPluginDicomWebSetBinaryNode
void(* OrthancPluginDicomWebSetBinaryNode)(OrthancPluginDicomWebNode *node, OrthancPluginDicomWebBinaryMode mode, const char *bulkDataUri)
Signature of a function to set the content of a node encoding a binary DICOM tag, into a JSON or XML ...
Definition OrthancCPlugin.h:1332
OrthancPluginRegisterDecodeImageCallback
OrthancPluginErrorCode OrthancPluginRegisterDecodeImageCallback(OrthancPluginContext *context, OrthancPluginDecodeImageCallback callback)
Register a callback to handle the decoding of DICOM images.
Definition OrthancCPlugin.h:5640
OrthancPluginChangeType
OrthancPluginChangeType
Definition OrthancCPlugin.h:759
OrthancPluginStorageReadWhole
OrthancPluginErrorCode(* OrthancPluginStorageReadWhole)(OrthancPluginMemoryBuffer64 *target, const char *uuid, OrthancPluginContentType type)
Callback for reading a whole file from the storage area.
Definition OrthancCPlugin.h:1398
OrthancPluginRegisterIncomingCStoreInstanceFilter
OrthancPluginErrorCode OrthancPluginRegisterIncomingCStoreInstanceFilter(OrthancPluginContext *context, OrthancPluginIncomingCStoreInstanceFilter callback)
Register a callback to filter incoming DICOM instances received by Orthanc through C-STORE.
Definition OrthancCPlugin.h:8169
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:1310
OrthancPluginRegisterRefreshMetricsCallback
void OrthancPluginRegisterRefreshMetricsCallback(OrthancPluginContext *context, OrthancPluginRefreshMetricsCallback callback)
Register a callback to refresh the metrics.
Definition OrthancCPlugin.h:7300
OrthancPluginWebDavCreateFolderCallback
OrthancPluginErrorCode(* OrthancPluginWebDavCreateFolderCallback)(uint8_t *isReadOnly, uint32_t pathSize, const char *const *pathItems, void *payload)
Callback to create a folder.
Definition OrthancCPlugin.h:9254
OrthancPluginWebDavCollection
struct _OrthancPluginWebDavCollection_t OrthancPluginWebDavCollection
Opaque structure that represents a WebDAV collection.
Definition OrthancCPlugin.h:9070
OrthancPluginDicomWebBinaryCallback
void(* OrthancPluginDicomWebBinaryCallback)(OrthancPluginDicomWebNode *node, OrthancPluginDicomWebSetBinaryNode setter, uint32_t levelDepth, const uint16_t *levelTagGroup, const uint16_t *levelTagElement, const uint32_t *levelIndex, uint16_t tagGroup, uint16_t tagElement, OrthancPluginValueRepresentation vr)
Callback executed to encode a binary tag in DICOMweb.
Definition OrthancCPlugin.h:1868
OrthancPluginWebDavRetrieveFileCallback
OrthancPluginErrorCode(* OrthancPluginWebDavRetrieveFileCallback)(OrthancPluginWebDavCollection *collection, OrthancPluginWebDavRetrieveFile retrieveFile, uint32_t pathSize, const char *const *pathItems, void *payload)
Callback for retrieving the content of a file.
Definition OrthancCPlugin.h:9209
OrthancPluginIncomingDicomInstanceFilter
int32_t(* OrthancPluginIncomingDicomInstanceFilter)(const OrthancPluginDicomInstance *instance)
Callback to filter incoming DICOM instances received by Orthanc.
Definition OrthancCPlugin.h:8085
OrthancPluginStorageAreaRemove
OrthancPluginErrorCode OrthancPluginStorageAreaRemove(OrthancPluginContext *context, OrthancPluginStorageArea *storageArea, const char *uuid, OrthancPluginContentType type)
Remove a file from the storage area.
Definition OrthancCPlugin.h:4998
OrthancPluginTranscoderCallback
OrthancPluginErrorCode(* OrthancPluginTranscoderCallback)(OrthancPluginMemoryBuffer *transcoded, const void *buffer, uint64_t size, const char *const *allowedSyntaxes, uint32_t countSyntaxes, uint8_t allowNewSopInstanceUid)
Signature of a callback function to transcode a DICOM instance.
Definition OrthancCPlugin.h:8734
OrthancPluginRegisterIncomingHttpRequestFilter2
OrthancPluginErrorCode OrthancPluginRegisterIncomingHttpRequestFilter2(OrthancPluginContext *context, OrthancPluginIncomingHttpRequestFilter2 callback)
Register a callback to filter incoming HTTP requests.
Definition OrthancCPlugin.h:6543
OrthancPluginWebDavRetrieveFile
OrthancPluginErrorCode(* OrthancPluginWebDavRetrieveFile)(OrthancPluginWebDavCollection *collection, const void *data, uint64_t size, const char *mimeType, const char *dateTime)
Retrieve the content of a file.
Definition OrthancCPlugin.h:9137
OrthancPluginStorageRead
OrthancPluginErrorCode(* OrthancPluginStorageRead)(void **content, int64_t *size, const char *uuid, OrthancPluginContentType type)
Callback for reading from the storage area.
Definition OrthancCPlugin.h:1378
OrthancPluginRegisterRestCallback
void OrthancPluginRegisterRestCallback(OrthancPluginContext *context, const char *pathRegularExpression, OrthancPluginRestCallback callback)
Register a REST callback.
Definition OrthancCPlugin.h:2215
OrthancPluginGetExpectedDatabaseVersion
uint32_t OrthancPluginGetExpectedDatabaseVersion(OrthancPluginContext *context)
Get the expected version of the database schema.
Definition OrthancCPlugin.h:3802
OrthancPluginRegisterReceivedInstanceCallback
OrthancPluginErrorCode OrthancPluginRegisterReceivedInstanceCallback(OrthancPluginContext *context, OrthancPluginReceivedInstanceCallback callback)
Register a callback to keep/discard/modify a DICOM instance received by Orthanc from any source (C-ST...
Definition OrthancCPlugin.h:8246
OrthancPluginCheckVersion
int32_t OrthancPluginCheckVersion(OrthancPluginContext *context)
Check the compatibility of the plugin wrt. the version of its hosting Orthanc.
Definition OrthancCPlugin.h:2096
OrthancPluginWebDavListFolderCallback
OrthancPluginErrorCode(* OrthancPluginWebDavListFolderCallback)(uint8_t *isExisting, OrthancPluginWebDavCollection *collection, OrthancPluginWebDavAddFile addFile, OrthancPluginWebDavAddFolder addFolder, uint32_t pathSize, const char *const *pathItems, void *payload)
Callback for listing the content of a folder.
Definition OrthancCPlugin.h:9183
OrthancPluginJobsUnserializer
OrthancPluginJob *(* OrthancPluginJobsUnserializer)(const char *jobType, const char *serialized)
Callback executed to unserialize a custom job.
Definition OrthancCPlugin.h:1821
OrthancPluginRestOutput
struct _OrthancPluginRestOutput_t OrthancPluginRestOutput
Opaque structure that represents the HTTP connection to the client application.
Definition OrthancCPlugin.h:1181
OrthancPluginRegisterOnChangeCallback
void OrthancPluginRegisterOnChangeCallback(OrthancPluginContext *context, OrthancPluginOnChangeCallback callback)
Register a callback to monitor changes.
Definition OrthancCPlugin.h:3471
OrthancPluginRegisterStorageArea2
void OrthancPluginRegisterStorageArea2(OrthancPluginContext *context, OrthancPluginStorageCreate create, OrthancPluginStorageReadWhole readWhole, OrthancPluginStorageReadRange readRange, OrthancPluginStorageRemove remove)
Register a custom storage area, with support for range request.
Definition OrthancCPlugin.h:8917
OrthancPluginWebDavAddFolder
OrthancPluginErrorCode(* OrthancPluginWebDavAddFolder)(OrthancPluginWebDavCollection *collection, const char *name, const char *dateTime)
Declare a subfolder while returning the content of a folder.
Definition OrthancCPlugin.h:9110
OrthancPluginRegisterWebDavCollection
OrthancPluginErrorCode OrthancPluginRegisterWebDavCollection(OrthancPluginContext *context, const char *uri, OrthancPluginWebDavIsExistingFolderCallback isExistingFolder, OrthancPluginWebDavListFolderCallback listFolder, OrthancPluginWebDavRetrieveFileCallback retrieveFile, OrthancPluginWebDavStoreFileCallback storeFile, OrthancPluginWebDavCreateFolderCallback createFolder, OrthancPluginWebDavDeleteItemCallback deleteItem, void *payload)
Register a WebDAV virtual filesystem.
Definition OrthancCPlugin.h:9313
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:1524
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:1278
OrthancPluginRefreshMetricsCallback
void(* OrthancPluginRefreshMetricsCallback)()
Callback executed to update the metrics of the plugin.
Definition OrthancCPlugin.h:1840
OrthancPluginRegisterTranscoderCallback
OrthancPluginErrorCode OrthancPluginRegisterTranscoderCallback(OrthancPluginContext *context, OrthancPluginTranscoderCallback callback)
Register a callback to handle the transcoding of DICOM images.
Definition OrthancCPlugin.h:8761
OrthancPluginOnStoredInstanceCallback
OrthancPluginErrorCode(* OrthancPluginOnStoredInstanceCallback)(const OrthancPluginDicomInstance *instance, const char *instanceId)
Signature of a callback function that is triggered when Orthanc stores a new DICOM instance.
Definition OrthancCPlugin.h:1289
OrthancPluginWebDavStoreFileCallback
OrthancPluginErrorCode(* OrthancPluginWebDavStoreFileCallback)(uint8_t *isReadOnly, uint32_t pathSize, const char *const *pathItems, const void *data, uint64_t size, void *payload)
Callback to store a file.
Definition OrthancCPlugin.h:9232
OrthancPluginWebDavDeleteItemCallback
OrthancPluginErrorCode(* OrthancPluginWebDavDeleteItemCallback)(uint8_t *isReadOnly, uint32_t pathSize, const char *const *pathItems, void *payload)
Callback to remove a file or a folder.
Definition OrthancCPlugin.h:9274
OrthancPluginReconstructMainDicomTags
OrthancPluginErrorCode OrthancPluginReconstructMainDicomTags(OrthancPluginContext *context, OrthancPluginStorageArea *storageArea, OrthancPluginResourceType level)
Reconstruct the main DICOM tags.
Definition OrthancCPlugin.h:5190
OrthancPluginStorageRemove
OrthancPluginErrorCode(* OrthancPluginStorageRemove)(const char *uuid, OrthancPluginContentType type)
Callback for removing a file from the storage area.
Definition OrthancCPlugin.h:1439
OrthancPluginStorageCreate
OrthancPluginErrorCode(* OrthancPluginStorageCreate)(const char *uuid, const void *content, int64_t size, OrthancPluginContentType type)
Callback for writing to the storage area.
Definition OrthancCPlugin.h:1351
OrthancPluginDicomWebBinaryCallback2
void(* OrthancPluginDicomWebBinaryCallback2)(OrthancPluginDicomWebNode *node, OrthancPluginDicomWebSetBinaryNode setter, uint32_t levelDepth, const uint16_t *levelTagGroup, const uint16_t *levelTagElement, const uint32_t *levelIndex, uint16_t tagGroup, uint16_t tagElement, OrthancPluginValueRepresentation vr, void *payload)
Callback executed to encode a binary tag in DICOMweb.
Definition OrthancCPlugin.h:1906
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:1299
OrthancPluginFinalizeDatabaseBackendV4
void(* OrthancPluginFinalizeDatabaseBackendV4)(void *backend)
Signature of a callback function that is triggered when the database plugin must be finalized.
Definition OrthancCPlugin.h:9384
OrthancPluginServerChunkedRequestReader
struct _OrthancPluginServerChunkedRequestReader_t OrthancPluginServerChunkedRequestReader
Opaque structure that reads the content of a HTTP request body during a chunked HTTP transfer.
Definition OrthancCPlugin.h:7748
OrthancPluginWebDavIsExistingFolderCallback
OrthancPluginErrorCode(* OrthancPluginWebDavIsExistingFolderCallback)(uint8_t *isExisting, uint32_t pathSize, const char *const *pathItems, void *payload)
Callback for testing the existence of a folder.
Definition OrthancCPlugin.h:9158
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:1489
OrthancPluginRegisterJobsUnserializer
void OrthancPluginRegisterJobsUnserializer(OrthancPluginContext *context, OrthancPluginJobsUnserializer unserializer)
Register an unserializer for custom jobs.
Definition OrthancCPlugin.h:7155
OrthancPluginFree
void(* OrthancPluginFree)(void *buffer)
Signature of a function to free dynamic memory.
Definition OrthancCPlugin.h:1322
OrthancPluginRegisterRestCallbackNoLock
void OrthancPluginRegisterRestCallbackNoLock(OrthancPluginContext *context, const char *pathRegularExpression, OrthancPluginRestCallback callback)
Register a REST callback, without locking.
Definition OrthancCPlugin.h:2255
OrthancPluginStorageAreaRead
OrthancPluginErrorCode OrthancPluginStorageAreaRead(OrthancPluginContext *context, OrthancPluginMemoryBuffer *target, OrthancPluginStorageArea *storageArea, const char *uuid, OrthancPluginContentType type)
Read a file from the storage area.
Definition OrthancCPlugin.h:4959
OrthancPluginCheckVersionAdvanced
int32_t OrthancPluginCheckVersionAdvanced(OrthancPluginContext *context, int32_t expectedMajor, int32_t expectedMinor, int32_t expectedRevision)
Check that the version of the hosting Orthanc is above a given version.
Definition OrthancCPlugin.h:1987
OrthancPluginStorageReadRange
OrthancPluginErrorCode(* OrthancPluginStorageReadRange)(OrthancPluginMemoryBuffer64 *target, const char *uuid, OrthancPluginContentType type, uint64_t rangeStart)
Callback for reading a range of a file from the storage area.
Definition OrthancCPlugin.h:1421
OrthancPluginRegisterChunkedRestCallback
void OrthancPluginRegisterChunkedRestCallback(OrthancPluginContext *context, const char *pathRegularExpression, OrthancPluginRestCallback getHandler, OrthancPluginServerChunkedRequestReaderFactory postHandler, OrthancPluginRestCallback deleteHandler, OrthancPluginServerChunkedRequestReaderFactory putHandler, OrthancPluginServerChunkedRequestReaderAddChunk addChunk, OrthancPluginServerChunkedRequestReaderExecute execute, OrthancPluginServerChunkedRequestReaderFinalize finalize)
Register a REST callback to handle chunked HTTP transfers.
Definition OrthancCPlugin.h:7869
OrthancPluginIncomingCStoreInstanceFilter
int32_t(* OrthancPluginIncomingCStoreInstanceFilter)(uint16_t *dimseStatus, const OrthancPluginDicomInstance *instance)
Callback to filter incoming DICOM instances received by Orthanc through C-STORE.
Definition OrthancCPlugin.h:8147
OrthancPluginRegisterIncomingDicomInstanceFilter
OrthancPluginErrorCode OrthancPluginRegisterIncomingDicomInstanceFilter(OrthancPluginContext *context, OrthancPluginIncomingDicomInstanceFilter callback)
Register a callback to filter incoming DICOM instances.
Definition OrthancCPlugin.h:8106
OrthancPluginRegisterIncomingHttpRequestFilter
OrthancPluginErrorCode OrthancPluginRegisterIncomingHttpRequestFilter(OrthancPluginContext *context, OrthancPluginIncomingHttpRequestFilter callback)
Register a callback to filter incoming HTTP requests.
Definition OrthancCPlugin.h:5976
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:4915
OrthancPluginChangeType_OrthancStopped
@ OrthancPluginChangeType_OrthancStopped
Definition OrthancCPlugin.h:771
OrthancPluginChangeType_OrthancStarted
@ OrthancPluginChangeType_OrthancStarted
Definition OrthancCPlugin.h:770
OrthancPluginChangeType_Deleted
@ OrthancPluginChangeType_Deleted
Definition OrthancCPlugin.h:761
OrthancPluginChangeType_JobFailure
@ OrthancPluginChangeType_JobFailure
Definition OrthancCPlugin.h:778
OrthancPluginChangeType_NewInstance
@ OrthancPluginChangeType_NewInstance
Definition OrthancCPlugin.h:763
OrthancPluginChangeType_NewPatient
@ OrthancPluginChangeType_NewPatient
Definition OrthancCPlugin.h:764
OrthancPluginChangeType_JobSubmitted
@ OrthancPluginChangeType_JobSubmitted
Definition OrthancCPlugin.h:776
OrthancPluginChangeType_NewSeries
@ OrthancPluginChangeType_NewSeries
Definition OrthancCPlugin.h:765
OrthancPluginChangeType_StablePatient
@ OrthancPluginChangeType_StablePatient
Definition OrthancCPlugin.h:767
OrthancPluginChangeType_UpdatedPeers
@ OrthancPluginChangeType_UpdatedPeers
Definition OrthancCPlugin.h:774
OrthancPluginChangeType_StableStudy
@ OrthancPluginChangeType_StableStudy
Definition OrthancCPlugin.h:769
OrthancPluginChangeType_CompletedSeries
@ OrthancPluginChangeType_CompletedSeries
Definition OrthancCPlugin.h:760
OrthancPluginChangeType_NewChildInstance
@ OrthancPluginChangeType_NewChildInstance
Definition OrthancCPlugin.h:762
OrthancPluginChangeType_UpdatedAttachment
@ OrthancPluginChangeType_UpdatedAttachment
Definition OrthancCPlugin.h:772
OrthancPluginChangeType_UpdatedMetadata
@ OrthancPluginChangeType_UpdatedMetadata
Definition OrthancCPlugin.h:773
OrthancPluginChangeType_StableSeries
@ OrthancPluginChangeType_StableSeries
Definition OrthancCPlugin.h:768
OrthancPluginChangeType_UpdatedModalities
@ OrthancPluginChangeType_UpdatedModalities
Definition OrthancCPlugin.h:775
OrthancPluginChangeType_JobSuccess
@ OrthancPluginChangeType_JobSuccess
Definition OrthancCPlugin.h:777
OrthancPluginChangeType_NewStudy
@ OrthancPluginChangeType_NewStudy
Definition OrthancCPlugin.h:766
OrthancPluginGetFindQuerySize
uint32_t OrthancPluginGetFindQuerySize(OrthancPluginContext *context, const OrthancPluginFindQuery *query)
Get the number of tags in a C-Find query.
Definition OrthancCPlugin.h:6237
OrthancPluginFindQuery
struct _OrthancPluginFindQuery_t OrthancPluginFindQuery
Opaque structure to an object that represents a C-Find query.
Definition OrthancCPlugin.h:1229
OrthancPluginApplyMove
OrthancPluginErrorCode(* OrthancPluginApplyMove)(void *moveDriver)
Callback to apply one C-Move suboperation.
Definition OrthancCPlugin.h:1634
OrthancPluginFindMarkIncomplete
OrthancPluginErrorCode OrthancPluginFindMarkIncomplete(OrthancPluginContext *context, OrthancPluginFindAnswers *answers)
Mark the set of C-Find answers as incomplete.
Definition OrthancCPlugin.h:6213
OrthancPluginStorageCommitmentDestructor
void(* OrthancPluginStorageCommitmentDestructor)(void *handler)
Callback to free one storage commitment SCP handler.
Definition OrthancCPlugin.h:7997
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:1458
OrthancPluginRegisterMoveCallback
OrthancPluginErrorCode OrthancPluginRegisterMoveCallback(OrthancPluginContext *context, OrthancPluginMoveCallback callback, OrthancPluginGetMoveSize getMoveSize, OrthancPluginApplyMove applyMove, OrthancPluginFreeMove freeMove)
Register a callback to handle C-Move requests.
Definition OrthancCPlugin.h:6391
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:6343
OrthancPluginStorageCommitmentFactory
OrthancPluginErrorCode(* OrthancPluginStorageCommitmentFactory)(void **handler, const char *jobId, const char *transactionUid, const char *const *sopClassUids, const char *const *sopInstanceUids, uint32_t countInstances, const char *remoteAet, const char *calledAet)
Callback executed by the storage commitment SCP.
Definition OrthancCPlugin.h:7975
OrthancPluginRegisterFindCallback
OrthancPluginErrorCode OrthancPluginRegisterFindCallback(OrthancPluginContext *context, OrthancPluginFindCallback callback)
Register a callback to handle C-Find requests.
Definition OrthancCPlugin.h:6145
OrthancPluginWorklistGetDicomQuery
OrthancPluginErrorCode OrthancPluginWorklistGetDicomQuery(OrthancPluginContext *context, OrthancPluginMemoryBuffer *target, const OrthancPluginWorklistQuery *query)
Retrieve the worklist query as a DICOM file.
Definition OrthancCPlugin.h:5522
OrthancPluginStorageCommitmentLookup
OrthancPluginErrorCode(* OrthancPluginStorageCommitmentLookup)(OrthancPluginStorageCommitmentFailureReason *target, void *handler, const char *sopClassUid, const char *sopInstanceUid)
Callback to get the status of one DICOM instance in the storage commitment SCP.
Definition OrthancCPlugin.h:8018
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:5483
OrthancPluginFindAddAnswer
OrthancPluginErrorCode OrthancPluginFindAddAnswer(OrthancPluginContext *context, OrthancPluginFindAnswers *answers, const void *dicom, uint32_t size)
Add one answer to some C-Find request.
Definition OrthancCPlugin.h:6184
OrthancPluginRegisterStorageCommitmentScpCallback
OrthancPluginErrorCode OrthancPluginRegisterStorageCommitmentScpCallback(OrthancPluginContext *context, OrthancPluginStorageCommitmentFactory factory, OrthancPluginStorageCommitmentDestructor destructor, OrthancPluginStorageCommitmentLookup lookup)
Register a callback to handle incoming requests to the storage commitment SCP.
Definition OrthancCPlugin.h:8045
OrthancPluginFindAnswers
struct _OrthancPluginFindAnswers_t OrthancPluginFindAnswers
Opaque structure to an object that represents the answers to a C-Find query for worklists.
Definition OrthancCPlugin.h:1237
OrthancPluginWorklistAnswers
struct _OrthancPluginWorklistAnswers_t OrthancPluginWorklistAnswers
Opaque structure to an object that represents the answers to a C-Find query for worklists.
Definition OrthancCPlugin.h:1221
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:1551
OrthancPluginGetMoveSize
uint32_t(* OrthancPluginGetMoveSize)(void *moveDriver)
Callback to read the size of a C-Move driver.
Definition OrthancCPlugin.h:1619
OrthancPluginRegisterWorklistCallback
OrthancPluginErrorCode OrthancPluginRegisterWorklistCallback(OrthancPluginContext *context, OrthancPluginWorklistCallback callback)
Register a callback to handle modality worklists requests.
Definition OrthancCPlugin.h:5379
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:6305
OrthancPluginWorklistMarkIncomplete
OrthancPluginErrorCode OrthancPluginWorklistMarkIncomplete(OrthancPluginContext *context, OrthancPluginWorklistAnswers *answers)
Mark the set of worklist answers as incomplete.
Definition OrthancCPlugin.h:5445
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:6274
OrthancPluginFreeMove
void(* OrthancPluginFreeMove)(void *moveDriver)
Callback to free one C-Move driver.
Definition OrthancCPlugin.h:1648
OrthancPluginWorklistQuery
struct _OrthancPluginWorklistQuery_t OrthancPluginWorklistQuery
Opaque structure to an object that represents a C-Find query for worklists.
Definition OrthancCPlugin.h:1213
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:1594
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:5415
OrthancPluginHasInstancePixelData
int32_t OrthancPluginHasInstancePixelData(OrthancPluginContext *context, const OrthancPluginDicomInstance *instance)
Check whether the DICOM file has pixel data.
Definition OrthancCPlugin.h:8304
OrthancPluginGetInstanceDicomWebXml
char * OrthancPluginGetInstanceDicomWebXml(OrthancPluginContext *context, const OrthancPluginDicomInstance *instance, OrthancPluginDicomWebBinaryCallback2 callback, void *payload)
Convert a DICOM instance to DICOMweb XML.
Definition OrthancCPlugin.h:8689
OrthancPluginDicomInstance
struct _OrthancPluginDicomInstance_t OrthancPluginDicomInstance
Opaque structure that represents a DICOM instance that is managed by the Orthanc core.
Definition OrthancCPlugin.h:1189
OrthancPluginGetInstanceRawFrame
OrthancPluginErrorCode OrthancPluginGetInstanceRawFrame(OrthancPluginContext *context, OrthancPluginMemoryBuffer *target, const OrthancPluginDicomInstance *instance, uint32_t frameIndex)
Get the raw content of a frame in a DICOM instance.
Definition OrthancCPlugin.h:8469
OrthancPluginGetInstanceRemoteAet
const char * OrthancPluginGetInstanceRemoteAet(OrthancPluginContext *context, const OrthancPluginDicomInstance *instance)
Get the AET of a DICOM instance.
Definition OrthancCPlugin.h:3059
OrthancPluginLoadDicomInstance
OrthancPluginDicomInstance * OrthancPluginLoadDicomInstance(OrthancPluginContext *context, const char *instanceId, OrthancPluginLoadDicomInstanceMode mode)
Load a DICOM instance from the Orthanc server.
Definition OrthancCPlugin.h:9448
OrthancPluginGetInstanceJson
char * OrthancPluginGetInstanceJson(OrthancPluginContext *context, const OrthancPluginDicomInstance *instance)
Get the DICOM tag hierarchy as a JSON file.
Definition OrthancCPlugin.h:3161
OrthancPluginTranscodeDicomInstance
OrthancPluginDicomInstance * OrthancPluginTranscodeDicomInstance(OrthancPluginContext *context, const void *buffer, uint32_t size, const char *transferSyntax)
Parse and transcode a DICOM instance.
Definition OrthancCPlugin.h:8536
OrthancPluginHasInstanceMetadata
int32_t OrthancPluginHasInstanceMetadata(OrthancPluginContext *context, const OrthancPluginDicomInstance *instance, const char *metadata)
Check whether a DICOM instance is associated with some metadata.
Definition OrthancCPlugin.h:3238
OrthancPluginCreateDicomInstance
OrthancPluginDicomInstance * OrthancPluginCreateDicomInstance(OrthancPluginContext *context, const void *buffer, uint32_t size)
Parse a DICOM instance.
Definition OrthancCPlugin.h:8354
OrthancPluginGetInstanceFramesCount
uint32_t OrthancPluginGetInstanceFramesCount(OrthancPluginContext *context, const OrthancPluginDicomInstance *instance)
Get the number of frames in a DICOM instance.
Definition OrthancCPlugin.h:8429
OrthancPluginGetInstanceOrigin
OrthancPluginInstanceOrigin OrthancPluginGetInstanceOrigin(OrthancPluginContext *context, const OrthancPluginDicomInstance *instance)
Get the origin of a DICOM file.
Definition OrthancCPlugin.h:5548
OrthancPluginGetInstanceSize
int64_t OrthancPluginGetInstanceSize(OrthancPluginContext *context, const OrthancPluginDicomInstance *instance)
Get the size of a DICOM file.
Definition OrthancCPlugin.h:3092
OrthancPluginGetInstanceDicomWebJson
char * OrthancPluginGetInstanceDicomWebJson(OrthancPluginContext *context, const OrthancPluginDicomInstance *instance, OrthancPluginDicomWebBinaryCallback2 callback, void *payload)
Convert a DICOM instance to DICOMweb JSON.
Definition OrthancCPlugin.h:8649
OrthancPluginGetInstanceTransferSyntaxUid
char * OrthancPluginGetInstanceTransferSyntaxUid(OrthancPluginContext *context, const OrthancPluginDicomInstance *instance)
Get the transfer syntax of a DICOM file.
Definition OrthancCPlugin.h:8269
OrthancPluginFreeDicomInstance
void OrthancPluginFreeDicomInstance(OrthancPluginContext *context, OrthancPluginDicomInstance *dicom)
Free a DICOM instance.
Definition OrthancCPlugin.h:8392
OrthancPluginSerializeDicomInstance
OrthancPluginErrorCode OrthancPluginSerializeDicomInstance(OrthancPluginContext *context, OrthancPluginMemoryBuffer *target, const OrthancPluginDicomInstance *instance)
Writes a DICOM instance to a memory buffer.
Definition OrthancCPlugin.h:8574
OrthancPluginGetInstanceMetadata
const char * OrthancPluginGetInstanceMetadata(OrthancPluginContext *context, const OrthancPluginDicomInstance *instance, const char *metadata)
Get the value of some metadata associated with a given DICOM instance.
Definition OrthancCPlugin.h:3279
OrthancPluginGetInstanceSimplifiedJson
char * OrthancPluginGetInstanceSimplifiedJson(OrthancPluginContext *context, const OrthancPluginDicomInstance *instance)
Get the DICOM tag hierarchy as a JSON file (with simplification).
Definition OrthancCPlugin.h:3199
OrthancPluginGetInstanceData
const void * OrthancPluginGetInstanceData(OrthancPluginContext *context, const OrthancPluginDicomInstance *instance)
Get the data of a DICOM file.
Definition OrthancCPlugin.h:3125
OrthancPluginGetInstanceDecodedFrame
OrthancPluginImage * OrthancPluginGetInstanceDecodedFrame(OrthancPluginContext *context, const OrthancPluginDicomInstance *instance, uint32_t frameIndex)
Decode one frame from a DICOM instance.
Definition OrthancCPlugin.h:8497
OrthancPluginGetInstanceAdvancedJson
char * OrthancPluginGetInstanceAdvancedJson(OrthancPluginContext *context, const OrthancPluginDicomInstance *instance, OrthancPluginDicomToJsonFormat format, OrthancPluginDicomToJsonFlags flags, uint32_t maxStringLength)
Format a DICOM memory buffer as a JSON string.
Definition OrthancCPlugin.h:8606
OrthancPluginConvertPixelFormat
OrthancPluginImage * OrthancPluginConvertPixelFormat(OrthancPluginContext *context, const OrthancPluginImage *source, OrthancPluginPixelFormat targetFormat)
Change the pixel format of an image.
Definition OrthancCPlugin.h:4701
OrthancPluginPixelFormat
OrthancPluginPixelFormat
Definition OrthancCPlugin.h:634
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:4861
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:4445
OrthancPluginGetImagePitch
uint32_t OrthancPluginGetImagePitch(OrthancPluginContext *context, const OrthancPluginImage *image)
Return the pitch of an image.
Definition OrthancCPlugin.h:4236
OrthancPluginGetImagePixelFormat
OrthancPluginPixelFormat OrthancPluginGetImagePixelFormat(OrthancPluginContext *context, const OrthancPluginImage *image)
Return the pixel format of an image.
Definition OrthancCPlugin.h:4135
OrthancPluginCreateImage
OrthancPluginImage * OrthancPluginCreateImage(OrthancPluginContext *context, OrthancPluginPixelFormat format, uint32_t width, uint32_t height)
Create an image.
Definition OrthancCPlugin.h:5678
OrthancPluginGetFontsCount
uint32_t OrthancPluginGetFontsCount(OrthancPluginContext *context)
Return the number of available fonts.
Definition OrthancCPlugin.h:4736
OrthancPluginGetImageHeight
uint32_t OrthancPluginGetImageHeight(OrthancPluginContext *context, const OrthancPluginImage *image)
Return the height of an image.
Definition OrthancCPlugin.h:4201
OrthancPluginGetImageBuffer
void * OrthancPluginGetImageBuffer(OrthancPluginContext *context, const OrthancPluginImage *image)
Return a pointer to the content of an image.
Definition OrthancCPlugin.h:4270
OrthancPluginFreeImage
void OrthancPluginFreeImage(OrthancPluginContext *context, OrthancPluginImage *image)
Free an image.
Definition OrthancCPlugin.h:4355
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:4400
OrthancPluginDecodeDicomImage
OrthancPluginImage * OrthancPluginDecodeDicomImage(OrthancPluginContext *context, const void *buffer, uint32_t bufferSize, uint32_t frameIndex)
Decode one frame from a DICOM instance.
Definition OrthancCPlugin.h:5767
OrthancPluginUncompressImage
OrthancPluginImage * OrthancPluginUncompressImage(OrthancPluginContext *context, const void *data, uint32_t size, OrthancPluginImageFormat format)
Decode a compressed image.
Definition OrthancCPlugin.h:4313
OrthancPluginGetFontName
const char * OrthancPluginGetFontName(OrthancPluginContext *context, uint32_t fontIndex)
Return the name of a font.
Definition OrthancCPlugin.h:4776
OrthancPluginImageFormat
OrthancPluginImageFormat
Definition OrthancCPlugin.h:804
OrthancPluginStorageArea
struct _OrthancPluginStorageArea_t OrthancPluginStorageArea
Opaque structure that represents the storage area that is actually used by Orthanc.
Definition OrthancCPlugin.h:1205
OrthancPluginCompressionType
OrthancPluginCompressionType
Definition OrthancCPlugin.h:789
OrthancPluginGetImageWidth
uint32_t OrthancPluginGetImageWidth(OrthancPluginContext *context, const OrthancPluginImage *image)
Return the width of an image.
Definition OrthancCPlugin.h:4168
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:3947
OrthancPluginGetFontSize
uint32_t OrthancPluginGetFontSize(OrthancPluginContext *context, uint32_t fontIndex)
Return the size of a font.
Definition OrthancCPlugin.h:4808
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:5721
OrthancPluginImage
struct _OrthancPluginImage_t OrthancPluginImage
Opaque structure that represents an image that is uncompressed in memory.
Definition OrthancCPlugin.h:1197
OrthancPluginPixelFormat_RGBA32
@ OrthancPluginPixelFormat_RGBA32
Color image in RGBA32 format.
Definition OrthancCPlugin.h:673
OrthancPluginPixelFormat_RGB48
@ OrthancPluginPixelFormat_RGB48
Color image in RGB48 format.
Definition OrthancCPlugin.h:683
OrthancPluginPixelFormat_Grayscale8
@ OrthancPluginPixelFormat_Grayscale8
Graylevel 8bpp image.
Definition OrthancCPlugin.h:641
OrthancPluginPixelFormat_SignedGrayscale16
@ OrthancPluginPixelFormat_SignedGrayscale16
Graylevel, signed 16bpp image.
Definition OrthancCPlugin.h:657
OrthancPluginPixelFormat_Float32
@ OrthancPluginPixelFormat_Float32
Graylevel, floating-point 32bpp image.
Definition OrthancCPlugin.h:699
OrthancPluginPixelFormat_RGB24
@ OrthancPluginPixelFormat_RGB24
Color image in RGB24 format.
Definition OrthancCPlugin.h:665
OrthancPluginPixelFormat_BGRA32
@ OrthancPluginPixelFormat_BGRA32
Color image in BGRA32 format.
Definition OrthancCPlugin.h:707
OrthancPluginPixelFormat_Unknown
@ OrthancPluginPixelFormat_Unknown
Definition OrthancCPlugin.h:675
OrthancPluginPixelFormat_Grayscale64
@ OrthancPluginPixelFormat_Grayscale64
Graylevel, unsigned 64bpp image.
Definition OrthancCPlugin.h:715
OrthancPluginPixelFormat_Grayscale32
@ OrthancPluginPixelFormat_Grayscale32
Graylevel, unsigned 32bpp image.
Definition OrthancCPlugin.h:691
OrthancPluginPixelFormat_Grayscale16
@ OrthancPluginPixelFormat_Grayscale16
Graylevel, unsigned 16bpp image.
Definition OrthancCPlugin.h:649
OrthancPluginImageFormat_Png
@ OrthancPluginImageFormat_Png
Definition OrthancCPlugin.h:805
OrthancPluginImageFormat_Jpeg
@ OrthancPluginImageFormat_Jpeg
Definition OrthancCPlugin.h:806
OrthancPluginImageFormat_Dicom
@ OrthancPluginImageFormat_Dicom
Definition OrthancCPlugin.h:807
OrthancPluginCompressionType_Gzip
@ OrthancPluginCompressionType_Gzip
Definition OrthancCPlugin.h:792
OrthancPluginCompressionType_ZlibWithSize
@ OrthancPluginCompressionType_ZlibWithSize
Definition OrthancCPlugin.h:791
OrthancPluginCompressionType_Zlib
@ OrthancPluginCompressionType_Zlib
Definition OrthancCPlugin.h:790
OrthancPluginCompressionType_GzipWithSize
@ OrthancPluginCompressionType_GzipWithSize
Definition OrthancCPlugin.h:793
OrthancPluginRestApiPost
OrthancPluginErrorCode OrthancPluginRestApiPost(OrthancPluginContext *context, OrthancPluginMemoryBuffer *target, const char *uri, const void *body, uint32_t bodySize)
Make a POST call to the built-in Orthanc REST API.
Definition OrthancCPlugin.h:2523
OrthancPluginRestApiPostAfterPlugins
OrthancPluginErrorCode OrthancPluginRestApiPostAfterPlugins(OrthancPluginContext *context, OrthancPluginMemoryBuffer *target, const char *uri, const void *body, uint32_t bodySize)
Make a POST call to the REST API, as tainted by the plugins.
Definition OrthancCPlugin.h:2558
OrthancPluginRestApiPutAfterPlugins
OrthancPluginErrorCode OrthancPluginRestApiPutAfterPlugins(OrthancPluginContext *context, OrthancPluginMemoryBuffer *target, const char *uri, const void *body, uint32_t bodySize)
Make a PUT call to the REST API, as tainted by the plugins.
Definition OrthancCPlugin.h:2671
OrthancPluginLookupStudyWithAccessionNumber
char * OrthancPluginLookupStudyWithAccessionNumber(OrthancPluginContext *context, const char *accessionNumber)
Look for a study, using the accession number.
Definition OrthancCPlugin.h:2807
OrthancPluginLookupSeries
char * OrthancPluginLookupSeries(OrthancPluginContext *context, const char *seriesUID)
Look for a series.
Definition OrthancCPlugin.h:2842
OrthancPluginSetGlobalProperty
OrthancPluginErrorCode OrthancPluginSetGlobalProperty(OrthancPluginContext *context, int32_t property, const char *value)
Set the value of a global property.
Definition OrthancCPlugin.h:3705
OrthancPluginRestApiPut
OrthancPluginErrorCode OrthancPluginRestApiPut(OrthancPluginContext *context, OrthancPluginMemoryBuffer *target, const char *uri, const void *body, uint32_t bodySize)
Make a PUT call to the built-in Orthanc REST API.
Definition OrthancCPlugin.h:2635
OrthancPluginGetGlobalProperty
char * OrthancPluginGetGlobalProperty(OrthancPluginContext *context, int32_t property, const char *defaultValue)
Get the value of a global property.
Definition OrthancCPlugin.h:3666
OrthancPluginLookupStudy
char * OrthancPluginLookupStudy(OrthancPluginContext *context, const char *studyUID)
Look for a study.
Definition OrthancCPlugin.h:2772
OrthancPluginRestApiGet
OrthancPluginErrorCode OrthancPluginRestApiGet(OrthancPluginContext *context, OrthancPluginMemoryBuffer *target, const char *uri)
Make a GET call to the built-in Orthanc REST API.
Definition OrthancCPlugin.h:2456
OrthancPluginLookupInstance
char * OrthancPluginLookupInstance(OrthancPluginContext *context, const char *sopInstanceUID)
Look for an instance.
Definition OrthancCPlugin.h:2877
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:2486
OrthancPluginLookupPatient
char * OrthancPluginLookupPatient(OrthancPluginContext *context, const char *patientID)
Look for a patient.
Definition OrthancCPlugin.h:2737
OrthancPluginRestApiDelete
OrthancPluginErrorCode OrthancPluginRestApiDelete(OrthancPluginContext *context, const char *uri)
Make a DELETE call to the built-in Orthanc REST API.
Definition OrthancCPlugin.h:2587
OrthancPluginRestApiDeleteAfterPlugins
OrthancPluginErrorCode OrthancPluginRestApiDeleteAfterPlugins(OrthancPluginContext *context, const char *uri)
Make a DELETE call to the REST API, as tainted by the plugins.
Definition OrthancCPlugin.h:2610
OrthancPluginCallRestApi
OrthancPluginErrorCode OrthancPluginCallRestApi(OrthancPluginContext *context, OrthancPluginMemoryBuffer *answerBody, OrthancPluginMemoryBuffer *answerHeaders, uint16_t *httpStatus, OrthancPluginHttpMethod method, const char *uri, uint32_t headersCount, const char *const *headersKeys, const char *const *headersValues, const void *body, uint32_t bodySize, uint8_t afterPlugins)
Call the REST API of Orthanc with full flexibility.
Definition OrthancCPlugin.h:9032
OrthancPluginGenerateRestApiAuthorizationToken
char * OrthancPluginGenerateRestApiAuthorizationToken(OrthancPluginContext *context)
Generate a token to grant full access to the REST API of Orthanc.
Definition OrthancCPlugin.h:8834
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:5341
OrthancPluginGetDicomForInstance
OrthancPluginErrorCode OrthancPluginGetDicomForInstance(OrthancPluginContext *context, OrthancPluginMemoryBuffer *target, const char *instanceId)
Retrieve a DICOM instance using its Orthanc identifier.
Definition OrthancCPlugin.h:2423
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:2382
OrthancPluginSendUnauthorized
void OrthancPluginSendUnauthorized(OrthancPluginContext *context, OrthancPluginRestOutput *output, const char *realm)
Signal that a REST request is not authorized.
Definition OrthancCPlugin.h:2945
OrthancPluginSetHttpErrorDetails
void OrthancPluginSetHttpErrorDetails(OrthancPluginContext *context, OrthancPluginRestOutput *output, const char *details, uint8_t log)
Provide a detailed description for an HTTP error.
Definition OrthancCPlugin.h:7191
OrthancPluginSendMethodNotAllowed
void OrthancPluginSendMethodNotAllowed(OrthancPluginContext *context, OrthancPluginRestOutput *output, const char *allowedMethods)
Signal that this URI does not support this HTTP method.
Definition OrthancCPlugin.h:2968
OrthancPluginSendStreamChunk
OrthancPluginErrorCode OrthancPluginSendStreamChunk(OrthancPluginContext *context, OrthancPluginRestOutput *output, const void *answer, uint32_t answerSize)
Send a chunk as a part of an HTTP stream answer.
Definition OrthancCPlugin.h:9619
OrthancPluginAnswerBuffer
void OrthancPluginAnswerBuffer(OrthancPluginContext *context, OrthancPluginRestOutput *output, const void *answer, uint32_t answerSize, const char *mimeType)
Answer to a REST request.
Definition OrthancCPlugin.h:2325
OrthancPluginSendHttpStatusCode
void OrthancPluginSendHttpStatusCode(OrthancPluginContext *context, OrthancPluginRestOutput *output, uint16_t status)
Send a HTTP status code.
Definition OrthancCPlugin.h:2922
OrthancPluginSetHttpHeader
void OrthancPluginSetHttpHeader(OrthancPluginContext *context, OrthancPluginRestOutput *output, const char *key, const char *value)
Set some HTTP header.
Definition OrthancCPlugin.h:3023
OrthancPluginStartStreamAnswer
OrthancPluginErrorCode OrthancPluginStartStreamAnswer(OrthancPluginContext *context, OrthancPluginRestOutput *output, const char *contentType)
Start an HTTP stream answer.
Definition OrthancCPlugin.h:9592
OrthancPluginSetCookie
void OrthancPluginSetCookie(OrthancPluginContext *context, OrthancPluginRestOutput *output, const char *cookie, const char *value)
Set a cookie.
Definition OrthancCPlugin.h:2998
OrthancPluginRedirect
void OrthancPluginRedirect(OrthancPluginContext *context, OrthancPluginRestOutput *output, const char *redirection)
Redirect a REST request.
Definition OrthancCPlugin.h:2705
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:4492
OrthancPluginSendMultipartItem
OrthancPluginErrorCode OrthancPluginSendMultipartItem(OrthancPluginContext *context, OrthancPluginRestOutput *output, const void *answer, uint32_t answerSize)
Send an item as a part of some HTTP multipart answer.
Definition OrthancCPlugin.h:3905
OrthancPluginSendMultipartItem2
OrthancPluginErrorCode OrthancPluginSendMultipartItem2(OrthancPluginContext *context, OrthancPluginRestOutput *output, const void *answer, uint32_t answerSize, uint32_t headersCount, const char *const *headersKeys, const char *const *headersValues)
Send an item as a part of some HTTP multipart answer, with custom headers.
Definition OrthancCPlugin.h:5938
OrthancPluginSendHttpStatus
void OrthancPluginSendHttpStatus(OrthancPluginContext *context, OrthancPluginRestOutput *output, uint16_t status, const void *body, uint32_t bodySize)
Send a HTTP status, with a custom body.
Definition OrthancCPlugin.h:4099
OrthancPluginStartMultipartAnswer
OrthancPluginErrorCode OrthancPluginStartMultipartAnswer(OrthancPluginContext *context, OrthancPluginRestOutput *output, const char *subType, const char *contentType)
Start an HTTP multipart answer.
Definition OrthancCPlugin.h:3876
OrthancPluginJobStop
OrthancPluginErrorCode(* OrthancPluginJobStop)(void *job, OrthancPluginJobStopReason reason)
Callback executed once one custom job leaves the "running" state.
Definition OrthancCPlugin.h:1788
OrthancPluginServerChunkedRequestReaderExecute
OrthancPluginErrorCode(* OrthancPluginServerChunkedRequestReaderExecute)(OrthancPluginServerChunkedRequestReader *reader, OrthancPluginRestOutput *output)
Callback invoked whenever the request body is entirely received.
Definition OrthancCPlugin.h:7806
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 void *body, uint32_t bodySize, const char *username, const char *password, uint32_t timeout, const char *certificateFile, const char *certificateKeyFile, const char *certificateKeyPassword, uint8_t pkcs11)
Issue a HTTP call with full flexibility.
Definition OrthancCPlugin.h:6051
OrthancPluginJob
struct _OrthancPluginJob_t OrthancPluginJob
Opaque structure to a job to be executed by Orthanc.
Definition OrthancCPlugin.h:1261
OrthancPluginCreateDicom2
OrthancPluginErrorCode OrthancPluginCreateDicom2(OrthancPluginContext *context, OrthancPluginMemoryBuffer *target, const char *json, const OrthancPluginImage *pixelData, OrthancPluginCreateDicomFlags flags, const char *privateCreator)
Create a DICOM instance from a JSON string and an image, with a private creator.
Definition OrthancCPlugin.h:8964
OrthancPluginLogMessage
void OrthancPluginLogMessage(OrthancPluginContext *context, const char *message, const char *plugin, const char *file, uint32_t line, OrthancPluginLogCategory category, OrthancPluginLogLevel level)
Log a message.
Definition OrthancCPlugin.h:9554
OrthancPluginLogInfo
void OrthancPluginLogInfo(OrthancPluginContext *context, const char *message)
Log an information.
Definition OrthancCPlugin.h:2179
OrthancPluginServerChunkedRequestReaderFactory
OrthancPluginErrorCode(* OrthancPluginServerChunkedRequestReaderFactory)(OrthancPluginServerChunkedRequestReader **reader, const char *url, const OrthancPluginHttpRequest *request)
Callback to create a reader to handle incoming chunked HTTP transfers.
Definition OrthancCPlugin.h:7767
OrthancPluginFreeFindMatcher
void OrthancPluginFreeFindMatcher(OrthancPluginContext *context, OrthancPluginFindMatcher *matcher)
Free a C-Find matcher.
Definition OrthancCPlugin.h:6468
OrthancPluginFreePeers
void OrthancPluginFreePeers(OrthancPluginContext *context, OrthancPluginPeers *peers)
Free the list of available Orthanc peers.
Definition OrthancCPlugin.h:6605
OrthancPluginLogLevel
OrthancPluginLogLevel
Definition OrthancCPlugin.h:1102
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:5146
OrthancPluginIdentifierConstraint
OrthancPluginIdentifierConstraint
Definition OrthancCPlugin.h:908
OrthancPluginExtendOrthancExplorer2
void OrthancPluginExtendOrthancExplorer2(OrthancPluginContext *context, const char *plugin, const char *javascript)
Extend the JavaScript code of Orthanc Explorer.
Definition OrthancCPlugin.h:3631
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:5093
OrthancPluginResourceType
OrthancPluginResourceType
Definition OrthancCPlugin.h:741
OrthancPluginSetRootUri2
void OrthancPluginSetRootUri2(OrthancPluginContext *context, const char *plugin, const char *uri)
Set the URI where the plugin provides its Web interface.
Definition OrthancCPlugin.h:3531
OrthancPluginSetMetricsIntegerValue
void OrthancPluginSetMetricsIntegerValue(OrthancPluginContext *context, const char *name, int64_t value, OrthancPluginMetricsType type)
Set the value of an integer metrics.
Definition OrthancCPlugin.h:9494
OrthancPluginLogCategory
OrthancPluginLogCategory
Definition OrthancCPlugin.h:1119
OrthancPluginWriteFile
OrthancPluginErrorCode OrthancPluginWriteFile(OrthancPluginContext *context, const char *path, const void *data, uint32_t size)
Write a file.
Definition OrthancCPlugin.h:4015
OrthancPluginGetCommandLineArgumentsCount
uint32_t OrthancPluginGetCommandLineArgumentsCount(OrthancPluginContext *context)
Get the number of command-line arguments.
Definition OrthancCPlugin.h:3736
OrthancPluginComputeMd5
char * OrthancPluginComputeMd5(OrthancPluginContext *context, const void *buffer, uint32_t size)
Compute an MD5 hash.
Definition OrthancCPlugin.h:5813
OrthancPluginErrorCode
OrthancPluginErrorCode
Definition OrthancCPlugin.h:216
OrthancPluginPeers
struct _OrthancPluginPeers_t OrthancPluginPeers
Opaque structure to the set of remote Orthanc Peers that are known to the local Orthanc server.
Definition OrthancCPlugin.h:1253
OrthancPluginHttpPost
OrthancPluginErrorCode OrthancPluginHttpPost(OrthancPluginContext *context, OrthancPluginMemoryBuffer *target, const char *url, const void *body, uint32_t bodySize, const char *username, const char *password)
Issue a HTTP POST call.
Definition OrthancCPlugin.h:4583
OrthancPluginChunkedClientRequestGetChunkSize
uint32_t(* OrthancPluginChunkedClientRequestGetChunkSize)(void *request)
Callback to read the size of the current request chunk during a chunked transfer.
Definition OrthancCPlugin.h:7608
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:5037
OrthancPluginCreateMemoryBuffer
OrthancPluginErrorCode OrthancPluginCreateMemoryBuffer(OrthancPluginContext *context, OrthancPluginMemoryBuffer *target, uint32_t size)
Create a 32-bit memory buffer.
Definition OrthancCPlugin.h:8796
OrthancPluginCreateJob2
OrthancPluginJob * OrthancPluginCreateJob2(OrthancPluginContext *context, void *job, OrthancPluginJobFinalize finalize, const char *type, OrthancPluginJobGetProgress getProgress, OrthancPluginJobGetContent2 getContent, OrthancPluginJobGetSerialized2 getSerialized, OrthancPluginJobStep step, OrthancPluginJobStop stop, OrthancPluginJobReset reset)
Create a custom job.
Definition OrthancCPlugin.h:7023
OrthancPluginDicomWebBinaryMode
OrthancPluginDicomWebBinaryMode
Definition OrthancCPlugin.h:997
OrthancPluginJobGetContent2
OrthancPluginErrorCode(* OrthancPluginJobGetContent2)(OrthancPluginMemoryBuffer *target, void *job)
Callback to retrieve the content of one custom job.
Definition OrthancCPlugin.h:1708
OrthancPluginChunkedClientRequestNext
OrthancPluginErrorCode(* OrthancPluginChunkedClientRequestNext)(void *request)
Callback to advance in the request body during a chunked transfer.
Definition OrthancCPlugin.h:7576
OrthancPluginDicomWebNode
struct _OrthancPluginDicomWebNode_t OrthancPluginDicomWebNode
Opaque structure that represents a node in a JSON or XML document used in DICOMweb.
Definition OrthancCPlugin.h:1270
OrthancPluginJobGetProgress
float(* OrthancPluginJobGetProgress)(void *job)
Callback to check the progress of one custom job.
Definition OrthancCPlugin.h:1674
OrthancPluginEncodeDicomWebJson
char * OrthancPluginEncodeDicomWebJson(OrthancPluginContext *context, const void *dicom, uint32_t dicomSize, OrthancPluginDicomWebBinaryCallback callback)
Convert a DICOM instance to DICOMweb JSON.
Definition OrthancCPlugin.h:7336
OrthancPluginCreateFindMatcher
OrthancPluginFindMatcher * OrthancPluginCreateFindMatcher(OrthancPluginContext *context, const void *query, uint32_t size)
Create a C-Find matcher.
Definition OrthancCPlugin.h:6430
OrthancPluginDicomToJsonFlags
OrthancPluginDicomToJsonFlags
Definition OrthancCPlugin.h:872
OrthancPluginJobStepStatus
OrthancPluginJobStepStatus
Definition OrthancCPlugin.h:954
OrthancPluginCreateDicomFlags
OrthancPluginCreateDicomFlags
Definition OrthancCPlugin.h:893
OrthancPluginServerChunkedRequestReaderFinalize
void(* OrthancPluginServerChunkedRequestReaderFinalize)(OrthancPluginServerChunkedRequestReader *reader)
Callback invoked to release the resources associated with an incoming HTTP chunked transfer.
Definition OrthancCPlugin.h:7824
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:6501
OrthancPluginExtendOrthancExplorer
void OrthancPluginExtendOrthancExplorer(OrthancPluginContext *context, const char *javascript)
Extend the JavaScript code of Orthanc Explorer.
Definition OrthancCPlugin.h:3608
OrthancPluginLogWarning
void OrthancPluginLogWarning(OrthancPluginContext *context, const char *message)
Log a warning.
Definition OrthancCPlugin.h:2163
OrthancPluginGetPeerName
const char * OrthancPluginGetPeerName(OrthancPluginContext *context, const OrthancPluginPeers *peers, uint32_t peerIndex)
Get the symbolic name of an Orthanc peer.
Definition OrthancCPlugin.h:6683
OrthancPluginGetPeers
OrthancPluginPeers * OrthancPluginGetPeers(OrthancPluginContext *context)
Return the list of available Orthanc peers.
Definition OrthancCPlugin.h:6571
OrthancPluginConstraintType
OrthancPluginConstraintType
Definition OrthancCPlugin.h:923
OrthancPluginGetOrthancDirectory
char * OrthancPluginGetOrthancDirectory(OrthancPluginContext *context)
Return the directory containing the Orthanc.
Definition OrthancCPlugin.h:3390
OrthancPluginReadFile
OrthancPluginErrorCode OrthancPluginReadFile(OrthancPluginContext *context, OrthancPluginMemoryBuffer *target, const char *path)
Read a file.
Definition OrthancCPlugin.h:3984
OrthancPluginJobStep
OrthancPluginJobStepStatus(* OrthancPluginJobStep)(void *job)
Callback to execute one step of a custom job.
Definition OrthancCPlugin.h:1764
OrthancPluginComputeSha1
char * OrthancPluginComputeSha1(OrthancPluginContext *context, const void *buffer, uint32_t size)
Compute a SHA-1 hash.
Definition OrthancCPlugin.h:5849
OrthancPluginGetCommandLineArgument
char * OrthancPluginGetCommandLineArgument(OrthancPluginContext *context, uint32_t argument)
Get the value of a command-line argument.
Definition OrthancCPlugin.h:3770
OrthancPluginSetMetricsValue
void OrthancPluginSetMetricsValue(OrthancPluginContext *context, const char *name, float value, OrthancPluginMetricsType type)
Set the value of a floating-point metrics.
Definition OrthancCPlugin.h:7269
OrthancPluginServerChunkedRequestReaderAddChunk
OrthancPluginErrorCode(* OrthancPluginServerChunkedRequestReaderAddChunk)(OrthancPluginServerChunkedRequestReader *reader, const void *data, uint32_t size)
Callback invoked whenever a new data chunk is available during a chunked transfer.
Definition OrthancCPlugin.h:7786
OrthancPluginReceivedInstanceAction
OrthancPluginReceivedInstanceAction
Definition OrthancCPlugin.h:1058
OrthancPluginChunkedHttpClient
OrthancPluginErrorCode OrthancPluginChunkedHttpClient(OrthancPluginContext *context, void *answer, OrthancPluginChunkedClientAnswerAddChunk answerAddChunk, OrthancPluginChunkedClientAnswerAddHeader answerAddHeader, uint16_t *httpStatus, OrthancPluginHttpMethod method, const char *url, uint32_t headersCount, const char *const *headersKeys, const char *const *headersValues, void *request, OrthancPluginChunkedClientRequestIsDone requestIsDone, OrthancPluginChunkedClientRequestGetChunkData requestChunkData, OrthancPluginChunkedClientRequestGetChunkSize requestChunkSize, OrthancPluginChunkedClientRequestNext requestNext, const char *username, const char *password, uint32_t timeout, const char *certificateFile, const char *certificateKeyFile, const char *certificateKeyPassword, uint8_t pkcs11)
Issue a HTTP call, using chunked HTTP transfers.
Definition OrthancCPlugin.h:7687
OrthancPluginJobGetSerialized2
int32_t(* OrthancPluginJobGetSerialized2)(OrthancPluginMemoryBuffer *target, void *job)
Callback to serialize one custom job.
Definition OrthancCPlugin.h:1748
OrthancPluginFreeMemoryBuffer64
void OrthancPluginFreeMemoryBuffer64(OrthancPluginContext *context, OrthancPluginMemoryBuffer64 *buffer)
Free a memory buffer.
Definition OrthancCPlugin.h:2131
OrthancPluginHttpPut
OrthancPluginErrorCode OrthancPluginHttpPut(OrthancPluginContext *context, OrthancPluginMemoryBuffer *target, const char *url, const void *body, uint32_t bodySize, const char *username, const char *password)
Issue a HTTP PUT call.
Definition OrthancCPlugin.h:4625
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:5234
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:5604
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:5283
OrthancPluginFreeJob
void OrthancPluginFreeJob(OrthancPluginContext *context, OrthancPluginJob *job)
Free a custom job.
Definition OrthancCPlugin.h:7078
OrthancPluginGetDatabaseServerIdentifier
const char * OrthancPluginGetDatabaseServerIdentifier(OrthancPluginContext *context)
Gets the DatabaseServerIdentifier.
Definition OrthancCPlugin.h:9346
OrthancPluginGenerateUuid
char * OrthancPluginGenerateUuid(OrthancPluginContext *context)
Generate an UUID.
Definition OrthancCPlugin.h:6106
OrthancPluginStorageCommitmentFailureReason
OrthancPluginStorageCommitmentFailureReason
Definition OrthancCPlugin.h:1010
OrthancPluginChunkedClientAnswerAddChunk
OrthancPluginErrorCode(* OrthancPluginChunkedClientAnswerAddChunk)(void *answer, const void *data, uint32_t size)
Callback executed when an answer chunk is received during a chunked transfer.
Definition OrthancCPlugin.h:7539
OrthancPluginGetPeerUserProperty
const char * OrthancPluginGetPeerUserProperty(OrthancPluginContext *context, const OrthancPluginPeers *peers, uint32_t peerIndex, const char *userProperty)
Get some user-defined property of an Orthanc peer.
Definition OrthancCPlugin.h:6770
OrthancPluginMetricsType
OrthancPluginMetricsType
Definition OrthancCPlugin.h:980
OrthancPluginAutodetectMimeType
const char * OrthancPluginAutodetectMimeType(OrthancPluginContext *context, const char *path)
Detect the MIME type of a file.
Definition OrthancCPlugin.h:7223
OrthancPluginHttpDelete
OrthancPluginErrorCode OrthancPluginHttpDelete(OrthancPluginContext *context, const char *url, const char *username, const char *password)
Issue a HTTP DELETE call.
Definition OrthancCPlugin.h:4663
OrthancPluginChunkedClientRequestIsDone
uint8_t(* OrthancPluginChunkedClientRequestIsDone)(void *request)
Callback to know whether the request body is entirely read during a chunked transfer.
Definition OrthancCPlugin.h:7559
OrthancPluginChunkedClientRequestGetChunkData
const void *(* OrthancPluginChunkedClientRequestGetChunkData)(void *request)
Callback to read the current chunk of the request body during a chunked transfer.
Definition OrthancCPlugin.h:7592
OrthancPluginCreateJob
OrthancPluginJob * OrthancPluginCreateJob(OrthancPluginContext *context, void *job, OrthancPluginJobFinalize finalize, const char *type, OrthancPluginJobGetProgress getProgress, OrthancPluginJobGetContent getContent, OrthancPluginJobGetSerialized getSerialized, OrthancPluginJobStep step, OrthancPluginJobStop stop, OrthancPluginJobReset reset)
Create a custom job.
Definition OrthancCPlugin.h:6937
OrthancPluginFreeMemoryBuffer
void OrthancPluginFreeMemoryBuffer(OrthancPluginContext *context, OrthancPluginMemoryBuffer *buffer)
Free a memory buffer.
Definition OrthancCPlugin.h:2115
OrthancPluginEncodeDicomWebXml
char * OrthancPluginEncodeDicomWebXml(OrthancPluginContext *context, const void *dicom, uint32_t dicomSize, OrthancPluginDicomWebBinaryCallback callback)
Convert a DICOM instance to DICOMweb XML.
Definition OrthancCPlugin.h:7378
OrthancPluginJobGetSerialized
const char *(* OrthancPluginJobGetSerialized)(void *job)
Callback to serialize one custom job.
Definition OrthancCPlugin.h:1728
OrthancPluginGetConfiguration
char * OrthancPluginGetConfiguration(OrthancPluginContext *context)
Return the content of the configuration file(s).
Definition OrthancCPlugin.h:3835
OrthancPluginCreateMemoryBuffer64
OrthancPluginErrorCode OrthancPluginCreateMemoryBuffer64(OrthancPluginContext *context, OrthancPluginMemoryBuffer64 *target, uint64_t size)
Create a 64-bit memory buffer.
Definition OrthancCPlugin.h:8880
OrthancPluginLoadDicomInstanceMode
OrthancPluginLoadDicomInstanceMode
Definition OrthancCPlugin.h:1072
OrthancPluginChunkedClientAnswerAddHeader
OrthancPluginErrorCode(* OrthancPluginChunkedClientAnswerAddHeader)(void *answer, const char *key, const char *value)
Callback executed when a HTTP header is received during a chunked transfer.
Definition OrthancCPlugin.h:7518
OrthancPluginGetPeersCount
uint32_t OrthancPluginGetPeersCount(OrthancPluginContext *context, const OrthancPluginPeers *peers)
Get the number of Orthanc peers.
Definition OrthancCPlugin.h:6635
OrthancPluginJobGetContent
const char *(* OrthancPluginJobGetContent)(void *job)
Callback to retrieve the content of one custom job.
Definition OrthancCPlugin.h:1690
OrthancPluginValueRepresentation
OrthancPluginValueRepresentation
Definition OrthancCPlugin.h:818
OrthancPluginSubmitJob
char * OrthancPluginSubmitJob(OrthancPluginContext *context, OrthancPluginJob *job, int32_t priority)
Submit a new job to the jobs engine of Orthanc.
Definition OrthancCPlugin.h:7110
OrthancPluginHttpGet
OrthancPluginErrorCode OrthancPluginHttpGet(OrthancPluginContext *context, OrthancPluginMemoryBuffer *target, const char *url, const char *username, const char *password)
Issue a HTTP GET call.
Definition OrthancCPlugin.h:4545
OrthancPluginJobStopReason
OrthancPluginJobStopReason
Definition OrthancCPlugin.h:968
OrthancPluginGetOrthancPath
char * OrthancPluginGetOrthancPath(OrthancPluginContext *context)
Return the path to the Orthanc executable.
Definition OrthancCPlugin.h:3360
OrthancPluginDicomToJsonFormat
OrthancPluginDicomToJsonFormat
Definition OrthancCPlugin.h:857
OrthancPluginSetDescription2
void OrthancPluginSetDescription2(OrthancPluginContext *context, const char *plugin, const char *description)
Set a description for this plugin.
Definition OrthancCPlugin.h:3581
OrthancPluginLogError
void OrthancPluginLogError(OrthancPluginContext *context, const char *message)
Log an error.
Definition OrthancCPlugin.h:2147
OrthancPluginGetConfigurationPath
char * OrthancPluginGetConfigurationPath(OrthancPluginContext *context)
Return the path to the configuration file(s).
Definition OrthancCPlugin.h:3425
OrthancPluginHttpMethod
OrthancPluginHttpMethod
Definition OrthancCPlugin.h:345
OrthancPluginSetRootUri
void OrthancPluginSetRootUri(OrthancPluginContext *context, const char *uri)
Set the URI where the plugin provides its Web interface.
Definition OrthancCPlugin.h:3506
OrthancPluginEncodeDicomWebXml2
char * OrthancPluginEncodeDicomWebXml2(OrthancPluginContext *context, const void *dicom, uint32_t dicomSize, OrthancPluginDicomWebBinaryCallback2 callback, void *payload)
Convert a DICOM instance to DICOMweb XML.
Definition OrthancCPlugin.h:7474
OrthancPluginCallPeerApi
OrthancPluginErrorCode OrthancPluginCallPeerApi(OrthancPluginContext *context, OrthancPluginMemoryBuffer *answerBody, OrthancPluginMemoryBuffer *answerHeaders, uint16_t *httpStatus, const OrthancPluginPeers *peers, uint32_t peerIndex, OrthancPluginHttpMethod method, const char *uri, uint32_t additionalHeadersCount, const char *const *additionalHeadersKeys, const char *const *additionalHeadersValues, const void *body, uint32_t bodySize, uint32_t timeout)
Call the REST API of an Orthanc peer.
Definition OrthancCPlugin.h:6851
OrthancPluginFindMatcher
struct _OrthancPluginFindMatcher_t OrthancPluginFindMatcher
Opaque structure to an object that can be used to check whether a DICOM instance matches a C-Find que...
Definition OrthancCPlugin.h:1245
OrthancPluginEncodeDicomWebJson2
char * OrthancPluginEncodeDicomWebJson2(OrthancPluginContext *context, const void *dicom, uint32_t dicomSize, OrthancPluginDicomWebBinaryCallback2 callback, void *payload)
Convert a DICOM instance to DICOMweb JSON.
Definition OrthancCPlugin.h:7430
OrthancPluginLookupDictionary
OrthancPluginErrorCode OrthancPluginLookupDictionary(OrthancPluginContext *context, OrthancPluginDictionaryEntry *target, const char *name)
Get information about the given DICOM tag.
Definition OrthancCPlugin.h:5895
OrthancPluginInstanceOrigin
OrthancPluginInstanceOrigin
Definition OrthancCPlugin.h:938
OrthancPluginJobFinalize
void(* OrthancPluginJobFinalize)(void *job)
Callback to finalize one custom job.
Definition OrthancCPlugin.h:1661
OrthancPluginFreeString
void OrthancPluginFreeString(OrthancPluginContext *context, char *str)
Free a string.
Definition OrthancCPlugin.h:1957
OrthancPluginSetCurrentThreadName
OrthancPluginErrorCode OrthancPluginSetCurrentThreadName(OrthancPluginContext *context, const char *threadName)
Set the name of the current thread.
Definition OrthancCPlugin.h:9521
OrthancPluginJobReset
OrthancPluginErrorCode(* OrthancPluginJobReset)(void *job)
Callback executed once one stopped custom job is started again.
Definition OrthancCPlugin.h:1805
OrthancPluginGetErrorDescription
const char * OrthancPluginGetErrorDescription(OrthancPluginContext *context, OrthancPluginErrorCode error)
Get the description of a given error code.
Definition OrthancCPlugin.h:4046
OrthancPluginContext
struct _OrthancPluginContext_t OrthancPluginContext
Data structure that contains information about the Orthanc core.
OrthancPluginContentType
OrthancPluginContentType
Definition OrthancCPlugin.h:726
OrthancPluginGetPeerUrl
const char * OrthancPluginGetPeerUrl(OrthancPluginContext *context, const OrthancPluginPeers *peers, uint32_t peerIndex)
Get the base URL of an Orthanc peer.
Definition OrthancCPlugin.h:6724
OrthancPluginSetDescription
void OrthancPluginSetDescription(OrthancPluginContext *context, const char *description)
Set a description for this plugin.
Definition OrthancCPlugin.h:3558
OrthancPluginGetTagName
char * OrthancPluginGetTagName(OrthancPluginContext *context, uint16_t group, uint16_t element, const char *privateCreator)
Returns the symbolic name of a DICOM tag.
Definition OrthancCPlugin.h:7920
OrthancPluginLogLevel_Warning
@ OrthancPluginLogLevel_Warning
Definition OrthancCPlugin.h:1104
OrthancPluginLogLevel_Trace
@ OrthancPluginLogLevel_Trace
Definition OrthancCPlugin.h:1106
OrthancPluginLogLevel_Error
@ OrthancPluginLogLevel_Error
Definition OrthancCPlugin.h:1103
OrthancPluginLogLevel_Info
@ OrthancPluginLogLevel_Info
Definition OrthancCPlugin.h:1105
OrthancPluginIdentifierConstraint_Wildcard
@ OrthancPluginIdentifierConstraint_Wildcard
Definition OrthancCPlugin.h:912
OrthancPluginIdentifierConstraint_Equal
@ OrthancPluginIdentifierConstraint_Equal
Definition OrthancCPlugin.h:909
OrthancPluginIdentifierConstraint_SmallerOrEqual
@ OrthancPluginIdentifierConstraint_SmallerOrEqual
Definition OrthancCPlugin.h:910
OrthancPluginIdentifierConstraint_GreaterOrEqual
@ OrthancPluginIdentifierConstraint_GreaterOrEqual
Definition OrthancCPlugin.h:911
OrthancPluginResourceType_Instance
@ OrthancPluginResourceType_Instance
Definition OrthancCPlugin.h:745
OrthancPluginResourceType_None
@ OrthancPluginResourceType_None
Definition OrthancCPlugin.h:746
OrthancPluginResourceType_Series
@ OrthancPluginResourceType_Series
Definition OrthancCPlugin.h:744
OrthancPluginResourceType_Study
@ OrthancPluginResourceType_Study
Definition OrthancCPlugin.h:743
OrthancPluginResourceType_Patient
@ OrthancPluginResourceType_Patient
Definition OrthancCPlugin.h:742
OrthancPluginLogCategory_Dicom
@ OrthancPluginLogCategory_Dicom
Definition OrthancCPlugin.h:1124
OrthancPluginLogCategory_Jobs
@ OrthancPluginLogCategory_Jobs
Definition OrthancCPlugin.h:1125
OrthancPluginLogCategory_Sqlite
@ OrthancPluginLogCategory_Sqlite
Definition OrthancCPlugin.h:1123
OrthancPluginLogCategory_Plugins
@ OrthancPluginLogCategory_Plugins
Definition OrthancCPlugin.h:1121
OrthancPluginLogCategory_Generic
@ OrthancPluginLogCategory_Generic
Definition OrthancCPlugin.h:1120
OrthancPluginLogCategory_Lua
@ OrthancPluginLogCategory_Lua
Definition OrthancCPlugin.h:1126
OrthancPluginLogCategory_Http
@ OrthancPluginLogCategory_Http
Definition OrthancCPlugin.h:1122
OrthancPluginErrorCode_CreateDicomBadParent
@ OrthancPluginErrorCode_CreateDicomBadParent
Definition OrthancCPlugin.h:306
OrthancPluginErrorCode_MainDicomTagsMultiplyDefined
@ OrthancPluginErrorCode_MainDicomTagsMultiplyDefined
Definition OrthancCPlugin.h:262
OrthancPluginErrorCode_SQLiteFlush
@ OrthancPluginErrorCode_SQLiteFlush
Definition OrthancCPlugin.h:274
OrthancPluginErrorCode_IncompatibleDatabaseVersion
@ OrthancPluginErrorCode_IncompatibleDatabaseVersion
Definition OrthancCPlugin.h:236
OrthancPluginErrorCode_BadSequenceOfCalls
@ OrthancPluginErrorCode_BadSequenceOfCalls
Definition OrthancCPlugin.h:224
OrthancPluginErrorCode_SharedLibrary
@ OrthancPluginErrorCode_SharedLibrary
Definition OrthancCPlugin.h:243
OrthancPluginErrorCode_NullPointer
@ OrthancPluginErrorCode_NullPointer
Definition OrthancCPlugin.h:253
OrthancPluginErrorCode_NotLuaPredicate
@ OrthancPluginErrorCode_NotLuaPredicate
Definition OrthancCPlugin.h:316
OrthancPluginErrorCode_LuaAlreadyExecuted
@ OrthancPluginErrorCode_LuaAlreadyExecuted
Definition OrthancCPlugin.h:314
OrthancPluginErrorCode_NotAcceptable
@ OrthancPluginErrorCode_NotAcceptable
Definition OrthancCPlugin.h:252
OrthancPluginErrorCode_FullStorage
@ OrthancPluginErrorCode_FullStorage
Definition OrthancCPlugin.h:237
OrthancPluginErrorCode_DatabaseBackendAlreadyRegistered
@ OrthancPluginErrorCode_DatabaseBackendAlreadyRegistered
Definition OrthancCPlugin.h:319
OrthancPluginErrorCode_InexistentFile
@ OrthancPluginErrorCode_InexistentFile
Definition OrthancCPlugin.h:231
OrthancPluginErrorCode_CreateDicomParentEncoding
@ OrthancPluginErrorCode_CreateDicomParentEncoding
Definition OrthancCPlugin.h:308
OrthancPluginErrorCode_CannotOrderSlices
@ OrthancPluginErrorCode_CannotOrderSlices
Definition OrthancCPlugin.h:322
OrthancPluginErrorCode_InternalError
@ OrthancPluginErrorCode_InternalError
Definition OrthancCPlugin.h:217
OrthancPluginErrorCode_DiscontinuedAbi
@ OrthancPluginErrorCode_DiscontinuedAbi
Definition OrthancCPlugin.h:258
OrthancPluginErrorCode_NoCFindHandler
@ OrthancPluginErrorCode_NoCFindHandler
Definition OrthancCPlugin.h:292
OrthancPluginErrorCode_SQLiteCommitWithoutTransaction
@ OrthancPluginErrorCode_SQLiteCommitWithoutTransaction
Definition OrthancCPlugin.h:272
OrthancPluginErrorCode_DatabasePlugin
@ OrthancPluginErrorCode_DatabasePlugin
Definition OrthancCPlugin.h:249
OrthancPluginErrorCode_SQLiteStatementAlreadyUsed
@ OrthancPluginErrorCode_SQLiteStatementAlreadyUsed
Definition OrthancCPlugin.h:269
OrthancPluginErrorCode_SQLiteCannotRun
@ OrthancPluginErrorCode_SQLiteCannotRun
Definition OrthancCPlugin.h:275
OrthancPluginErrorCode_UnknownPluginService
@ OrthancPluginErrorCode_UnknownPluginService
Definition OrthancCPlugin.h:244
OrthancPluginErrorCode_JsonToLuaTable
@ OrthancPluginErrorCode_JsonToLuaTable
Definition OrthancCPlugin.h:311
OrthancPluginErrorCode_CreateDicomOverrideTag
@ OrthancPluginErrorCode_CreateDicomOverrideTag
Definition OrthancCPlugin.h:302
OrthancPluginErrorCode_SQLiteBindOutOfRange
@ OrthancPluginErrorCode_SQLiteBindOutOfRange
Definition OrthancCPlugin.h:277
OrthancPluginErrorCode_ParameterOutOfRange
@ OrthancPluginErrorCode_ParameterOutOfRange
Definition OrthancCPlugin.h:221
OrthancPluginErrorCode_SQLiteRegisterFunction
@ OrthancPluginErrorCode_SQLiteRegisterFunction
Definition OrthancCPlugin.h:273
OrthancPluginErrorCode_SQLiteTransactionBegin
@ OrthancPluginErrorCode_SQLiteTransactionBegin
Definition OrthancCPlugin.h:281
OrthancPluginErrorCode_CreateDicomNoPayload
@ OrthancPluginErrorCode_CreateDicomNoPayload
Definition OrthancCPlugin.h:304
OrthancPluginErrorCode_Unauthorized
@ OrthancPluginErrorCode_Unauthorized
Definition OrthancCPlugin.h:247
OrthancPluginErrorCode_RegularFileExpected
@ OrthancPluginErrorCode_RegularFileExpected
Definition OrthancCPlugin.h:288
OrthancPluginErrorCode_DicomPortInUse
@ OrthancPluginErrorCode_DicomPortInUse
Definition OrthancCPlugin.h:286
OrthancPluginErrorCode_BadApplicationEntityTitle
@ OrthancPluginErrorCode_BadApplicationEntityTitle
Definition OrthancCPlugin.h:291
OrthancPluginErrorCode_NoCStoreHandler
@ OrthancPluginErrorCode_NoCStoreHandler
Definition OrthancCPlugin.h:294
OrthancPluginErrorCode_PathToExecutable
@ OrthancPluginErrorCode_PathToExecutable
Definition OrthancCPlugin.h:289
OrthancPluginErrorCode_NoSopClassOrInstance
@ OrthancPluginErrorCode_NoSopClassOrInstance
Definition OrthancCPlugin.h:296
OrthancPluginErrorCode_BadFont
@ OrthancPluginErrorCode_BadFont
Definition OrthancCPlugin.h:248
OrthancPluginErrorCode_DicomGetUnavailable
@ OrthancPluginErrorCode_DicomGetUnavailable
Definition OrthancCPlugin.h:327
OrthancPluginErrorCode_DatabaseUnavailable
@ OrthancPluginErrorCode_DatabaseUnavailable
Definition OrthancCPlugin.h:254
OrthancPluginErrorCode_CannotCreateLua
@ OrthancPluginErrorCode_CannotCreateLua
Definition OrthancCPlugin.h:312
OrthancPluginErrorCode_SQLiteExecute
@ OrthancPluginErrorCode_SQLiteExecute
Definition OrthancCPlugin.h:270
OrthancPluginErrorCode_UriSyntax
@ OrthancPluginErrorCode_UriSyntax
Definition OrthancCPlugin.h:230
OrthancPluginErrorCode_DirectoryOverFile
@ OrthancPluginErrorCode_DirectoryOverFile
Definition OrthancCPlugin.h:282
OrthancPluginErrorCode_Revision
@ OrthancPluginErrorCode_Revision
Definition OrthancCPlugin.h:261
OrthancPluginErrorCode_InexistentTag
@ OrthancPluginErrorCode_InexistentTag
Definition OrthancCPlugin.h:239
OrthancPluginErrorCode_IncompatibleImageFormat
@ OrthancPluginErrorCode_IncompatibleImageFormat
Definition OrthancCPlugin.h:241
OrthancPluginErrorCode_UnsupportedMediaType
@ OrthancPluginErrorCode_UnsupportedMediaType
Definition OrthancCPlugin.h:328
OrthancPluginErrorCode_DicomFindUnavailable
@ OrthancPluginErrorCode_DicomFindUnavailable
Definition OrthancCPlugin.h:298
OrthancPluginErrorCode_SQLiteCannotStep
@ OrthancPluginErrorCode_SQLiteCannotStep
Definition OrthancCPlugin.h:276
OrthancPluginErrorCode_CreateDicomParentIsInstance
@ OrthancPluginErrorCode_CreateDicomParentIsInstance
Definition OrthancCPlugin.h:307
OrthancPluginErrorCode_DuplicateResource
@ OrthancPluginErrorCode_DuplicateResource
Definition OrthancCPlugin.h:264
OrthancPluginErrorCode_StorageAreaAlreadyRegistered
@ OrthancPluginErrorCode_StorageAreaAlreadyRegistered
Definition OrthancCPlugin.h:318
OrthancPluginErrorCode_LuaReturnsNoString
@ OrthancPluginErrorCode_LuaReturnsNoString
Definition OrthancCPlugin.h:317
OrthancPluginErrorCode_UnknownResource
@ OrthancPluginErrorCode_UnknownResource
Definition OrthancCPlugin.h:235
OrthancPluginErrorCode_CreateDicomNotString
@ OrthancPluginErrorCode_CreateDicomNotString
Definition OrthancCPlugin.h:301
OrthancPluginErrorCode_HttpPortInUse
@ OrthancPluginErrorCode_HttpPortInUse
Definition OrthancCPlugin.h:285
OrthancPluginErrorCode_SslDisabled
@ OrthancPluginErrorCode_SslDisabled
Definition OrthancCPlugin.h:321
OrthancPluginErrorCode_UnknownModality
@ OrthancPluginErrorCode_UnknownModality
Definition OrthancCPlugin.h:309
OrthancPluginErrorCode_BadHttpStatusInRest
@ OrthancPluginErrorCode_BadHttpStatusInRest
Definition OrthancCPlugin.h:287
OrthancPluginErrorCode_BadGeometry
@ OrthancPluginErrorCode_BadGeometry
Definition OrthancCPlugin.h:256
OrthancPluginErrorCode_AlreadyExistingTag
@ OrthancPluginErrorCode_AlreadyExistingTag
Definition OrthancCPlugin.h:324
OrthancPluginErrorCode_FileStorageCannotWrite
@ OrthancPluginErrorCode_FileStorageCannotWrite
Definition OrthancCPlugin.h:283
OrthancPluginErrorCode_CreateDicomUseDataUriScheme
@ OrthancPluginErrorCode_CreateDicomUseDataUriScheme
Definition OrthancCPlugin.h:305
OrthancPluginErrorCode_DirectoryExpected
@ OrthancPluginErrorCode_DirectoryExpected
Definition OrthancCPlugin.h:284
OrthancPluginErrorCode_NoCMoveHandler
@ OrthancPluginErrorCode_NoCMoveHandler
Definition OrthancCPlugin.h:293
OrthancPluginErrorCode_SQLitePrepareStatement
@ OrthancPluginErrorCode_SQLitePrepareStatement
Definition OrthancCPlugin.h:278
OrthancPluginErrorCode_CorruptedFile
@ OrthancPluginErrorCode_CorruptedFile
Definition OrthancCPlugin.h:238
OrthancPluginErrorCode_StorageAreaPlugin
@ OrthancPluginErrorCode_StorageAreaPlugin
Definition OrthancCPlugin.h:250
OrthancPluginErrorCode_BadJobOrdering
@ OrthancPluginErrorCode_BadJobOrdering
Definition OrthancCPlugin.h:310
OrthancPluginErrorCode_IncompatibleConfigurations
@ OrthancPluginErrorCode_IncompatibleConfigurations
Definition OrthancCPlugin.h:265
OrthancPluginErrorCode_DatabaseCannotSerialize
@ OrthancPluginErrorCode_DatabaseCannotSerialize
Definition OrthancCPlugin.h:260
OrthancPluginErrorCode_CanceledJob
@ OrthancPluginErrorCode_CanceledJob
Definition OrthancCPlugin.h:255
OrthancPluginErrorCode_BadRange
@ OrthancPluginErrorCode_BadRange
Definition OrthancCPlugin.h:259
OrthancPluginErrorCode_NotImplemented
@ OrthancPluginErrorCode_NotImplemented
Definition OrthancCPlugin.h:220
OrthancPluginErrorCode_SslInitialization
@ OrthancPluginErrorCode_SslInitialization
Definition OrthancCPlugin.h:257
OrthancPluginErrorCode_IncompatibleImageSize
@ OrthancPluginErrorCode_IncompatibleImageSize
Definition OrthancCPlugin.h:242
OrthancPluginErrorCode_BadFileFormat
@ OrthancPluginErrorCode_BadFileFormat
Definition OrthancCPlugin.h:233
OrthancPluginErrorCode_BadRequest
@ OrthancPluginErrorCode_BadRequest
Definition OrthancCPlugin.h:226
OrthancPluginErrorCode_SystemCommand
@ OrthancPluginErrorCode_SystemCommand
Definition OrthancCPlugin.h:228
OrthancPluginErrorCode_NoStorageCommitmentHandler
@ OrthancPluginErrorCode_NoStorageCommitmentHandler
Definition OrthancCPlugin.h:325
OrthancPluginErrorCode_SQLiteAlreadyOpened
@ OrthancPluginErrorCode_SQLiteAlreadyOpened
Definition OrthancCPlugin.h:267
OrthancPluginErrorCode_Plugin
@ OrthancPluginErrorCode_Plugin
Definition OrthancCPlugin.h:219
OrthancPluginErrorCode_CannotExecuteLua
@ OrthancPluginErrorCode_CannotExecuteLua
Definition OrthancCPlugin.h:313
OrthancPluginErrorCode_SQLiteRollbackWithoutTransaction
@ OrthancPluginErrorCode_SQLiteRollbackWithoutTransaction
Definition OrthancCPlugin.h:271
OrthancPluginErrorCode_UnknownDicomTag
@ OrthancPluginErrorCode_UnknownDicomTag
Definition OrthancCPlugin.h:245
OrthancPluginErrorCode_ForbiddenAccess
@ OrthancPluginErrorCode_ForbiddenAccess
Definition OrthancCPlugin.h:263
OrthancPluginErrorCode_NoPresentationContext
@ OrthancPluginErrorCode_NoPresentationContext
Definition OrthancCPlugin.h:297
OrthancPluginErrorCode_EmptyRequest
@ OrthancPluginErrorCode_EmptyRequest
Definition OrthancCPlugin.h:251
OrthancPluginErrorCode_DatabaseNotInitialized
@ OrthancPluginErrorCode_DatabaseNotInitialized
Definition OrthancCPlugin.h:320
OrthancPluginErrorCode_DicomMoveUnavailable
@ OrthancPluginErrorCode_DicomMoveUnavailable
Definition OrthancCPlugin.h:299
OrthancPluginErrorCode_SQLiteTransactionCommit
@ OrthancPluginErrorCode_SQLiteTransactionCommit
Definition OrthancCPlugin.h:280
OrthancPluginErrorCode_BadJson
@ OrthancPluginErrorCode_BadJson
Definition OrthancCPlugin.h:246
OrthancPluginErrorCode_Success
@ OrthancPluginErrorCode_Success
Definition OrthancCPlugin.h:218
OrthancPluginErrorCode_NetworkProtocol
@ OrthancPluginErrorCode_NetworkProtocol
Definition OrthancCPlugin.h:227
OrthancPluginErrorCode_NoApplicationEntityFilter
@ OrthancPluginErrorCode_NoApplicationEntityFilter
Definition OrthancCPlugin.h:295
OrthancPluginErrorCode_InexistentItem
@ OrthancPluginErrorCode_InexistentItem
Definition OrthancCPlugin.h:225
OrthancPluginErrorCode_Timeout
@ OrthancPluginErrorCode_Timeout
Definition OrthancCPlugin.h:234
OrthancPluginErrorCode_LuaBadOutput
@ OrthancPluginErrorCode_LuaBadOutput
Definition OrthancCPlugin.h:315
OrthancPluginErrorCode_SQLiteTransactionAlreadyStarted
@ OrthancPluginErrorCode_SQLiteTransactionAlreadyStarted
Definition OrthancCPlugin.h:279
OrthancPluginErrorCode_NoCGetHandler
@ OrthancPluginErrorCode_NoCGetHandler
Definition OrthancCPlugin.h:326
OrthancPluginErrorCode_SQLiteNotOpened
@ OrthancPluginErrorCode_SQLiteNotOpened
Definition OrthancCPlugin.h:266
OrthancPluginErrorCode_ReadOnly
@ OrthancPluginErrorCode_ReadOnly
Definition OrthancCPlugin.h:240
OrthancPluginErrorCode_CannotStoreInstance
@ OrthancPluginErrorCode_CannotStoreInstance
Definition OrthancCPlugin.h:300
OrthancPluginErrorCode_CannotWriteFile
@ OrthancPluginErrorCode_CannotWriteFile
Definition OrthancCPlugin.h:232
OrthancPluginErrorCode_BadParameterType
@ OrthancPluginErrorCode_BadParameterType
Definition OrthancCPlugin.h:223
OrthancPluginErrorCode_NotEnoughMemory
@ OrthancPluginErrorCode_NotEnoughMemory
Definition OrthancCPlugin.h:222
OrthancPluginErrorCode_CreateDicomUseContent
@ OrthancPluginErrorCode_CreateDicomUseContent
Definition OrthancCPlugin.h:303
OrthancPluginErrorCode_Database
@ OrthancPluginErrorCode_Database
Definition OrthancCPlugin.h:229
OrthancPluginErrorCode_SQLiteCannotOpen
@ OrthancPluginErrorCode_SQLiteCannotOpen
Definition OrthancCPlugin.h:268
OrthancPluginErrorCode_MakeDirectory
@ OrthancPluginErrorCode_MakeDirectory
Definition OrthancCPlugin.h:290
OrthancPluginErrorCode_NoWorklistHandler
@ OrthancPluginErrorCode_NoWorklistHandler
Definition OrthancCPlugin.h:323
OrthancPluginDicomWebBinaryMode_InlineBinary
@ OrthancPluginDicomWebBinaryMode_InlineBinary
Definition OrthancCPlugin.h:999
OrthancPluginDicomWebBinaryMode_BulkDataUri
@ OrthancPluginDicomWebBinaryMode_BulkDataUri
Definition OrthancCPlugin.h:1000
OrthancPluginDicomWebBinaryMode_Ignore
@ OrthancPluginDicomWebBinaryMode_Ignore
Definition OrthancCPlugin.h:998
OrthancPluginDicomToJsonFlags_ConvertBinaryToAscii
@ OrthancPluginDicomToJsonFlags_ConvertBinaryToAscii
Definition OrthancCPlugin.h:878
OrthancPluginDicomToJsonFlags_IncludeBinary
@ OrthancPluginDicomToJsonFlags_IncludeBinary
Definition OrthancCPlugin.h:874
OrthancPluginDicomToJsonFlags_IncludePixelData
@ OrthancPluginDicomToJsonFlags_IncludePixelData
Definition OrthancCPlugin.h:877
OrthancPluginDicomToJsonFlags_IncludeUnknownTags
@ OrthancPluginDicomToJsonFlags_IncludeUnknownTags
Definition OrthancCPlugin.h:876
OrthancPluginDicomToJsonFlags_SkipGroupLengths
@ OrthancPluginDicomToJsonFlags_SkipGroupLengths
Definition OrthancCPlugin.h:881
OrthancPluginDicomToJsonFlags_None
@ OrthancPluginDicomToJsonFlags_None
Definition OrthancCPlugin.h:873
OrthancPluginDicomToJsonFlags_ConvertBinaryToNull
@ OrthancPluginDicomToJsonFlags_ConvertBinaryToNull
Definition OrthancCPlugin.h:879
OrthancPluginDicomToJsonFlags_StopAfterPixelData
@ OrthancPluginDicomToJsonFlags_StopAfterPixelData
Definition OrthancCPlugin.h:880
OrthancPluginDicomToJsonFlags_IncludePrivateTags
@ OrthancPluginDicomToJsonFlags_IncludePrivateTags
Definition OrthancCPlugin.h:875
OrthancPluginJobStepStatus_Continue
@ OrthancPluginJobStepStatus_Continue
Definition OrthancCPlugin.h:957
OrthancPluginJobStepStatus_Success
@ OrthancPluginJobStepStatus_Success
Definition OrthancCPlugin.h:955
OrthancPluginJobStepStatus_Failure
@ OrthancPluginJobStepStatus_Failure
Definition OrthancCPlugin.h:956
OrthancPluginCreateDicomFlags_DecodeDataUriScheme
@ OrthancPluginCreateDicomFlags_DecodeDataUriScheme
Definition OrthancCPlugin.h:895
OrthancPluginCreateDicomFlags_None
@ OrthancPluginCreateDicomFlags_None
Definition OrthancCPlugin.h:894
OrthancPluginCreateDicomFlags_GenerateIdentifiers
@ OrthancPluginCreateDicomFlags_GenerateIdentifiers
Definition OrthancCPlugin.h:896
OrthancPluginConstraintType_SmallerOrEqual
@ OrthancPluginConstraintType_SmallerOrEqual
Definition OrthancCPlugin.h:925
OrthancPluginConstraintType_List
@ OrthancPluginConstraintType_List
Definition OrthancCPlugin.h:928
OrthancPluginConstraintType_GreaterOrEqual
@ OrthancPluginConstraintType_GreaterOrEqual
Definition OrthancCPlugin.h:926
OrthancPluginConstraintType_Equal
@ OrthancPluginConstraintType_Equal
Definition OrthancCPlugin.h:924
OrthancPluginConstraintType_Wildcard
@ OrthancPluginConstraintType_Wildcard
Definition OrthancCPlugin.h:927
OrthancPluginReceivedInstanceAction_KeepAsIs
@ OrthancPluginReceivedInstanceAction_KeepAsIs
Definition OrthancCPlugin.h:1059
OrthancPluginReceivedInstanceAction_Discard
@ OrthancPluginReceivedInstanceAction_Discard
Definition OrthancCPlugin.h:1061
OrthancPluginReceivedInstanceAction_Modify
@ OrthancPluginReceivedInstanceAction_Modify
Definition OrthancCPlugin.h:1060
OrthancPluginStorageCommitmentFailureReason_ReferencedSOPClassNotSupported
@ OrthancPluginStorageCommitmentFailureReason_ReferencedSOPClassNotSupported
Definition OrthancCPlugin.h:1037
OrthancPluginStorageCommitmentFailureReason_Success
@ OrthancPluginStorageCommitmentFailureReason_Success
Definition OrthancCPlugin.h:1014
OrthancPluginStorageCommitmentFailureReason_DuplicateTransactionUID
@ OrthancPluginStorageCommitmentFailureReason_DuplicateTransactionUID
Definition OrthancCPlugin.h:1050
OrthancPluginStorageCommitmentFailureReason_ClassInstanceConflict
@ OrthancPluginStorageCommitmentFailureReason_ClassInstanceConflict
Definition OrthancCPlugin.h:1044
OrthancPluginStorageCommitmentFailureReason_ResourceLimitation
@ OrthancPluginStorageCommitmentFailureReason_ResourceLimitation
Definition OrthancCPlugin.h:1031
OrthancPluginStorageCommitmentFailureReason_NoSuchObjectInstance
@ OrthancPluginStorageCommitmentFailureReason_NoSuchObjectInstance
Definition OrthancCPlugin.h:1025
OrthancPluginStorageCommitmentFailureReason_ProcessingFailure
@ OrthancPluginStorageCommitmentFailureReason_ProcessingFailure
Definition OrthancCPlugin.h:1019
OrthancPluginMetricsType_Default
@ OrthancPluginMetricsType_Default
Definition OrthancCPlugin.h:981
OrthancPluginMetricsType_Timer
@ OrthancPluginMetricsType_Timer
Definition OrthancCPlugin.h:988
OrthancPluginLoadDicomInstanceMode_UntilPixelData
@ OrthancPluginLoadDicomInstanceMode_UntilPixelData
Definition OrthancCPlugin.h:1082
OrthancPluginLoadDicomInstanceMode_WholeDicom
@ OrthancPluginLoadDicomInstanceMode_WholeDicom
Definition OrthancCPlugin.h:1076
OrthancPluginLoadDicomInstanceMode_EmptyPixelData
@ OrthancPluginLoadDicomInstanceMode_EmptyPixelData
Definition OrthancCPlugin.h:1089
OrthancPluginValueRepresentation_PN
@ OrthancPluginValueRepresentation_PN
Definition OrthancCPlugin.h:834
OrthancPluginValueRepresentation_UL
@ OrthancPluginValueRepresentation_UL
Definition OrthancCPlugin.h:842
OrthancPluginValueRepresentation_UN
@ OrthancPluginValueRepresentation_UN
Definition OrthancCPlugin.h:843
OrthancPluginValueRepresentation_DA
@ OrthancPluginValueRepresentation_DA
Definition OrthancCPlugin.h:823
OrthancPluginValueRepresentation_OF
@ OrthancPluginValueRepresentation_OF
Definition OrthancCPlugin.h:832
OrthancPluginValueRepresentation_OW
@ OrthancPluginValueRepresentation_OW
Definition OrthancCPlugin.h:833
OrthancPluginValueRepresentation_CS
@ OrthancPluginValueRepresentation_CS
Definition OrthancCPlugin.h:822
OrthancPluginValueRepresentation_US
@ OrthancPluginValueRepresentation_US
Definition OrthancCPlugin.h:844
OrthancPluginValueRepresentation_SH
@ OrthancPluginValueRepresentation_SH
Definition OrthancCPlugin.h:835
OrthancPluginValueRepresentation_FL
@ OrthancPluginValueRepresentation_FL
Definition OrthancCPlugin.h:827
OrthancPluginValueRepresentation_DT
@ OrthancPluginValueRepresentation_DT
Definition OrthancCPlugin.h:825
OrthancPluginValueRepresentation_TM
@ OrthancPluginValueRepresentation_TM
Definition OrthancCPlugin.h:840
OrthancPluginValueRepresentation_SQ
@ OrthancPluginValueRepresentation_SQ
Definition OrthancCPlugin.h:837
OrthancPluginValueRepresentation_DS
@ OrthancPluginValueRepresentation_DS
Definition OrthancCPlugin.h:824
OrthancPluginValueRepresentation_OB
@ OrthancPluginValueRepresentation_OB
Definition OrthancCPlugin.h:831
OrthancPluginValueRepresentation_SL
@ OrthancPluginValueRepresentation_SL
Definition OrthancCPlugin.h:836
OrthancPluginValueRepresentation_ST
@ OrthancPluginValueRepresentation_ST
Definition OrthancCPlugin.h:839
OrthancPluginValueRepresentation_IS
@ OrthancPluginValueRepresentation_IS
Definition OrthancCPlugin.h:828
OrthancPluginValueRepresentation_LT
@ OrthancPluginValueRepresentation_LT
Definition OrthancCPlugin.h:830
OrthancPluginValueRepresentation_SS
@ OrthancPluginValueRepresentation_SS
Definition OrthancCPlugin.h:838
OrthancPluginValueRepresentation_UT
@ OrthancPluginValueRepresentation_UT
Definition OrthancCPlugin.h:845
OrthancPluginValueRepresentation_LO
@ OrthancPluginValueRepresentation_LO
Definition OrthancCPlugin.h:829
OrthancPluginValueRepresentation_AE
@ OrthancPluginValueRepresentation_AE
Definition OrthancCPlugin.h:819
OrthancPluginValueRepresentation_FD
@ OrthancPluginValueRepresentation_FD
Definition OrthancCPlugin.h:826
OrthancPluginValueRepresentation_UI
@ OrthancPluginValueRepresentation_UI
Definition OrthancCPlugin.h:841
OrthancPluginValueRepresentation_AS
@ OrthancPluginValueRepresentation_AS
Definition OrthancCPlugin.h:820
OrthancPluginValueRepresentation_AT
@ OrthancPluginValueRepresentation_AT
Definition OrthancCPlugin.h:821
OrthancPluginJobStopReason_Failure
@ OrthancPluginJobStopReason_Failure
Definition OrthancCPlugin.h:971
OrthancPluginJobStopReason_Success
@ OrthancPluginJobStopReason_Success
Definition OrthancCPlugin.h:969
OrthancPluginJobStopReason_Canceled
@ OrthancPluginJobStopReason_Canceled
Definition OrthancCPlugin.h:972
OrthancPluginJobStopReason_Paused
@ OrthancPluginJobStopReason_Paused
Definition OrthancCPlugin.h:970
OrthancPluginDicomToJsonFormat_Full
@ OrthancPluginDicomToJsonFormat_Full
Definition OrthancCPlugin.h:858
OrthancPluginDicomToJsonFormat_Human
@ OrthancPluginDicomToJsonFormat_Human
Definition OrthancCPlugin.h:860
OrthancPluginDicomToJsonFormat_Short
@ OrthancPluginDicomToJsonFormat_Short
Definition OrthancCPlugin.h:859
OrthancPluginHttpMethod_Delete
@ OrthancPluginHttpMethod_Delete
Definition OrthancCPlugin.h:349
OrthancPluginHttpMethod_Post
@ OrthancPluginHttpMethod_Post
Definition OrthancCPlugin.h:347
OrthancPluginHttpMethod_Put
@ OrthancPluginHttpMethod_Put
Definition OrthancCPlugin.h:348
OrthancPluginHttpMethod_Get
@ OrthancPluginHttpMethod_Get
Definition OrthancCPlugin.h:346
OrthancPluginInstanceOrigin_Unknown
@ OrthancPluginInstanceOrigin_Unknown
Definition OrthancCPlugin.h:939
OrthancPluginInstanceOrigin_RestApi
@ OrthancPluginInstanceOrigin_RestApi
Definition OrthancCPlugin.h:941
OrthancPluginInstanceOrigin_Lua
@ OrthancPluginInstanceOrigin_Lua
Definition OrthancCPlugin.h:943
OrthancPluginInstanceOrigin_WebDav
@ OrthancPluginInstanceOrigin_WebDav
Definition OrthancCPlugin.h:944
OrthancPluginInstanceOrigin_DicomProtocol
@ OrthancPluginInstanceOrigin_DicomProtocol
Definition OrthancCPlugin.h:940
OrthancPluginInstanceOrigin_Plugin
@ OrthancPluginInstanceOrigin_Plugin
Definition OrthancCPlugin.h:942
OrthancPluginContentType_Dicom
@ OrthancPluginContentType_Dicom
Definition OrthancCPlugin.h:728
OrthancPluginContentType_DicomAsJson
@ OrthancPluginContentType_DicomAsJson
Definition OrthancCPlugin.h:729
OrthancPluginContentType_Unknown
@ OrthancPluginContentType_Unknown
Definition OrthancCPlugin.h:727
OrthancPluginContentType_DicomUntilPixelData
@ OrthancPluginContentType_DicomUntilPixelData
Definition OrthancCPlugin.h:730
OrthancPluginDictionaryEntry
An entry in the dictionary of DICOM tags.
Definition OrthancCPlugin.h:1939
OrthancPluginDictionaryEntry::minMultiplicity
uint32_t minMultiplicity
Definition OrthancCPlugin.h:1943
OrthancPluginDictionaryEntry::maxMultiplicity
uint32_t maxMultiplicity
Definition OrthancCPlugin.h:1944
OrthancPluginDictionaryEntry::vr
OrthancPluginValueRepresentation vr
Definition OrthancCPlugin.h:1942
OrthancPluginDictionaryEntry::element
uint16_t element
Definition OrthancCPlugin.h:1941
OrthancPluginDictionaryEntry::group
uint16_t group
Definition OrthancCPlugin.h:1940
OrthancPluginHttpRequest
The parameters of a REST request.
Definition OrthancCPlugin.h:360
OrthancPluginHttpRequest::getValues
const char *const * getValues
For a GET request, the values of the GET parameters.
Definition OrthancCPlugin.h:389
OrthancPluginHttpRequest::groups
const char *const * groups
The matched values for the groups of the regular expression.
Definition OrthancCPlugin.h:374
OrthancPluginHttpRequest::bodySize
uint32_t bodySize
For a PUT or POST request, the number of bytes of the body.
Definition OrthancCPlugin.h:399
OrthancPluginHttpRequest::groupsCount
uint32_t groupsCount
The number of groups of the regular expression.
Definition OrthancCPlugin.h:369
OrthancPluginHttpRequest::headersKeys
const char *const * headersKeys
The keys of the HTTP headers (always converted to low-case).
Definition OrthancCPlugin.h:414
OrthancPluginHttpRequest::body
const void * body
For a PUT or POST request, the content of the body.
Definition OrthancCPlugin.h:394
OrthancPluginHttpRequest::getKeys
const char *const * getKeys
For a GET request, the keys of the GET parameters.
Definition OrthancCPlugin.h:384
OrthancPluginHttpRequest::headersCount
uint32_t headersCount
The number of HTTP headers.
Definition OrthancCPlugin.h:409
OrthancPluginHttpRequest::method
OrthancPluginHttpMethod method
The HTTP method.
Definition OrthancCPlugin.h:364
OrthancPluginHttpRequest::getCount
uint32_t getCount
For a GET request, the number of GET parameters.
Definition OrthancCPlugin.h:379
OrthancPluginHttpRequest::headersValues
const char *const * headersValues
The values of the HTTP headers.
Definition OrthancCPlugin.h:419
OrthancPluginMemoryBuffer64
A 64-bit memory buffer allocated by the core system of Orthanc.
Definition OrthancCPlugin.h:1162
OrthancPluginMemoryBuffer64::size
uint64_t size
The number of bytes in the buffer.
Definition OrthancCPlugin.h:1171
OrthancPluginMemoryBuffer64::data
void * data
The content of the buffer.
Definition OrthancCPlugin.h:1166
OrthancPluginMemoryBuffer
A 32-bit memory buffer allocated by the core system of Orthanc.
Definition OrthancCPlugin.h:1140
OrthancPluginMemoryBuffer::size
uint32_t size
The number of bytes in the buffer.
Definition OrthancCPlugin.h:1149
OrthancPluginMemoryBuffer::data
void * data
The content of the buffer.
Definition OrthancCPlugin.h:1144