Orthanc Plugin SDK
Documentation of the plugin interface of Orthanc
Classes | Typedefs | Enumerations | Functions
Toolbox

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...
 

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 void(* OrthancPluginFree) (void *buffer)
 Signature of a function to free dynamic memory.
 
typedef struct _OrthancPluginContext_t OrthancPluginContext
 Data structure that contains information about the Orthanc core.
 

Enumerations

enum  OrthancPluginErrorCode {
  OrthancPluginErrorCode_InternalError,
  OrthancPluginErrorCode_Success,
  OrthancPluginErrorCode_Plugin,
  OrthancPluginErrorCode_NotImplemented,
  OrthancPluginErrorCode_ParameterOutOfRange,
  OrthancPluginErrorCode_NotEnoughMemory,
  OrthancPluginErrorCode_BadParameterType,
  OrthancPluginErrorCode_BadSequenceOfCalls,
  OrthancPluginErrorCode_InexistentItem,
  OrthancPluginErrorCode_BadRequest,
  OrthancPluginErrorCode_NetworkProtocol,
  OrthancPluginErrorCode_SystemCommand,
  OrthancPluginErrorCode_Database,
  OrthancPluginErrorCode_UriSyntax,
  OrthancPluginErrorCode_InexistentFile,
  OrthancPluginErrorCode_CannotWriteFile,
  OrthancPluginErrorCode_BadFileFormat,
  OrthancPluginErrorCode_Timeout,
  OrthancPluginErrorCode_UnknownResource,
  OrthancPluginErrorCode_IncompatibleDatabaseVersion,
  OrthancPluginErrorCode_FullStorage,
  OrthancPluginErrorCode_CorruptedFile,
  OrthancPluginErrorCode_InexistentTag,
  OrthancPluginErrorCode_ReadOnly,
  OrthancPluginErrorCode_IncompatibleImageFormat,
  OrthancPluginErrorCode_IncompatibleImageSize,
  OrthancPluginErrorCode_SharedLibrary,
  OrthancPluginErrorCode_UnknownPluginService,
  OrthancPluginErrorCode_UnknownDicomTag,
  OrthancPluginErrorCode_BadJson,
  OrthancPluginErrorCode_Unauthorized,
  OrthancPluginErrorCode_BadFont,
  OrthancPluginErrorCode_SQLiteNotOpened,
  OrthancPluginErrorCode_SQLiteAlreadyOpened,
  OrthancPluginErrorCode_SQLiteCannotOpen,
  OrthancPluginErrorCode_SQLiteStatementAlreadyUsed,
  OrthancPluginErrorCode_SQLiteExecute,
  OrthancPluginErrorCode_SQLiteRollbackWithoutTransaction,
  OrthancPluginErrorCode_SQLiteCommitWithoutTransaction,
  OrthancPluginErrorCode_SQLiteRegisterFunction,
  OrthancPluginErrorCode_SQLiteFlush,
  OrthancPluginErrorCode_SQLiteCannotRun,
  OrthancPluginErrorCode_SQLiteCannotStep,
  OrthancPluginErrorCode_SQLiteBindOutOfRange,
  OrthancPluginErrorCode_SQLitePrepareStatement,
  OrthancPluginErrorCode_SQLiteTransactionAlreadyStarted,
  OrthancPluginErrorCode_SQLiteTransactionCommit,
  OrthancPluginErrorCode_SQLiteTransactionBegin,
  OrthancPluginErrorCode_DirectoryOverFile,
  OrthancPluginErrorCode_FileStorageCannotWrite,
  OrthancPluginErrorCode_DirectoryExpected,
  OrthancPluginErrorCode_HttpPortInUse,
  OrthancPluginErrorCode_DicomPortInUse,
  OrthancPluginErrorCode_BadHttpStatusInRest,
  OrthancPluginErrorCode_RegularFileExpected,
  OrthancPluginErrorCode_PathToExecutable,
  OrthancPluginErrorCode_MakeDirectory,
  OrthancPluginErrorCode_BadApplicationEntityTitle,
  OrthancPluginErrorCode_NoCFindHandler,
  OrthancPluginErrorCode_NoCMoveHandler,
  OrthancPluginErrorCode_NoCStoreHandler,
  OrthancPluginErrorCode_NoApplicationEntityFilter,
  OrthancPluginErrorCode_NoSopClassOrInstance,
  OrthancPluginErrorCode_NoPresentationContext,
  OrthancPluginErrorCode_DicomFindUnavailable,
  OrthancPluginErrorCode_DicomMoveUnavailable,
  OrthancPluginErrorCode_CannotStoreInstance,
  OrthancPluginErrorCode_CreateDicomNotString,
  OrthancPluginErrorCode_CreateDicomOverrideTag,
  OrthancPluginErrorCode_CreateDicomUseContent,
  OrthancPluginErrorCode_CreateDicomNoPayload,
  OrthancPluginErrorCode_CreateDicomUseDataUriScheme,
  OrthancPluginErrorCode_CreateDicomBadParent,
  OrthancPluginErrorCode_CreateDicomParentIsInstance,
  OrthancPluginErrorCode_CreateDicomParentEncoding,
  OrthancPluginErrorCode_UnknownModality,
  OrthancPluginErrorCode_BadJobOrdering,
  OrthancPluginErrorCode_JsonToLuaTable,
  OrthancPluginErrorCode_CannotCreateLua,
  OrthancPluginErrorCode_CannotExecuteLua,
  OrthancPluginErrorCode_LuaAlreadyExecuted,
  OrthancPluginErrorCode_LuaBadOutput,
  OrthancPluginErrorCode_NotLuaPredicate,
  OrthancPluginErrorCode_LuaReturnsNoString
}
 
