class Orthanc::Tool

Attributes

base_uri[RW]

Public Class Methods

new(id = nil) click to toggle source
# File lib/orthanc/tools.rb, line 6
def initialize(id = nil)
  client = Client.new
  self.base_uri = client.base_uri["tools"]
end

Public Instance Methods

create_dicom(payload = {}) click to toggle source

POST /tools/create-dicom

# File lib/orthanc/tools.rb, line 12
def create_dicom(payload = {}) # Create and store a new DICOM instance (experimental)
  handle_response(base_uri["create-dicom"].post(payload))
end
dicom_conformance() click to toggle source

GET /tools/dicom-conformance

# File lib/orthanc/tools.rb, line 17
def dicom_conformance # DICOM conformance statement of this version of Orthanc
  base_uri["dicom-conformance"].get
end
execute_script(payload = {}) click to toggle source

POST /tools/execute-script

# File lib/orthanc/tools.rb, line 22
def execute_script(payload = {}) # Execute the Lua script in the POST body (experimental)
  handle_response(base_uri["execute-script"].post(payload))
end
generate_uid(level) click to toggle source

GET /tools/generate-uid

# File lib/orthanc/tools.rb, line 27
def generate_uid(level) # "level" argument among "patient", "study", "series" and "instance"
  handle_response(base_uri["generate-uid"].get({params: {level: level}}))
end
lookup(payload = {}) click to toggle source

POST /tools/lookup

# File lib/orthanc/tools.rb, line 32
def lookup(payload = {}) # Map DICOM UIDs to Orthanc identifiers
  handle_response(base_uri["lookup"].post(payload))
end
now() click to toggle source

GET /tools/now

# File lib/orthanc/tools.rb, line 37
def now # Returns the current datetime in the ISO 8601 format
  base_uri["now"].get
end
reset(payload = {}) click to toggle source

POST /tools/reset

# File lib/orthanc/tools.rb, line 42
def reset(payload = {}) # Hot restart of Orthanc, the configuration file will be read again
  handle_response(base_uri["reset"].post(payload))
end