Skip to content
This repository has been archived by the owner on May 12, 2023. It is now read-only.

Latest commit

 

History

History
841 lines (651 loc) · 36.3 KB

DOCUMENTATION.md

File metadata and controls

841 lines (651 loc) · 36.3 KB

Client

Kind: global class

new Client(param)

Creates a new Client

Param Type Default Description
param Object
[param.url] String http://localhost:8042 Orthanc REST API's URL
[param.auth] Object
[param.auth.user] String Valid Orthanc Server username
[param.auth.pass] String Valid Orthanc Server password

client.url : String

Orthanc REST API's url

Kind: instance property of Client

client.auth : Object

Orthanc REST API's user credentials

Kind: instance property of Client
Properties

Name Type Description
username String Username which will be used by the client to authenticate against Orthanc server
password String Password which will be used by the client to authenticate against Orthanc server

client.instances

Operations over instances

Kind: instance property of Client

instances.getAll() ⇒ Promise

Get all instances

Kind: static method of instances
Returns: Promise - The expected response is an array containing Strings

instances.get(id) ⇒ Promise

Get the instance with the given id

Kind: static method of instances
Returns: Promise - The expected result is a JSON object

Param Type Description
id String Id of the targeted instance

instances.add(buffer) ⇒ Promise

Add the new DICOM file given as a Buffer

Kind: static method of instances
Returns: Promise - The expected result is a JSON object

Param Type Description
buffer Buffer The DICOM file which will be uploaded

instances.getContent(id, [group], [element], [index]) ⇒ Promise

Get raw access to DICOM tags. If both group and element are provided, get raw access to the value of the targeted DICOM tag. If index is also provided, get raw access to the targeted DICOM sequence value.

Kind: static method of instances
Returns: Promise - The expected value is either an array containing Strings, either a String (if group and element are both provided)

Param Type Description
id String Id of the targeted instance
[group] String Group number of the targeted element
[element] String Element number of the targeted value
[index] Integer Index number of the targeted sequence value

instances.export(id) ⇒ Promise

Write the DICOM file in the filesystem where Orthanc is running

Kind: static method of instances
Returns: Promise - The expected response is an empty JSON object

Param Type Description
id String Id of the targeted instance

instances.getFile(id) ⇒ Promise

Get the .dcm file of the instance with the given id

Kind: static method of instances
Returns: Promise - The expected response is a Buffer

Param Type Description
id String Id of the targeted instance

instances.getAllFrames(id) ⇒ Promise

Get an array containing all the frames index of the instance with the given id

Kind: static method of instances
Returns: Promise - The expected response is an array containing Integers

Param Type Description
id String Id of the targeted instance

instances.getFrame(id, frameNumber, [frameFormat])

Get the frameNumber'th frame of the instance with the given id

Kind: static method of instances

Param Type Default Description
id String Id of the targeted instance
frameNumber Integer Index of the targeted frame
[frameFormat] String preview Wanted format for the targeted frame. Must be image-int16, image-uint16, image-uint8, matlab or preview

instances.getImage(id, [imageFormat])

Get the image of the instance with the given id

Kind: static method of instances

Param Type Default Description
id String Id of the targeted instance
[imageFormat] String preview Wanted format for the targeted frame. Must be image-int16, image-uint16, image-uint8, matlab or preview

instances.getModule(id, [simplify]) ⇒ Promise

Kind: static method of instances
Returns: Promise - The expected response is a JSON object
Todo

  • Improve the documentation of this function
Param Type Default Description
id String Id of the targeted instance
[simplify] Boolean false Specify whether or not the output should be simplified

instances.getPatient(id) ⇒ Promise

Get the parent Patient of the instance with the given id

Kind: static method of instances
Returns: Promise - The expected result is a JSON objects

Param Type Description
id String Id of the targeted instance

instances.getSeries(id) ⇒ Promise

Get the parent Series of the instance with the given id

Kind: static method of instances
Returns: Promise - The expected result is a JSON objects

Param Type Description
id String Id of the targeted instance

instances.getTags(id, [simplify]) ⇒ Promise

Get the tags of the instance with the given id

Kind: static method of instances
Returns: Promise - The expected response is a JSON object

Param Type Default Description
id String Id of the targeted instance
[simplify] Boolean false Specify whether or not the output should be simplified

instances.getStatistics(id) ⇒ Promise

Get some general informations about the instance with the given id

Kind: static method of instances
Returns: Promise - The expected response is a JSON object

Param Type Description
id String Id of the targeted instance

instances.getStudy(id) ⇒ Promise

Get the parent Study of the instance with the given id

Kind: static method of instances
Returns: Promise - The expected result is a JSON objects

Param Type Description
id String Id of the targeted instance

client.series

Operations over series

Kind: instance property of Client

series.getAll() ⇒ Promise

Get all series

Kind: static method of series
Returns: Promise - The expected result is an array containing Strings