enum  OrthancPluginHttpMethod {
  OrthancPluginHttpMethod_Get,
  OrthancPluginHttpMethod_Post,
  OrthancPluginHttpMethod_Put,
  OrthancPluginHttpMethod_Delete
}
 
enum  OrthancPluginContentType {
  OrthancPluginContentType_Unknown,
  OrthancPluginContentType_Dicom,
  OrthancPluginContentType_DicomAsJson
}
 
enum  OrthancPluginResourceType {
  OrthancPluginResourceType_Patient,
  OrthancPluginResourceType_Study,
  OrthancPluginResourceType_Series,
  OrthancPluginResourceType_Instance
}
 

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...
 

Detailed Description

Enumeration Type Documentation

The content types that are supported by Orthanc plugins.

Enumerator
OrthancPluginContentType_Unknown 

Unknown content type

OrthancPluginContentType_Dicom 

DICOM

OrthancPluginContentType_DicomAsJson 

JSON summary of a DICOM file

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.

Enumerator
OrthancPluginErrorCode_InternalError 

Internal error

OrthancPluginErrorCode_Success 

Success

OrthancPluginErrorCode_Plugin 

Error encountered within the plugin engine

OrthancPluginErrorCode_NotImplemented 

Not implemented yet

OrthancPluginErrorCode_ParameterOutOfRange 

Parameter out of range

OrthancPluginErrorCode_NotEnoughMemory 

Not enough memory

OrthancPluginErrorCode_BadParameterType 

Bad type for a parameter

OrthancPluginErrorCode_BadSequenceOfCalls 

Bad sequence of calls

OrthancPluginErrorCode_InexistentItem 

Accessing an inexistent item

OrthancPluginErrorCode_BadRequest 

Bad request

OrthancPluginErrorCode_NetworkProtocol 

Error in the network protocol

OrthancPluginErrorCode_SystemCommand 

Error while calling a system command

OrthancPluginErrorCode_Database 

Error with the database engine

OrthancPluginErrorCode_UriSyntax 

Badly formatted URI

OrthancPluginErrorCode_InexistentFile 

Inexistent file

OrthancPluginErrorCode_CannotWriteFile 

Cannot write to file

OrthancPluginErrorCode_BadFileFormat 

Bad file format

OrthancPluginErrorCode_Timeout 

Timeout

OrthancPluginErrorCode_UnknownResource 

Unknown resource

OrthancPluginErrorCode_IncompatibleDatabaseVersion 

Incompatible version of the database

OrthancPluginErrorCode_FullStorage 

The file storage is full

OrthancPluginErrorCode_CorruptedFile 

Corrupted file (e.g. inconsistent MD5 hash)

OrthancPluginErrorCode_InexistentTag 

Inexistent tag

OrthancPluginErrorCode_ReadOnly 

Cannot modify a read-only data structure

