Class: Orthanc::Modality
- Inherits:
-
Object
- Object
- Orthanc::Modality
- Includes:
- Response
- Defined in:
- lib/orthanc/modalities.rb
Instance Attribute Summary collapse
-
#base_uri ⇒ Object
Returns the value of attribute base_uri.
Instance Method Summary collapse
-
#delete ⇒ Object
DELETE /modalities/id.
-
#echo(payload = {}) ⇒ Object
POST /modalities/dicom/echo.
-
#fetch ⇒ Object
GET /modalities, # GET /modalities/id.
-
#find(payload = {}) ⇒ Object
POST /modalities/dicom/find.
-
#find_patient(payload = {}) ⇒ Object
POST /modalities/dicom/find-patient.
-
#find_series(payload = {}) ⇒ Object
POST /modalities/dicom/find-series.
-
#find_study(payload = {}) ⇒ Object
POST /modalities/dicom/find-study.
-
#initialize(id = nil) ⇒ Modality
constructor
A new instance of Modality.
-
#modify(payload = {}) ⇒ Object
PUT /modalities/dicom.
-
#store(payload = {}) ⇒ Object
POST /modalities/dicom/store.
Methods included from Response
#bool_to_num, #handle_response, #num_to_bool
Constructor Details
#initialize(id = nil) ⇒ Modality
Returns a new instance of Modality.
6 7 8 9 |
# File 'lib/orthanc/modalities.rb', line 6 def initialize(id = nil) client = Client.new self.base_uri = client.base_uri["/modalities/#{id}"] end |
Instance Attribute Details
#base_uri ⇒ Object
Returns the value of attribute base_uri.
4 5 6 |
# File 'lib/orthanc/modalities.rb', line 4 def base_uri @base_uri end |
Instance Method Details
#delete ⇒ Object
DELETE /modalities/id
17 18 19 |
# File 'lib/orthanc/modalities.rb', line 17 def delete handle_response(base_uri.delete) end |
#echo(payload = {}) ⇒ Object
POST /modalities/dicom/echo
27 28 29 |
# File 'lib/orthanc/modalities.rb', line 27 def echo(payload = {}) # C-Echo SCU handle_response(base_uri["echo"].post(payload)) end |
#fetch ⇒ Object
GET /modalities, # GET /modalities/id
12 13 14 |
# File 'lib/orthanc/modalities.rb', line 12 def fetch # Fetch API response handle_response(base_uri.get) end |
#find(payload = {}) ⇒ Object
POST /modalities/dicom/find
32 33 34 |
# File 'lib/orthanc/modalities.rb', line 32 def find(payload = {}) handle_response(base_uri["find"].post(payload)) end |
#find_patient(payload = {}) ⇒ Object
POST /modalities/dicom/find-patient
37 38 39 |
# File 'lib/orthanc/modalities.rb', line 37 def find_patient(payload = {}) handle_response(base_uri["find-patient"].post(payload)) end |
#find_series(payload = {}) ⇒ Object
POST /modalities/dicom/find-series
42 43 44 |
# File 'lib/orthanc/modalities.rb', line 42 def find_series(payload = {}) handle_response(base_uri["find-series"].post(payload)) end |
#find_study(payload = {}) ⇒ Object
POST /modalities/dicom/find-study
47 48 49 |
# File 'lib/orthanc/modalities.rb', line 47 def find_study(payload = {}) handle_response(base_uri["find-study"].post(payload)) end |
#modify(payload = {}) ⇒ Object
PUT /modalities/dicom
22 23 24 |
# File 'lib/orthanc/modalities.rb', line 22 def modify(payload = {}) handle_response(base_uri["modalities/#{dicom}"].put(payload)) end |
#store(payload = {}) ⇒ Object
POST /modalities/dicom/store
52 53 54 |
# File 'lib/orthanc/modalities.rb', line 52 def store(payload = {}) # POST body = UUID series, UUID instance, or raw DICOM file handle_response(base_uri["store"].post(payload)) end |