series.get(id) ⇒ Promise

Get the series with the given id

Kind: static method of series
Returns: Promise - The expected result is a JSON object

Param Type Description
id String Id of the targeted series

series.getArchive(id) ⇒ Promise

Get a zipped archive containing the series with the given id

Kind: static method of series
Returns: Promise - The expected response is a Buffer

Param Type Description
id String Id of the targeted series

series.getInstances(id) ⇒ Promise

Get all the instances of the series with the given id

Kind: static method of series
Returns: Promise - The expected response is an array of JSON objects

Param Type Description
id String Id of the targeted series

series.getMedia(id) ⇒ Promise

Get a zipped archive containing the series with the given id for media storage with DICOMDIR

Kind: static method of series
Returns: Promise - The expected response is a Buffer

Param Type Description
id String Id of the targeted series

series.getModule(id, [simplify]) ⇒ Promise

Kind: static method of series
Returns: Promise - The expected response is a JSON object
Todo

  • Improve the documentation of this function
Param Type Default Description
id String Id of the targeted series
[simplify] Boolean false Specify whether or not the output should be simplified

series.getPatient(id) ⇒ Promise

Get the parent Patient of the series with the given id

Kind: static method of series
Returns: Promise - The expected result is an array of JSON objects

Param Type Description
id String Id of the targeted series

series.getSharedTags(id, [simplify]) ⇒ Promise

Get the shared tags of the series with the given id

Kind: static method of series
Returns: Promise - The expected response is a JSON object

Param Type Default Description
id String Id of the targeted series
[simplify] Boolean false Specify whether or not the output should be simplified

series.getStatistics(id) ⇒ Promise

Get some general informations about the series with the given id

Kind: static method of series
Returns: Promise - The expected response is a JSON object

Param Type Description
id String Id of the targeted series

series.getStudy(id) ⇒ Promise

Get the parent Study of the series with the given id

Kind: static method of series
Returns: Promise - The expected result is an array of JSON objects

Param Type Description
id String Id of the targeted series

client.studies

Operations over studies

Kind: instance property of Client

studies.getAll() ⇒ Promise

Get all studies

Kind: static method of studies
Returns: Promise - The expected result is an array containing Strings

studies.get(id) ⇒ Promise

Get the study with the given id

Kind: static method of studies
Returns: Promise - The expected result is a JSON object

Param Type Description
id String Id of the targeted study

studies.getArchive(id) ⇒ Promise

Get a zipped archive containing the study with the given id

Kind: static method of studies
Returns: Promise - The expected response is a Buffer

Param Type Description
id String Id of the targeted study

studies.getInstances(id) ⇒ Promise

Get all the instances of the study with the given id

Kind: static method of studies
Returns: Promise - The expected response is an array of JSON objects

Param Type Description
id String Id of the targeted study

studies.getMedia(id) ⇒ Promise

Get a zipped archive containing the study with the given id for media storage with DICOMDIR

Kind: static method of studies
Returns: Promise - The expected response is a Buffer

Param Type Description
id String Id of the targeted study

studies.getModule(id, [simplify]) ⇒ Promise

Kind: static method of studies
Returns: Promise - The expected response is a JSON object
Todo

  • Improve the documentation of this function
Param Type Default Description
id String Id of the targeted study
[simplify] Boolean false Specify whether or not the output should be simplified

studies.getModulePatient(id, [simplify]) ⇒ Promise

Kind: static method of studies
Returns: Promise - The expected response is a JSON object
Todo

  • Improve the documentation of this function
Param Type Default Description
id String Id of the targeted study
[simplify] Boolean false Specify whether or not the output should be simplified

studies.getPatient(id) ⇒ Promise

Get the parent Patient of the study with the given id

Kind: static method of studies
Returns: Promise - The expected result is an array of JSON objects

Param Type Description
id String Id of the targeted study

studies.getSeries(id) ⇒ Promise

Get all the series of the study with the given id

Kind: static method of studies
Returns: Promise - The expected result is an array of JSON objects

Param Type Description
id String Id of the targeted study

studies.getSharedTags(id, [simplify]) ⇒ Promise

Get the shared tags of the study with the given id

Kind: static method of studies
Returns: Promise - The expected response is a JSON object

Param Type Default Description
id String Id of the targeted study
[simplify] Boolean false Specify whether or not the output should be simplified

studies.getStatistics(id) ⇒ Promise

Get some general informations about the study with the given id

Kind: static method of studies
Returns: Promise - The expected response is a JSON object

Param Type Description
id String Id of the targeted study

client.patients

Operations over patients

Kind: instance property of Client

patients.getAll() ⇒ Promise

Get all patients

Kind: static method of patients
Returns: Promise - The expected result is an array containing Strings

patients.get(id) ⇒ Promise

Get the patient with the given id

Kind: static method of patients
Returns: Promise - The expected result is a JSON object