OrthancPluginErrorCode_IncompatibleImageFormat 

Incompatible format of the images

OrthancPluginErrorCode_IncompatibleImageSize 

Incompatible size of the images

OrthancPluginErrorCode_SharedLibrary 

Error while using a shared library (plugin)

OrthancPluginErrorCode_UnknownPluginService 

Plugin invoking an unknown service

OrthancPluginErrorCode_UnknownDicomTag 

Unknown DICOM tag

OrthancPluginErrorCode_BadJson 

Cannot parse a JSON document

OrthancPluginErrorCode_Unauthorized 

Bad credentials were provided to an HTTP request

OrthancPluginErrorCode_BadFont 

Badly formatted font file

OrthancPluginErrorCode_SQLiteNotOpened 

SQLite: The database is not opened

OrthancPluginErrorCode_SQLiteAlreadyOpened 

SQLite: Connection is already open

OrthancPluginErrorCode_SQLiteCannotOpen 

SQLite: Unable to open the database

OrthancPluginErrorCode_SQLiteStatementAlreadyUsed 

SQLite: This cached statement is already being referred to

OrthancPluginErrorCode_SQLiteExecute 

SQLite: Cannot execute a command

OrthancPluginErrorCode_SQLiteRollbackWithoutTransaction 

SQLite: Rolling back a nonexistent transaction (have you called Begin()?)

OrthancPluginErrorCode_SQLiteCommitWithoutTransaction 

SQLite: Committing a nonexistent transaction

OrthancPluginErrorCode_SQLiteRegisterFunction 

SQLite: Unable to register a function

OrthancPluginErrorCode_SQLiteFlush 

SQLite: Unable to flush the database

OrthancPluginErrorCode_SQLiteCannotRun 

SQLite: Cannot run a cached statement

OrthancPluginErrorCode_SQLiteCannotStep 

SQLite: Cannot step over a cached statement

OrthancPluginErrorCode_SQLiteBindOutOfRange 

SQLite: Bing a value while out of range (serious error)

OrthancPluginErrorCode_SQLitePrepareStatement 

SQLite: Cannot prepare a cached statement

OrthancPluginErrorCode_SQLiteTransactionAlreadyStarted 

SQLite: Beginning the same transaction twice

OrthancPluginErrorCode_SQLiteTransactionCommit 

SQLite: Failure when committing the transaction

OrthancPluginErrorCode_SQLiteTransactionBegin 

SQLite: Cannot start a transaction

OrthancPluginErrorCode_DirectoryOverFile 

The directory to be created is already occupied by a regular file

OrthancPluginErrorCode_FileStorageCannotWrite 

Unable to create a subdirectory or a file in the file storage

OrthancPluginErrorCode_DirectoryExpected 

The specified path does not point to a directory

OrthancPluginErrorCode_HttpPortInUse 

The TCP port of the HTTP server is already in use

OrthancPluginErrorCode_DicomPortInUse 

The TCP port of the DICOM server is already in use

OrthancPluginErrorCode_BadHttpStatusInRest 

This HTTP status is not allowed in a REST API

OrthancPluginErrorCode_RegularFileExpected 

The specified path does not point to a regular file

OrthancPluginErrorCode_PathToExecutable 

Unable to get the path to the executable

OrthancPluginErrorCode_MakeDirectory 

Cannot create a directory

OrthancPluginErrorCode_BadApplicationEntityTitle 

An application entity title (AET) cannot be empty or be longer than 16 characters

OrthancPluginErrorCode_NoCFindHandler 

No request handler factory for DICOM C-FIND SCP

OrthancPluginErrorCode_NoCMoveHandler 

No request handler factory for DICOM C-MOVE SCP

OrthancPluginErrorCode_NoCStoreHandler 

No request handler factory for DICOM C-STORE SCP

OrthancPluginErrorCode_NoApplicationEntityFilter 

No application entity filter

OrthancPluginErrorCode_NoSopClassOrInstance 

DicomUserConnection: Unable to find the SOP class and instance

OrthancPluginErrorCode_NoPresentationContext 

DicomUserConnection: No acceptable presentation context for modality

OrthancPluginErrorCode_DicomFindUnavailable 

DicomUserConnection: The C-FIND command is not supported by the remote SCP

