OrthancCPlugin.h
#pragma once
#include <stdio.h>
#include <string.h>
#ifdef WIN32
#define ORTHANC_PLUGINS_API __declspec(dllexport)
#else
#define ORTHANC_PLUGINS_API
#endif
#define ORTHANC_PLUGINS_MINIMAL_MAJOR_NUMBER 1
#define ORTHANC_PLUGINS_MINIMAL_MINOR_NUMBER 3
#define ORTHANC_PLUGINS_MINIMAL_REVISION_NUMBER 0
/********************************************************************
** Check that function inlining is properly supported. The use of
** inlining is required, to avoid the duplication of object code
** between two compilation modules that would use the Orthanc Plugin
** API.
********************************************************************/
/* If the auto-detection of the "inline" keyword below does not work
automatically and that your compiler is known to properly support
inlining, uncomment the following #define and adapt the definition
of "static inline". */
/* #define ORTHANC_PLUGIN_INLINE static inline */
#ifndef ORTHANC_PLUGIN_INLINE
# if __STDC_VERSION__ >= 199901L
/* This is C99 or above: http://predef.sourceforge.net/prestd.html */
# define ORTHANC_PLUGIN_INLINE static inline
# elif defined(__cplusplus)
/* This is C++ */
# define ORTHANC_PLUGIN_INLINE static inline
# elif defined(__GNUC__)
/* This is GCC running in C89 mode */
# define ORTHANC_PLUGIN_INLINE static __inline
# elif defined(_MSC_VER)
/* This is Visual Studio running in C89 mode */
# define ORTHANC_PLUGIN_INLINE static __inline
# else
# error Your compiler is not known to support the "inline" keyword
# endif
#endif
/********************************************************************
** Inclusion of standard libraries.
********************************************************************/
#include <stdint.h>
#include <stdlib.h>
/********************************************************************
** Definition of the Orthanc Plugin API.
********************************************************************/
#ifdef __cplusplus
extern "C"
{
#endif
typedef enum
{
OrthancPluginErrorCode_InternalError = -1 ,
OrthancPluginErrorCode_Success = 0 ,
OrthancPluginErrorCode_Plugin = 1 ,
OrthancPluginErrorCode_NotImplemented = 2 ,
OrthancPluginErrorCode_ParameterOutOfRange = 3 ,
OrthancPluginErrorCode_NotEnoughMemory = 4 ,
OrthancPluginErrorCode_BadParameterType = 5 ,
OrthancPluginErrorCode_BadSequenceOfCalls = 6 ,
OrthancPluginErrorCode_InexistentItem = 7 ,
OrthancPluginErrorCode_BadRequest = 8 ,
OrthancPluginErrorCode_NetworkProtocol = 9 ,
OrthancPluginErrorCode_SystemCommand = 10 ,
OrthancPluginErrorCode_Database = 11 ,
OrthancPluginErrorCode_UriSyntax = 12 ,
OrthancPluginErrorCode_InexistentFile = 13 ,
OrthancPluginErrorCode_CannotWriteFile = 14 ,
OrthancPluginErrorCode_BadFileFormat = 15 ,
OrthancPluginErrorCode_Timeout = 16 ,
OrthancPluginErrorCode_UnknownResource = 17 ,
OrthancPluginErrorCode_IncompatibleDatabaseVersion = 18 ,
OrthancPluginErrorCode_FullStorage = 19 ,
OrthancPluginErrorCode_CorruptedFile = 20 ,
OrthancPluginErrorCode_InexistentTag = 21 ,
OrthancPluginErrorCode_ReadOnly = 22 ,
OrthancPluginErrorCode_IncompatibleImageFormat = 23 ,
OrthancPluginErrorCode_IncompatibleImageSize = 24 ,
OrthancPluginErrorCode_SharedLibrary = 25 ,
OrthancPluginErrorCode_UnknownPluginService = 26 ,
OrthancPluginErrorCode_UnknownDicomTag = 27 ,
OrthancPluginErrorCode_BadJson = 28 ,
OrthancPluginErrorCode_Unauthorized = 29 ,
OrthancPluginErrorCode_BadFont = 30 ,
OrthancPluginErrorCode_DatabasePlugin = 31 ,
OrthancPluginErrorCode_StorageAreaPlugin = 32 ,
OrthancPluginErrorCode_EmptyRequest = 33 ,
OrthancPluginErrorCode_NotAcceptable = 34 ,
OrthancPluginErrorCode_NullPointer = 35 ,
OrthancPluginErrorCode_SQLiteNotOpened = 1000 ,
OrthancPluginErrorCode_SQLiteAlreadyOpened = 1001 ,
OrthancPluginErrorCode_SQLiteCannotOpen = 1002 ,
OrthancPluginErrorCode_SQLiteStatementAlreadyUsed = 1003 ,
OrthancPluginErrorCode_SQLiteExecute = 1004 ,
OrthancPluginErrorCode_SQLiteRollbackWithoutTransaction = 1005 ,
OrthancPluginErrorCode_SQLiteCommitWithoutTransaction = 1006 ,
OrthancPluginErrorCode_SQLiteRegisterFunction = 1007 ,
OrthancPluginErrorCode_SQLiteFlush = 1008 ,
OrthancPluginErrorCode_SQLiteCannotRun = 1009 ,
OrthancPluginErrorCode_SQLiteCannotStep = 1010 ,
OrthancPluginErrorCode_SQLiteBindOutOfRange = 1011 ,
OrthancPluginErrorCode_SQLitePrepareStatement = 1012 ,
OrthancPluginErrorCode_SQLiteTransactionAlreadyStarted = 1013 ,
OrthancPluginErrorCode_SQLiteTransactionCommit = 1014 ,
OrthancPluginErrorCode_SQLiteTransactionBegin = 1015 ,
OrthancPluginErrorCode_DirectoryOverFile = 2000 ,
OrthancPluginErrorCode_FileStorageCannotWrite = 2001 ,
OrthancPluginErrorCode_DirectoryExpected = 2002 ,
OrthancPluginErrorCode_HttpPortInUse = 2003 ,
OrthancPluginErrorCode_DicomPortInUse = 2004 ,
OrthancPluginErrorCode_BadHttpStatusInRest = 2005 ,
OrthancPluginErrorCode_RegularFileExpected = 2006 ,
OrthancPluginErrorCode_PathToExecutable = 2007 ,
OrthancPluginErrorCode_MakeDirectory = 2008 ,
OrthancPluginErrorCode_BadApplicationEntityTitle = 2009 ,
OrthancPluginErrorCode_NoCFindHandler = 2010 ,
OrthancPluginErrorCode_NoCMoveHandler = 2011 ,
OrthancPluginErrorCode_NoCStoreHandler = 2012 ,
OrthancPluginErrorCode_NoApplicationEntityFilter = 2013 ,
OrthancPluginErrorCode_NoSopClassOrInstance = 2014 ,
OrthancPluginErrorCode_NoPresentationContext = 2015 ,
OrthancPluginErrorCode_DicomFindUnavailable = 2016 ,
OrthancPluginErrorCode_DicomMoveUnavailable = 2017 ,
OrthancPluginErrorCode_CannotStoreInstance = 2018 ,
OrthancPluginErrorCode_CreateDicomNotString = 2019 ,
OrthancPluginErrorCode_CreateDicomOverrideTag = 2020 ,
OrthancPluginErrorCode_CreateDicomUseContent = 2021 ,
OrthancPluginErrorCode_CreateDicomNoPayload = 2022 ,
OrthancPluginErrorCode_CreateDicomUseDataUriScheme = 2023 ,
OrthancPluginErrorCode_CreateDicomBadParent = 2024 ,
OrthancPluginErrorCode_CreateDicomParentIsInstance = 2025 ,
OrthancPluginErrorCode_CreateDicomParentEncoding = 2026 ,
OrthancPluginErrorCode_UnknownModality = 2027 ,
OrthancPluginErrorCode_BadJobOrdering = 2028 ,
OrthancPluginErrorCode_JsonToLuaTable = 2029 ,
OrthancPluginErrorCode_CannotCreateLua = 2030 ,
OrthancPluginErrorCode_CannotExecuteLua = 2031 ,
OrthancPluginErrorCode_LuaAlreadyExecuted = 2032 ,
OrthancPluginErrorCode_LuaBadOutput = 2033 ,
OrthancPluginErrorCode_NotLuaPredicate = 2034 ,
OrthancPluginErrorCode_LuaReturnsNoString = 2035 ,
OrthancPluginErrorCode_StorageAreaAlreadyRegistered = 2036 ,
OrthancPluginErrorCode_DatabaseBackendAlreadyRegistered = 2037 ,
OrthancPluginErrorCode_DatabaseNotInitialized = 2038 ,
OrthancPluginErrorCode_SslDisabled = 2039 ,
OrthancPluginErrorCode_CannotOrderSlices = 2040 ,
OrthancPluginErrorCode_NoWorklistHandler = 2041 ,
OrthancPluginErrorCode_AlreadyExistingTag = 2042 ,
_OrthancPluginErrorCode_INTERNAL = 0x7fffffff
} OrthancPluginErrorCode;
ORTHANC_PLUGINS_API const char* OrthancPluginGetName();
typedef enum
{
OrthancPluginHttpMethod_Get = 1,
OrthancPluginHttpMethod_Post = 2,
OrthancPluginHttpMethod_Put = 3,
OrthancPluginHttpMethod_Delete = 4,
_OrthancPluginHttpMethod_INTERNAL = 0x7fffffff
} OrthancPluginHttpMethod;
typedef struct
{
OrthancPluginHttpMethod method;
uint32_t groupsCount;
const char* const* groups;
uint32_t getCount;
const char* const* getKeys;
const char* const* getValues;
const char* body;
uint32_t bodySize;
/* --------------------------------------------------
New in version 0.8.1
-------------------------------------------------- */
uint32_t headersCount;
const char* const* headersKeys;
const char* const* headersValues;
} OrthancPluginHttpRequest;
typedef enum
{
/* Generic services */
_OrthancPluginService_LogInfo = 1,
_OrthancPluginService_LogWarning = 2,
_OrthancPluginService_LogError = 3,
_OrthancPluginService_GetOrthancPath = 4,
_OrthancPluginService_GetOrthancDirectory = 5,
_OrthancPluginService_GetConfigurationPath = 6,
_OrthancPluginService_SetPluginProperty = 7,
_OrthancPluginService_GetGlobalProperty = 8,
_OrthancPluginService_SetGlobalProperty = 9,
_OrthancPluginService_GetCommandLineArgumentsCount = 10,
_OrthancPluginService_GetCommandLineArgument = 11,
_OrthancPluginService_GetExpectedDatabaseVersion = 12,
_OrthancPluginService_GetConfiguration = 13,
_OrthancPluginService_BufferCompression = 14,
_OrthancPluginService_ReadFile = 15,
_OrthancPluginService_WriteFile = 16,
_OrthancPluginService_GetErrorDescription = 17,
_OrthancPluginService_CallHttpClient = 18,
_OrthancPluginService_RegisterErrorCode = 19,
_OrthancPluginService_RegisterDictionaryTag = 20,
_OrthancPluginService_DicomBufferToJson = 21,
_OrthancPluginService_DicomInstanceToJson = 22,
_OrthancPluginService_CreateDicom = 23,
_OrthancPluginService_ComputeMd5 = 24,
_OrthancPluginService_ComputeSha1 = 25,
_OrthancPluginService_LookupDictionary = 26,
_OrthancPluginService_CallHttpClient2 = 27,
_OrthancPluginService_GenerateUuid = 28,
_OrthancPluginService_RegisterPrivateDictionaryTag = 29,
/* Registration of callbacks */
_OrthancPluginService_RegisterRestCallback = 1000,
_OrthancPluginService_RegisterOnStoredInstanceCallback = 1001,
_OrthancPluginService_RegisterStorageArea = 1002,
_OrthancPluginService_RegisterOnChangeCallback = 1003,
_OrthancPluginService_RegisterRestCallbackNoLock = 1004,
_OrthancPluginService_RegisterWorklistCallback = 1005,
_OrthancPluginService_RegisterDecodeImageCallback = 1006,
_OrthancPluginService_RegisterIncomingHttpRequestFilter = 1007,
_OrthancPluginService_RegisterFindCallback = 1008,
_OrthancPluginService_RegisterMoveCallback = 1009,
_OrthancPluginService_RegisterIncomingHttpRequestFilter2 = 1010,
/* Sending answers to REST calls */
_OrthancPluginService_AnswerBuffer = 2000,
_OrthancPluginService_CompressAndAnswerPngImage = 2001, /* Unused as of Orthanc 0.9.4 */
_OrthancPluginService_Redirect = 2002,
_OrthancPluginService_SendHttpStatusCode = 2003,
_OrthancPluginService_SendUnauthorized = 2004,
_OrthancPluginService_SendMethodNotAllowed = 2005,
_OrthancPluginService_SetCookie = 2006,
_OrthancPluginService_SetHttpHeader = 2007,
_OrthancPluginService_StartMultipartAnswer = 2008,
_OrthancPluginService_SendMultipartItem = 2009,
_OrthancPluginService_SendHttpStatus = 2010,
_OrthancPluginService_CompressAndAnswerImage = 2011,
_OrthancPluginService_SendMultipartItem2 = 2012,
/* Access to the Orthanc database and API */
_OrthancPluginService_GetDicomForInstance = 3000,
_OrthancPluginService_RestApiGet = 3001,
_OrthancPluginService_RestApiPost = 3002,
_OrthancPluginService_RestApiDelete = 3003,
_OrthancPluginService_RestApiPut = 3004,
_OrthancPluginService_LookupPatient = 3005,
_OrthancPluginService_LookupStudy = 3006,
_OrthancPluginService_LookupSeries = 3007,
_OrthancPluginService_LookupInstance = 3008,
_OrthancPluginService_LookupStudyWithAccessionNumber = 3009,
_OrthancPluginService_RestApiGetAfterPlugins = 3010,
_OrthancPluginService_RestApiPostAfterPlugins = 3011,
_OrthancPluginService_RestApiDeleteAfterPlugins = 3012,
_OrthancPluginService_RestApiPutAfterPlugins = 3013,
_OrthancPluginService_ReconstructMainDicomTags = 3014,
_OrthancPluginService_RestApiGet2 = 3015,
/* Access to DICOM instances */
_OrthancPluginService_GetInstanceRemoteAet = 4000,
_OrthancPluginService_GetInstanceSize = 4001,
_OrthancPluginService_GetInstanceData = 4002,
_OrthancPluginService_GetInstanceJson = 4003,
_OrthancPluginService_GetInstanceSimplifiedJson = 4004,
_OrthancPluginService_HasInstanceMetadata = 4005,
_OrthancPluginService_GetInstanceMetadata = 4006,
_OrthancPluginService_GetInstanceOrigin = 4007,
/* Services for plugins implementing a database back-end */
_OrthancPluginService_RegisterDatabaseBackend = 5000,
_OrthancPluginService_DatabaseAnswer = 5001,
_OrthancPluginService_RegisterDatabaseBackendV2 = 5002,
_OrthancPluginService_StorageAreaCreate = 5003,
_OrthancPluginService_StorageAreaRead = 5004,
_OrthancPluginService_StorageAreaRemove = 5005,
/* Primitives for handling images */
_OrthancPluginService_GetImagePixelFormat = 6000,
_OrthancPluginService_GetImageWidth = 6001,
_OrthancPluginService_GetImageHeight = 6002,
_OrthancPluginService_GetImagePitch = 6003,
_OrthancPluginService_GetImageBuffer = 6004,
_OrthancPluginService_UncompressImage = 6005,
_OrthancPluginService_FreeImage = 6006,
_OrthancPluginService_CompressImage = 6007,
_OrthancPluginService_ConvertPixelFormat = 6008,
_OrthancPluginService_GetFontsCount = 6009,
_OrthancPluginService_GetFontInfo = 6010,
_OrthancPluginService_DrawText = 6011,
_OrthancPluginService_CreateImage = 6012,
_OrthancPluginService_CreateImageAccessor = 6013,
_OrthancPluginService_DecodeDicomImage = 6014,
/* Primitives for handling C-Find, C-Move and worklists */
_OrthancPluginService_WorklistAddAnswer = 7000,
_OrthancPluginService_WorklistMarkIncomplete = 7001,
_OrthancPluginService_WorklistIsMatch = 7002,
_OrthancPluginService_WorklistGetDicomQuery = 7003,
_OrthancPluginService_FindAddAnswer = 7004,
_OrthancPluginService_FindMarkIncomplete = 7005,
_OrthancPluginService_GetFindQuerySize = 7006,
_OrthancPluginService_GetFindQueryTag = 7007,
_OrthancPluginService_GetFindQueryTagName = 7008,
_OrthancPluginService_GetFindQueryValue = 7009,
_OrthancPluginService_CreateFindMatcher = 7010,
_OrthancPluginService_FreeFindMatcher = 7011,
_OrthancPluginService_FindMatcherIsMatch = 7012,
_OrthancPluginService_INTERNAL = 0x7fffffff
} _OrthancPluginService;
typedef enum
{
_OrthancPluginProperty_Description = 1,
_OrthancPluginProperty_RootUri = 2,
_OrthancPluginProperty_OrthancExplorer = 3,
_OrthancPluginProperty_INTERNAL = 0x7fffffff
} _OrthancPluginProperty;
typedef enum
{
OrthancPluginPixelFormat_Grayscale8 = 1,
OrthancPluginPixelFormat_Grayscale16 = 2,
OrthancPluginPixelFormat_SignedGrayscale16 = 3,
OrthancPluginPixelFormat_RGB24 = 4,
OrthancPluginPixelFormat_RGBA32 = 5,
OrthancPluginPixelFormat_Unknown = 6,
_OrthancPluginPixelFormat_INTERNAL = 0x7fffffff
} OrthancPluginPixelFormat;
typedef enum
{
OrthancPluginContentType_Unknown = 0,
OrthancPluginContentType_Dicom = 1,
OrthancPluginContentType_DicomAsJson = 2,
_OrthancPluginContentType_INTERNAL = 0x7fffffff
} OrthancPluginContentType;
typedef enum
{
OrthancPluginResourceType_Patient = 0,
OrthancPluginResourceType_Study = 1,
OrthancPluginResourceType_Series = 2,
OrthancPluginResourceType_Instance = 3,
OrthancPluginResourceType_None = 4,
_OrthancPluginResourceType_INTERNAL = 0x7fffffff
} OrthancPluginResourceType;
typedef enum
{
OrthancPluginChangeType_CompletedSeries = 0,
OrthancPluginChangeType_Deleted = 1,
OrthancPluginChangeType_NewChildInstance = 2,
OrthancPluginChangeType_NewInstance = 3,
OrthancPluginChangeType_NewPatient = 4,
OrthancPluginChangeType_NewSeries = 5,
OrthancPluginChangeType_NewStudy = 6,
OrthancPluginChangeType_StablePatient = 7,
OrthancPluginChangeType_StableSeries = 8,
OrthancPluginChangeType_StableStudy = 9,
OrthancPluginChangeType_OrthancStarted = 10,
OrthancPluginChangeType_OrthancStopped = 11,
OrthancPluginChangeType_UpdatedAttachment = 12,
OrthancPluginChangeType_UpdatedMetadata = 13,
_OrthancPluginChangeType_INTERNAL = 0x7fffffff
} OrthancPluginChangeType;
typedef enum
{
OrthancPluginCompressionType_Zlib = 0,
OrthancPluginCompressionType_ZlibWithSize = 1,
OrthancPluginCompressionType_Gzip = 2,
OrthancPluginCompressionType_GzipWithSize = 3,
_OrthancPluginCompressionType_INTERNAL = 0x7fffffff
} OrthancPluginCompressionType;
typedef enum
{
OrthancPluginImageFormat_Png = 0,
OrthancPluginImageFormat_Jpeg = 1,
OrthancPluginImageFormat_Dicom = 2,
_OrthancPluginImageFormat_INTERNAL = 0x7fffffff
} OrthancPluginImageFormat;
typedef enum
{
OrthancPluginValueRepresentation_AE = 1,
OrthancPluginValueRepresentation_AS = 2,
OrthancPluginValueRepresentation_AT = 3,
OrthancPluginValueRepresentation_CS = 4,
OrthancPluginValueRepresentation_DA = 5,
OrthancPluginValueRepresentation_DS = 6,
OrthancPluginValueRepresentation_DT = 7,
OrthancPluginValueRepresentation_FD = 8,
OrthancPluginValueRepresentation_FL = 9,
OrthancPluginValueRepresentation_IS = 10,
OrthancPluginValueRepresentation_LO = 11,
OrthancPluginValueRepresentation_LT = 12,
OrthancPluginValueRepresentation_OB = 13,
OrthancPluginValueRepresentation_OF = 14,
OrthancPluginValueRepresentation_OW = 15,
OrthancPluginValueRepresentation_PN = 16,
OrthancPluginValueRepresentation_SH = 17,
OrthancPluginValueRepresentation_SL = 18,
OrthancPluginValueRepresentation_SQ = 19,
OrthancPluginValueRepresentation_SS = 20,
OrthancPluginValueRepresentation_ST = 21,
OrthancPluginValueRepresentation_TM = 22,
OrthancPluginValueRepresentation_UI = 23,
OrthancPluginValueRepresentation_UL = 24,
OrthancPluginValueRepresentation_UN = 25,
OrthancPluginValueRepresentation_US = 26,
OrthancPluginValueRepresentation_UT = 27,
_OrthancPluginValueRepresentation_INTERNAL = 0x7fffffff
} OrthancPluginValueRepresentation;
typedef enum
{
OrthancPluginDicomToJsonFormat_Full = 1,
OrthancPluginDicomToJsonFormat_Short = 2,
OrthancPluginDicomToJsonFormat_Human = 3,
_OrthancPluginDicomToJsonFormat_INTERNAL = 0x7fffffff
} OrthancPluginDicomToJsonFormat;
typedef enum
{
OrthancPluginDicomToJsonFlags_None = 0,
OrthancPluginDicomToJsonFlags_IncludeBinary = (1 << 0),
OrthancPluginDicomToJsonFlags_IncludePrivateTags = (1 << 1),
OrthancPluginDicomToJsonFlags_IncludeUnknownTags = (1 << 2),
OrthancPluginDicomToJsonFlags_IncludePixelData = (1 << 3),
OrthancPluginDicomToJsonFlags_ConvertBinaryToAscii = (1 << 4),
OrthancPluginDicomToJsonFlags_ConvertBinaryToNull = (1 << 5),
_OrthancPluginDicomToJsonFlags_INTERNAL = 0x7fffffff
} OrthancPluginDicomToJsonFlags;
typedef enum
{
OrthancPluginCreateDicomFlags_None = 0,
OrthancPluginCreateDicomFlags_DecodeDataUriScheme = (1 << 0),
OrthancPluginCreateDicomFlags_GenerateIdentifiers = (1 << 1),
_OrthancPluginCreateDicomFlags_INTERNAL = 0x7fffffff
} OrthancPluginCreateDicomFlags;
typedef enum
{
OrthancPluginIdentifierConstraint_Equal = 1,
OrthancPluginIdentifierConstraint_SmallerOrEqual = 2,
OrthancPluginIdentifierConstraint_GreaterOrEqual = 3,
OrthancPluginIdentifierConstraint_Wildcard = 4,
_OrthancPluginIdentifierConstraint_INTERNAL = 0x7fffffff
} OrthancPluginIdentifierConstraint;
typedef enum
{
OrthancPluginInstanceOrigin_Unknown = 1,
OrthancPluginInstanceOrigin_DicomProtocol = 2,
OrthancPluginInstanceOrigin_RestApi = 3,
OrthancPluginInstanceOrigin_Plugin = 4,
OrthancPluginInstanceOrigin_Lua = 5,
_OrthancPluginInstanceOrigin_INTERNAL = 0x7fffffff
} OrthancPluginInstanceOrigin;
typedef struct
{
void* data;
uint32_t size;
} OrthancPluginMemoryBuffer;
typedef struct _OrthancPluginRestOutput_t OrthancPluginRestOutput;
typedef struct _OrthancPluginDicomInstance_t OrthancPluginDicomInstance;
typedef struct _OrthancPluginImage_t OrthancPluginImage;
typedef struct _OrthancPluginStorageArea_t OrthancPluginStorageArea;
typedef struct _OrthancPluginWorklistQuery_t OrthancPluginWorklistQuery;
typedef struct _OrthancPluginWorklistAnswers_t OrthancPluginWorklistAnswers;
typedef struct _OrthancPluginFindQuery_t OrthancPluginFindQuery;
typedef struct _OrthancPluginFindAnswers_t OrthancPluginFindAnswers;
typedef struct _OrthancPluginFindAnswers_t OrthancPluginFindMatcher;
typedef OrthancPluginErrorCode (*OrthancPluginRestCallback) (
OrthancPluginRestOutput* output,
const char* url,
const OrthancPluginHttpRequest* request);
typedef OrthancPluginErrorCode (*OrthancPluginOnStoredInstanceCallback) (
OrthancPluginDicomInstance* instance,
const char* instanceId);
typedef OrthancPluginErrorCode (*OrthancPluginOnChangeCallback) (
OrthancPluginChangeType changeType,
OrthancPluginResourceType resourceType,
const char* resourceId);
typedef OrthancPluginErrorCode (*OrthancPluginDecodeImageCallback) (
OrthancPluginImage** target,
const void* dicom,
const uint32_t size,
uint32_t frameIndex);
typedef void (*OrthancPluginFree) (void* buffer);
typedef OrthancPluginErrorCode (*OrthancPluginStorageCreate) (
const char* uuid,
const void* content,
int64_t size,
OrthancPluginContentType type);
typedef OrthancPluginErrorCode (*OrthancPluginStorageRead) (
void** content,
int64_t* size,
const char* uuid,
OrthancPluginContentType type);
typedef OrthancPluginErrorCode (*OrthancPluginStorageRemove) (
const char* uuid,
OrthancPluginContentType type);
typedef OrthancPluginErrorCode (*OrthancPluginWorklistCallback) (
OrthancPluginWorklistAnswers* answers,
const OrthancPluginWorklistQuery* query,
const char* issuerAet,
const char* calledAet);
typedef int32_t (*OrthancPluginIncomingHttpRequestFilter) (
OrthancPluginHttpMethod method,
const char* uri,
const char* ip,
uint32_t headersCount,
const char* const* headersKeys,
const char* const* headersValues);
typedef 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);
typedef OrthancPluginErrorCode (*OrthancPluginFindCallback) (
OrthancPluginFindAnswers* answers,
const OrthancPluginFindQuery* query,
const char* issuerAet,
const char* calledAet);
typedef 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);
typedef uint32_t (*OrthancPluginGetMoveSize) (void* moveDriver);
typedef OrthancPluginErrorCode (*OrthancPluginApplyMove) (void* moveDriver);
typedef void (*OrthancPluginFreeMove) (void* moveDriver);
typedef struct _OrthancPluginContext_t
{
void* pluginsManager;
const char* orthancVersion;
OrthancPluginFree Free;
OrthancPluginErrorCode (*InvokeService) (struct _OrthancPluginContext_t* context,
_OrthancPluginService service,
const void* params);
} OrthancPluginContext;
typedef struct
{
uint16_t group;
uint16_t element;
OrthancPluginValueRepresentation vr;
uint32_t minMultiplicity;
uint32_t maxMultiplicity;
} OrthancPluginDictionaryEntry;
ORTHANC_PLUGIN_INLINE void OrthancPluginFreeString(
OrthancPluginContext* context,
char* str)
{
if (str != NULL)
{
context->Free(str);
}
}
ORTHANC_PLUGIN_INLINE int OrthancPluginCheckVersion(
OrthancPluginContext* context)
{
int major, minor, revision;
if (sizeof(int32_t) != sizeof(OrthancPluginErrorCode) ||
sizeof(int32_t) != sizeof(OrthancPluginHttpMethod) ||
sizeof(int32_t) != sizeof(_OrthancPluginService) ||
sizeof(int32_t) != sizeof(_OrthancPluginProperty) ||
sizeof(int32_t) != sizeof(OrthancPluginPixelFormat) ||
sizeof(int32_t) != sizeof(OrthancPluginContentType) ||
sizeof(int32_t) != sizeof(OrthancPluginResourceType) ||
sizeof(int32_t) != sizeof(OrthancPluginChangeType) ||
sizeof(int32_t) != sizeof(OrthancPluginCompressionType) ||
sizeof(int32_t) != sizeof(OrthancPluginImageFormat) ||
sizeof(int32_t) != sizeof(OrthancPluginValueRepresentation) ||
sizeof(int32_t) != sizeof(OrthancPluginDicomToJsonFormat) ||
sizeof(int32_t) != sizeof(OrthancPluginDicomToJsonFlags) ||
sizeof(int32_t) != sizeof(OrthancPluginCreateDicomFlags) ||
sizeof(int32_t) != sizeof(OrthancPluginIdentifierConstraint) ||
sizeof(int32_t) != sizeof(OrthancPluginInstanceOrigin))
{
/* Mismatch in the size of the enumerations */
return 0;
}
/* Assume compatibility with the mainline */
if (!strcmp(context->orthancVersion, "mainline"))
{
return 1;
}
/* Parse the version of the Orthanc core */
if (
#ifdef _MSC_VER
sscanf_s
#else
sscanf
#endif
(context->orthancVersion, "%4d.%4d.%4d", &major, &minor, &revision) != 3)
{
return 0;
}
/* Check the major number of the version */
if (major > ORTHANC_PLUGINS_MINIMAL_MAJOR_NUMBER)
{
return 1;
}
if (major < ORTHANC_PLUGINS_MINIMAL_MAJOR_NUMBER)
{
return 0;
}
/* Check the minor number of the version */
if (minor > ORTHANC_PLUGINS_MINIMAL_MINOR_NUMBER)
{
return 1;
}
if (minor < ORTHANC_PLUGINS_MINIMAL_MINOR_NUMBER)
{
return 0;
}
/* Check the revision number of the version */
if (revision >= ORTHANC_PLUGINS_MINIMAL_REVISION_NUMBER)
{
return 1;
}
else
{
return 0;
}
}
ORTHANC_PLUGIN_INLINE void OrthancPluginFreeMemoryBuffer(
OrthancPluginContext* context,
OrthancPluginMemoryBuffer* buffer)
{
context->Free(buffer->data);
}
ORTHANC_PLUGIN_INLINE void OrthancPluginLogError(
OrthancPluginContext* context,
const char* message)
{
context->InvokeService(context, _OrthancPluginService_LogError, message);
}
ORTHANC_PLUGIN_INLINE void OrthancPluginLogWarning(
OrthancPluginContext* context,
const char* message)
{
context->InvokeService(context, _OrthancPluginService_LogWarning, message);
}
ORTHANC_PLUGIN_INLINE void OrthancPluginLogInfo(
OrthancPluginContext* context,
const char* message)
{
context->InvokeService(context, _OrthancPluginService_LogInfo, message);
}
typedef struct
{
const char* pathRegularExpression;
OrthancPluginRestCallback callback;
} _OrthancPluginRestCallback;
ORTHANC_PLUGIN_INLINE void OrthancPluginRegisterRestCallback(
OrthancPluginContext* context,
const char* pathRegularExpression,
OrthancPluginRestCallback callback)
{
_OrthancPluginRestCallback params;
params.pathRegularExpression = pathRegularExpression;
params.callback = callback;
context->InvokeService(context, _OrthancPluginService_RegisterRestCallback, &params);
}
ORTHANC_PLUGIN_INLINE void OrthancPluginRegisterRestCallbackNoLock(
OrthancPluginContext* context,
const char* pathRegularExpression,
OrthancPluginRestCallback callback)
{
_OrthancPluginRestCallback params;
params.pathRegularExpression = pathRegularExpression;
params.callback = callback;
context->InvokeService(context, _OrthancPluginService_RegisterRestCallbackNoLock, &params);
}
typedef struct
{
OrthancPluginOnStoredInstanceCallback callback;
} _OrthancPluginOnStoredInstanceCallback;
ORTHANC_PLUGIN_INLINE void OrthancPluginRegisterOnStoredInstanceCallback(
OrthancPluginContext* context,
OrthancPluginOnStoredInstanceCallback callback)
{
_OrthancPluginOnStoredInstanceCallback params;
params.callback = callback;
context->InvokeService(context, _OrthancPluginService_RegisterOnStoredInstanceCallback, &params);
}
typedef struct
{
OrthancPluginRestOutput* output;
const char* answer;
uint32_t answerSize;
const char* mimeType;
} _OrthancPluginAnswerBuffer;
ORTHANC_PLUGIN_INLINE void OrthancPluginAnswerBuffer(
OrthancPluginContext* context,
OrthancPluginRestOutput* output,
const char* answer,
uint32_t answerSize,
const char* mimeType)
{
_OrthancPluginAnswerBuffer params;
params.output = output;
params.answer = answer;
params.answerSize = answerSize;
params.mimeType = mimeType;
context->InvokeService(context, _OrthancPluginService_AnswerBuffer, &params);
}
typedef struct
{
OrthancPluginRestOutput* output;
OrthancPluginPixelFormat format;
uint32_t width;
uint32_t height;
uint32_t pitch;
const void* buffer;
} _OrthancPluginCompressAndAnswerPngImage;
typedef struct
{
OrthancPluginRestOutput* output;
OrthancPluginImageFormat imageFormat;
OrthancPluginPixelFormat pixelFormat;
uint32_t width;
uint32_t height;
uint32_t pitch;
const void* buffer;
uint8_t quality;
} _OrthancPluginCompressAndAnswerImage;
ORTHANC_PLUGIN_INLINE void OrthancPluginCompressAndAnswerPngImage(
OrthancPluginContext* context,
OrthancPluginRestOutput* output,
OrthancPluginPixelFormat format,
uint32_t width,
uint32_t height,
uint32_t pitch,
const void* buffer)
{
_OrthancPluginCompressAndAnswerImage params;
params.output = output;
params.imageFormat = OrthancPluginImageFormat_Png;
params.pixelFormat = format;
params.width = width;
params.height = height;
params.pitch = pitch;
params.buffer = buffer;
params.quality = 0; /* No quality for PNG */
context->InvokeService(context, _OrthancPluginService_CompressAndAnswerImage, &params);
}
typedef struct
{
OrthancPluginMemoryBuffer* target;
const char* instanceId;
} _OrthancPluginGetDicomForInstance;
ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginGetDicomForInstance(
OrthancPluginContext* context,
OrthancPluginMemoryBuffer* target,
const char* instanceId)
{
_OrthancPluginGetDicomForInstance params;
params.target = target;
params.instanceId = instanceId;
return context->InvokeService(context, _OrthancPluginService_GetDicomForInstance, &params);
}
typedef struct
{
OrthancPluginMemoryBuffer* target;
const char* uri;
} _OrthancPluginRestApiGet;
ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRestApiGet(
OrthancPluginContext* context,
OrthancPluginMemoryBuffer* target,
const char* uri)
{
_OrthancPluginRestApiGet params;
params.target = target;
params.uri = uri;
return context->InvokeService(context, _OrthancPluginService_RestApiGet, &params);
}
ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRestApiGetAfterPlugins(
OrthancPluginContext* context,
OrthancPluginMemoryBuffer* target,
const char* uri)
{
_OrthancPluginRestApiGet params;
params.target = target;
params.uri = uri;
return context->InvokeService(context, _OrthancPluginService_RestApiGetAfterPlugins, &params);
}
typedef struct
{
OrthancPluginMemoryBuffer* target;
const char* uri;
const char* body;
uint32_t bodySize;
} _OrthancPluginRestApiPostPut;
ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRestApiPost(
OrthancPluginContext* context,
OrthancPluginMemoryBuffer* target,
const char* uri,
const char* body,
uint32_t bodySize)
{
_OrthancPluginRestApiPostPut params;
params.target = target;
params.uri = uri;
params.body = body;
params.bodySize = bodySize;
return context->InvokeService(context, _OrthancPluginService_RestApiPost, &params);
}
ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRestApiPostAfterPlugins(
OrthancPluginContext* context,
OrthancPluginMemoryBuffer* target,
const char* uri,
const char* body,
uint32_t bodySize)
{
_OrthancPluginRestApiPostPut params;
params.target = target;
params.uri = uri;
params.body = body;
params.bodySize = bodySize;
return context->InvokeService(context, _OrthancPluginService_RestApiPostAfterPlugins, &params);
}
ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRestApiDelete(
OrthancPluginContext* context,
const char* uri)
{
return context->InvokeService(context, _OrthancPluginService_RestApiDelete, uri);
}
ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRestApiDeleteAfterPlugins(
OrthancPluginContext* context,
const char* uri)
{
return context->InvokeService(context, _OrthancPluginService_RestApiDeleteAfterPlugins, uri);
}
ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRestApiPut(
OrthancPluginContext* context,
OrthancPluginMemoryBuffer* target,
const char* uri,
const char* body,
uint32_t bodySize)
{
_OrthancPluginRestApiPostPut params;
params.target = target;
params.uri = uri;
params.body = body;
params.bodySize = bodySize;
return context->InvokeService(context, _OrthancPluginService_RestApiPut, &params);
}
ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRestApiPutAfterPlugins(
OrthancPluginContext* context,
OrthancPluginMemoryBuffer* target,
const char* uri,
const char* body,
uint32_t bodySize)
{
_OrthancPluginRestApiPostPut params;
params.target = target;
params.uri = uri;
params.body = body;
params.bodySize = bodySize;
return context->InvokeService(context, _OrthancPluginService_RestApiPutAfterPlugins, &params);
}
typedef struct
{
OrthancPluginRestOutput* output;
const char* argument;
} _OrthancPluginOutputPlusArgument;
ORTHANC_PLUGIN_INLINE void OrthancPluginRedirect(
OrthancPluginContext* context,
OrthancPluginRestOutput* output,
const char* redirection)
{
_OrthancPluginOutputPlusArgument params;
params.output = output;
params.argument = redirection;
context->InvokeService(context, _OrthancPluginService_Redirect, &params);
}
typedef struct
{
char** result;
const char* argument;
} _OrthancPluginRetrieveDynamicString;
ORTHANC_PLUGIN_INLINE char* OrthancPluginLookupPatient(
OrthancPluginContext* context,
const char* patientID)
{
char* result;
_OrthancPluginRetrieveDynamicString params;
params.result = &result;
params.argument = patientID;
if (context->InvokeService(context, _OrthancPluginService_LookupPatient, &params) != OrthancPluginErrorCode_Success)
{
/* Error */
return NULL;
}
else
{
return result;
}
}
ORTHANC_PLUGIN_INLINE char* OrthancPluginLookupStudy(
OrthancPluginContext* context,
const char* studyUID)
{
char* result;
_OrthancPluginRetrieveDynamicString params;
params.result = &result;
params.argument = studyUID;
if (context->InvokeService(context, _OrthancPluginService_LookupStudy, &params) != OrthancPluginErrorCode_Success)
{
/* Error */
return NULL;
}
else
{
return result;
}
}
ORTHANC_PLUGIN_INLINE char* OrthancPluginLookupStudyWithAccessionNumber(
OrthancPluginContext* context,
const char* accessionNumber)
{
char* result;
_OrthancPluginRetrieveDynamicString params;
params.result = &result;
params.argument = accessionNumber;
if (context->InvokeService(context, _OrthancPluginService_LookupStudyWithAccessionNumber, &params) != OrthancPluginErrorCode_Success)
{
/* Error */
return NULL;
}
else
{
return result;
}
}
ORTHANC_PLUGIN_INLINE char* OrthancPluginLookupSeries(
OrthancPluginContext* context,
const char* seriesUID)
{
char* result;
_OrthancPluginRetrieveDynamicString params;
params.result = &result;
params.argument = seriesUID;
if (context->InvokeService(context, _OrthancPluginService_LookupSeries, &params) != OrthancPluginErrorCode_Success)
{
/* Error */
return NULL;
}
else
{
return result;
}
}
ORTHANC_PLUGIN_INLINE char* OrthancPluginLookupInstance(
OrthancPluginContext* context,
const char* sopInstanceUID)
{
char* result;
_OrthancPluginRetrieveDynamicString params;
params.result = &result;
params.argument = sopInstanceUID;
if (context->InvokeService(context, _OrthancPluginService_LookupInstance, &params) != OrthancPluginErrorCode_Success)
{
/* Error */
return NULL;
}
else
{
return result;
}
}
typedef struct
{
OrthancPluginRestOutput* output;
uint16_t status;
} _OrthancPluginSendHttpStatusCode;
ORTHANC_PLUGIN_INLINE void OrthancPluginSendHttpStatusCode(
OrthancPluginContext* context,
OrthancPluginRestOutput* output,
uint16_t status)
{
_OrthancPluginSendHttpStatusCode params;
params.output = output;
params.status = status;
context->InvokeService(context, _OrthancPluginService_SendHttpStatusCode, &params);
}
ORTHANC_PLUGIN_INLINE void OrthancPluginSendUnauthorized(
OrthancPluginContext* context,
OrthancPluginRestOutput* output,
const char* realm)
{
_OrthancPluginOutputPlusArgument params;
params.output = output;
params.argument = realm;
context->InvokeService(context, _OrthancPluginService_SendUnauthorized, &params);
}
ORTHANC_PLUGIN_INLINE void OrthancPluginSendMethodNotAllowed(
OrthancPluginContext* context,
OrthancPluginRestOutput* output,
const char* allowedMethods)
{
_OrthancPluginOutputPlusArgument params;
params.output = output;
params.argument = allowedMethods;
context->InvokeService(context, _OrthancPluginService_SendMethodNotAllowed, &params);
}
typedef struct
{
OrthancPluginRestOutput* output;
const char* key;
const char* value;
} _OrthancPluginSetHttpHeader;
ORTHANC_PLUGIN_INLINE void OrthancPluginSetCookie(
OrthancPluginContext* context,
OrthancPluginRestOutput* output,
const char* cookie,
const char* value)
{
_OrthancPluginSetHttpHeader params;
params.output = output;
params.key = cookie;
params.value = value;
context->InvokeService(context, _OrthancPluginService_SetCookie, &params);
}
ORTHANC_PLUGIN_INLINE void OrthancPluginSetHttpHeader(
OrthancPluginContext* context,
OrthancPluginRestOutput* output,
const char* key,
const char* value)
{
_OrthancPluginSetHttpHeader params;
params.output = output;
params.key = key;
params.value = value;
context->InvokeService(context, _OrthancPluginService_SetHttpHeader, &params);
}
typedef struct
{
char** resultStringToFree;
const char** resultString;
int64_t* resultInt64;
const char* key;
OrthancPluginDicomInstance* instance;
OrthancPluginInstanceOrigin* resultOrigin; /* New in Orthanc 0.9.5 SDK */
} _OrthancPluginAccessDicomInstance;
ORTHANC_PLUGIN_INLINE const char* OrthancPluginGetInstanceRemoteAet(
OrthancPluginContext* context,
OrthancPluginDicomInstance* instance)
{
const char* result;
_OrthancPluginAccessDicomInstance params;
memset(&params, 0, sizeof(params));
params.resultString = &result;
params.instance = instance;
if (context->InvokeService(context, _OrthancPluginService_GetInstanceRemoteAet, &params) != OrthancPluginErrorCode_Success)
{
/* Error */
return NULL;
}
else
{
return result;
}
}
ORTHANC_PLUGIN_INLINE int64_t OrthancPluginGetInstanceSize(
OrthancPluginContext* context,
OrthancPluginDicomInstance* instance)
{
int64_t size;
_OrthancPluginAccessDicomInstance params;
memset(&params, 0, sizeof(params));
params.resultInt64 = &size;
params.instance = instance;
if (context->InvokeService(context, _OrthancPluginService_GetInstanceSize, &params) != OrthancPluginErrorCode_Success)
{
/* Error */
return -1;
}
else
{
return size;
}
}
ORTHANC_PLUGIN_INLINE const char* OrthancPluginGetInstanceData(
OrthancPluginContext* context,
OrthancPluginDicomInstance* instance)
{
const char* result;
_OrthancPluginAccessDicomInstance params;
memset(&params, 0, sizeof(params));
params.resultString = &result;
params.instance = instance;
if (context->InvokeService(context, _OrthancPluginService_GetInstanceData, &params) != OrthancPluginErrorCode_Success)
{
/* Error */
return NULL;
}
else
{
return result;
}
}
ORTHANC_PLUGIN_INLINE char* OrthancPluginGetInstanceJson(
OrthancPluginContext* context,
OrthancPluginDicomInstance* instance)
{
char* result;
_OrthancPluginAccessDicomInstance params;
memset(&params, 0, sizeof(params));
params.resultStringToFree = &result;
params.instance = instance;
if (context->InvokeService(context, _OrthancPluginService_GetInstanceJson, &params) != OrthancPluginErrorCode_Success)
{
/* Error */
return NULL;
}
else
{
return result;
}
}
ORTHANC_PLUGIN_INLINE char* OrthancPluginGetInstanceSimplifiedJson(
OrthancPluginContext* context,
OrthancPluginDicomInstance* instance)
{
char* result;
_OrthancPluginAccessDicomInstance params;
memset(&params, 0, sizeof(params));
params.resultStringToFree = &result;
params.instance = instance;
if (context->InvokeService(context, _OrthancPluginService_GetInstanceSimplifiedJson, &params) != OrthancPluginErrorCode_Success)
{
/* Error */
return NULL;
}
else
{
return result;
}
}
ORTHANC_PLUGIN_INLINE int OrthancPluginHasInstanceMetadata(
OrthancPluginContext* context,
OrthancPluginDicomInstance* instance,
const char* metadata)
{
int64_t result;
_OrthancPluginAccessDicomInstance params;
memset(&params, 0, sizeof(params));
params.resultInt64 = &result;
params.instance = instance;
params.key = metadata;
if (context->InvokeService(context, _OrthancPluginService_HasInstanceMetadata, &params) != OrthancPluginErrorCode_Success)
{
/* Error */
return -1;
}
else
{
return (result != 0);
}
}
ORTHANC_PLUGIN_INLINE const char* OrthancPluginGetInstanceMetadata(
OrthancPluginContext* context,
OrthancPluginDicomInstance* instance,
const char* metadata)
{
const char* result;
_OrthancPluginAccessDicomInstance params;
memset(&params, 0, sizeof(params));
params.resultString = &result;
params.instance = instance;
params.key = metadata;
if (context->InvokeService(context, _OrthancPluginService_GetInstanceMetadata, &params) != OrthancPluginErrorCode_Success)
{
/* Error */
return NULL;
}
else
{
return result;
}
}
typedef struct
{
OrthancPluginStorageCreate create;
OrthancPluginStorageRead read;
OrthancPluginStorageRemove remove;
OrthancPluginFree free;
} _OrthancPluginRegisterStorageArea;
ORTHANC_PLUGIN_INLINE void OrthancPluginRegisterStorageArea(
OrthancPluginContext* context,
OrthancPluginStorageCreate create,
OrthancPluginStorageRead read,
OrthancPluginStorageRemove remove)
{
_OrthancPluginRegisterStorageArea params;
params.create = create;
params.read = read;
params.remove = remove;
#ifdef __cplusplus
params.free = ::free;
#else
params.free = free;
#endif
context->InvokeService(context, _OrthancPluginService_RegisterStorageArea, &params);
}
ORTHANC_PLUGIN_INLINE char *OrthancPluginGetOrthancPath(OrthancPluginContext* context)
{
char* result;
_OrthancPluginRetrieveDynamicString params;
params.result = &result;
params.argument = NULL;
if (context->InvokeService(context, _OrthancPluginService_GetOrthancPath, &params) != OrthancPluginErrorCode_Success)
{
/* Error */
return NULL;
}
else
{
return result;
}
}
ORTHANC_PLUGIN_INLINE char *OrthancPluginGetOrthancDirectory(OrthancPluginContext* context)
{
char* result;
_OrthancPluginRetrieveDynamicString params;
params.result = &result;
params.argument = NULL;
if (context->InvokeService(context, _OrthancPluginService_GetOrthancDirectory, &params) != OrthancPluginErrorCode_Success)
{
/* Error */
return NULL;
}
else
{
return result;
}
}
ORTHANC_PLUGIN_INLINE char *OrthancPluginGetConfigurationPath(OrthancPluginContext* context)
{
char* result;
_OrthancPluginRetrieveDynamicString params;
params.result = &result;
params.argument = NULL;
if (context->InvokeService(context, _OrthancPluginService_GetConfigurationPath, &params) != OrthancPluginErrorCode_Success)
{
/* Error */
return NULL;
}
else
{
return result;
}
}
typedef struct
{
OrthancPluginOnChangeCallback callback;
} _OrthancPluginOnChangeCallback;
ORTHANC_PLUGIN_INLINE void OrthancPluginRegisterOnChangeCallback(
OrthancPluginContext* context,
OrthancPluginOnChangeCallback callback)
{
_OrthancPluginOnChangeCallback params;
params.callback = callback;
context->InvokeService(context, _OrthancPluginService_RegisterOnChangeCallback, &params);
}
typedef struct
{
const char* plugin;
_OrthancPluginProperty property;
const char* value;
} _OrthancPluginSetPluginProperty;
ORTHANC_PLUGIN_INLINE void OrthancPluginSetRootUri(
OrthancPluginContext* context,
const char* uri)
{
_OrthancPluginSetPluginProperty params;
params.plugin = OrthancPluginGetName();
params.property = _OrthancPluginProperty_RootUri;
params.value = uri;
context->InvokeService(context, _OrthancPluginService_SetPluginProperty, &params);
}
ORTHANC_PLUGIN_INLINE void OrthancPluginSetDescription(
OrthancPluginContext* context,
const char* description)
{
_OrthancPluginSetPluginProperty params;
params.plugin = OrthancPluginGetName();
params.property = _OrthancPluginProperty_Description;
params.value = description;
context->InvokeService(context, _OrthancPluginService_SetPluginProperty, &params);
}
ORTHANC_PLUGIN_INLINE void OrthancPluginExtendOrthancExplorer(
OrthancPluginContext* context,
const char* javascript)
{
_OrthancPluginSetPluginProperty params;
params.plugin = OrthancPluginGetName();
params.property = _OrthancPluginProperty_OrthancExplorer;
params.value = javascript;
context->InvokeService(context, _OrthancPluginService_SetPluginProperty, &params);
}
typedef struct
{
char** result;
int32_t property;
const char* value;
} _OrthancPluginGlobalProperty;
ORTHANC_PLUGIN_INLINE char* OrthancPluginGetGlobalProperty(
OrthancPluginContext* context,
int32_t property,
const char* defaultValue)
{
char* result;
_OrthancPluginGlobalProperty params;
params.result = &result;
params.property = property;
params.value = defaultValue;
if (context->InvokeService(context, _OrthancPluginService_GetGlobalProperty, &params) != OrthancPluginErrorCode_Success)
{
/* Error */
return NULL;
}
else
{
return result;
}
}
ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginSetGlobalProperty(
OrthancPluginContext* context,
int32_t property,
const char* value)
{
_OrthancPluginGlobalProperty params;
params.result = NULL;
params.property = property;
params.value = value;
return context->InvokeService(context, _OrthancPluginService_SetGlobalProperty, &params);
}
typedef struct
{
int32_t *resultInt32;
uint32_t *resultUint32;
int64_t *resultInt64;
uint64_t *resultUint64;
} _OrthancPluginReturnSingleValue;
ORTHANC_PLUGIN_INLINE uint32_t OrthancPluginGetCommandLineArgumentsCount(
OrthancPluginContext* context)
{
uint32_t count = 0;
_OrthancPluginReturnSingleValue params;
memset(&params, 0, sizeof(params));
params.resultUint32 = &count;
if (context->InvokeService(context, _OrthancPluginService_GetCommandLineArgumentsCount, &params) != OrthancPluginErrorCode_Success)
{
/* Error */
return 0;
}
else
{
return count;
}
}
ORTHANC_PLUGIN_INLINE char* OrthancPluginGetCommandLineArgument(
OrthancPluginContext* context,
uint32_t argument)
{
char* result;
_OrthancPluginGlobalProperty params;
params.result = &result;
params.property = (int32_t) argument;
params.value = NULL;
if (context->InvokeService(context, _OrthancPluginService_GetCommandLineArgument, &params) != OrthancPluginErrorCode_Success)
{
/* Error */
return NULL;
}
else
{
return result;
}
}
ORTHANC_PLUGIN_INLINE uint32_t OrthancPluginGetExpectedDatabaseVersion(
OrthancPluginContext* context)
{
uint32_t count = 0;
_OrthancPluginReturnSingleValue params;
memset(&params, 0, sizeof(params));
params.resultUint32 = &count;
if (context->InvokeService(context, _OrthancPluginService_GetExpectedDatabaseVersion, &params) != OrthancPluginErrorCode_Success)
{
/* Error */
return 0;
}
else
{
return count;
}
}
ORTHANC_PLUGIN_INLINE char *OrthancPluginGetConfiguration(OrthancPluginContext* context)
{
char* result;
_OrthancPluginRetrieveDynamicString params;
params.result = &result;
params.argument = NULL;
if (context->InvokeService(context, _OrthancPluginService_GetConfiguration, &params) != OrthancPluginErrorCode_Success)
{
/* Error */
return NULL;
}
else
{
return result;
}
}
typedef struct
{
OrthancPluginRestOutput* output;
const char* subType;
const char* contentType;
} _OrthancPluginStartMultipartAnswer;
ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginStartMultipartAnswer(
OrthancPluginContext* context,
OrthancPluginRestOutput* output,
const char* subType,
const char* contentType)
{
_OrthancPluginStartMultipartAnswer params;
params.output = output;
params.subType = subType;
params.contentType = contentType;
return context->InvokeService(context, _OrthancPluginService_StartMultipartAnswer, &params);
}
ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginSendMultipartItem(
OrthancPluginContext* context,
OrthancPluginRestOutput* output,
const char* answer,
uint32_t answerSize)
{
_OrthancPluginAnswerBuffer params;
params.output = output;
params.answer = answer;
params.answerSize = answerSize;
params.mimeType = NULL;
return context->InvokeService(context, _OrthancPluginService_SendMultipartItem, &params);
}
typedef struct
{
OrthancPluginMemoryBuffer* target;
const void* source;
uint32_t size;
OrthancPluginCompressionType compression;
uint8_t uncompress;
} _OrthancPluginBufferCompression;
ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginBufferCompression(
OrthancPluginContext* context,
OrthancPluginMemoryBuffer* target,
const void* source,
uint32_t size,
OrthancPluginCompressionType compression,
uint8_t uncompress)
{
_OrthancPluginBufferCompression params;
params.target = target;
params.source = source;
params.size = size;
params.compression = compression;
params.uncompress = uncompress;
return context->InvokeService(context, _OrthancPluginService_BufferCompression, &params);
}
typedef struct
{
OrthancPluginMemoryBuffer* target;
const char* path;
} _OrthancPluginReadFile;
ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginReadFile(
OrthancPluginContext* context,
OrthancPluginMemoryBuffer* target,
const char* path)
{
_OrthancPluginReadFile params;
params.target = target;
params.path = path;
return context->InvokeService(context, _OrthancPluginService_ReadFile, &params);
}
typedef struct
{
const char* path;
const void* data;
uint32_t size;
} _OrthancPluginWriteFile;
ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginWriteFile(
OrthancPluginContext* context,
const char* path,
const void* data,
uint32_t size)
{
_OrthancPluginWriteFile params;
params.path = path;
params.data = data;
params.size = size;
return context->InvokeService(context, _OrthancPluginService_WriteFile, &params);
}
typedef struct
{
const char** target;
OrthancPluginErrorCode error;
} _OrthancPluginGetErrorDescription;
ORTHANC_PLUGIN_INLINE const char* OrthancPluginGetErrorDescription(
OrthancPluginContext* context,
OrthancPluginErrorCode error)
{
const char* result = NULL;
_OrthancPluginGetErrorDescription params;
params.target = &result;
params.error = error;
if (context->InvokeService(context, _OrthancPluginService_GetErrorDescription, &params) != OrthancPluginErrorCode_Success ||
result == NULL)
{
return "Unknown error code";
}
else
{
return result;
}
}
typedef struct
{
OrthancPluginRestOutput* output;
uint16_t status;
const char* body;
uint32_t bodySize;
} _OrthancPluginSendHttpStatus;
ORTHANC_PLUGIN_INLINE void OrthancPluginSendHttpStatus(
OrthancPluginContext* context,
OrthancPluginRestOutput* output,
uint16_t status,
const char* body,
uint32_t bodySize)
{
_OrthancPluginSendHttpStatus params;
params.output = output;
params.status = status;
params.body = body;
params.bodySize = bodySize;
context->InvokeService(context, _OrthancPluginService_SendHttpStatus, &params);
}
typedef struct
{
const OrthancPluginImage* image;
uint32_t* resultUint32;
OrthancPluginPixelFormat* resultPixelFormat;
void** resultBuffer;
} _OrthancPluginGetImageInfo;
ORTHANC_PLUGIN_INLINE OrthancPluginPixelFormat OrthancPluginGetImagePixelFormat(
OrthancPluginContext* context,
const OrthancPluginImage* image)
{
OrthancPluginPixelFormat target;
_OrthancPluginGetImageInfo params;
memset(&params, 0, sizeof(params));
params.image = image;
params.resultPixelFormat = &target;
if (context->InvokeService(context, _OrthancPluginService_GetImagePixelFormat, &params) != OrthancPluginErrorCode_Success)
{
return OrthancPluginPixelFormat_Unknown;
}
else
{
return (OrthancPluginPixelFormat) target;
}
}
ORTHANC_PLUGIN_INLINE uint32_t OrthancPluginGetImageWidth(
OrthancPluginContext* context,
const OrthancPluginImage* image)
{
uint32_t width;
_OrthancPluginGetImageInfo params;
memset(&params, 0, sizeof(params));
params.image = image;
params.resultUint32 = &width;
if (context->InvokeService(context, _OrthancPluginService_GetImageWidth, &params) != OrthancPluginErrorCode_Success)
{
return 0;
}
else
{
return width;
}
}
ORTHANC_PLUGIN_INLINE uint32_t OrthancPluginGetImageHeight(
OrthancPluginContext* context,
const OrthancPluginImage* image)
{
uint32_t height;
_OrthancPluginGetImageInfo params;
memset(&params, 0, sizeof(params));
params.image = image;
params.resultUint32 = &height;
if (context->InvokeService(context, _OrthancPluginService_GetImageHeight, &params) != OrthancPluginErrorCode_Success)
{
return 0;
}
else
{
return height;
}
}
ORTHANC_PLUGIN_INLINE uint32_t OrthancPluginGetImagePitch(
OrthancPluginContext* context,
const OrthancPluginImage* image)
{
uint32_t pitch;
_OrthancPluginGetImageInfo params;
memset(&params, 0, sizeof(params));
params.image = image;
params.resultUint32 = &pitch;
if (context->InvokeService(context, _OrthancPluginService_GetImagePitch, &params) != OrthancPluginErrorCode_Success)
{
return 0;
}
else
{
return pitch;
}
}
ORTHANC_PLUGIN_INLINE void* OrthancPluginGetImageBuffer(
OrthancPluginContext* context,
const OrthancPluginImage* image)
{
void* target = NULL;
_OrthancPluginGetImageInfo params;
memset(&params, 0, sizeof(params));
params.resultBuffer = &target;
params.image = image;
if (context->InvokeService(context, _OrthancPluginService_GetImageBuffer, &params) != OrthancPluginErrorCode_Success)
{
return NULL;
}
else
{
return target;
}
}
typedef struct
{
OrthancPluginImage** target;
const void* data;
uint32_t size;
OrthancPluginImageFormat format;
} _OrthancPluginUncompressImage;
ORTHANC_PLUGIN_INLINE OrthancPluginImage *OrthancPluginUncompressImage(
OrthancPluginContext* context,
const void* data,
uint32_t size,
OrthancPluginImageFormat format)
{
OrthancPluginImage* target = NULL;
_OrthancPluginUncompressImage params;
memset(&params, 0, sizeof(params));
params.target = &target;
params.data = data;
params.size = size;
params.format = format;
if (context->InvokeService(context, _OrthancPluginService_UncompressImage, &params) != OrthancPluginErrorCode_Success)
{
return NULL;
}
else
{
return target;
}
}
typedef struct
{
OrthancPluginImage* image;
} _OrthancPluginFreeImage;
ORTHANC_PLUGIN_INLINE void OrthancPluginFreeImage(
OrthancPluginContext* context,
OrthancPluginImage* image)
{
_OrthancPluginFreeImage params;
params.image = image;
context->InvokeService(context, _OrthancPluginService_FreeImage, &params);
}
typedef struct
{
OrthancPluginMemoryBuffer* target;
OrthancPluginImageFormat imageFormat;
OrthancPluginPixelFormat pixelFormat;
uint32_t width;
uint32_t height;
uint32_t pitch;
const void* buffer;
uint8_t quality;
} _OrthancPluginCompressImage;
ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginCompressPngImage(
OrthancPluginContext* context,
OrthancPluginMemoryBuffer* target,
OrthancPluginPixelFormat format,
uint32_t width,
uint32_t height,
uint32_t pitch,
const void* buffer)
{
_OrthancPluginCompressImage params;
memset(&params, 0, sizeof(params));
params.target = target;
params.imageFormat = OrthancPluginImageFormat_Png;
params.pixelFormat = format;
params.width = width;
params.height = height;
params.pitch = pitch;
params.buffer = buffer;
params.quality = 0; /* Unused for PNG */
return context->InvokeService(context, _OrthancPluginService_CompressImage, &params);
}
ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginCompressJpegImage(
OrthancPluginContext* context,
OrthancPluginMemoryBuffer* target,
OrthancPluginPixelFormat format,
uint32_t width,
uint32_t height,
uint32_t pitch,
const void* buffer,
uint8_t quality)
{
_OrthancPluginCompressImage params;
memset(&params, 0, sizeof(params));
params.target = target;
params.imageFormat = OrthancPluginImageFormat_Jpeg;
params.pixelFormat = format;
params.width = width;
params.height = height;
params.pitch = pitch;
params.buffer = buffer;
params.quality = quality;
return context->InvokeService(context, _OrthancPluginService_CompressImage, &params);
}
ORTHANC_PLUGIN_INLINE void OrthancPluginCompressAndAnswerJpegImage(
OrthancPluginContext* context,
OrthancPluginRestOutput* output,
OrthancPluginPixelFormat format,
uint32_t width,
uint32_t height,
uint32_t pitch,
const void* buffer,
uint8_t quality)
{
_OrthancPluginCompressAndAnswerImage params;
params.output = output;
params.imageFormat = OrthancPluginImageFormat_Jpeg;
params.pixelFormat = format;
params.width = width;
params.height = height;
params.pitch = pitch;
params.buffer = buffer;
params.quality = quality;
context->InvokeService(context, _OrthancPluginService_CompressAndAnswerImage, &params);
}
typedef struct
{
OrthancPluginMemoryBuffer* target;
OrthancPluginHttpMethod method;
const char* url;
const char* username;
const char* password;
const char* body;
uint32_t bodySize;
} _OrthancPluginCallHttpClient;
ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginHttpGet(
OrthancPluginContext* context,
OrthancPluginMemoryBuffer* target,
const char* url,
const char* username,
const char* password)
{
_OrthancPluginCallHttpClient params;
memset(&params, 0, sizeof(params));
params.target = target;
params.method = OrthancPluginHttpMethod_Get;
params.url = url;
params.username = username;
params.password = password;
return context->InvokeService(context, _OrthancPluginService_CallHttpClient, &params);
}
ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginHttpPost(
OrthancPluginContext* context,
OrthancPluginMemoryBuffer* target,
const char* url,
const char* body,
uint32_t bodySize,
const char* username,
const char* password)
{
_OrthancPluginCallHttpClient params;
memset(&params, 0, sizeof(params));
params.target = target;
params.method = OrthancPluginHttpMethod_Post;
params.url = url;
params.body = body;
params.bodySize = bodySize;
params.username = username;
params.password = password;
return context->InvokeService(context, _OrthancPluginService_CallHttpClient, &params);
}
ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginHttpPut(
OrthancPluginContext* context,
OrthancPluginMemoryBuffer* target,
const char* url,
const char* body,
uint32_t bodySize,
const char* username,
const char* password)
{
_OrthancPluginCallHttpClient params;
memset(&params, 0, sizeof(params));
params.target = target;
params.method = OrthancPluginHttpMethod_Put;
params.url = url;
params.body = body;
params.bodySize = bodySize;
params.username = username;
params.password = password;
return context->InvokeService(context, _OrthancPluginService_CallHttpClient, &params);
}
ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginHttpDelete(
OrthancPluginContext* context,
const char* url,
const char* username,
const char* password)
{
_OrthancPluginCallHttpClient params;
memset(&params, 0, sizeof(params));
params.method = OrthancPluginHttpMethod_Delete;
params.url = url;
params.username = username;
params.password = password;
return context->InvokeService(context, _OrthancPluginService_CallHttpClient, &params);
}
typedef struct
{
OrthancPluginImage** target;
const OrthancPluginImage* source;
OrthancPluginPixelFormat targetFormat;
} _OrthancPluginConvertPixelFormat;
ORTHANC_PLUGIN_INLINE OrthancPluginImage *OrthancPluginConvertPixelFormat(
OrthancPluginContext* context,
const OrthancPluginImage* source,
OrthancPluginPixelFormat targetFormat)
{
OrthancPluginImage* target = NULL;
_OrthancPluginConvertPixelFormat params;
params.target = &target;
params.source = source;
params.targetFormat = targetFormat;
if (context->InvokeService(context, _OrthancPluginService_ConvertPixelFormat, &params) != OrthancPluginErrorCode_Success)
{
return NULL;
}
else
{
return target;
}
}
ORTHANC_PLUGIN_INLINE uint32_t OrthancPluginGetFontsCount(
OrthancPluginContext* context)
{
uint32_t count = 0;
_OrthancPluginReturnSingleValue params;
memset(&params, 0, sizeof(params));
params.resultUint32 = &count;
if (context->InvokeService(context, _OrthancPluginService_GetFontsCount, &params) != OrthancPluginErrorCode_Success)
{
/* Error */
return 0;
}
else
{
return count;
}
}
typedef struct
{
uint32_t fontIndex; /* in */
const char** name; /* out */
uint32_t* size; /* out */
} _OrthancPluginGetFontInfo;
ORTHANC_PLUGIN_INLINE const char* OrthancPluginGetFontName(
OrthancPluginContext* context,
uint32_t fontIndex)
{
const char* result = NULL;
_OrthancPluginGetFontInfo params;
memset(&params, 0, sizeof(params));
params.name = &result;
params.fontIndex = fontIndex;
if (context->InvokeService(context, _OrthancPluginService_GetFontInfo, &params) != OrthancPluginErrorCode_Success)
{
return NULL;
}
else
{
return result;
}
}
ORTHANC_PLUGIN_INLINE uint32_t OrthancPluginGetFontSize(
OrthancPluginContext* context,
uint32_t fontIndex)
{
uint32_t result;
_OrthancPluginGetFontInfo params;
memset(&params, 0, sizeof(params));
params.size = &result;
params.fontIndex = fontIndex;
if (context->InvokeService(context, _OrthancPluginService_GetFontInfo, &params) != OrthancPluginErrorCode_Success)
{
return 0;
}
else
{
return result;
}
}
typedef struct
{
OrthancPluginImage* image;
uint32_t fontIndex;
const char* utf8Text;
int32_t x;
int32_t y;
uint8_t r;
uint8_t g;
uint8_t b;
} _OrthancPluginDrawText;
ORTHANC_PLUGIN_INLINE 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)
{
_OrthancPluginDrawText params;
memset(&params, 0, sizeof(params));
params.image = image;
params.fontIndex = fontIndex;
params.utf8Text = utf8Text;
params.x = x;
params.y = y;
params.r = r;
params.g = g;
params.b = b;
return context->InvokeService(context, _OrthancPluginService_DrawText, &params);
}
typedef struct
{
OrthancPluginStorageArea* storageArea;
const char* uuid;
const void* content;
uint64_t size;
OrthancPluginContentType type;
} _OrthancPluginStorageAreaCreate;
ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginStorageAreaCreate(
OrthancPluginContext* context,
OrthancPluginStorageArea* storageArea,
const char* uuid,
const void* content,
uint64_t size,
OrthancPluginContentType type)
{
_OrthancPluginStorageAreaCreate params;
params.storageArea = storageArea;
params.uuid = uuid;
params.content = content;
params.size = size;
params.type = type;
return context->InvokeService(context, _OrthancPluginService_StorageAreaCreate, &params);
}
typedef struct
{
OrthancPluginMemoryBuffer* target;
OrthancPluginStorageArea* storageArea;
const char* uuid;
OrthancPluginContentType type;
} _OrthancPluginStorageAreaRead;
ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginStorageAreaRead(
OrthancPluginContext* context,
OrthancPluginMemoryBuffer* target,
OrthancPluginStorageArea* storageArea,
const char* uuid,
OrthancPluginContentType type)
{
_OrthancPluginStorageAreaRead params;
params.target = target;
params.storageArea = storageArea;
params.uuid = uuid;
params.type = type;
return context->InvokeService(context, _OrthancPluginService_StorageAreaRead, &params);
}
typedef struct
{
OrthancPluginStorageArea* storageArea;
const char* uuid;
OrthancPluginContentType type;
} _OrthancPluginStorageAreaRemove;
ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginStorageAreaRemove(
OrthancPluginContext* context,
OrthancPluginStorageArea* storageArea,
const char* uuid,
OrthancPluginContentType type)
{
_OrthancPluginStorageAreaRemove params;
params.storageArea = storageArea;
params.uuid = uuid;
params.type = type;
return context->InvokeService(context, _OrthancPluginService_StorageAreaRemove, &params);
}
typedef struct
{
OrthancPluginErrorCode* target;
int32_t code;
uint16_t httpStatus;
const char* message;
} _OrthancPluginRegisterErrorCode;
ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRegisterErrorCode(
OrthancPluginContext* context,
int32_t code,
uint16_t httpStatus,
const char* message)
{
OrthancPluginErrorCode target;
_OrthancPluginRegisterErrorCode params;
params.target = &target;
params.code = code;
params.httpStatus = httpStatus;
params.message = message;
if (context->InvokeService(context, _OrthancPluginService_RegisterErrorCode, &params) == OrthancPluginErrorCode_Success)
{
return target;
}
else
{
/* There was an error while assigned the error. Use a generic code. */
return OrthancPluginErrorCode_Plugin;
}
}
typedef struct
{
uint16_t group;
uint16_t element;
OrthancPluginValueRepresentation vr;
const char* name;
uint32_t minMultiplicity;
uint32_t maxMultiplicity;
} _OrthancPluginRegisterDictionaryTag;
ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRegisterDictionaryTag(
OrthancPluginContext* context,
uint16_t group,
uint16_t element,
OrthancPluginValueRepresentation vr,
const char* name,
uint32_t minMultiplicity,
uint32_t maxMultiplicity)
{
_OrthancPluginRegisterDictionaryTag params;
params.group = group;
params.element = element;
params.vr = vr;
params.name = name;
params.minMultiplicity = minMultiplicity;
params.maxMultiplicity = maxMultiplicity;
return context->InvokeService(context, _OrthancPluginService_RegisterDictionaryTag, &params);
}
typedef struct
{
uint16_t group;
uint16_t element;
OrthancPluginValueRepresentation vr;
const char* name;
uint32_t minMultiplicity;
uint32_t maxMultiplicity;
const char* privateCreator;
} _OrthancPluginRegisterPrivateDictionaryTag;
ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRegisterPrivateDictionaryTag(
OrthancPluginContext* context,
uint16_t group,
uint16_t element,
OrthancPluginValueRepresentation vr,
const char* name,
uint32_t minMultiplicity,
uint32_t maxMultiplicity,
const char* privateCreator)
{
_OrthancPluginRegisterPrivateDictionaryTag params;
params.group = group;
params.element = element;
params.vr = vr;
params.name = name;
params.minMultiplicity = minMultiplicity;
params.maxMultiplicity = maxMultiplicity;
params.privateCreator = privateCreator;
return context->InvokeService(context, _OrthancPluginService_RegisterPrivateDictionaryTag, &params);
}
typedef struct
{
OrthancPluginStorageArea* storageArea;
OrthancPluginResourceType level;
} _OrthancPluginReconstructMainDicomTags;
ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginReconstructMainDicomTags(
OrthancPluginContext* context,
OrthancPluginStorageArea* storageArea,
OrthancPluginResourceType level)
{
_OrthancPluginReconstructMainDicomTags params;
params.level = level;
params.storageArea = storageArea;
return context->InvokeService(context, _OrthancPluginService_ReconstructMainDicomTags, &params);
}
typedef struct
{
char** result;
const char* instanceId;
const void* buffer;
uint32_t size;
OrthancPluginDicomToJsonFormat format;
OrthancPluginDicomToJsonFlags flags;
uint32_t maxStringLength;
} _OrthancPluginDicomToJson;
ORTHANC_PLUGIN_INLINE char* OrthancPluginDicomBufferToJson(
OrthancPluginContext* context,
const void* buffer,
uint32_t size,
OrthancPluginDicomToJsonFormat format,
OrthancPluginDicomToJsonFlags flags,
uint32_t maxStringLength)
{
char* result;
_OrthancPluginDicomToJson params;
memset(&params, 0, sizeof(params));
params.result = &result;
params.buffer = buffer;
params.size = size;
params.format = format;
params.flags = flags;
params.maxStringLength = maxStringLength;
if (context->InvokeService(context, _OrthancPluginService_DicomBufferToJson, &params) != OrthancPluginErrorCode_Success)
{
/* Error */
return NULL;
}
else
{
return result;
}
}
ORTHANC_PLUGIN_INLINE char* OrthancPluginDicomInstanceToJson(
OrthancPluginContext* context,
const char* instanceId,
OrthancPluginDicomToJsonFormat format,
OrthancPluginDicomToJsonFlags flags,
uint32_t maxStringLength)
{
char* result;
_OrthancPluginDicomToJson params;
memset(&params, 0, sizeof(params));
params.result = &result;
params.instanceId = instanceId;
params.format = format;
params.flags = flags;
params.maxStringLength = maxStringLength;
if (context->InvokeService(context, _OrthancPluginService_DicomInstanceToJson, &params) != OrthancPluginErrorCode_Success)
{
/* Error */
return NULL;
}
else
{
return result;
}
}
typedef struct
{
OrthancPluginMemoryBuffer* target;
const char* uri;
uint32_t headersCount;
const char* const* headersKeys;
const char* const* headersValues;
int32_t afterPlugins;
} _OrthancPluginRestApiGet2;
ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRestApiGet2(
OrthancPluginContext* context,
OrthancPluginMemoryBuffer* target,
const char* uri,
uint32_t headersCount,
const char* const* headersKeys,
const char* const* headersValues,
int32_t afterPlugins)
{
_OrthancPluginRestApiGet2 params;
params.target = target;
params.uri = uri;
params.headersCount = headersCount;
params.headersKeys = headersKeys;
params.headersValues = headersValues;
params.afterPlugins = afterPlugins;
return context->InvokeService(context, _OrthancPluginService_RestApiGet2, &params);
}
typedef struct
{
OrthancPluginWorklistCallback callback;
} _OrthancPluginWorklistCallback;
ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRegisterWorklistCallback(
OrthancPluginContext* context,
OrthancPluginWorklistCallback callback)
{
_OrthancPluginWorklistCallback params;
params.callback = callback;
return context->InvokeService(context, _OrthancPluginService_RegisterWorklistCallback, &params);
}
typedef struct
{
OrthancPluginWorklistAnswers* answers;
const OrthancPluginWorklistQuery* query;
const void* dicom;
uint32_t size;
} _OrthancPluginWorklistAnswersOperation;
ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginWorklistAddAnswer(
OrthancPluginContext* context,
OrthancPluginWorklistAnswers* answers,
const OrthancPluginWorklistQuery* query,
const void* dicom,
uint32_t size)
{
_OrthancPluginWorklistAnswersOperation params;
params.answers = answers;
params.query = query;
params.dicom = dicom;
params.size = size;
return context->InvokeService(context, _OrthancPluginService_WorklistAddAnswer, &params);
}
ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginWorklistMarkIncomplete(
OrthancPluginContext* context,
OrthancPluginWorklistAnswers* answers)
{
_OrthancPluginWorklistAnswersOperation params;
params.answers = answers;
params.query = NULL;
params.dicom = NULL;
params.size = 0;
return context->InvokeService(context, _OrthancPluginService_WorklistMarkIncomplete, &params);
}
typedef struct
{
const OrthancPluginWorklistQuery* query;
const void* dicom;
uint32_t size;
int32_t* isMatch;
OrthancPluginMemoryBuffer* target;
} _OrthancPluginWorklistQueryOperation;
ORTHANC_PLUGIN_INLINE int32_t OrthancPluginWorklistIsMatch(
OrthancPluginContext* context,
const OrthancPluginWorklistQuery* query,
const void* dicom,
uint32_t size)
{
int32_t isMatch = 0;
_OrthancPluginWorklistQueryOperation params;
params.query = query;
params.dicom = dicom;
params.size = size;
params.isMatch = &isMatch;
params.target = NULL;
if (context->InvokeService(context, _OrthancPluginService_WorklistIsMatch, &params) == OrthancPluginErrorCode_Success)
{
return isMatch;
}
else
{
/* Error: Assume non-match */
return 0;
}
}
ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginWorklistGetDicomQuery(
OrthancPluginContext* context,
OrthancPluginMemoryBuffer* target,
const OrthancPluginWorklistQuery* query)
{
_OrthancPluginWorklistQueryOperation params;
params.query = query;
params.dicom = NULL;
params.size = 0;
params.isMatch = NULL;
params.target = target;
return context->InvokeService(context, _OrthancPluginService_WorklistGetDicomQuery, &params);
}
ORTHANC_PLUGIN_INLINE OrthancPluginInstanceOrigin OrthancPluginGetInstanceOrigin(
OrthancPluginContext* context,
OrthancPluginDicomInstance* instance)
{
OrthancPluginInstanceOrigin origin;
_OrthancPluginAccessDicomInstance params;
memset(&params, 0, sizeof(params));
params.resultOrigin = &origin;
params.instance = instance;
if (context->InvokeService(context, _OrthancPluginService_GetInstanceOrigin, &params) != OrthancPluginErrorCode_Success)
{
/* Error */
return OrthancPluginInstanceOrigin_Unknown;
}
else
{
return origin;
}
}
typedef struct
{
OrthancPluginMemoryBuffer* target;
const char* json;
const OrthancPluginImage* pixelData;
OrthancPluginCreateDicomFlags flags;
} _OrthancPluginCreateDicom;
ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginCreateDicom(
OrthancPluginContext* context,
OrthancPluginMemoryBuffer* target,
const char* json,
const OrthancPluginImage* pixelData,
OrthancPluginCreateDicomFlags flags)
{
_OrthancPluginCreateDicom params;
params.target = target;
params.json = json;
params.pixelData = pixelData;
params.flags = flags;
return context->InvokeService(context, _OrthancPluginService_CreateDicom, &params);
}
typedef struct
{
OrthancPluginDecodeImageCallback callback;
} _OrthancPluginDecodeImageCallback;
ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRegisterDecodeImageCallback(
OrthancPluginContext* context,
OrthancPluginDecodeImageCallback callback)
{
_OrthancPluginDecodeImageCallback params;
params.callback = callback;
return context->InvokeService(context, _OrthancPluginService_RegisterDecodeImageCallback, &params);
}
typedef struct
{
OrthancPluginImage** target;
OrthancPluginPixelFormat format;
uint32_t width;
uint32_t height;
uint32_t pitch;
void* buffer;
const void* constBuffer;
uint32_t bufferSize;
uint32_t frameIndex;
} _OrthancPluginCreateImage;
ORTHANC_PLUGIN_INLINE OrthancPluginImage* OrthancPluginCreateImage(
OrthancPluginContext* context,
OrthancPluginPixelFormat format,
uint32_t width,
uint32_t height)
{
OrthancPluginImage* target = NULL;
_OrthancPluginCreateImage params;
memset(&params, 0, sizeof(params));
params.target = &target;
params.format = format;
params.width = width;
params.height = height;
if (context->InvokeService(context, _OrthancPluginService_CreateImage, &params) != OrthancPluginErrorCode_Success)
{
return NULL;
}
else
{
return target;
}
}
ORTHANC_PLUGIN_INLINE OrthancPluginImage* OrthancPluginCreateImageAccessor(
OrthancPluginContext* context,
OrthancPluginPixelFormat format,
uint32_t width,
uint32_t height,
uint32_t pitch,
void* buffer)
{
OrthancPluginImage* target = NULL;
_OrthancPluginCreateImage params;
memset(&params, 0, sizeof(params));
params.target = &target;
params.format = format;
params.width = width;
params.height = height;
params.pitch = pitch;
params.buffer = buffer;
if (context->InvokeService(context, _OrthancPluginService_CreateImageAccessor, &params) != OrthancPluginErrorCode_Success)
{
return NULL;
}
else
{
return target;
}
}
ORTHANC_PLUGIN_INLINE OrthancPluginImage* OrthancPluginDecodeDicomImage(
OrthancPluginContext* context,
const void* buffer,
uint32_t bufferSize,
uint32_t frameIndex)
{
OrthancPluginImage* target = NULL;
_OrthancPluginCreateImage params;
memset(&params, 0, sizeof(params));
params.target = &target;
params.constBuffer = buffer;
params.bufferSize = bufferSize;
params.frameIndex = frameIndex;
if (context->InvokeService(context, _OrthancPluginService_DecodeDicomImage, &params) != OrthancPluginErrorCode_Success)
{
return NULL;
}
else
{
return target;
}
}
typedef struct
{
char** result;
const void* buffer;
uint32_t size;
} _OrthancPluginComputeHash;
ORTHANC_PLUGIN_INLINE char* OrthancPluginComputeMd5(
OrthancPluginContext* context,
const void* buffer,
uint32_t size)
{
char* result;
_OrthancPluginComputeHash params;
params.result = &result;
params.buffer = buffer;
params.size = size;
if (context->InvokeService(context, _OrthancPluginService_ComputeMd5, &params) != OrthancPluginErrorCode_Success)
{
/* Error */
return NULL;
}
else
{
return result;
}
}
ORTHANC_PLUGIN_INLINE char* OrthancPluginComputeSha1(
OrthancPluginContext* context,
const void* buffer,
uint32_t size)
{
char* result;
_OrthancPluginComputeHash params;
params.result = &result;
params.buffer = buffer;
params.size = size;
if (context->InvokeService(context, _OrthancPluginService_ComputeSha1, &params) != OrthancPluginErrorCode_Success)
{
/* Error */
return NULL;
}
else
{
return result;
}
}
typedef struct
{
OrthancPluginDictionaryEntry* target;
const char* name;
} _OrthancPluginLookupDictionary;
ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginLookupDictionary(
OrthancPluginContext* context,
OrthancPluginDictionaryEntry* target,
const char* name)
{
_OrthancPluginLookupDictionary params;
params.target = target;
params.name = name;
return context->InvokeService(context, _OrthancPluginService_LookupDictionary, &params);
}
typedef struct
{
OrthancPluginRestOutput* output;
const char* answer;
uint32_t answerSize;
uint32_t headersCount;
const char* const* headersKeys;
const char* const* headersValues;
} _OrthancPluginSendMultipartItem2;
ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginSendMultipartItem2(
OrthancPluginContext* context,
OrthancPluginRestOutput* output,
const char* answer,
uint32_t answerSize,
uint32_t headersCount,
const char* const* headersKeys,
const char* const* headersValues)
{
_OrthancPluginSendMultipartItem2 params;
params.output = output;
params.answer = answer;
params.answerSize = answerSize;
params.headersCount = headersCount;
params.headersKeys = headersKeys;
params.headersValues = headersValues;
return context->InvokeService(context, _OrthancPluginService_SendMultipartItem2, &params);
}
typedef struct
{
OrthancPluginIncomingHttpRequestFilter callback;
} _OrthancPluginIncomingHttpRequestFilter;
ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRegisterIncomingHttpRequestFilter(
OrthancPluginContext* context,
OrthancPluginIncomingHttpRequestFilter callback)
{
_OrthancPluginIncomingHttpRequestFilter params;
params.callback = callback;
return context->InvokeService(context, _OrthancPluginService_RegisterIncomingHttpRequestFilter, &params);
}
typedef struct
{
OrthancPluginMemoryBuffer* answerBody;
OrthancPluginMemoryBuffer* answerHeaders;
uint16_t* httpStatus;
OrthancPluginHttpMethod method;
const char* url;
uint32_t headersCount;
const char* const* headersKeys;
const char* const* headersValues;
const char* body;
uint32_t bodySize;
const char* username;
const char* password;
uint32_t timeout;
const char* certificateFile;
const char* certificateKeyFile;
const char* certificateKeyPassword;
uint8_t pkcs11;
} _OrthancPluginCallHttpClient2;
ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginHttpClient(
OrthancPluginContext* context,
OrthancPluginMemoryBuffer* answerBody,
OrthancPluginMemoryBuffer* answerHeaders,
uint16_t* httpStatus,
OrthancPluginHttpMethod method,
const char* url,
uint32_t headersCount,
const char* const* headersKeys,
const char* const* headersValues,
const char* body,
uint32_t bodySize,
const char* username,
const char* password,
uint32_t timeout,
const char* certificateFile,
const char* certificateKeyFile,
const char* certificateKeyPassword,
uint8_t pkcs11)
{
_OrthancPluginCallHttpClient2 params;
memset(&params, 0, sizeof(params));
params.answerBody = answerBody;
params.answerHeaders = answerHeaders;
params.httpStatus = httpStatus;
params.method = method;
params.url = url;
params.headersCount = headersCount;
params.headersKeys = headersKeys;
params.headersValues = headersValues;
params.body = body;
params.bodySize = bodySize;
params.username = username;
params.password = password;
params.timeout = timeout;
params.certificateFile = certificateFile;
params.certificateKeyFile = certificateKeyFile;
params.certificateKeyPassword = certificateKeyPassword;
params.pkcs11 = pkcs11;
return context->InvokeService(context, _OrthancPluginService_CallHttpClient2, &params);
}
ORTHANC_PLUGIN_INLINE char* OrthancPluginGenerateUuid(
OrthancPluginContext* context)
{
char* result;
_OrthancPluginRetrieveDynamicString params;
params.result = &result;
params.argument = NULL;
if (context->InvokeService(context, _OrthancPluginService_GenerateUuid, &params) != OrthancPluginErrorCode_Success)
{
/* Error */
return NULL;
}
else
{
return result;
}
}
typedef struct
{
OrthancPluginFindCallback callback;
} _OrthancPluginFindCallback;
ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRegisterFindCallback(
OrthancPluginContext* context,
OrthancPluginFindCallback callback)
{
_OrthancPluginFindCallback params;
params.callback = callback;
return context->InvokeService(context, _OrthancPluginService_RegisterFindCallback, &params);
}
typedef struct
{
OrthancPluginFindAnswers *answers;
const OrthancPluginFindQuery *query;
const void *dicom;
uint32_t size;
uint32_t index;
uint32_t *resultUint32;
uint16_t *resultGroup;
uint16_t *resultElement;
char **resultString;
} _OrthancPluginFindOperation;
ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginFindAddAnswer(
OrthancPluginContext* context,
OrthancPluginFindAnswers* answers,
const void* dicom,
uint32_t size)
{
_OrthancPluginFindOperation params;
memset(&params, 0, sizeof(params));
params.answers = answers;
params.dicom = dicom;
params.size = size;
return context->InvokeService(context, _OrthancPluginService_FindAddAnswer, &params);
}
ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginFindMarkIncomplete(
OrthancPluginContext* context,
OrthancPluginFindAnswers* answers)
{
_OrthancPluginFindOperation params;
memset(&params, 0, sizeof(params));
params.answers = answers;
return context->InvokeService(context, _OrthancPluginService_FindMarkIncomplete, &params);
}
ORTHANC_PLUGIN_INLINE uint32_t OrthancPluginGetFindQuerySize(
OrthancPluginContext* context,
const OrthancPluginFindQuery* query)
{
uint32_t count = 0;
_OrthancPluginFindOperation params;
memset(&params, 0, sizeof(params));
params.query = query;
params.resultUint32 = &count;
if (context->InvokeService(context, _OrthancPluginService_GetFindQuerySize, &params) != OrthancPluginErrorCode_Success)
{
/* Error */
return 0;
}
else
{
return count;
}
}
ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginGetFindQueryTag(
OrthancPluginContext* context,
uint16_t* group,
uint16_t* element,
const OrthancPluginFindQuery* query,
uint32_t index)
{
_OrthancPluginFindOperation params;
memset(&params, 0, sizeof(params));
params.query = query;
params.index = index;
params.resultGroup = group;
params.resultElement = element;
return context->InvokeService(context, _OrthancPluginService_GetFindQueryTag, &params);
}
ORTHANC_PLUGIN_INLINE char* OrthancPluginGetFindQueryTagName(
OrthancPluginContext* context,
const OrthancPluginFindQuery* query,
uint32_t index)
{
char* result;
_OrthancPluginFindOperation params;
memset(&params, 0, sizeof(params));
params.query = query;
params.index = index;
params.resultString = &result;
if (context->InvokeService(context, _OrthancPluginService_GetFindQueryTagName, &params) != OrthancPluginErrorCode_Success)
{
/* Error */
return NULL;
}
else
{
return result;
}
}
ORTHANC_PLUGIN_INLINE char* OrthancPluginGetFindQueryValue(
OrthancPluginContext* context,
const OrthancPluginFindQuery* query,
uint32_t index)
{
char* result;
_OrthancPluginFindOperation params;
memset(&params, 0, sizeof(params));
params.query = query;
params.index = index;
params.resultString = &result;
if (context->InvokeService(context, _OrthancPluginService_GetFindQueryValue, &params) != OrthancPluginErrorCode_Success)
{
/* Error */
return NULL;
}
else
{
return result;
}
}
typedef struct
{
OrthancPluginMoveCallback callback;
OrthancPluginGetMoveSize getMoveSize;
OrthancPluginApplyMove applyMove;
OrthancPluginFreeMove freeMove;
} _OrthancPluginMoveCallback;
ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRegisterMoveCallback(
OrthancPluginContext* context,
OrthancPluginMoveCallback callback,
OrthancPluginGetMoveSize getMoveSize,
OrthancPluginApplyMove applyMove,
OrthancPluginFreeMove freeMove)
{
_OrthancPluginMoveCallback params;
params.callback = callback;
params.getMoveSize = getMoveSize;
params.applyMove = applyMove;
params.freeMove = freeMove;
return context->InvokeService(context, _OrthancPluginService_RegisterMoveCallback, &params);
}
typedef struct
{
OrthancPluginFindMatcher** target;
const void* query;
uint32_t size;
} _OrthancPluginCreateFindMatcher;
ORTHANC_PLUGIN_INLINE OrthancPluginFindMatcher* OrthancPluginCreateFindMatcher(
OrthancPluginContext* context,
const void* query,
uint32_t size)
{
OrthancPluginFindMatcher* target = NULL;
_OrthancPluginCreateFindMatcher params;
memset(&params, 0, sizeof(params));
params.target = &target;
params.query = query;
params.size = size;
if (context->InvokeService(context, _OrthancPluginService_CreateFindMatcher, &params) != OrthancPluginErrorCode_Success)
{
return NULL;
}
else
{
return target;
}
}
typedef struct
{
OrthancPluginFindMatcher* matcher;
} _OrthancPluginFreeFindMatcher;
ORTHANC_PLUGIN_INLINE void OrthancPluginFreeFindMatcher(
OrthancPluginContext* context,
OrthancPluginFindMatcher* matcher)
{
_OrthancPluginFreeFindMatcher params;
params.matcher = matcher;
context->InvokeService(context, _OrthancPluginService_FreeFindMatcher, &params);
}
typedef struct
{
const OrthancPluginFindMatcher* matcher;
const void* dicom;
uint32_t size;
int32_t* isMatch;
} _OrthancPluginFindMatcherIsMatch;
ORTHANC_PLUGIN_INLINE int32_t OrthancPluginFindMatcherIsMatch(
OrthancPluginContext* context,
const OrthancPluginFindMatcher* matcher,
const void* dicom,
uint32_t size)
{
int32_t isMatch = 0;
_OrthancPluginFindMatcherIsMatch params;
params.matcher = matcher;
params.dicom = dicom;
params.size = size;
params.isMatch = &isMatch;
if (context->InvokeService(context, _OrthancPluginService_FindMatcherIsMatch, &params) == OrthancPluginErrorCode_Success)
{
return isMatch;
}
else
{
/* Error: Assume non-match */
return 0;
}
}
typedef struct
{
OrthancPluginIncomingHttpRequestFilter2 callback;
} _OrthancPluginIncomingHttpRequestFilter2;
ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRegisterIncomingHttpRequestFilter2(
OrthancPluginContext* context,
OrthancPluginIncomingHttpRequestFilter2 callback)
{
_OrthancPluginIncomingHttpRequestFilter2 params;
params.callback = callback;
return context->InvokeService(context, _OrthancPluginService_RegisterIncomingHttpRequestFilter2, &params);
}
#ifdef __cplusplus
}
#endif
OrthancPluginChangeType_NewPatient
@ OrthancPluginChangeType_NewPatient
Definition: OrthancCPlugin.h:618
OrthancPluginErrorCode_SQLiteStatementAlreadyUsed
@ OrthancPluginErrorCode_SQLiteStatementAlreadyUsed
Definition: OrthancCPlugin.h:230
OrthancPluginConvertPixelFormat
OrthancPluginImage * OrthancPluginConvertPixelFormat(OrthancPluginContext *context, const OrthancPluginImage *source, OrthancPluginPixelFormat targetFormat)
Change the pixel format of an image.
Definition: OrthancCPlugin.h:3778
OrthancPluginRestApiPut
OrthancPluginErrorCode OrthancPluginRestApiPut(OrthancPluginContext *context, OrthancPluginMemoryBuffer *target, const char *uri, const char *body, uint32_t bodySize)
Make a PUT call to the built-in Orthanc REST API.
Definition: OrthancCPlugin.h:1809
OrthancPluginDicomToJsonFlags_ConvertBinaryToNull
@ OrthancPluginDicomToJsonFlags_ConvertBinaryToNull
Definition: OrthancCPlugin.h:728
OrthancPluginErrorCode_CannotExecuteLua
@ OrthancPluginErrorCode_CannotExecuteLua
Definition: OrthancCPlugin.h:274
OrthancPluginGetInstanceOrigin
OrthancPluginInstanceOrigin OrthancPluginGetInstanceOrigin(OrthancPluginContext *context, OrthancPluginDicomInstance *instance)
Get the origin of a DICOM file.
Definition: OrthancCPlugin.h:4621
OrthancPluginCheckVersion
int OrthancPluginCheckVersion(OrthancPluginContext *context)
Check the compatibility of the plugin wrt. the version of its hosting Orthanc.
Definition: OrthancCPlugin.h:1237
OrthancPluginErrorCode_NoWorklistHandler
@ OrthancPluginErrorCode_NoWorklistHandler
Definition: OrthancCPlugin.h:284
OrthancPluginGetFindQuerySize
uint32_t OrthancPluginGetFindQuerySize(OrthancPluginContext *context, const OrthancPluginFindQuery *query)
Get the number of tags in a C-Find query.
Definition: OrthancCPlugin.h:5296
OrthancPluginCompressionType_Gzip
@ OrthancPluginCompressionType_Gzip
Definition: OrthancCPlugin.h:641
OrthancPluginExtendOrthancExplorer
void OrthancPluginExtendOrthancExplorer(OrthancPluginContext *context, const char *javascript)
Extend the JavaScript code of Orthanc Explorer.
Definition: OrthancCPlugin.h:2712
OrthancPluginDicomToJsonFlags_ConvertBinaryToAscii
@ OrthancPluginDicomToJsonFlags_ConvertBinaryToAscii
Definition: OrthancCPlugin.h:727
OrthancPluginErrorCode_SQLiteBindOutOfRange
@ OrthancPluginErrorCode_SQLiteBindOutOfRange
Definition: OrthancCPlugin.h:238
OrthancPluginRegisterOnStoredInstanceCallback
void OrthancPluginRegisterOnStoredInstanceCallback(OrthancPluginContext *context, OrthancPluginOnStoredInstanceCallback callback)
Register a callback for received instances.
Definition: OrthancCPlugin.h:1467
OrthancPluginValueRepresentation_AS
@ OrthancPluginValueRepresentation_AS
Definition: OrthancCPlugin.h:669
OrthancPluginValueRepresentation_UT
@ OrthancPluginValueRepresentation_UT
Definition: OrthancCPlugin.h:694
OrthancPluginErrorCode_SystemCommand
@ OrthancPluginErrorCode_SystemCommand
Definition: OrthancCPlugin.h:201
OrthancPluginContext
struct _OrthancPluginContext_t OrthancPluginContext
Data structure that contains information about the Orthanc core.
OrthancPluginErrorCode_NotEnoughMemory
@ OrthancPluginErrorCode_NotEnoughMemory
Definition: OrthancCPlugin.h:195
OrthancPluginChangeType_UpdatedAttachment
@ OrthancPluginChangeType_UpdatedAttachment
Definition: OrthancCPlugin.h:626
OrthancPluginSendHttpStatus
void OrthancPluginSendHttpStatus(OrthancPluginContext *context, OrthancPluginRestOutput *output, uint16_t status, const char *body, uint32_t bodySize)
Send a HTTP status, with a custom body.
Definition: OrthancCPlugin.h:3180
OrthancPluginInstanceOrigin_Plugin
@ OrthancPluginInstanceOrigin_Plugin
Definition: OrthancCPlugin.h:772
OrthancPluginGetOrthancDirectory
char * OrthancPluginGetOrthancDirectory(OrthancPluginContext *context)
Return the directory containing the Orthanc.
Definition: OrthancCPlugin.h:2560
OrthancPluginDicomToJsonFlags_IncludePrivateTags
@ OrthancPluginDicomToJsonFlags_IncludePrivateTags
Definition: OrthancCPlugin.h:724
OrthancPluginPixelFormat_RGBA32
@ OrthancPluginPixelFormat_RGBA32
Color image in RGBA32 format.
Definition: OrthancCPlugin.h:569
OrthancPluginRegisterFindCallback
OrthancPluginErrorCode OrthancPluginRegisterFindCallback(OrthancPluginContext *context, OrthancPluginFindCallback callback)
Register a callback to handle C-Find requests.
Definition: OrthancCPlugin.h:5204
OrthancPluginChangeType_StableStudy
@ OrthancPluginChangeType_StableStudy
Definition: OrthancCPlugin.h:623
OrthancPluginRestApiDelete
OrthancPluginErrorCode OrthancPluginRestApiDelete(OrthancPluginContext *context, const char *uri)
Make a DELETE call to the built-in Orthanc REST API.
Definition: OrthancCPlugin.h:1761
OrthancPluginValueRepresentation_FD
@ OrthancPluginValueRepresentation_FD
Definition: OrthancCPlugin.h:675
OrthancPluginErrorCode_Unauthorized
@ OrthancPluginErrorCode_Unauthorized
Definition: OrthancCPlugin.h:220
OrthancPluginErrorCode_CreateDicomNoPayload
@ OrthancPluginErrorCode_CreateDicomNoPayload
Definition: OrthancCPlugin.h:265
OrthancPluginErrorCode_InexistentTag
@ OrthancPluginErrorCode_InexistentTag
Definition: OrthancCPlugin.h:212
OrthancPluginComputeSha1
char * OrthancPluginComputeSha1(OrthancPluginContext *context, const void *buffer, uint32_t size)
Compute a SHA-1 hash.
Definition: OrthancCPlugin.h:4911
OrthancPluginErrorCode_CreateDicomUseContent
@ OrthancPluginErrorCode_CreateDicomUseContent
Definition: OrthancCPlugin.h:264
OrthancPluginErrorCode_Timeout
@ OrthancPluginErrorCode_Timeout
Definition: OrthancCPlugin.h:207
OrthancPluginResourceType_Patient
@ OrthancPluginResourceType_Patient
Definition: OrthancCPlugin.h:597
OrthancPluginErrorCode_JsonToLuaTable
@ OrthancPluginErrorCode_JsonToLuaTable
Definition: OrthancCPlugin.h:272
OrthancPluginErrorCode_LuaReturnsNoString
@ OrthancPluginErrorCode_LuaReturnsNoString
Definition: OrthancCPlugin.h:278
OrthancPluginDictionaryEntry::group
uint16_t group
Definition: OrthancCPlugin.h:1196
OrthancPluginCreateDicomFlags_DecodeDataUriScheme
@ OrthancPluginCreateDicomFlags_DecodeDataUriScheme
Definition: OrthancCPlugin.h:742
OrthancPluginCreateImage
OrthancPluginImage * OrthancPluginCreateImage(OrthancPluginContext *context, OrthancPluginPixelFormat format, uint32_t width, uint32_t height)
Create an image.
Definition: OrthancCPlugin.h:4741
OrthancPluginLookupSeries
char * OrthancPluginLookupSeries(OrthancPluginContext *context, const char *seriesUID)
Look for a series.
Definition: OrthancCPlugin.h:2016
OrthancPluginChangeType_OrthancStopped
@ OrthancPluginChangeType_OrthancStopped
Definition: OrthancCPlugin.h:625
OrthancPluginErrorCode_LuaAlreadyExecuted
@ OrthancPluginErrorCode_LuaAlreadyExecuted
Definition: OrthancCPlugin.h:275
OrthancPluginDicomToJsonFlags
OrthancPluginDicomToJsonFlags
Definition: OrthancCPlugin.h:721
OrthancPluginErrorCode_SQLiteCannotStep
@ OrthancPluginErrorCode_SQLiteCannotStep
Definition: OrthancCPlugin.h:237
OrthancPluginCompressAndAnswerJpegImage
void OrthancPluginCompressAndAnswerJpegImage(OrthancPluginContext *context, OrthancPluginRestOutput *output, OrthancPluginPixelFormat format, uint32_t width, uint32_t height, uint32_t pitch, const void *buffer, uint8_t quality)
Answer to a REST request with a JPEG image.
Definition: OrthancCPlugin.h:3573
OrthancPluginValueRepresentation_ST
@ OrthancPluginValueRepresentation_ST
Definition: OrthancCPlugin.h:688
OrthancPluginImageFormat
OrthancPluginImageFormat
Definition: OrthancCPlugin.h:653
OrthancPluginStorageAreaRead
OrthancPluginErrorCode OrthancPluginStorageAreaRead(OrthancPluginContext *context, OrthancPluginMemoryBuffer *target, OrthancPluginStorageArea *storageArea, const char *uuid, OrthancPluginContentType type)
Read a file from the storage area.
Definition: OrthancCPlugin.h:4032
OrthancPluginRegisterDecodeImageCallback
OrthancPluginErrorCode OrthancPluginRegisterDecodeImageCallback(OrthancPluginContext *context, OrthancPluginDecodeImageCallback callback)
Register a callback to handle the decoding of DICOM images.
Definition: OrthancCPlugin.h:4703
OrthancPluginErrorCode_SQLiteCannotOpen
@ OrthancPluginErrorCode_SQLiteCannotOpen
Definition: OrthancCPlugin.h:229
OrthancPluginChangeType_CompletedSeries
@ OrthancPluginChangeType_CompletedSeries
Definition: OrthancCPlugin.h:614
OrthancPluginErrorCode_SQLiteFlush
@ OrthancPluginErrorCode_SQLiteFlush
Definition: OrthancCPlugin.h:235
OrthancPluginErrorCode_SQLiteExecute
@ OrthancPluginErrorCode_SQLiteExecute
Definition: OrthancCPlugin.h:231
OrthancPluginHttpRequest
The parameters of a REST request.
Definition: OrthancCPlugin.h:317
OrthancPluginInstanceOrigin_Unknown
@ OrthancPluginInstanceOrigin_Unknown
Definition: OrthancCPlugin.h:769
OrthancPluginValueRepresentation_DA
@ OrthancPluginValueRepresentation_DA
Definition: OrthancCPlugin.h:672
OrthancPluginGetInstanceRemoteAet
const char * OrthancPluginGetInstanceRemoteAet(OrthancPluginContext *context, OrthancPluginDicomInstance *instance)
Get the AET of a DICOM instance.
Definition: OrthancCPlugin.h:2233
OrthancPluginIdentifierConstraint_SmallerOrEqual
@ OrthancPluginIdentifierConstraint_SmallerOrEqual
Definition: OrthancCPlugin.h:756
OrthancPluginGetImageWidth
uint32_t OrthancPluginGetImageWidth(OrthancPluginContext *context, const OrthancPluginImage *image)
Return the width of an image.
Definition: OrthancCPlugin.h:3249
OrthancPluginGetMoveSize
uint32_t(* OrthancPluginGetMoveSize)(void *moveDriver)
Callback to read the size of a C-Move driver.
Definition: OrthancCPlugin.h:1145
OrthancPluginErrorCode_InternalError
@ OrthancPluginErrorCode_InternalError
Definition: OrthancCPlugin.h:190
OrthancPluginChangeType_NewChildInstance
@ OrthancPluginChangeType_NewChildInstance
Definition: OrthancCPlugin.h:616
OrthancPluginApplyMove
OrthancPluginErrorCode(* OrthancPluginApplyMove)(void *moveDriver)
Callback to apply one C-Move suboperation.
Definition: OrthancCPlugin.h:1159
OrthancPluginGetImagePitch
uint32_t OrthancPluginGetImagePitch(OrthancPluginContext *context, const OrthancPluginImage *image)
Return the pitch of an image.
Definition: OrthancCPlugin.h:3317
OrthancPluginErrorCode_BadApplicationEntityTitle
@ OrthancPluginErrorCode_BadApplicationEntityTitle
Definition: OrthancCPlugin.h:252
OrthancPluginGetInstanceJson
char * OrthancPluginGetInstanceJson(OrthancPluginContext *context, OrthancPluginDicomInstance *instance)
Get the DICOM tag hierarchy as a JSON file.
Definition: OrthancCPlugin.h:2335
OrthancPluginErrorCode_NoCMoveHandler
@ OrthancPluginErrorCode_NoCMoveHandler
Definition: OrthancCPlugin.h:254
OrthancPluginErrorCode_SQLiteCannotRun
@ OrthancPluginErrorCode_SQLiteCannotRun
Definition: OrthancCPlugin.h:236
OrthancPluginDicomToJsonFlags_IncludeBinary
@ OrthancPluginDicomToJsonFlags_IncludeBinary
Definition: OrthancCPlugin.h:723
OrthancPluginHttpRequest::groups
const char *const * groups
The matched values for the groups of the regular expression.
Definition: OrthancCPlugin.h:331
OrthancPluginRegisterWorklistCallback
OrthancPluginErrorCode OrthancPluginRegisterWorklistCallback(OrthancPluginContext *context, OrthancPluginWorklistCallback callback)
Register a callback to handle modality worklists requests.
Definition: OrthancCPlugin.h:4452
OrthancPluginCreateDicomFlags_GenerateIdentifiers
@ OrthancPluginCreateDicomFlags_GenerateIdentifiers
Definition: OrthancCPlugin.h:743
OrthancPluginErrorCode_SQLitePrepareStatement
@ OrthancPluginErrorCode_SQLitePrepareStatement
Definition: OrthancCPlugin.h:239
OrthancPluginRestCallback
OrthancPluginErrorCode(* OrthancPluginRestCallback)(OrthancPluginRestOutput *output, const char *url, const OrthancPluginHttpRequest *request)
Signature of a callback function that answers to a REST request.
Definition: OrthancCPlugin.h:877
OrthancPluginHttpRequest::bodySize
uint32_t bodySize
For a PUT or POST request, the number of bytes of the body.
Definition: OrthancCPlugin.h:356
OrthancPluginReconstructMainDicomTags
OrthancPluginErrorCode OrthancPluginReconstructMainDicomTags(OrthancPluginContext *context, OrthancPluginStorageArea *storageArea, OrthancPluginResourceType level)
Reconstruct the main DICOM tags.
Definition: OrthancCPlugin.h:4263
OrthancPluginLookupDictionary
OrthancPluginErrorCode OrthancPluginLookupDictionary(OrthancPluginContext *context, OrthancPluginDictionaryEntry *target, const char *name)
Get information about the given DICOM tag.
Definition: OrthancCPlugin.h:4957
OrthancPluginDicomBufferToJson
char * OrthancPluginDicomBufferToJson(OrthancPluginContext *context, const void *buffer, uint32_t size, OrthancPluginDicomToJsonFormat format, OrthancPluginDicomToJsonFlags flags, uint32_t maxStringLength)
Format a DICOM memory buffer as a JSON string.
Definition: OrthancCPlugin.h:4307
OrthancPluginGetConfigurationPath
char * OrthancPluginGetConfigurationPath(OrthancPluginContext *context)
Return the path to the configuration file(s).
Definition: OrthancCPlugin.h:2595
OrthancPluginHttpDelete
OrthancPluginErrorCode OrthancPluginHttpDelete(OrthancPluginContext *context, const char *url, const char *username, const char *password)
Issue a HTTP DELETE call.
Definition: OrthancCPlugin.h:3740
OrthancPluginCompressionType
OrthancPluginCompressionType
Definition: OrthancCPlugin.h:638
OrthancPluginDictionaryEntry::minMultiplicity
uint32_t minMultiplicity
Definition: OrthancCPlugin.h:1199
OrthancPluginErrorCode_InexistentFile
@ OrthancPluginErrorCode_InexistentFile
Definition: OrthancCPlugin.h:204
OrthancPluginErrorCode_ParameterOutOfRange
@ OrthancPluginErrorCode_ParameterOutOfRange
Definition: OrthancCPlugin.h:194
OrthancPluginContentType_Dicom
@ OrthancPluginContentType_Dicom
Definition: OrthancCPlugin.h:584
OrthancPluginErrorCode_UnknownResource
@ OrthancPluginErrorCode_UnknownResource
Definition: OrthancCPlugin.h:208
OrthancPluginErrorCode_DirectoryExpected
@ OrthancPluginErrorCode_DirectoryExpected
Definition: OrthancCPlugin.h:245
OrthancPluginResourceType_Instance
@ OrthancPluginResourceType_Instance
Definition: OrthancCPlugin.h:600
OrthancPluginRegisterIncomingHttpRequestFilter
OrthancPluginErrorCode OrthancPluginRegisterIncomingHttpRequestFilter(OrthancPluginContext *context, OrthancPluginIncomingHttpRequestFilter callback)
Register a callback to filter incoming HTTP requests.
Definition: OrthancCPlugin.h:5038
OrthancPluginErrorCode_Success
@ OrthancPluginErrorCode_Success
Definition: OrthancCPlugin.h:191
OrthancPluginCompressPngImage
OrthancPluginErrorCode OrthancPluginCompressPngImage(OrthancPluginContext *context, OrthancPluginMemoryBuffer *target, OrthancPluginPixelFormat format, uint32_t width, uint32_t height, uint32_t pitch, const void *buffer)
Encode a PNG image.
Definition: OrthancCPlugin.h:3481
OrthancPluginErrorCode_MakeDirectory
@ OrthancPluginErrorCode_MakeDirectory
Definition: OrthancCPlugin.h:251
OrthancPluginChangeType_NewInstance
@ OrthancPluginChangeType_NewInstance
Definition: OrthancCPlugin.h:617
OrthancPluginDrawText
OrthancPluginErrorCode OrthancPluginDrawText(OrthancPluginContext *context, OrthancPluginImage *image, uint32_t fontIndex, const char *utf8Text, int32_t x, int32_t y, uint8_t r, uint8_t g, uint8_t b)
Draw text on an image.
Definition: OrthancCPlugin.h:3938
OrthancPluginResourceType_None
@ OrthancPluginResourceType_None
Definition: OrthancCPlugin.h:601
OrthancPluginErrorCode_CannotStoreInstance
@ OrthancPluginErrorCode_CannotStoreInstance
Definition: OrthancCPlugin.h:261
OrthancPluginHttpMethod_Get
@ OrthancPluginHttpMethod_Get
Definition: OrthancCPlugin.h:303
OrthancPluginCreateDicomFlags
OrthancPluginCreateDicomFlags
Definition: OrthancCPlugin.h:740
OrthancPluginPixelFormat_Grayscale8
@ OrthancPluginPixelFormat_Grayscale8
Graylevel 8bpp image.
Definition: OrthancCPlugin.h:537
OrthancPluginStorageArea
struct _OrthancPluginStorageArea_t OrthancPluginStorageArea
Opaque structure that represents the storage area that is actually used by Orthanc.
Definition: OrthancCPlugin.h:829
OrthancPluginWorklistGetDicomQuery
OrthancPluginErrorCode OrthancPluginWorklistGetDicomQuery(OrthancPluginContext *context, OrthancPluginMemoryBuffer *target, const OrthancPluginWorklistQuery *query)
Retrieve the worklist query as a DICOM file.
Definition: OrthancCPlugin.h:4595
OrthancPluginWorklistMarkIncomplete
OrthancPluginErrorCode OrthancPluginWorklistMarkIncomplete(OrthancPluginContext *context, OrthancPluginWorklistAnswers *answers)
Mark the set of worklist answers as incomplete.
Definition: OrthancCPlugin.h:4518
OrthancPluginSendHttpStatusCode
void OrthancPluginSendHttpStatusCode(OrthancPluginContext *context, OrthancPluginRestOutput *output, uint16_t status)
Send a HTTP status code.
Definition: OrthancCPlugin.h:2096
OrthancPluginIdentifierConstraint
OrthancPluginIdentifierConstraint
Definition: OrthancCPlugin.h:754
OrthancPluginRestApiDeleteAfterPlugins
OrthancPluginErrorCode OrthancPluginRestApiDeleteAfterPlugins(OrthancPluginContext *context, const char *uri)
Make a DELETE call to the REST API, as tainted by the plugins.
Definition: OrthancCPlugin.h:1784
OrthancPluginWorklistAddAnswer
OrthancPluginErrorCode OrthancPluginWorklistAddAnswer(OrthancPluginContext *context, OrthancPluginWorklistAnswers *answers, const OrthancPluginWorklistQuery *query, const void *dicom, uint32_t size)
Add one answer to some modality worklist request.
Definition: OrthancCPlugin.h:4488
OrthancPluginPixelFormat_Unknown
@ OrthancPluginPixelFormat_Unknown
Definition: OrthancCPlugin.h:571
OrthancPluginValueRepresentation_LO
@ OrthancPluginValueRepresentation_LO
Definition: OrthancCPlugin.h:678
OrthancPluginRegisterIncomingHttpRequestFilter2
OrthancPluginErrorCode OrthancPluginRegisterIncomingHttpRequestFilter2(OrthancPluginContext *context, OrthancPluginIncomingHttpRequestFilter2 callback)
Register a callback to filter incoming HTTP requests.
Definition: OrthancCPlugin.h:5602
OrthancPluginValueRepresentation_AE
@ OrthancPluginValueRepresentation_AE
Definition: OrthancCPlugin.h:668
OrthancPluginRestApiGet2
OrthancPluginErrorCode OrthancPluginRestApiGet2(OrthancPluginContext *context, OrthancPluginMemoryBuffer *target, const char *uri, uint32_t headersCount, const char *const *headersKeys, const char *const *headersValues, int32_t afterPlugins)
Make a GET call to the Orthanc REST API, with custom HTTP headers.
Definition: OrthancCPlugin.h:4414
OrthancPluginResourceType
OrthancPluginResourceType
Definition: OrthancCPlugin.h:596
OrthancPluginCreateFindMatcher
OrthancPluginFindMatcher * OrthancPluginCreateFindMatcher(OrthancPluginContext *context, const void *query, uint32_t size)
Create a C-Find matcher.
Definition: OrthancCPlugin.h:5489
OrthancPluginErrorCode_NoSopClassOrInstance
@ OrthancPluginErrorCode_NoSopClassOrInstance
Definition: OrthancCPlugin.h:257
OrthancPluginValueRepresentation_AT
@ OrthancPluginValueRepresentation_AT
Definition: OrthancCPlugin.h:670
OrthancPluginReadFile
OrthancPluginErrorCode OrthancPluginReadFile(OrthancPluginContext *context, OrthancPluginMemoryBuffer *target, const char *path)
Read a file.
Definition: OrthancCPlugin.h:3065
OrthancPluginOnChangeCallback
OrthancPluginErrorCode(* OrthancPluginOnChangeCallback)(OrthancPluginChangeType changeType, OrthancPluginResourceType resourceType, const char *resourceId)
Signature of a callback function that is triggered when a change happens to some DICOM resource.
Definition: OrthancCPlugin.h:898
OrthancPluginInstanceOrigin_RestApi
@ OrthancPluginInstanceOrigin_RestApi
Definition: OrthancCPlugin.h:771
OrthancPluginErrorCode_NoApplicationEntityFilter
@ OrthancPluginErrorCode_NoApplicationEntityFilter
Definition: OrthancCPlugin.h:256
OrthancPluginLookupStudyWithAccessionNumber
char * OrthancPluginLookupStudyWithAccessionNumber(OrthancPluginContext *context, const char *accessionNumber)
Look for a study, using the accession number.
Definition: OrthancCPlugin.h:1981
OrthancPluginCompressionType_ZlibWithSize
@ OrthancPluginCompressionType_ZlibWithSize
Definition: OrthancCPlugin.h:640
OrthancPluginGetCommandLineArgumentsCount
uint32_t OrthancPluginGetCommandLineArgumentsCount(OrthancPluginContext *context)
Get the number of command-line arguments.
Definition: OrthancCPlugin.h:2816
OrthancPluginErrorCode_ReadOnly
@ OrthancPluginErrorCode_ReadOnly
Definition: OrthancCPlugin.h:213
OrthancPluginErrorCode_SQLiteTransactionAlreadyStarted
@ OrthancPluginErrorCode_SQLiteTransactionAlreadyStarted
Definition: OrthancCPlugin.h:240
OrthancPluginValueRepresentation_TM
@ OrthancPluginValueRepresentation_TM
Definition: OrthancCPlugin.h:689
OrthancPluginErrorCode_StorageAreaPlugin
@ OrthancPluginErrorCode_StorageAreaPlugin
Definition: OrthancCPlugin.h:223
OrthancPluginImageFormat_Jpeg
@ OrthancPluginImageFormat_Jpeg
Definition: OrthancCPlugin.h:655
OrthancPluginErrorCode_BadRequest
@ OrthancPluginErrorCode_BadRequest
Definition: OrthancCPlugin.h:199
OrthancPluginRestApiGet
OrthancPluginErrorCode OrthancPluginRestApiGet(OrthancPluginContext *context, OrthancPluginMemoryBuffer *target, const char *uri)
Make a GET call to the built-in Orthanc REST API.
Definition: OrthancCPlugin.h:1630
OrthancPluginGetFindQueryValue
char * OrthancPluginGetFindQueryValue(OrthancPluginContext *context, const OrthancPluginFindQuery *query, uint32_t index)
Get the value associated with one tag in a C-Find query.
Definition: OrthancCPlugin.h:5402
OrthancPluginRestOutput
struct _OrthancPluginRestOutput_t OrthancPluginRestOutput
Opaque structure that represents the HTTP connection to the client application.
Definition: OrthancCPlugin.h:806
OrthancPluginFindAnswers
struct _OrthancPluginFindAnswers_t OrthancPluginFindAnswers
Opaque structure to an object that represents the answers to a C-Find query for worklists.
Definition: OrthancCPlugin.h:861
OrthancPluginFreeMove
void(* OrthancPluginFreeMove)(void *moveDriver)
Callback to free one C-Move driver.
Definition: OrthancCPlugin.h:1172
OrthancPluginCompressionType_Zlib
@ OrthancPluginCompressionType_Zlib
Definition: OrthancCPlugin.h:639
OrthancPluginErrorCode_NoCStoreHandler
@ OrthancPluginErrorCode_NoCStoreHandler
Definition: OrthancCPlugin.h:255
OrthancPluginErrorCode_CreateDicomParentEncoding
@ OrthancPluginErrorCode_CreateDicomParentEncoding
Definition: OrthancCPlugin.h:269
OrthancPluginDicomToJsonFormat_Short
@ OrthancPluginDicomToJsonFormat_Short
Definition: OrthancCPlugin.h:708
OrthancPluginLogError
void OrthancPluginLogError(OrthancPluginContext *context, const char *message)
Log an error.
Definition: OrthancCPlugin.h:1342
OrthancPluginCompressAndAnswerPngImage
void OrthancPluginCompressAndAnswerPngImage(OrthancPluginContext *context, OrthancPluginRestOutput *output, OrthancPluginPixelFormat format, uint32_t width, uint32_t height, uint32_t pitch, const void *buffer)
Answer to a REST request with a PNG image.
Definition: OrthancCPlugin.h:1556
OrthancPluginGetInstanceSize
int64_t OrthancPluginGetInstanceSize(OrthancPluginContext *context, OrthancPluginDicomInstance *instance)
Get the size of a DICOM file.
Definition: OrthancCPlugin.h:2266
OrthancPluginValueRepresentation_SL
@ OrthancPluginValueRepresentation_SL
Definition: OrthancCPlugin.h:685
OrthancPluginErrorCode_DicomFindUnavailable
@ OrthancPluginErrorCode_DicomFindUnavailable
Definition: OrthancCPlugin.h:259
OrthancPluginErrorCode_InexistentItem
@ OrthancPluginErrorCode_InexistentItem
Definition: OrthancCPlugin.h:198
OrthancPluginDicomToJsonFormat
OrthancPluginDicomToJsonFormat
Definition: OrthancCPlugin.h:706
OrthancPluginErrorCode_IncompatibleDatabaseVersion
@ OrthancPluginErrorCode_IncompatibleDatabaseVersion
Definition: OrthancCPlugin.h:209
OrthancPluginErrorCode_AlreadyExistingTag
@ OrthancPluginErrorCode_AlreadyExistingTag
Definition: OrthancCPlugin.h:285
OrthancPluginErrorCode_CreateDicomNotString
@ OrthancPluginErrorCode_CreateDicomNotString
Definition: OrthancCPlugin.h:262
OrthancPluginErrorCode_BadFont
@ OrthancPluginErrorCode_BadFont
Definition: OrthancCPlugin.h:221
OrthancPluginErrorCode_IncompatibleImageSize
@ OrthancPluginErrorCode_IncompatibleImageSize
Definition: OrthancCPlugin.h:215
OrthancPluginErrorCode_SQLiteTransactionCommit
@ OrthancPluginErrorCode_SQLiteTransactionCommit
Definition: OrthancCPlugin.h:241
OrthancPluginHttpMethod_Post
@ OrthancPluginHttpMethod_Post
Definition: OrthancCPlugin.h:304
OrthancPluginErrorCode_UnknownPluginService
@ OrthancPluginErrorCode_UnknownPluginService
Definition: OrthancCPlugin.h:217
OrthancPluginErrorCode_CorruptedFile
@ OrthancPluginErrorCode_CorruptedFile
Definition: OrthancCPlugin.h:211
OrthancPluginGetFindQueryTag
OrthancPluginErrorCode OrthancPluginGetFindQueryTag(OrthancPluginContext *context, uint16_t *group, uint16_t *element, const OrthancPluginFindQuery *query, uint32_t index)
Get one tag in a C-Find query.
Definition: OrthancCPlugin.h:5333
OrthancPluginIncomingHttpRequestFilter
int32_t(* OrthancPluginIncomingHttpRequestFilter)(OrthancPluginHttpMethod method, const char *uri, const char *ip, uint32_t headersCount, const char *const *headersKeys, const char *const *headersValues)
Callback to filter incoming HTTP requests received by Orthanc.
Definition: OrthancCPlugin.h:1020
OrthancPluginChangeType_StableSeries
@ OrthancPluginChangeType_StableSeries
Definition: OrthancCPlugin.h:622
OrthancPluginGetOrthancPath
char * OrthancPluginGetOrthancPath(OrthancPluginContext *context)
Return the path to the Orthanc executable.
Definition: OrthancCPlugin.h:2530
OrthancPluginStorageCreate
OrthancPluginErrorCode(* OrthancPluginStorageCreate)(const char *uuid, const void *content, int64_t size, OrthancPluginContentType type)
Callback for writing to the storage area.
Definition: OrthancCPlugin.h:936
OrthancPluginContentType
OrthancPluginContentType
Definition: OrthancCPlugin.h:582
OrthancPluginGenerateUuid
char * OrthancPluginGenerateUuid(OrthancPluginContext *context)
Generate an UUID.
Definition: OrthancCPlugin.h:5165
OrthancPluginValueRepresentation_LT
@ OrthancPluginValueRepresentation_LT
Definition: OrthancCPlugin.h:679
OrthancPluginFreeMemoryBuffer
void OrthancPluginFreeMemoryBuffer(OrthancPluginContext *context, OrthancPluginMemoryBuffer *buffer)
Free a memory buffer.
Definition: OrthancCPlugin.h:1326
OrthancPluginSendMultipartItem
OrthancPluginErrorCode OrthancPluginSendMultipartItem(OrthancPluginContext *context, OrthancPluginRestOutput *output, const char *answer, uint32_t answerSize)
Send an item as a part of some HTTP multipart answer.
Definition: OrthancCPlugin.h:2986
OrthancPluginHttpRequest::headersCount
uint32_t headersCount
The number of HTTP headers.
Definition: OrthancCPlugin.h:366
OrthancPluginInstanceOrigin_Lua
@ OrthancPluginInstanceOrigin_Lua
Definition: OrthancCPlugin.h:773
OrthancPluginMoveCallback
void *(* OrthancPluginMoveCallback)(OrthancPluginResourceType resourceType, const char *patientId, const char *accessionNumber, const char *studyInstanceUid, const char *seriesInstanceUid, const char *sopInstanceUid, const char *originatorAet, const char *sourceAet, const char *targetAet, uint16_t originatorId)
Callback to handle incoming C-Move SCP requests.
Definition: OrthancCPlugin.h:1121
OrthancPluginGetInstanceData
const char * OrthancPluginGetInstanceData(OrthancPluginContext *context, OrthancPluginDicomInstance *instance)
Get the data of a DICOM file.
Definition: OrthancCPlugin.h:2299
OrthancPluginSetRootUri
void OrthancPluginSetRootUri(OrthancPluginContext *context, const char *uri)
Set the URI where the plugin provides its Web interface.
Definition: OrthancCPlugin.h:2668
OrthancPluginCompressionType_GzipWithSize
@ OrthancPluginCompressionType_GzipWithSize
Definition: OrthancCPlugin.h:642
OrthancPluginStartMultipartAnswer
OrthancPluginErrorCode OrthancPluginStartMultipartAnswer(OrthancPluginContext *context, OrthancPluginRestOutput *output, const char *subType, const char *contentType)
Start an HTTP multipart answer.
Definition: OrthancCPlugin.h:2957
OrthancPluginErrorCode_CannotOrderSlices
@ OrthancPluginErrorCode_CannotOrderSlices
Definition: OrthancCPlugin.h:283
OrthancPluginGetImageBuffer
void * OrthancPluginGetImageBuffer(OrthancPluginContext *context, const OrthancPluginImage *image)
Return a pointer to the content of an image.
Definition: OrthancCPlugin.h:3351
OrthancPluginStorageRemove
OrthancPluginErrorCode(* OrthancPluginStorageRemove)(const char *uuid, OrthancPluginContentType type)
Callback for removing a file from the storage area.
Definition: OrthancCPlugin.h:974
OrthancPluginErrorCode_SQLiteTransactionBegin
@ OrthancPluginErrorCode_SQLiteTransactionBegin
Definition: OrthancCPlugin.h:242
OrthancPluginErrorCode_BadJobOrdering
@ OrthancPluginErrorCode_BadJobOrdering
Definition: OrthancCPlugin.h:271
OrthancPluginHttpRequest::headersValues
const char *const * headersValues
The values of the HTTP headers.
Definition: OrthancCPlugin.h:376
OrthancPluginRestApiPostAfterPlugins
OrthancPluginErrorCode OrthancPluginRestApiPostAfterPlugins(OrthancPluginContext *context, OrthancPluginMemoryBuffer *target, const char *uri, const char *body, uint32_t bodySize)
Make a POST call to the REST API, as tainted by the plugins.
Definition: OrthancCPlugin.h:1732
OrthancPluginValueRepresentation_DS
@ OrthancPluginValueRepresentation_DS
Definition: OrthancCPlugin.h:673
OrthancPluginInstanceOrigin
OrthancPluginInstanceOrigin
Definition: OrthancCPlugin.h:768
OrthancPluginErrorCode_CreateDicomOverrideTag
@ OrthancPluginErrorCode_CreateDicomOverrideTag
Definition: OrthancCPlugin.h:263
OrthancPluginGetFontsCount
uint32_t OrthancPluginGetFontsCount(OrthancPluginContext *context)
Return the number of available fonts.
Definition: OrthancCPlugin.h:3813
OrthancPluginChangeType_StablePatient
@ OrthancPluginChangeType_StablePatient
Definition: OrthancCPlugin.h:621
OrthancPluginFindQuery
struct _OrthancPluginFindQuery_t OrthancPluginFindQuery
Opaque structure to an object that represents a C-Find query.
Definition: OrthancCPlugin.h:853
OrthancPluginGetInstanceSimplifiedJson
char * OrthancPluginGetInstanceSimplifiedJson(OrthancPluginContext *context, OrthancPluginDicomInstance *instance)
Get the DICOM tag hierarchy as a JSON file (with simplification).
Definition: OrthancCPlugin.h:2373
OrthancPluginGetExpectedDatabaseVersion
uint32_t OrthancPluginGetExpectedDatabaseVersion(OrthancPluginContext *context)
Get the expected version of the database schema.
Definition: OrthancCPlugin.h:2883
OrthancPluginRegisterOnChangeCallback
void OrthancPluginRegisterOnChangeCallback(OrthancPluginContext *context, OrthancPluginOnChangeCallback callback)
Register a callback to monitor changes.
Definition: OrthancCPlugin.h:2637
OrthancPluginChangeType_OrthancStarted
@ OrthancPluginChangeType_OrthancStarted
Definition: OrthancCPlugin.h:624
OrthancPluginChangeType_NewSeries
@ OrthancPluginChangeType_NewSeries
Definition: OrthancCPlugin.h:619
OrthancPluginDicomToJsonFormat_Human
@ OrthancPluginDicomToJsonFormat_Human
Definition: OrthancCPlugin.h:709
OrthancPluginIdentifierConstraint_GreaterOrEqual
@ OrthancPluginIdentifierConstraint_GreaterOrEqual
Definition: OrthancCPlugin.h:757
OrthancPluginValueRepresentation
OrthancPluginValueRepresentation
Definition: OrthancCPlugin.h:667
OrthancPluginErrorCode_CannotWriteFile
@ OrthancPluginErrorCode_CannotWriteFile
Definition: OrthancCPlugin.h:205
OrthancPluginDictionaryEntry::maxMultiplicity
uint32_t maxMultiplicity
Definition: OrthancCPlugin.h:1200
OrthancPluginIdentifierConstraint_Equal
@ OrthancPluginIdentifierConstraint_Equal
Definition: OrthancCPlugin.h:755
OrthancPluginHttpPost
OrthancPluginErrorCode OrthancPluginHttpPost(OrthancPluginContext *context, OrthancPluginMemoryBuffer *target, const char *url, const char *body, uint32_t bodySize, const char *username, const char *password)
Issue a HTTP POST call.
Definition: OrthancCPlugin.h:3662
OrthancPluginGetInstanceMetadata
const char * OrthancPluginGetInstanceMetadata(OrthancPluginContext *context, OrthancPluginDicomInstance *instance, const char *metadata)
Get the value of some metadata associated with a given DICOM instance.
Definition: OrthancCPlugin.h:2450
OrthancPluginErrorCode_Database
@ OrthancPluginErrorCode_Database
Definition: OrthancCPlugin.h:202
OrthancPluginErrorCode_DirectoryOverFile
@ OrthancPluginErrorCode_DirectoryOverFile
Definition: OrthancCPlugin.h:243
OrthancPluginCreateDicom
OrthancPluginErrorCode OrthancPluginCreateDicom(OrthancPluginContext *context, OrthancPluginMemoryBuffer *target, const char *json, const OrthancPluginImage *pixelData, OrthancPluginCreateDicomFlags flags)
Create a DICOM instance from a JSON string and an image.
Definition: OrthancCPlugin.h:4670
OrthancPluginErrorCode_DatabaseBackendAlreadyRegistered
@ OrthancPluginErrorCode_DatabaseBackendAlreadyRegistered
Definition: OrthancCPlugin.h:280
OrthancPluginGetFontSize
uint32_t OrthancPluginGetFontSize(OrthancPluginContext *context, uint32_t fontIndex)
Return the size of a font.
Definition: OrthancCPlugin.h:3885
OrthancPluginGetErrorDescription
const char * OrthancPluginGetErrorDescription(OrthancPluginContext *context, OrthancPluginErrorCode error)
Get the description of a given error code.
Definition: OrthancCPlugin.h:3127
OrthancPluginSetGlobalProperty
OrthancPluginErrorCode OrthancPluginSetGlobalProperty(OrthancPluginContext *context, int32_t property, const char *value)
Set the value of a global property.
Definition: OrthancCPlugin.h:2785
OrthancPluginDecodeImageCallback
OrthancPluginErrorCode(* OrthancPluginDecodeImageCallback)(OrthancPluginImage **target, const void *dicom, const uint32_t size, uint32_t frameIndex)
Signature of a callback function to decode a DICOM instance as an image.
Definition: OrthancCPlugin.h:909
OrthancPluginRegisterRestCallback
void OrthancPluginRegisterRestCallback(OrthancPluginContext *context, const char *pathRegularExpression, OrthancPluginRestCallback callback)
Register a REST callback.
Definition: OrthancCPlugin.h:1405
OrthancPluginChangeType_Deleted
@ OrthancPluginChangeType_Deleted
Definition: OrthancCPlugin.h:615
OrthancPluginWorklistQuery
struct _OrthancPluginWorklistQuery_t OrthancPluginWorklistQuery
Opaque structure to an object that represents a C-Find query for worklists.
Definition: OrthancCPlugin.h:837
OrthancPluginImageFormat_Dicom
@ OrthancPluginImageFormat_Dicom
Definition: OrthancCPlugin.h:656
OrthancPluginGetGlobalProperty
char * OrthancPluginGetGlobalProperty(OrthancPluginContext *context, int32_t property, const char *defaultValue)
Get the value of a global property.
Definition: OrthancCPlugin.h:2746
OrthancPluginValueRepresentation_SH
@ OrthancPluginValueRepresentation_SH
Definition: OrthancCPlugin.h:684
OrthancPluginGetImageHeight
uint32_t OrthancPluginGetImageHeight(OrthancPluginContext *context, const OrthancPluginImage *image)
Return the height of an image.
Definition: OrthancCPlugin.h:3282
OrthancPluginValueRepresentation_OB
@ OrthancPluginValueRepresentation_OB
Definition: OrthancCPlugin.h:680
OrthancPluginValueRepresentation_DT
@ OrthancPluginValueRepresentation_DT
Definition: OrthancCPlugin.h:674
OrthancPluginValueRepresentation_UL
@ OrthancPluginValueRepresentation_UL
Definition: OrthancCPlugin.h:691
OrthancPluginPixelFormat_RGB24
@ OrthancPluginPixelFormat_RGB24
Color image in RGB24 format.
Definition: OrthancCPlugin.h:561
OrthancPluginValueRepresentation_SQ
@ OrthancPluginValueRepresentation_SQ
Definition: OrthancCPlugin.h:686
OrthancPluginRegisterErrorCode
OrthancPluginErrorCode OrthancPluginRegisterErrorCode(OrthancPluginContext *context, int32_t code, uint16_t httpStatus, const char *message)
Declare a custom error code for this plugin.
Definition: OrthancCPlugin.h:4108
OrthancPluginComputeMd5
char * OrthancPluginComputeMd5(OrthancPluginContext *context, const void *buffer, uint32_t size)
Compute an MD5 hash.
Definition: OrthancCPlugin.h:4875
OrthancPluginErrorCode_SQLiteRegisterFunction
@ OrthancPluginErrorCode_SQLiteRegisterFunction
Definition: OrthancCPlugin.h:234
OrthancPluginValueRepresentation_CS
@ OrthancPluginValueRepresentation_CS
Definition: OrthancCPlugin.h:671
OrthancPluginMemoryBuffer::data
void * data
The content of the buffer.
Definition: OrthancCPlugin.h:791
OrthancPluginPixelFormat_SignedGrayscale16
@ OrthancPluginPixelFormat_SignedGrayscale16
Graylevel, signed 16bpp image.
Definition: OrthancCPlugin.h:553
OrthancPluginFreeFindMatcher
void OrthancPluginFreeFindMatcher(OrthancPluginContext *context, OrthancPluginFindMatcher *matcher)
Free a C-Find matcher.
Definition: OrthancCPlugin.h:5527
OrthancPluginCompressJpegImage
OrthancPluginErrorCode OrthancPluginCompressJpegImage(OrthancPluginContext *context, OrthancPluginMemoryBuffer *target, OrthancPluginPixelFormat format, uint32_t width, uint32_t height, uint32_t pitch, const void *buffer, uint8_t quality)
Encode a JPEG image.
Definition: OrthancCPlugin.h:3526
OrthancPluginHttpMethod_Put
@ OrthancPluginHttpMethod_Put
Definition: OrthancCPlugin.h:305
OrthancPluginStorageAreaCreate
OrthancPluginErrorCode OrthancPluginStorageAreaCreate(OrthancPluginContext *context, OrthancPluginStorageArea *storageArea, const char *uuid, const void *content, uint64_t size, OrthancPluginContentType type)
Create a file inside the storage area.
Definition: OrthancCPlugin.h:3990
OrthancPluginErrorCode_NotImplemented
@ OrthancPluginErrorCode_NotImplemented
Definition: OrthancCPlugin.h:193
OrthancPluginDicomToJsonFlags_IncludePixelData
@ OrthancPluginDicomToJsonFlags_IncludePixelData
Definition: OrthancCPlugin.h:726
OrthancPluginErrorCode_UnknownModality
@ OrthancPluginErrorCode_UnknownModality
Definition: OrthancCPlugin.h:270
OrthancPluginErrorCode_CreateDicomBadParent
@ OrthancPluginErrorCode_CreateDicomBadParent
Definition: OrthancCPlugin.h:267
OrthancPluginDicomInstanceToJson
char * OrthancPluginDicomInstanceToJson(OrthancPluginContext *context, const char *instanceId, OrthancPluginDicomToJsonFormat format, OrthancPluginDicomToJsonFlags flags, uint32_t maxStringLength)
Format a DICOM instance as a JSON string.
Definition: OrthancCPlugin.h:4356
OrthancPluginFindMarkIncomplete
OrthancPluginErrorCode OrthancPluginFindMarkIncomplete(OrthancPluginContext *context, OrthancPluginFindAnswers *answers)
Mark the set of C-Find answers as incomplete.
Definition: OrthancCPlugin.h:5272
OrthancPluginValueRepresentation_UN
@ OrthancPluginValueRepresentation_UN
Definition: OrthancCPlugin.h:692
OrthancPluginSetDescription
void OrthancPluginSetDescription(OrthancPluginContext *context, const char *description)
Set a description for this plugin.
Definition: OrthancCPlugin.h:2690
OrthancPluginIdentifierConstraint_Wildcard
@ OrthancPluginIdentifierConstraint_Wildcard
Definition: OrthancCPlugin.h:758
OrthancPluginErrorCode_NoCFindHandler
@ OrthancPluginErrorCode_NoCFindHandler
Definition: OrthancCPlugin.h:253
OrthancPluginValueRepresentation_IS
@ OrthancPluginValueRepresentation_IS
Definition: OrthancCPlugin.h:677
OrthancPluginRegisterMoveCallback
OrthancPluginErrorCode OrthancPluginRegisterMoveCallback(OrthancPluginContext *context, OrthancPluginMoveCallback callback, OrthancPluginGetMoveSize getMoveSize, OrthancPluginApplyMove applyMove, OrthancPluginFreeMove freeMove)
Register a callback to handle C-Move requests.
Definition: OrthancCPlugin.h:5450
OrthancPluginLogWarning
void OrthancPluginLogWarning(OrthancPluginContext *context, const char *message)
Log a warning.
Definition: OrthancCPlugin.h:1358
OrthancPluginValueRepresentation_UI
@ OrthancPluginValueRepresentation_UI
Definition: OrthancCPlugin.h:690
OrthancPluginGetImagePixelFormat
OrthancPluginPixelFormat OrthancPluginGetImagePixelFormat(OrthancPluginContext *context, const OrthancPluginImage *image)
Return the pixel format of an image.
Definition: OrthancCPlugin.h:3216
OrthancPluginErrorCode_CreateDicomParentIsInstance
@ OrthancPluginErrorCode_CreateDicomParentIsInstance
Definition: OrthancCPlugin.h:268
OrthancPluginRedirect
void OrthancPluginRedirect(OrthancPluginContext *context, OrthancPluginRestOutput *output, const char *redirection)
Redirect a REST request.
Definition: OrthancCPlugin.h:1879
OrthancPluginValueRepresentation_SS
@ OrthancPluginValueRepresentation_SS
Definition: OrthancCPlugin.h:687
OrthancPluginHttpRequest::method
OrthancPluginHttpMethod method
The HTTP method.
Definition: OrthancCPlugin.h:321
OrthancPluginErrorCode_SQLiteCommitWithoutTransaction
@ OrthancPluginErrorCode_SQLiteCommitWithoutTransaction
Definition: OrthancCPlugin.h:233
OrthancPluginValueRepresentation_PN
@ OrthancPluginValueRepresentation_PN
Definition: OrthancCPlugin.h:683
OrthancPluginErrorCode
OrthancPluginErrorCode
Definition: OrthancCPlugin.h:189
OrthancPluginWorklistCallback
OrthancPluginErrorCode(* OrthancPluginWorklistCallback)(OrthancPluginWorklistAnswers *answers, const OrthancPluginWorklistQuery *query, const char *issuerAet, const char *calledAet)
Callback to handle the C-Find SCP requests for worklists.
Definition: OrthancCPlugin.h:993
OrthancPluginWorklistAnswers
struct _OrthancPluginWorklistAnswers_t OrthancPluginWorklistAnswers
Opaque structure to an object that represents the answers to a C-Find query for worklists.
Definition: OrthancCPlugin.h:845
OrthancPluginHttpRequest::getValues
const char *const * getValues
For a GET request, the values of the GET parameters.
Definition: OrthancCPlugin.h:346
OrthancPluginErrorCode_Plugin
@ OrthancPluginErrorCode_Plugin
Definition: OrthancCPlugin.h:192
OrthancPluginErrorCode_UriSyntax
@ OrthancPluginErrorCode_UriSyntax
Definition: OrthancCPlugin.h:203
OrthancPluginHttpRequest::headersKeys
const char *const * headersKeys
The keys of the HTTP headers (always converted to low-case).
Definition: OrthancCPlugin.h:371
OrthancPluginStorageRead
OrthancPluginErrorCode(* OrthancPluginStorageRead)(void **content, int64_t *size, const char *uuid, OrthancPluginContentType type)
Callback for reading from the storage area.
Definition: OrthancCPlugin.h:956
OrthancPluginChangeType_UpdatedMetadata
@ OrthancPluginChangeType_UpdatedMetadata
Definition: OrthancCPlugin.h:627
OrthancPluginMemoryBuffer
A memory buffer allocated by the core system of Orthanc.
Definition: OrthancCPlugin.h:787
OrthancPluginValueRepresentation_FL
@ OrthancPluginValueRepresentation_FL
Definition: OrthancCPlugin.h:676
OrthancPluginDictionaryEntry::vr
OrthancPluginValueRepresentation vr
Definition: OrthancCPlugin.h:1198
OrthancPluginImage
struct _OrthancPluginImage_t OrthancPluginImage
Opaque structure that represents an image that is uncompressed in memory.
Definition: OrthancCPlugin.h:821
OrthancPluginErrorCode_BadSequenceOfCalls
@ OrthancPluginErrorCode_BadSequenceOfCalls
Definition: OrthancCPlugin.h:197
OrthancPluginContentType_Unknown
@ OrthancPluginContentType_Unknown
Definition: OrthancCPlugin.h:583
OrthancPluginIncomingHttpRequestFilter2
int32_t(* OrthancPluginIncomingHttpRequestFilter2)(OrthancPluginHttpMethod method, const char *uri, const char *ip, uint32_t headersCount, const char *const *headersKeys, const char *const *headersValues, uint32_t getArgumentsCount, const char *const *getArgumentsKeys, const char *const *getArgumentsValues)
Callback to filter incoming HTTP requests received by Orthanc.
Definition: OrthancCPlugin.h:1051
OrthancPluginFindMatcher
struct _OrthancPluginFindAnswers_t OrthancPluginFindMatcher
Opaque structure to an object that can be used to check whether a DICOM instance matches a C-Find que...
Definition: OrthancCPlugin.h:869
OrthancPluginHttpMethod
OrthancPluginHttpMethod
Definition: OrthancCPlugin.h:302
OrthancPluginFree
void(* OrthancPluginFree)(void *buffer)
Signature of a function to free dynamic memory.
Definition: OrthancCPlugin.h:920
OrthancPluginWorklistIsMatch
int32_t OrthancPluginWorklistIsMatch(OrthancPluginContext *context, const OrthancPluginWorklistQuery *query, const void *dicom, uint32_t size)
Test whether a worklist matches the query.
Definition: OrthancCPlugin.h:4556
OrthancPluginFreeImage
void OrthancPluginFreeImage(OrthancPluginContext *context, OrthancPluginImage *image)
Free an image.
Definition: OrthancCPlugin.h:3436
OrthancPluginHttpRequest::groupsCount
uint32_t groupsCount
The number of groups of the regular expression.
Definition: OrthancCPlugin.h:326
OrthancPluginHttpPut
OrthancPluginErrorCode OrthancPluginHttpPut(OrthancPluginContext *context, OrthancPluginMemoryBuffer *target, const char *url, const char *body, uint32_t bodySize, const char *username, const char *password)
Issue a HTTP PUT call.
Definition: OrthancCPlugin.h:3703
OrthancPluginErrorCode_DicomMoveUnavailable
@ OrthancPluginErrorCode_DicomMoveUnavailable
Definition: OrthancCPlugin.h:260
OrthancPluginErrorCode_DicomPortInUse
@ OrthancPluginErrorCode_DicomPortInUse
Definition: OrthancCPlugin.h:247
OrthancPluginGetFontName
const char * OrthancPluginGetFontName(OrthancPluginContext *context, uint32_t fontIndex)
Return the name of a font.
Definition: OrthancCPlugin.h:3853
OrthancPluginSetCookie
void OrthancPluginSetCookie(OrthancPluginContext *context, OrthancPluginRestOutput *output, const char *cookie, const char *value)
Set a cookie.
Definition: OrthancCPlugin.h:2172
OrthancPluginErrorCode_EmptyRequest
@ OrthancPluginErrorCode_EmptyRequest
Definition: OrthancCPlugin.h:224
OrthancPluginErrorCode_NoPresentationContext
@ OrthancPluginErrorCode_NoPresentationContext
Definition: OrthancCPlugin.h:258
OrthancPluginErrorCode_NetworkProtocol
@ OrthancPluginErrorCode_NetworkProtocol
Definition: OrthancCPlugin.h:200
OrthancPluginDicomToJsonFormat_Full
@ OrthancPluginDicomToJsonFormat_Full
Definition: OrthancCPlugin.h:707
OrthancPluginHttpMethod_Delete
@ OrthancPluginHttpMethod_Delete
Definition: OrthancCPlugin.h:306
OrthancPluginHttpRequest::getCount
uint32_t getCount
For a GET request, the number of GET parameters.
Definition: OrthancCPlugin.h:336
OrthancPluginErrorCode_UnknownDicomTag
@ OrthancPluginErrorCode_UnknownDicomTag
Definition: OrthancCPlugin.h:218
OrthancPluginInstanceOrigin_DicomProtocol
@ OrthancPluginInstanceOrigin_DicomProtocol
Definition: OrthancCPlugin.h:770
OrthancPluginHttpClient
OrthancPluginErrorCode OrthancPluginHttpClient(OrthancPluginContext *context, OrthancPluginMemoryBuffer *answerBody, OrthancPluginMemoryBuffer *answerHeaders, uint16_t *httpStatus, OrthancPluginHttpMethod method, const char *url, uint32_t headersCount, const char *const *headersKeys, const char *const *headersValues, const char *body, uint32_t bodySize, const char *username, const char *password, uint32_t timeout, const char *certificateFile, const char *certificateKeyFile, const char *certificateKeyPassword, uint8_t pkcs11)
Issue a HTTP call with full flexibility.
Definition: OrthancCPlugin.h:5110
OrthancPluginResourceType_Series
@ OrthancPluginResourceType_Series
Definition: OrthancCPlugin.h:599
OrthancPluginErrorCode_IncompatibleImageFormat
@ OrthancPluginErrorCode_IncompatibleImageFormat
Definition: OrthancCPlugin.h:214
OrthancPluginChangeType_NewStudy
@ OrthancPluginChangeType_NewStudy
Definition: OrthancCPlugin.h:620
OrthancPluginErrorCode_FullStorage
@ OrthancPluginErrorCode_FullStorage
Definition: OrthancCPlugin.h:210
OrthancPluginDictionaryEntry
An entry in the dictionary of DICOM tags.
Definition: OrthancCPlugin.h:1195
OrthancPluginCreateImageAccessor
OrthancPluginImage * OrthancPluginCreateImageAccessor(OrthancPluginContext *context, OrthancPluginPixelFormat format, uint32_t width, uint32_t height, uint32_t pitch, void *buffer)
Create an image pointing to a memory buffer.
Definition: OrthancCPlugin.h:4784
OrthancPluginLookupPatient
char * OrthancPluginLookupPatient(OrthancPluginContext *context, const char *patientID)
Look for a patient.
Definition: OrthancCPlugin.h:1911
OrthancPluginErrorCode_SQLiteAlreadyOpened
@ OrthancPluginErrorCode_SQLiteAlreadyOpened
Definition: OrthancCPlugin.h:228
OrthancPluginFreeString
void OrthancPluginFreeString(OrthancPluginContext *context, char *str)
Free a string.
Definition: OrthancCPlugin.h:1213
OrthancPluginWriteFile
OrthancPluginErrorCode OrthancPluginWriteFile(OrthancPluginContext *context, const char *path, const void *data, uint32_t size)
Write a file.
Definition: OrthancCPlugin.h:3096
OrthancPluginGetCommandLineArgument
char * OrthancPluginGetCommandLineArgument(OrthancPluginContext *context, uint32_t argument)
Get the value of a command-line argument.
Definition: OrthancCPlugin.h:2850
OrthancPluginErrorCode_RegularFileExpected
@ OrthancPluginErrorCode_RegularFileExpected
Definition: OrthancCPlugin.h:249
OrthancPluginLookupInstance
char * OrthancPluginLookupInstance(OrthancPluginContext *context, const char *sopInstanceUID)
Look for an instance.
Definition: OrthancCPlugin.h:2051
OrthancPluginErrorCode_SslDisabled
@ OrthancPluginErrorCode_SslDisabled
Definition: OrthancCPlugin.h:282
OrthancPluginErrorCode_CreateDicomUseDataUriScheme
@ OrthancPluginErrorCode_CreateDicomUseDataUriScheme
Definition: OrthancCPlugin.h:266
OrthancPluginChangeType
OrthancPluginChangeType
Definition: OrthancCPlugin.h:613
OrthancPluginErrorCode_CannotCreateLua
@ OrthancPluginErrorCode_CannotCreateLua
Definition: OrthancCPlugin.h:273
OrthancPluginRestApiPost
OrthancPluginErrorCode OrthancPluginRestApiPost(OrthancPluginContext *context, OrthancPluginMemoryBuffer *target, const char *uri, const char *body, uint32_t bodySize)
Make a POST call to the built-in Orthanc REST API.
Definition: OrthancCPlugin.h:1697
OrthancPluginErrorCode_BadHttpStatusInRest
@ OrthancPluginErrorCode_BadHttpStatusInRest
Definition: OrthancCPlugin.h:248
OrthancPluginErrorCode_StorageAreaAlreadyRegistered
@ OrthancPluginErrorCode_StorageAreaAlreadyRegistered
Definition: OrthancCPlugin.h:279
OrthancPluginFindCallback
OrthancPluginErrorCode(* OrthancPluginFindCallback)(OrthancPluginFindAnswers *answers, const OrthancPluginFindQuery *query, const char *issuerAet, const char *calledAet)
Callback to handle incoming C-Find SCP requests.
Definition: OrthancCPlugin.h:1078
OrthancPluginUncompressImage
OrthancPluginImage * OrthancPluginUncompressImage(OrthancPluginContext *context, const void *data, uint32_t size, OrthancPluginImageFormat format)
Decode a compressed image.
Definition: OrthancCPlugin.h:3394
OrthancPluginRegisterRestCallbackNoLock
void OrthancPluginRegisterRestCallbackNoLock(OrthancPluginContext *context, const char *pathRegularExpression, OrthancPluginRestCallback callback)
Register a REST callback, without locking.
Definition: OrthancCPlugin.h:1439
OrthancPluginValueRepresentation_US
@ OrthancPluginValueRepresentation_US
Definition: OrthancCPlugin.h:693
OrthancPluginErrorCode_DatabaseNotInitialized
@ OrthancPluginErrorCode_DatabaseNotInitialized
Definition: OrthancCPlugin.h:281
OrthancPluginDicomToJsonFlags_IncludeUnknownTags
@ OrthancPluginDicomToJsonFlags_IncludeUnknownTags
Definition: OrthancCPlugin.h:725
OrthancPluginMemoryBuffer::size
uint32_t size
The number of bytes in the buffer.
Definition: OrthancCPlugin.h:796
OrthancPluginRegisterPrivateDictionaryTag
OrthancPluginErrorCode OrthancPluginRegisterPrivateDictionaryTag(OrthancPluginContext *context, uint16_t group, uint16_t element, OrthancPluginValueRepresentation vr, const char *name, uint32_t minMultiplicity, uint32_t maxMultiplicity, const char *privateCreator)
Register a new private tag into the DICOM dictionary.
Definition: OrthancCPlugin.h:4217
OrthancPluginFindAddAnswer
OrthancPluginErrorCode OrthancPluginFindAddAnswer(OrthancPluginContext *context, OrthancPluginFindAnswers *answers, const void *dicom, uint32_t size)
Add one answer to some C-Find request.
Definition: OrthancCPlugin.h:5243
OrthancPluginStorageAreaRemove
OrthancPluginErrorCode OrthancPluginStorageAreaRemove(OrthancPluginContext *context, OrthancPluginStorageArea *storageArea, const char *uuid, OrthancPluginContentType type)
Remove a file from the storage area.
Definition: OrthancCPlugin.h:4069
OrthancPluginLogInfo
void OrthancPluginLogInfo(OrthancPluginContext *context, const char *message)
Log an information.
Definition: OrthancCPlugin.h:1374
OrthancPluginErrorCode_SQLiteRollbackWithoutTransaction
@ OrthancPluginErrorCode_SQLiteRollbackWithoutTransaction
Definition: OrthancCPlugin.h:232
OrthancPluginHasInstanceMetadata
int OrthancPluginHasInstanceMetadata(OrthancPluginContext *context, OrthancPluginDicomInstance *instance, const char *metadata)
Check whether a DICOM instance is associated with some metadata.
Definition: OrthancCPlugin.h:2412
OrthancPluginDicomInstance
struct _OrthancPluginDicomInstance_t OrthancPluginDicomInstance
Opaque structure that represents a DICOM instance received by Orthanc.
Definition: OrthancCPlugin.h:813
OrthancPluginGetFindQueryTagName
char * OrthancPluginGetFindQueryTagName(OrthancPluginContext *context, const OrthancPluginFindQuery *query, uint32_t index)
Get the symbolic name of one tag in a C-Find query.
Definition: OrthancCPlugin.h:5364
OrthancPluginHttpGet
OrthancPluginErrorCode OrthancPluginHttpGet(OrthancPluginContext *context, OrthancPluginMemoryBuffer *target, const char *url, const char *username, const char *password)
Issue a HTTP GET call.
Definition: OrthancCPlugin.h:3625
OrthancPluginRestApiPutAfterPlugins
OrthancPluginErrorCode OrthancPluginRestApiPutAfterPlugins(OrthancPluginContext *context, OrthancPluginMemoryBuffer *target, const char *uri, const char *body, uint32_t bodySize)
Make a PUT call to the REST API, as tainted by the plugins.
Definition: OrthancCPlugin.h:1845
OrthancPluginErrorCode_BadFileFormat
@ OrthancPluginErrorCode_BadFileFormat
Definition: OrthancCPlugin.h:206
OrthancPluginErrorCode_BadJson
@ OrthancPluginErrorCode_BadJson
Definition: OrthancCPlugin.h:219
OrthancPluginHttpRequest::getKeys
const char *const * getKeys
For a GET request, the keys of the GET parameters.
Definition: OrthancCPlugin.h:341
OrthancPluginResourceType_Study
@ OrthancPluginResourceType_Study
Definition: OrthancCPlugin.h:598
OrthancPluginContentType_DicomAsJson
@ OrthancPluginContentType_DicomAsJson
Definition: OrthancCPlugin.h:585
OrthancPluginErrorCode_HttpPortInUse
@ OrthancPluginErrorCode_HttpPortInUse
Definition: OrthancCPlugin.h:246
OrthancPluginErrorCode_PathToExecutable
@ OrthancPluginErrorCode_PathToExecutable
Definition: OrthancCPlugin.h:250
OrthancPluginBufferCompression
OrthancPluginErrorCode OrthancPluginBufferCompression(OrthancPluginContext *context, OrthancPluginMemoryBuffer *target, const void *source, uint32_t size, OrthancPluginCompressionType compression, uint8_t uncompress)
Compress or decompress a buffer.
Definition: OrthancCPlugin.h:3028
OrthancPluginGetDicomForInstance
OrthancPluginErrorCode OrthancPluginGetDicomForInstance(OrthancPluginContext *context, OrthancPluginMemoryBuffer *target, const char *instanceId)
Retrieve a DICOM instance using its Orthanc identifier.
Definition: OrthancCPlugin.h:1597
OrthancPluginOnStoredInstanceCallback
OrthancPluginErrorCode(* OrthancPluginOnStoredInstanceCallback)(OrthancPluginDicomInstance *instance, const char *instanceId)
Signature of a callback function that is triggered when Orthanc receives a DICOM instance.
Definition: OrthancCPlugin.h:888
OrthancPluginErrorCode_NullPointer
@ OrthancPluginErrorCode_NullPointer
Definition: OrthancCPlugin.h:226
OrthancPluginErrorCode_SharedLibrary
@ OrthancPluginErrorCode_SharedLibrary
Definition: OrthancCPlugin.h:216
OrthancPluginErrorCode_FileStorageCannotWrite
@ OrthancPluginErrorCode_FileStorageCannotWrite
Definition: OrthancCPlugin.h:244
OrthancPluginFindMatcherIsMatch
int32_t OrthancPluginFindMatcherIsMatch(OrthancPluginContext *context, const OrthancPluginFindMatcher *matcher, const void *dicom, uint32_t size)
Test whether a DICOM instance matches a C-Find query.
Definition: OrthancCPlugin.h:5560
OrthancPluginValueRepresentation_OW
@ OrthancPluginValueRepresentation_OW
Definition: OrthancCPlugin.h:682
OrthancPluginValueRepresentation_OF
@ OrthancPluginValueRepresentation_OF
Definition: OrthancCPlugin.h:681
OrthancPluginErrorCode_SQLiteNotOpened
@ OrthancPluginErrorCode_SQLiteNotOpened
Definition: OrthancCPlugin.h:227
OrthancPluginRegisterStorageArea
void OrthancPluginRegisterStorageArea(OrthancPluginContext *context, OrthancPluginStorageCreate create, OrthancPluginStorageRead read, OrthancPluginStorageRemove remove)
Register a custom storage area.
Definition: OrthancCPlugin.h:2498
OrthancPluginErrorCode_BadParameterType
@ OrthancPluginErrorCode_BadParameterType
Definition: OrthancCPlugin.h:196
OrthancPluginRestApiGetAfterPlugins
OrthancPluginErrorCode OrthancPluginRestApiGetAfterPlugins(OrthancPluginContext *context, OrthancPluginMemoryBuffer *target, const char *uri)
Make a GET call to the REST API, as tainted by the plugins.
Definition: OrthancCPlugin.h:1660
OrthancPluginSendMultipartItem2
OrthancPluginErrorCode OrthancPluginSendMultipartItem2(OrthancPluginContext *context, OrthancPluginRestOutput *output, const char *answer, uint32_t answerSize, uint32_t headersCount, const char *const *headersKeys, const char *const *headersValues)
Send an item as a part of some HTTP multipart answer, with custom headers.
Definition: OrthancCPlugin.h:5000
OrthancPluginImageFormat_Png
@ OrthancPluginImageFormat_Png
Definition: OrthancCPlugin.h:654
OrthancPluginPixelFormat
OrthancPluginPixelFormat
Definition: OrthancCPlugin.h:530
OrthancPluginErrorCode_LuaBadOutput
@ OrthancPluginErrorCode_LuaBadOutput
Definition: OrthancCPlugin.h:276
OrthancPluginSendUnauthorized
void OrthancPluginSendUnauthorized(OrthancPluginContext *context, OrthancPluginRestOutput *output, const char *realm)
Signal that a REST request is not authorized.
Definition: OrthancCPlugin.h:2119
OrthancPluginErrorCode_DatabasePlugin
@ OrthancPluginErrorCode_DatabasePlugin
Definition: OrthancCPlugin.h:222
OrthancPluginPixelFormat_Grayscale16
@ OrthancPluginPixelFormat_Grayscale16
Graylevel, unsigned 16bpp image.
Definition: OrthancCPlugin.h:545
OrthancPluginSendMethodNotAllowed
void OrthancPluginSendMethodNotAllowed(OrthancPluginContext *context, OrthancPluginRestOutput *output, const char *allowedMethods)
Signal that this URI does not support this HTTP method.
Definition: OrthancCPlugin.h:2142
OrthancPluginSetHttpHeader
void OrthancPluginSetHttpHeader(OrthancPluginContext *context, OrthancPluginRestOutput *output, const char *key, const char *value)
Set some HTTP header.
Definition: OrthancCPlugin.h:2197
OrthancPluginRegisterDictionaryTag
OrthancPluginErrorCode OrthancPluginRegisterDictionaryTag(OrthancPluginContext *context, uint16_t group, uint16_t element, OrthancPluginValueRepresentation vr, const char *name, uint32_t minMultiplicity, uint32_t maxMultiplicity)
Register a new tag into the DICOM dictionary.
Definition: OrthancCPlugin.h:4164
OrthancPluginAnswerBuffer
void OrthancPluginAnswerBuffer(OrthancPluginContext *context, OrthancPluginRestOutput *output, const char *answer, uint32_t answerSize, const char *mimeType)
Answer to a REST request.
Definition: OrthancCPlugin.h:1499
OrthancPluginErrorCode_NotLuaPredicate
@ OrthancPluginErrorCode_NotLuaPredicate
Definition: OrthancCPlugin.h:277
OrthancPluginLookupStudy
char * OrthancPluginLookupStudy(OrthancPluginContext *context, const char *studyUID)
Look for a study.
Definition: OrthancCPlugin.h:1946
OrthancPluginDictionaryEntry::element
uint16_t element
Definition: OrthancCPlugin.h:1197
OrthancPluginErrorCode_NotAcceptable
@ OrthancPluginErrorCode_NotAcceptable
Definition: OrthancCPlugin.h:225
OrthancPluginDecodeDicomImage
OrthancPluginImage * OrthancPluginDecodeDicomImage(OrthancPluginContext *context, const void *buffer, uint32_t bufferSize, uint32_t frameIndex)
Decode one frame from a DICOM instance.
Definition: OrthancCPlugin.h:4829
OrthancPluginHttpRequest::body
const char * body
For a PUT or POST request, the content of the body.
Definition: OrthancCPlugin.h:351
OrthancPluginGetConfiguration
char * OrthancPluginGetConfiguration(OrthancPluginContext *context)
Return the content of the configuration file(s).
Definition: OrthancCPlugin.h:2916