Param Type Description
id String Id of the targeted patient

patients.getArchive(id) ⇒ Promise

Get a zipped archive containing the patient with the given id

Kind: static method of patients
Returns: Promise - The expected response is a Buffer

Param Type Description
id String Id of the targeted patient

patients.getInstances(id) ⇒ Promise

Get all the instances of the patient with the given id

Kind: static method of patients
Returns: Promise - The expected response is an array of JSON objects

Param Type Description
id String Id of the targeted patient

patients.getMedia(id) ⇒ Promise

Get a zipped archive containing the patient with the given id for media storage with DICOMDIR

Kind: static method of patients
Returns: Promise - The expected response is a Buffer

Param Type Description
id String Id of the targeted patient

patients.getModule(id, [simplify]) ⇒ Promise

Kind: static method of patients
Returns: Promise - The expected response is a JSON object
Todo

  • Improve the documentation of this function
Param Type Default Description
id String Id of the targeted patient
[simplify] Boolean false

patients.getProtected(id) ⇒ Promise

Get the protection against recycling status

Kind: static method of patients
Returns: Promise - The expected result is a Boolean

Param Type Description
id String Id of the targeted patient

patients.setProtected(id, protect) ⇒ Promise

Set the protection against recycling status

Kind: static method of patients
Returns: Promise - The expected response is empty

Param Type Description
id String Id of the targeted patient
protect Boolean Specify whether or not the patient should be protected against recycling

patients.getSeries(id) ⇒ Promise

Get all the series of the patient with the given id

Kind: static method of patients
Returns: Promise - The expected result is an array of JSON objects

Param Type Description
id String Id of the targeted patient

patients.getSharedTags(id, [simplify]) ⇒ Promise

Get the shared tags of the patient with the given id

Kind: static method of patients
Returns: Promise - The expected response is a JSON object

Param Type Default Description
id String Id of the targeted patient
[simplify] Boolean false

patients.getStatistics(id) ⇒ Promise

Get some general informations about the patient with the given id

Kind: static method of patients
Returns: Promise - The expected response is a JSON object

Param Type Description
id String Id of the targeted patient

patients.getStudies(id) ⇒ Promise

Get all the studies of the patient with the given id

Kind: static method of patients
Returns: Promise - The expected response is an array of JSON objects

Param Type Description
id String Id of the targeted patient

client.tools

Tools operations

Kind: instance property of Client

tools.now() ⇒ Promise

Returns the current datetime in the ISO 8601 format

Kind: static method of tools
Returns: Promise - The expected response is a String

tools.reset() ⇒ Promise

Hot restart of Orthanc, the configuration file will be read again

Kind: static method of tools
Returns: Promise - The expected response is an empty JSON object

tools.lookup(uuid) ⇒ Promise

Map DICOM UIDs to Orthanc identifiers

Kind: static method of tools
Returns: Promise - The expected result is an array containing a JSON object

Param Type Description
uuid UUID UUID which will be used to perform the lookup

tools.dicomConformance() ⇒ Promise

DICOM conformance statement of this version of Orthanc

Kind: static method of tools
Returns: Promise - The expected result is a String

tools.generateUid(level) ⇒ Promise

Generates an UUID

Kind: static method of tools
Returns: Promise - The expected result is a String

Param Type Description
level String argument among "patient", "study", "series" and "instance"

client.system

System operations

Kind: instance property of Client

system.system() ⇒ Promise

Get some information about the Orthanc Server

Kind: static method of system
Returns: Promise - The expected response is a JSON object

client.changes

Operations over changes logs

Kind: instance property of Client

changes.getChanges([params]) ⇒ Promise

Get changes logs

Kind: static method of changes
Returns: Promise - The expected response is a JSON object

Param Type Default Description
[params] Object last, "limit" and "since" arguments
[params.last] Boolean false Specify whether or not only the last change should be returned
[params.since] Integer 0 Set the sequence number since which changes should be returned
[params.limit] Integer 100 Set the returned changes limit. Default and maximum values are the same : 100

changes.deleteChanges() ⇒ Promise

Delete changes logs

Kind: static method of changes
Returns: Promise - The expected response is empty

client.exports

Operations over exports logs

Kind: instance property of Client

exports.getExports([params]) ⇒ Promise

Get exports logs. For medical traceability, Orthanc stores a log of all the resources that have been exported to remote modalities.

Kind: static method of exports
Returns: Promise - The expected response is a JSON object

Param Type Default Description
[params] Object last, "limit" and "since" arguments
[params.last] Boolean false Specify whether or not only the last export should be returned
[params.since] Integer 0 Set the sequence number since which exports should be returned
[params.limit] Integer 100 Set the returned exports limit. Default and maximum values are the same : 100

exports.deleteExports() ⇒ Promise

Delete exports logs

Kind: static method of exports
Returns: Promise - The expected response is empty