OrthancPluginErrorCode_DicomMoveUnavailable 

DicomUserConnection: The C-MOVE command is not supported by the remote SCP

OrthancPluginErrorCode_CannotStoreInstance 

Cannot store an instance

OrthancPluginErrorCode_CreateDicomNotString 

Only string values are supported when creating DICOM instances

OrthancPluginErrorCode_CreateDicomOverrideTag 

Trying to override a value inherited from a parent module

OrthancPluginErrorCode_CreateDicomUseContent 

Use "Content" to inject an image into a new DICOM instance

OrthancPluginErrorCode_CreateDicomNoPayload 

No payload is present for one instance in the series

OrthancPluginErrorCode_CreateDicomUseDataUriScheme 

The payload of the DICOM instance must be specified according to Data URI scheme

OrthancPluginErrorCode_CreateDicomBadParent 

Trying to attach a new DICOM instance to an inexistent resource

OrthancPluginErrorCode_CreateDicomParentIsInstance 

Trying to attach a new DICOM instance to an instance (must be a series, study or patient)

OrthancPluginErrorCode_CreateDicomParentEncoding 

Unable to get the encoding of the parent resource

OrthancPluginErrorCode_UnknownModality 

Unknown modality

OrthancPluginErrorCode_BadJobOrdering 

Bad ordering of filters in a job

OrthancPluginErrorCode_JsonToLuaTable 

Cannot convert the given JSON object to a Lua table

OrthancPluginErrorCode_CannotCreateLua 

Cannot create the Lua context

OrthancPluginErrorCode_CannotExecuteLua 

Cannot execute a Lua command

OrthancPluginErrorCode_LuaAlreadyExecuted 

Arguments cannot be pushed after the Lua function is executed

OrthancPluginErrorCode_LuaBadOutput 

The Lua function does not give the expected number of outputs

OrthancPluginErrorCode_NotLuaPredicate 

The Lua function is not a predicate (only true/false outputs allowed)

OrthancPluginErrorCode_LuaReturnsNoString 

The Lua function does not return a string

The various HTTP methods for a REST call.

Enumerator
OrthancPluginHttpMethod_Get 

GET request

OrthancPluginHttpMethod_Post 

POST request

OrthancPluginHttpMethod_Put 

PUT request

OrthancPluginHttpMethod_Delete 

DELETE request

The supported types of DICOM resources.

Enumerator
OrthancPluginResourceType_Patient 

Patient

OrthancPluginResourceType_Study 

Study

OrthancPluginResourceType_Series 

Series

OrthancPluginResourceType_Instance 

Instance

Function Documentation

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.

Parameters
contextThe Orthanc plugin context, as received by OrthancPluginInitialize().
javascriptThe custom JavaScript code.
void OrthancPluginFreeMemoryBuffer ( OrthancPluginContext context,
OrthancPluginMemoryBuffer buffer 
)

Free a memory buffer that was allocated by the core system of Orthanc.

Parameters
contextThe Orthanc plugin context, as received by OrthancPluginInitialize().
bufferThe memory buffer to release.
void OrthancPluginFreeString ( OrthancPluginContext context,
char *  str 
)

Free a string that was allocated by the core system of Orthanc.

Parameters
contextThe Orthanc plugin context, as received by OrthancPluginInitialize().
strThe string to be freed.
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().

Parameters
contextThe Orthanc plugin context, as received by OrthancPluginInitialize().
argumentThe index of the argument.
Returns
The value of the argument, or NULL in the case of an error. This string must be freed by OrthancPluginFreeString().
uint32_t OrthancPluginGetCommandLineArgumentsCount ( OrthancPluginContext context)

Retrieve the number of command-line arguments that were used to launch Orthanc.

Parameters
contextThe Orthanc plugin context, as received by OrthancPluginInitialize().
Returns
The number of arguments.
char* OrthancPluginGetConfiguration ( OrthancPluginContext context)

This function returns the content of the configuration that is used by Orthanc, formatted as a JSON string.

Parameters
contextThe Orthanc plugin context, as received by OrthancPluginInitialize().
Returns
NULL in the case of an error, or a newly allocated string containing the configuration. This string must be freed by OrthancPluginFreeString().
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().

