![]() |
Orthanc Plugin SDK
1.3.2
Documentation of the plugin interface of Orthanc
|
Generic functions to help with the creation of plugins. More...
Classes | |
struct | OrthancPluginHttpRequest |
The parameters of a REST request. More... | |
struct | OrthancPluginMemoryBuffer |
A memory buffer allocated by the core system of Orthanc. More... | |
struct | OrthancPluginDictionaryEntry |
An entry in the dictionary of DICOM tags. More... | |
Typedefs | |
typedef struct _OrthancPluginRestOutput_t | OrthancPluginRestOutput |
Opaque structure that represents the HTTP connection to the client application. | |
typedef struct _OrthancPluginDicomInstance_t | OrthancPluginDicomInstance |
Opaque structure that represents a DICOM instance received by Orthanc. | |
typedef struct _OrthancPluginWorklistQuery_t | OrthancPluginWorklistQuery |
Opaque structure to an object that represents a C-Find query for worklists. | |
typedef struct _OrthancPluginWorklistAnswers_t | OrthancPluginWorklistAnswers |
Opaque structure to an object that represents the answers to a C-Find query for worklists. | |
typedef struct _OrthancPluginFindQuery_t | OrthancPluginFindQuery |
Opaque structure to an object that represents a C-Find query. | |
typedef struct _OrthancPluginFindAnswers_t | OrthancPluginFindAnswers |
Opaque structure to an object that represents the answers to a C-Find query for worklists. | |
typedef struct _OrthancPluginFindAnswers_t | OrthancPluginFindMatcher |
Opaque structure to an object that can be used to check whether a DICOM instance matches a C-Find query. | |
typedef void(* | OrthancPluginFree) (void *buffer) |
Signature of a function to free dynamic memory. | |
typedef OrthancPluginErrorCode(* | OrthancPluginWorklistCallback) (OrthancPluginWorklistAnswers *answers, const OrthancPluginWorklistQuery *query, const char *issuerAet, const char *calledAet) |
Callback to handle the C-Find SCP requests for worklists. More... | |
typedef 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. More... | |
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) |
Callback to filter incoming HTTP requests received by Orthanc. More... | |
typedef OrthancPluginErrorCode(* | OrthancPluginFindCallback) (OrthancPluginFindAnswers *answers, const OrthancPluginFindQuery *query, const char *issuerAet, const char *calledAet) |
Callback to handle incoming C-Find SCP requests. More... | |
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) |
Callback to handle incoming C-Move SCP requests. More... | |
typedef uint32_t(* | OrthancPluginGetMoveSize) (void *moveDriver) |
Callback to read the size of a C-Move driver. More... | |
typedef OrthancPluginErrorCode(* | OrthancPluginApplyMove) (void *moveDriver) |
Callback to apply one C-Move suboperation. More... | |
typedef void(* | OrthancPluginFreeMove) (void *moveDriver) |
Callback to free one C-Move driver. More... | |
typedef struct _OrthancPluginContext_t | OrthancPluginContext |
Data structure that contains information about the Orthanc core. | |
Functions | |
void | OrthancPluginFreeString (OrthancPluginContext *context, char *str) |
Free a string. More... | |
void | OrthancPluginFreeMemoryBuffer (OrthancPluginContext *context, OrthancPluginMemoryBuffer *buffer) |
Free a memory buffer. More... | |
void | OrthancPluginLogError (OrthancPluginContext *context, const char *message) |
Log an error. More... | |
void | OrthancPluginLogWarning (OrthancPluginContext *context, const char *message) |
Log a warning. More... | |
void | OrthancPluginLogInfo (OrthancPluginContext *context, const char *message) |
Log an information. More... | |
char * | OrthancPluginGetOrthancPath (OrthancPluginContext *context) |
Return the path to the Orthanc executable. More... | |
char * | OrthancPluginGetOrthancDirectory (OrthancPluginContext *context) |
Return the directory containing the Orthanc. More... | |
char * | OrthancPluginGetConfigurationPath (OrthancPluginContext *context) |
Return the path to the configuration file(s). More... | |
void | OrthancPluginSetRootUri (OrthancPluginContext *context, const char *uri) |
Set the URI where the plugin provides its Web interface. More... | |
void | OrthancPluginSetDescription (OrthancPluginContext *context, const char *description) |
Set a description for this plugin. More... | |
void | OrthancPluginExtendOrthancExplorer (OrthancPluginContext *context, const char *javascript) |
Extend the JavaScript code of Orthanc Explorer. More... | |
uint32_t | OrthancPluginGetCommandLineArgumentsCount (OrthancPluginContext *context) |
Get the number of command-line arguments. More... | |
char * | OrthancPluginGetCommandLineArgument (OrthancPluginContext *context, uint32_t argument) |
Get the value of a command-line argument. More... | |
char * | OrthancPluginGetConfiguration (OrthancPluginContext *context) |
Return the content of the configuration file(s). More... | |
OrthancPluginErrorCode | OrthancPluginReadFile (OrthancPluginContext *context, OrthancPluginMemoryBuffer *target, const char *path) |
Read a file. More... | |
OrthancPluginErrorCode | OrthancPluginWriteFile (OrthancPluginContext *context, const char *path, const void *data, uint32_t size) |
Write a file. More... | |
const char * | OrthancPluginGetErrorDescription (OrthancPluginContext *context, OrthancPluginErrorCode error) |
Get the description of a given error code. More... | |
OrthancPluginErrorCode | OrthancPluginHttpGet (OrthancPluginContext *context, OrthancPluginMemoryBuffer *target, const char *url, const char *username, const char *password) |
Issue a HTTP GET call. More... | |
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. More... | |
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. More... | |
OrthancPluginErrorCode | OrthancPluginHttpDelete (OrthancPluginContext *context, const char *url, const char *username, const char *password) |
Issue a HTTP DELETE call. More... | |
OrthancPluginErrorCode | OrthancPluginRegisterErrorCode (OrthancPluginContext *context, int32_t code, uint16_t httpStatus, const char *message) |
Declare a custom error code for this plugin. More... | |
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. More... | |
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. More... | |
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. More... | |
char * | OrthancPluginDicomInstanceToJson (OrthancPluginContext *context, const char *instanceId, OrthancPluginDicomToJsonFormat format, OrthancPluginDicomToJsonFlags flags, uint32_t maxStringLength) |
Format a DICOM instance as a JSON string. More... | |
OrthancPluginErrorCode | OrthancPluginRegisterWorklistCallback (OrthancPluginContext *context, OrthancPluginWorklistCallback callback) |
Register a callback to handle modality worklists requests. More... | |
OrthancPluginErrorCode | OrthancPluginWorklistAddAnswer (OrthancPluginContext *context, OrthancPluginWorklistAnswers *answers, const OrthancPluginWorklistQuery *query, const void *dicom, uint32_t size) |
Add one answer to some modality worklist request. More... | |
OrthancPluginErrorCode | OrthancPluginWorklistMarkIncomplete (OrthancPluginContext *context, OrthancPluginWorklistAnswers *answers) |
Mark the set of worklist answers as incomplete. More... | |
int32_t | OrthancPluginWorklistIsMatch (OrthancPluginContext *context, const OrthancPluginWorklistQuery *query, const void *dicom, uint32_t size) |
Test whether a worklist matches the query. More... | |
OrthancPluginErrorCode | OrthancPluginWorklistGetDicomQuery (OrthancPluginContext *context, OrthancPluginMemoryBuffer *target, const OrthancPluginWorklistQuery *query) |
Retrieve the worklist query as a DICOM file. More... | |
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. More... | |
char * | OrthancPluginComputeMd5 (OrthancPluginContext *context, const void *buffer, uint32_t size) |
Compute an MD5 hash. More... | |
char * | OrthancPluginComputeSha1 (OrthancPluginContext *context, const void *buffer, uint32_t size) |
Compute a SHA-1 hash. More... | |
OrthancPluginErrorCode | OrthancPluginLookupDictionary (OrthancPluginContext *context, OrthancPluginDictionaryEntry *target, const char *name) |
Get information about the given DICOM tag. More... | |
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. More... | |
char * | OrthancPluginGenerateUuid (OrthancPluginContext *context) |
Generate an UUID. More... | |
OrthancPluginErrorCode | OrthancPluginRegisterFindCallback (OrthancPluginContext *context, OrthancPluginFindCallback callback) |
Register a callback to handle C-Find requests. More... | |
OrthancPluginErrorCode | OrthancPluginFindAddAnswer (OrthancPluginContext *context, OrthancPluginFindAnswers *answers, const void *dicom, uint32_t size) |
Add one answer to some C-Find request. More... | |
OrthancPluginErrorCode | OrthancPluginFindMarkIncomplete (OrthancPluginContext *context, OrthancPluginFindAnswers *answers) |
Mark the set of C-Find answers as incomplete. More... | |
uint32_t | OrthancPluginGetFindQuerySize (OrthancPluginContext *context, const OrthancPluginFindQuery *query) |
Get the number of tags in a C-Find query. More... | |
OrthancPluginErrorCode | OrthancPluginGetFindQueryTag (OrthancPluginContext *context, uint16_t *group, uint16_t *element, const OrthancPluginFindQuery *query, uint32_t index) |
Get one tag in a C-Find query. More... | |
char * | OrthancPluginGetFindQueryTagName (OrthancPluginContext *context, const OrthancPluginFindQuery *query, uint32_t index) |
Get the symbolic name of one tag in a C-Find query. More... | |
char * | OrthancPluginGetFindQueryValue (OrthancPluginContext *context, const OrthancPluginFindQuery *query, uint32_t index) |
Get the value associated with one tag in a C-Find query. More... | |
OrthancPluginErrorCode | OrthancPluginRegisterMoveCallback (OrthancPluginContext *context, OrthancPluginMoveCallback callback, OrthancPluginGetMoveSize getMoveSize, OrthancPluginApplyMove applyMove, OrthancPluginFreeMove freeMove) |
Register a callback to handle C-Move requests. More... | |
OrthancPluginFindMatcher * | OrthancPluginCreateFindMatcher (OrthancPluginContext *context, const void *query, uint32_t size) |
Create a C-Find matcher. More... | |
void | OrthancPluginFreeFindMatcher (OrthancPluginContext *context, OrthancPluginFindMatcher *matcher) |
Free a C-Find matcher. More... | |
int32_t | OrthancPluginFindMatcherIsMatch (OrthancPluginContext *context, const OrthancPluginFindMatcher *matcher, const void *dicom, uint32_t size) |
Test whether a DICOM instance matches a C-Find query. More... | |
typedef OrthancPluginErrorCode(* OrthancPluginApplyMove) (void *moveDriver) |
Signature of a callback function that applies the next C-Move suboperation that os to be achieved by the given C-Move driver. This driver is the return value of a previous call to the OrthancPluginMoveCallback() callback.
moveDriver | The C-Move driver of interest. |
typedef OrthancPluginErrorCode(* OrthancPluginFindCallback) (OrthancPluginFindAnswers *answers, const OrthancPluginFindQuery *query, const char *issuerAet, const char *calledAet) |
Signature of a callback function that is triggered whenever Orthanc receives a C-Find SCP request not concerning modality worklists.
answers | The target structure where answers must be stored. |
query | The worklist query. |
issuerAet | The Application Entity Title (AET) of the modality from which the request originates. |
calledAet | The Application Entity Title (AET) of the modality that is called by the request. |
typedef void(* OrthancPluginFreeMove) (void *moveDriver) |
Signature of a callback function that releases the resources allocated by the given C-Move driver. This driver is the return value of a previous call to the OrthancPluginMoveCallback() callback.
moveDriver | The C-Move driver of interest. |
typedef uint32_t(* OrthancPluginGetMoveSize) (void *moveDriver) |
Signature of a callback function that returns the number of C-Move suboperations that are to be achieved by the given C-Move driver. This driver is the return value of a previous call to the OrthancPluginMoveCallback() callback.
moveDriver | The C-Move driver of interest. |
typedef int32_t(* OrthancPluginIncomingHttpRequestFilter) (OrthancPluginHttpMethod method, const char *uri, const char *ip, uint32_t headersCount, const char *const *headersKeys, const char *const *headersValues) |
Signature of a callback function that is triggered whenever Orthanc receives an HTTP/REST request, and that answers whether this request should be allowed. If the callback returns "0" ("false"), the server answers with HTTP status code 403 (Forbidden).
method | The HTTP method used by the request. |
uri | The URI of interest. |
ip | The IP address of the HTTP client. |
headersCount | The number of HTTP headers. |
headersKeys | The keys of the HTTP headers (always converted to low-case). |
headersValues | The values of the HTTP headers. |
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) |
Signature of a callback function that is triggered whenever Orthanc receives an HTTP/REST request, and that answers whether this request should be allowed. If the callback returns "0" ("false"), the server answers with HTTP status code 403 (Forbidden).
method | The HTTP method used by the request. |
uri | The URI of interest. |
ip | The IP address of the HTTP client. |
headersCount | The number of HTTP headers. |
headersKeys | The keys of the HTTP headers (always converted to low-case). |
headersValues | The values of the HTTP headers. |
getArgumentsCount | The number of GET arguments (only for the GET HTTP method). |
getArgumentsKeys | The keys of the GET arguments (only for the GET HTTP method). |
getArgumentsValues | The values of the GET arguments (only for the GET HTTP method). |
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) |
Signature of a callback function that is triggered whenever Orthanc receives a C-Move SCP request. The callback receives the type of the resource of interest (study, series, instance...) together with the DICOM tags containing its identifiers. In turn, the plugin must create a driver object that will be responsible for driving the successive move suboperations.
resourceType | The type of the resource of interest. Note that this might be set to ResourceType_None if the QueryRetrieveLevel (0008,0052) tag was not provided by the issuer (i.e. the originator modality). |
patientId | Content of the PatientID (0x0010, 0x0020) tag of the resource of interest. Might be NULL. |
accessionNumber | Content of the AccessionNumber (0x0008, 0x0050) tag. Might be NULL. |
studyInstanceUid | Content of the StudyInstanceUID (0x0020, 0x000d) tag. Might be NULL. |
seriesInstanceUid | Content of the SeriesInstanceUID (0x0020, 0x000e) tag. Might be NULL. |
sopInstanceUid | Content of the SOPInstanceUID (0x0008, 0x0018) tag. Might be NULL. |
originatorAet | The Application Entity Title (AET) of the modality from which the request originates. |
sourceAet | The Application Entity Title (AET) of the modality that should send its DICOM files to another modality. |
targetAet | The Application Entity Title (AET) of the modality that should receive the DICOM files. |
originatorId | The Message ID issued by the originator modality, as found in tag (0000,0110) of the DICOM query emitted by the issuer. |
typedef OrthancPluginErrorCode(* OrthancPluginWorklistCallback) (OrthancPluginWorklistAnswers *answers, const OrthancPluginWorklistQuery *query, const char *issuerAet, const char *calledAet) |
Signature of a callback function that is triggered when Orthanc receives a C-Find SCP request against modality worklists.
answers | The target structure where answers must be stored. |
query | The worklist query. |
issuerAet | The Application Entity Title (AET) of the modality from which the request originates. |
calledAet | The Application Entity Title (AET) of the modality that is called by the request. |
Flags to the creation of a DICOM file.
Enumerator | |
---|---|
OrthancPluginCreateDicomFlags_DecodeDataUriScheme | Decode fields encoded using data URI scheme |
OrthancPluginCreateDicomFlags_GenerateIdentifiers | Automatically generate DICOM identifiers |
Flags to customize a DICOM-to-JSON conversion. By default, binary tags are formatted using Data URI scheme.
The possible output formats for a DICOM-to-JSON conversion.
For Microsoft Visual Studio, a compatibility "stdint.h" can be downloaded at the following URL: https://orthanc.googlecode.com/hg/Resources/ThirdParty/VisualStudio/stdint.h The various error codes that can be returned by the Orthanc core.
The constraints on the DICOM identifiers that must be supported by the database plugins.
The origin of a DICOM instance that has been received by Orthanc.
The value representations present in the DICOM standard (version 2013).
char* OrthancPluginComputeMd5 | ( | OrthancPluginContext * | context, |
const void * | buffer, | ||
uint32_t | size | ||
) |
This functions computes the MD5 cryptographic hash of the given memory buffer.
context | The Orthanc plugin context, as received by OrthancPluginInitialize(). |
buffer | The source memory buffer. |
size | The size in bytes of the source buffer. |
char* OrthancPluginComputeSha1 | ( | OrthancPluginContext * | context, |
const void * | buffer, | ||
uint32_t | size | ||
) |
This functions computes the SHA-1 cryptographic hash of the given memory buffer.
context | The Orthanc plugin context, as received by OrthancPluginInitialize(). |
buffer | The source memory buffer. |
size | The size in bytes of the source buffer. |
OrthancPluginErrorCode OrthancPluginCreateDicom | ( | OrthancPluginContext * | context, |
OrthancPluginMemoryBuffer * | target, | ||
const char * | json, | ||
const OrthancPluginImage * | pixelData, | ||
OrthancPluginCreateDicomFlags | flags | ||
) |
This function takes as input a string containing a JSON file describing the content of a DICOM instance. As an output, it writes the corresponding DICOM instance to a newly allocated memory buffer. Additionally, an image to be encoded within the DICOM instance can also be provided.
context | The Orthanc plugin context, as received by OrthancPluginInitialize(). |
target | The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer(). |
json | The input JSON file. |
pixelData | The image. Can be NULL, if the pixel data is encoded inside the JSON with the data URI scheme. |
flags | Flags governing the output. |
OrthancPluginFindMatcher* OrthancPluginCreateFindMatcher | ( | OrthancPluginContext * | context, |
const void * | query, | ||
uint32_t | size | ||
) |
This function creates a "matcher" object that can be used to check whether a DICOM instance matches a C-Find query. The C-Find query must be expressed as a DICOM buffer.
context | The Orthanc plugin context, as received by OrthancPluginInitialize(). |
query | The C-Find DICOM query. |
size | The size of the DICOM query. |
char* OrthancPluginDicomBufferToJson | ( | OrthancPluginContext * | context, |
const void * | buffer, | ||
uint32_t | size, | ||
OrthancPluginDicomToJsonFormat | format, | ||
OrthancPluginDicomToJsonFlags | flags, | ||
uint32_t | maxStringLength | ||
) |
This function takes as input a memory buffer containing a DICOM file, and outputs a JSON string representing the tags of this DICOM file.
context | The Orthanc plugin context, as received by OrthancPluginInitialize(). |
buffer | The memory buffer containing the DICOM file. |
size | The size of the memory buffer. |
format | The output format. |
flags | Flags governing the output. |
maxStringLength | The maximum length of a field. Too long fields will be output as "null". The 0 value means no maximum length. |
char* OrthancPluginDicomInstanceToJson | ( | OrthancPluginContext * | context, |
const char * | instanceId, | ||
OrthancPluginDicomToJsonFormat | format, | ||
OrthancPluginDicomToJsonFlags | flags, | ||
uint32_t | maxStringLength | ||
) |
This function formats a DICOM instance that is stored in Orthanc, and outputs a JSON string representing the tags of this DICOM instance.
context | The Orthanc plugin context, as received by OrthancPluginInitialize(). |
instanceId | The Orthanc identifier of the instance. |
format | The output format. |
flags | Flags governing the output. |
maxStringLength | The maximum length of a field. Too long fields will be output as "null". The 0 value means no maximum length. |
void OrthancPluginExtendOrthancExplorer | ( | OrthancPluginContext * | context, |
const char * | javascript | ||
) |
Add JavaScript code to customize the default behavior of Orthanc Explorer. This can for instance be used to add new buttons.
context | The Orthanc plugin context, as received by OrthancPluginInitialize(). |
javascript | The custom JavaScript code. |
OrthancPluginErrorCode OrthancPluginFindAddAnswer | ( | OrthancPluginContext * | context, |
OrthancPluginFindAnswers * | answers, | ||
const void * | dicom, | ||
uint32_t | size | ||
) |
This function adds one answer (encoded as a DICOM file) to the set of answers corresponding to some C-Find SCP request that is not related to modality worklists.
context | The Orthanc plugin context, as received by OrthancPluginInitialize(). |
answers | The set of answers. |
dicom | The answer to be added, encoded as a DICOM file. |
size | The size of the DICOM file. |
OrthancPluginErrorCode OrthancPluginFindMarkIncomplete | ( | OrthancPluginContext * | context, |
OrthancPluginFindAnswers * | answers | ||
) |
This function marks as incomplete the set of answers corresponding to some C-Find SCP request that is not related to modality worklists. This must be used if canceling the handling of a request when too many answers are to be returned.
context | The Orthanc plugin context, as received by OrthancPluginInitialize(). |
answers | The set of answers. |
int32_t OrthancPluginFindMatcherIsMatch | ( | OrthancPluginContext * | context, |
const OrthancPluginFindMatcher * | matcher, | ||
const void * | dicom, | ||
uint32_t | size | ||
) |
This function checks whether one DICOM instance matches C-Find matcher that was previously allocated using OrthancPluginCreateFindMatcher().
context | The Orthanc plugin context, as received by OrthancPluginInitialize(). |
matcher | The matcher of interest. |
dicom | The DICOM instance to be matched. |
size | The size of the DICOM instance. |
void OrthancPluginFreeFindMatcher | ( | OrthancPluginContext * | context, |
OrthancPluginFindMatcher * | matcher | ||
) |
This function frees a matcher that was created using OrthancPluginCreateFindMatcher().
context | The Orthanc plugin context, as received by OrthancPluginInitialize(). |
matcher | The matcher of interest. |
void OrthancPluginFreeMemoryBuffer | ( | OrthancPluginContext * | context, |
OrthancPluginMemoryBuffer * | buffer | ||
) |
Free a memory buffer that was allocated by the core system of Orthanc.
context | The Orthanc plugin context, as received by OrthancPluginInitialize(). |
buffer | The memory buffer to release. |
void OrthancPluginFreeString | ( | OrthancPluginContext * | context, |
char * | str | ||
) |
Free a string that was allocated by the core system of Orthanc.
context | The Orthanc plugin context, as received by OrthancPluginInitialize(). |
str | The string to be freed. |
char* OrthancPluginGenerateUuid | ( | OrthancPluginContext * | context | ) |
Generate a random GUID/UUID (globally unique identifier).
context | The Orthanc plugin context, as received by OrthancPluginInitialize(). |
char* OrthancPluginGetCommandLineArgument | ( | OrthancPluginContext * | context, |
uint32_t | argument | ||
) |
Get the value of one of the command-line arguments that were used to launch Orthanc. The number of available arguments can be retrieved by OrthancPluginGetCommandLineArgumentsCount().
context | The Orthanc plugin context, as received by OrthancPluginInitialize(). |
argument | The index of the argument. |
uint32_t OrthancPluginGetCommandLineArgumentsCount | ( | OrthancPluginContext * | context | ) |
Retrieve the number of command-line arguments that were used to launch Orthanc.
context | The Orthanc plugin context, as received by OrthancPluginInitialize(). |
char* OrthancPluginGetConfiguration | ( | OrthancPluginContext * | context | ) |
This function returns the content of the configuration that is used by Orthanc, formatted as a JSON string.
context | The Orthanc plugin context, as received by OrthancPluginInitialize(). |
char* OrthancPluginGetConfigurationPath | ( | OrthancPluginContext * | context | ) |
This function returns the path to the configuration file(s) that was specified when starting Orthanc. Since version 0.9.1, this path can refer to a folder that stores a set of configuration files. This function is deprecated in favor of OrthancPluginGetConfiguration().
context | The Orthanc plugin context, as received by OrthancPluginInitialize(). |
const char* OrthancPluginGetErrorDescription | ( | OrthancPluginContext * | context, |
OrthancPluginErrorCode | error | ||
) |
This function returns the description of a given error code.
context | The Orthanc plugin context, as received by OrthancPluginInitialize(). |
error | The error code of interest. |
uint32_t OrthancPluginGetFindQuerySize | ( | OrthancPluginContext * | context, |
const OrthancPluginFindQuery * | query | ||
) |
This function returns the number of tags that are contained in the given C-Find query.
context | The Orthanc plugin context, as received by OrthancPluginInitialize(). |
query | The C-Find query. |
OrthancPluginErrorCode OrthancPluginGetFindQueryTag | ( | OrthancPluginContext * | context, |
uint16_t * | group, | ||
uint16_t * | element, | ||
const OrthancPluginFindQuery * | query, | ||
uint32_t | index | ||
) |
This function returns the group and the element of one DICOM tag in the given C-Find query.
context | The Orthanc plugin context, as received by OrthancPluginInitialize(). |
group | The group of the tag (output). |
element | The element of the tag (output). |
query | The C-Find query. |
index | The index of the tag of interest. |
char* OrthancPluginGetFindQueryTagName | ( | OrthancPluginContext * | context, |
const OrthancPluginFindQuery * | query, | ||
uint32_t | index | ||
) |
This function returns the symbolic name of one DICOM tag in the given C-Find query.
context | The Orthanc plugin context, as received by OrthancPluginInitialize(). |
query | The C-Find query. |
index | The index of the tag of interest. |
char* OrthancPluginGetFindQueryValue | ( | OrthancPluginContext * | context, |
const OrthancPluginFindQuery * | query, | ||
uint32_t | index | ||
) |
This function returns the value associated with one tag in the given C-Find query.
context | The Orthanc plugin context, as received by OrthancPluginInitialize(). |
query | The C-Find query. |
index | The index of the tag of interest. |
char* OrthancPluginGetOrthancDirectory | ( | OrthancPluginContext * | context | ) |
This function returns the path to the directory containing the Orthanc executable.
context | The Orthanc plugin context, as received by OrthancPluginInitialize(). |
char* OrthancPluginGetOrthancPath | ( | OrthancPluginContext * | context | ) |
This function returns the path to the Orthanc executable.
context | The Orthanc plugin context, as received by OrthancPluginInitialize(). |
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 | ||
) |
Make a HTTP call to the given URL. The result to the query is stored into a newly allocated memory buffer. The HTTP request will be done accordingly to the global configuration of Orthanc (in particular, the options "HttpProxy", "HttpTimeout", "HttpsVerifyPeers", "HttpsCACertificates", and "Pkcs11" will be taken into account).
context | The Orthanc plugin context, as received by OrthancPluginInitialize(). |
answerBody | The target memory buffer (out argument). It must be freed with OrthancPluginFreeMemoryBuffer(). |
answerHeaders | The target memory buffer for the HTTP headers in the answers (out argument). The answer headers are formatted as a JSON object (associative array). The buffer must be freed with OrthancPluginFreeMemoryBuffer(). This argument can be set to NULL if the plugin has no interest in the HTTP headers. |
httpStatus | The HTTP status after the execution of the request (out argument). |
method | HTTP method to be used. |
url | The URL of interest. |
headersCount | The number of HTTP headers. |
headersKeys | Array containing the keys of the HTTP headers (can be NULL if no header). |
headersValues | Array containing the values of the HTTP headers (can be NULL if no header). |
username | The username (can be NULL if no password protection). |
password | The password (can be NULL if no password protection). |
body | The body of the POST request. |
bodySize | The size of the body. |
timeout | Timeout in seconds (0 for default timeout). |
certificateFile | Path to the client certificate for HTTPS, in PEM format (can be NULL if no client certificate or if not using HTTPS). |
certificateKeyFile | Path to the key of the client certificate for HTTPS, in PEM format (can be NULL if no client certificate or if not using HTTPS). |
certificateKeyPassword | Password to unlock the key of the client certificate (can be NULL if no client certificate or if not using HTTPS). |
pkcs11 | Enable PKCS#11 client authentication for hardware security modules and smart cards. |
OrthancPluginErrorCode OrthancPluginHttpDelete | ( | OrthancPluginContext * | context, |
const char * | url, | ||
const char * | username, | ||
const char * | password | ||
) |
Make a HTTP DELETE call to the given URL. Favor OrthancPluginRestApiDelete() if calling the built-in REST API of the Orthanc instance that hosts this plugin.
context | The Orthanc plugin context, as received by OrthancPluginInitialize(). |
url | The URL of interest. |
username | The username (can be NULL if no password protection). |
password | The password (can be NULL if no password protection). |
OrthancPluginErrorCode OrthancPluginHttpGet | ( | OrthancPluginContext * | context, |
OrthancPluginMemoryBuffer * | target, | ||
const char * | url, | ||
const char * | username, | ||
const char * | password | ||
) |
Make a HTTP GET call to the given URL. The result to the query is stored into a newly allocated memory buffer. Favor OrthancPluginRestApiGet() if calling the built-in REST API of the Orthanc instance that hosts this plugin.
context | The Orthanc plugin context, as received by OrthancPluginInitialize(). |
target | The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer(). |
url | The URL of interest. |
username | The username (can be NULL if no password protection). |
password | The password (can be NULL if no password protection). |
OrthancPluginErrorCode OrthancPluginHttpPost | ( | OrthancPluginContext * | context, |
OrthancPluginMemoryBuffer * | target, | ||
const char * | url, | ||
const char * | body, | ||
uint32_t | bodySize, | ||
const char * | username, | ||
const char * | password | ||
) |
Make a HTTP POST call to the given URL. The result to the query is stored into a newly allocated memory buffer. Favor OrthancPluginRestApiPost() if calling the built-in REST API of the Orthanc instance that hosts this plugin.
context | The Orthanc plugin context, as received by OrthancPluginInitialize(). |
target | The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer(). |
url | The URL of interest. |
body | The content of the body of the request. |
bodySize | The size of the body of the request. |
username | The username (can be NULL if no password protection). |
password | The password (can be NULL if no password protection). |
OrthancPluginErrorCode OrthancPluginHttpPut | ( | OrthancPluginContext * | context, |
OrthancPluginMemoryBuffer * | target, | ||
const char * | url, | ||
const char * | body, | ||
uint32_t | bodySize, | ||
const char * | username, | ||
const char * | password | ||
) |
Make a HTTP PUT call to the given URL. The result to the query is stored into a newly allocated memory buffer. Favor OrthancPluginRestApiPut() if calling the built-in REST API of the Orthanc instance that hosts this plugin.
context | The Orthanc plugin context, as received by OrthancPluginInitialize(). |
target | The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer(). |
url | The URL of interest. |
body | The content of the body of the request. |
bodySize | The size of the body of the request. |
username | The username (can be NULL if no password protection). |
password | The password (can be NULL if no password protection). |
void OrthancPluginLogError | ( | OrthancPluginContext * | context, |
const char * | message | ||
) |
Log an error message using the Orthanc logging system.
context | The Orthanc plugin context, as received by OrthancPluginInitialize(). |
message | The message to be logged. |
void OrthancPluginLogInfo | ( | OrthancPluginContext * | context, |
const char * | message | ||
) |
Log an information message using the Orthanc logging system.
context | The Orthanc plugin context, as received by OrthancPluginInitialize(). |
message | The message to be logged. |
void OrthancPluginLogWarning | ( | OrthancPluginContext * | context, |
const char * | message | ||
) |
Log a warning message using the Orthanc logging system.
context | The Orthanc plugin context, as received by OrthancPluginInitialize(). |
message | The message to be logged. |
OrthancPluginErrorCode OrthancPluginLookupDictionary | ( | OrthancPluginContext * | context, |
OrthancPluginDictionaryEntry * | target, | ||
const char * | name | ||
) |
This functions makes a lookup in the dictionary of DICOM tags that are known to Orthanc, and returns information about this tag. The tag can be specified using its human-readable name (e.g. "PatientName") or a set of two hexadecimal numbers (e.g. "0010-0020").
context | The Orthanc plugin context, as received by OrthancPluginInitialize(). |
target | Where to store the information about the tag. |
name | The name of the DICOM tag. |
OrthancPluginErrorCode OrthancPluginReadFile | ( | OrthancPluginContext * | context, |
OrthancPluginMemoryBuffer * | target, | ||
const char * | path | ||
) |
Read the content of a file on the filesystem, and returns it into a newly allocated memory buffer.
context | The Orthanc plugin context, as received by OrthancPluginInitialize(). |
target | The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer(). |
path | The path of the file to be read. |
OrthancPluginErrorCode OrthancPluginRegisterDictionaryTag | ( | OrthancPluginContext * | context, |
uint16_t | group, | ||
uint16_t | element, | ||
OrthancPluginValueRepresentation | vr, | ||
const char * | name, | ||
uint32_t | minMultiplicity, | ||
uint32_t | maxMultiplicity | ||
) |
This function declares a new public tag in the dictionary of DICOM tags that are known to Orthanc. This function should be used in the OrthancPluginInitialize() callback.
context | The Orthanc plugin context, as received by OrthancPluginInitialize(). |
group | The group of the tag. |
element | The element of the tag. |
vr | The value representation of the tag. |
name | The nickname of the tag. |
minMultiplicity | The minimum multiplicity of the tag (must be above 0). |
maxMultiplicity | The maximum multiplicity of the tag. A value of 0 means an arbitrary multiplicity ("<tt>n</tt>"). |
OrthancPluginErrorCode OrthancPluginRegisterErrorCode | ( | OrthancPluginContext * | context, |
int32_t | code, | ||
uint16_t | httpStatus, | ||
const char * | message | ||
) |
This function declares a custom error code that can be generated by this plugin. This declaration is used to enrich the body of the HTTP answer in the case of an error, and to set the proper HTTP status code.
context | The Orthanc plugin context, as received by OrthancPluginInitialize(). |
code | The error code that is internal to this plugin. |
httpStatus | The HTTP status corresponding to this error. |
message | The description of the error. |
OrthancPluginErrorCode OrthancPluginRegisterFindCallback | ( | OrthancPluginContext * | context, |
OrthancPluginFindCallback | callback | ||
) |
This function registers a callback to handle C-Find SCP requests that are not related to modality worklists.
context | The Orthanc plugin context, as received by OrthancPluginInitialize(). |
callback | The callback. |
OrthancPluginErrorCode OrthancPluginRegisterMoveCallback | ( | OrthancPluginContext * | context, |
OrthancPluginMoveCallback | callback, | ||
OrthancPluginGetMoveSize | getMoveSize, | ||
OrthancPluginApplyMove | applyMove, | ||
OrthancPluginFreeMove | freeMove | ||
) |
This function registers a callback to handle C-Move SCP requests.
context | The Orthanc plugin context, as received by OrthancPluginInitialize(). |
callback | The main callback. |
getMoveSize | Callback to read the number of C-Move suboperations. |
applyMove | Callback to apply one C-Move suboperations. |
freeMove | Callback to free the C-Move driver. |
OrthancPluginErrorCode OrthancPluginRegisterPrivateDictionaryTag | ( | OrthancPluginContext * | context, |
uint16_t | group, | ||
uint16_t | element, | ||
OrthancPluginValueRepresentation | vr, | ||
const char * | name, | ||
uint32_t | minMultiplicity, | ||
uint32_t | maxMultiplicity, | ||
const char * | privateCreator | ||
) |
This function declares a new private tag in the dictionary of DICOM tags that are known to Orthanc. This function should be used in the OrthancPluginInitialize() callback.
context | The Orthanc plugin context, as received by OrthancPluginInitialize(). |
group | The group of the tag. |
element | The element of the tag. |
vr | The value representation of the tag. |
name | The nickname of the tag. |
minMultiplicity | The minimum multiplicity of the tag (must be above 0). |
maxMultiplicity | The maximum multiplicity of the tag. A value of 0 means an arbitrary multiplicity ("<tt>n</tt>"). |
privateCreator | The private creator of this private tag. |
OrthancPluginErrorCode OrthancPluginRegisterWorklistCallback | ( | OrthancPluginContext * | context, |
OrthancPluginWorklistCallback | callback | ||
) |
This function registers a callback to handle C-Find SCP requests on modality worklists.
context | The Orthanc plugin context, as received by OrthancPluginInitialize(). |
callback | The callback. |
void OrthancPluginSetDescription | ( | OrthancPluginContext * | context, |
const char * | description | ||
) |
Set a description for this plugin. It is displayed in the "Plugins" page of Orthanc Explorer.
context | The Orthanc plugin context, as received by OrthancPluginInitialize(). |
description | The description. |
void OrthancPluginSetRootUri | ( | OrthancPluginContext * | context, |
const char * | uri | ||
) |
For plugins that come with a Web interface, this function declares the entry path where to find this interface. This information is notably used in the "Plugins" page of Orthanc Explorer.
context | The Orthanc plugin context, as received by OrthancPluginInitialize(). |
uri | The root URI for this plugin. |
OrthancPluginErrorCode OrthancPluginWorklistAddAnswer | ( | OrthancPluginContext * | context, |
OrthancPluginWorklistAnswers * | answers, | ||
const OrthancPluginWorklistQuery * | query, | ||
const void * | dicom, | ||
uint32_t | size | ||
) |
This function adds one worklist (encoded as a DICOM file) to the set of answers corresponding to some C-Find SCP request against modality worklists.
context | The Orthanc plugin context, as received by OrthancPluginInitialize(). |
answers | The set of answers. |
query | The worklist query, as received by the callback. |
dicom | The worklist to answer, encoded as a DICOM file. |
size | The size of the DICOM file. |
OrthancPluginErrorCode OrthancPluginWorklistGetDicomQuery | ( | OrthancPluginContext * | context, |
OrthancPluginMemoryBuffer * | target, | ||
const OrthancPluginWorklistQuery * | query | ||
) |
This function retrieves the DICOM file that underlies a C-Find SCP query against modality worklists.
context | The Orthanc plugin context, as received by OrthancPluginInitialize(). |
target | Memory buffer where to store the DICOM file. It must be freed with OrthancPluginFreeMemoryBuffer(). |
query | The worklist query, as received by the callback. |
int32_t OrthancPluginWorklistIsMatch | ( | OrthancPluginContext * | context, |
const OrthancPluginWorklistQuery * | query, | ||
const void * | dicom, | ||
uint32_t | size | ||
) |
This function checks whether one worklist (encoded as a DICOM file) matches the C-Find SCP query against modality worklists. This function must be called before adding the worklist as an answer through OrthancPluginWorklistAddAnswer().
context | The Orthanc plugin context, as received by OrthancPluginInitialize(). |
query | The worklist query, as received by the callback. |
dicom | The worklist to answer, encoded as a DICOM file. |
size | The size of the DICOM file. |
OrthancPluginErrorCode OrthancPluginWorklistMarkIncomplete | ( | OrthancPluginContext * | context, |
OrthancPluginWorklistAnswers * | answers | ||
) |
This function marks as incomplete the set of answers corresponding to some C-Find SCP request against modality worklists. This must be used if canceling the handling of a request when too many answers are to be returned.
context | The Orthanc plugin context, as received by OrthancPluginInitialize(). |
answers | The set of answers. |
OrthancPluginErrorCode OrthancPluginWriteFile | ( | OrthancPluginContext * | context, |
const char * | path, | ||
const void * | data, | ||
uint32_t | size | ||
) |
Write the content of a memory buffer to the filesystem.
context | The Orthanc plugin context, as received by OrthancPluginInitialize(). |
path | The path of the file to be written. |
data | The content of the memory buffer. |
size | The size of the memory buffer. |