Parameters
contextThe Orthanc plugin context, as received by OrthancPluginInitialize().
Returns
NULL in the case of an error, or a newly allocated string containing the path. This string must be freed by OrthancPluginFreeString().
See also
OrthancPluginGetConfiguration()
const char* OrthancPluginGetErrorDescription ( OrthancPluginContext context,
OrthancPluginErrorCode  error 
)

This function returns the description of a given error code.

Parameters
contextThe Orthanc plugin context, as received by OrthancPluginInitialize().
errorThe error code of interest.
Returns
The error description. This is a statically-allocated string, do not free it.
char* OrthancPluginGetOrthancDirectory ( OrthancPluginContext context)

This function returns the path to the directory containing the Orthanc executable.

Parameters
contextThe Orthanc plugin context, as received by OrthancPluginInitialize().
Returns
NULL in the case of an error, or a newly allocated string containing the path. This string must be freed by OrthancPluginFreeString().
char* OrthancPluginGetOrthancPath ( OrthancPluginContext context)

This function returns the path to the Orthanc executable.

Parameters
contextThe Orthanc plugin context, as received by OrthancPluginInitialize().
Returns
NULL in the case of an error, or a newly allocated string containing the path. This string must be freed by OrthancPluginFreeString().
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.

Parameters
contextThe Orthanc plugin context, as received by OrthancPluginInitialize().
urlThe URL of interest.
usernameThe username (can be NULL if no password protection).
passwordThe password (can be NULL if no password protection).
Returns
0 if success, or the error code if failure.
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.

Parameters
contextThe Orthanc plugin context, as received by OrthancPluginInitialize().
targetThe target memory buffer.
urlThe URL of interest.
usernameThe username (can be NULL if no password protection).
passwordThe password (can be NULL if no password protection).
Returns
0 if success, or the error code if failure.
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.

Parameters
contextThe Orthanc plugin context, as received by OrthancPluginInitialize().
targetThe target memory buffer.
urlThe URL of interest.
bodyThe content of the body of the request.
bodySizeThe size of the body of the request.
usernameThe username (can be NULL if no password protection).
passwordThe password (can be NULL if no password protection).
Returns
0 if success, or the error code if failure.
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.

Parameters
contextThe Orthanc plugin context, as received by OrthancPluginInitialize().
targetThe target memory buffer.
urlThe URL of interest.
bodyThe content of the body of the request.
bodySizeThe size of the body of the request.
usernameThe username (can be NULL if no password protection).
passwordThe password (can be NULL if no password protection).
Returns
0 if success, or the error code if failure.
void OrthancPluginLogError ( OrthancPluginContext context,
const char *  message 
)

Log an error message using the Orthanc logging system.

Parameters
contextThe Orthanc plugin context, as received by OrthancPluginInitialize().
messageThe message to be logged.
void OrthancPluginLogInfo ( OrthancPluginContext context,
const char *  message 
)

Log an information message using the Orthanc logging system.

Parameters
contextThe Orthanc plugin context, as received by OrthancPluginInitialize().
messageThe message to be logged.
void OrthancPluginLogWarning ( OrthancPluginContext context,
const char *  message 
)

Log a warning message using the Orthanc logging system.

Parameters
contextThe Orthanc plugin context, as received by OrthancPluginInitialize().
messageThe message to be logged.
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.

Parameters
contextThe Orthanc plugin context, as received by OrthancPluginInitialize().
targetThe target memory buffer.
pathThe path of the file to be read.
Returns
0 if success, or the error code if failure.
void OrthancPluginSetDescription ( OrthancPluginContext context,
const char *  description 
)

Set a description for this plugin. It is displayed in the "Plugins" page of Orthanc Explorer.

Parameters
contextThe Orthanc plugin context, as received by OrthancPluginInitialize().
descriptionThe 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.

Parameters
contextThe Orthanc plugin context, as received by OrthancPluginInitialize().
uriThe root URI for this plugin.
OrthancPluginErrorCode OrthancPluginWriteFile ( OrthancPluginContext context,
const char *  path,
const void *  data,
uint32_t  size 
)

Write the content of a memory buffer to the filesystem.

Parameters
contextThe Orthanc plugin context, as received by OrthancPluginInitialize().
pathThe path of the file to be written.
dataThe content of the memory buffer.
sizeThe size of the memory buffer.
Returns
0 if success, or the error code if failure.