Class: Orthanc::Series
- Inherits:
-
Object
- Object
- Orthanc::Series
- Includes:
- Response
- Defined in:
- lib/orthanc/series.rb
Instance Attribute Summary collapse
-
#base_uri ⇒ Object
Returns the value of attribute base_uri.
Instance Method Summary collapse
-
#anonymize(payload = {}) ⇒ Object
POST /series/id/anonymize.
-
#archive ⇒ Object
GET /series/id/archive.
- #attachments(id = nil) ⇒ Object
-
#attachments_list ⇒ Object
GET /resourceType/id/attachments.
-
#delete ⇒ Object
DELETE /series/id.
-
#fetch ⇒ Object
GET /series, # GET /series/id.
-
#initialize(id = nil) ⇒ Series
constructor
A new instance of Series.
-
#instances ⇒ Object
GET /series/id/instances.
-
#media ⇒ Object
GET /series/id/media.
-
#metadata(name = nil) ⇒ Object
As class instances, for method chaining.
-
#metadata_list ⇒ Object
GET /resourceType/id/metadata.
-
#modify(payload = {}) ⇒ Object
POST /series/id/modify.
-
#module ⇒ Object
GET /series/id/module.
-
#patient ⇒ Object
GET /series/id/patient.
-
#shared_tags(params = {}) ⇒ Object
GET /series/id/shared-tags.
-
#statistics ⇒ Object
GET /series/id/statistics.
-
#study ⇒ Object
GET /series/id/study.
Methods included from Response
#bool_to_num, #handle_response, #num_to_bool
Constructor Details
Instance Attribute Details
#base_uri ⇒ Object
Returns the value of attribute base_uri.
4 5 6 |
# File 'lib/orthanc/series.rb', line 4 def base_uri @base_uri end |
Instance Method Details
#anonymize(payload = {}) ⇒ Object
POST /series/id/anonymize
22 23 24 |
# File 'lib/orthanc/series.rb', line 22 def anonymize(payload = {}) # https://code.google.com/p/orthanc/wiki/Anonymization handle_response(base_uri["anonymize"].post(payload.to_s)) end |
#archive ⇒ Object
GET /series/id/archive
27 28 29 |
# File 'lib/orthanc/series.rb', line 27 def archive # Create ZIP base_uri["archive"].get # CAREFUL! Returns the whole zipfile end |
#attachments(id = nil) ⇒ Object
79 80 81 82 83 84 85 86 87 88 89 |
# File 'lib/orthanc/series.rb', line 79 def (id = nil) if id return Attachment.new(base_uri, id) else a = [] handle_response(base_uri["attachments"].get).each do |id| a << Attachment.new(base_uri, id) end return a end end |
#attachments_list ⇒ Object
GET /resourceType/id/attachments
75 76 77 |
# File 'lib/orthanc/series.rb', line 75 def # Orthanc endpoint response handle_response(base_uri["attachments"].get) end |
#delete ⇒ Object
DELETE /series/id
17 18 19 |
# File 'lib/orthanc/series.rb', line 17 def delete handle_response(base_uri.delete) end |
#fetch ⇒ Object
GET /series, # GET /series/id
12 13 14 |
# File 'lib/orthanc/series.rb', line 12 def fetch # Fetch API response handle_response(base_uri.get) end |
#instances ⇒ Object
GET /series/id/instances
32 33 34 |
# File 'lib/orthanc/series.rb', line 32 def instances # Retrieve all the instances of this patient in a single REST call handle_response(base_uri["instances"].get) end |
#media ⇒ Object
GET /series/id/media
37 38 39 |
# File 'lib/orthanc/series.rb', line 37 def media # Create a ZIP archive for media storage with DICOMDIR base_uri["media"].get # CAREFUL! Returns the whole zipfile end |
#metadata(name = nil) ⇒ Object
As class instances, for method chaining
98 99 100 101 102 103 104 105 106 107 108 |
# File 'lib/orthanc/series.rb', line 98 def (name = nil) # As class instances, for method chaining if name return Metadata.new(base_uri, name) else a = [] handle_response(base_uri["metadata"].get).each do |name| a << Metadata.new(base_uri, name) end return a end end |
#metadata_list ⇒ Object
GET /resourceType/id/metadata
94 95 96 |
# File 'lib/orthanc/series.rb', line 94 def # Orthanc endpoint response handle_response(base_uri["metadata"].get) end |
#modify(payload = {}) ⇒ Object
POST /series/id/modify
42 43 44 |
# File 'lib/orthanc/series.rb', line 42 def modify(payload = {}) # https://code.google.com/p/orthanc/wiki/Anonymization handle_response(base_uri["modify"].post(payload.to_s)) end |
#module ⇒ Object
GET /series/id/module
47 48 49 |
# File 'lib/orthanc/series.rb', line 47 def module handle_response(base_uri["module"].get) end |
#patient ⇒ Object
GET /series/id/patient
52 53 54 |
# File 'lib/orthanc/series.rb', line 52 def patient handle_response(base_uri["patient"].get) end |
#shared_tags(params = {}) ⇒ Object
GET /series/id/shared-tags
57 58 59 |
# File 'lib/orthanc/series.rb', line 57 def (params = {}) # "?simplify" argument to simplify output handle_response(base_uri["shared-tags"].get({params: params})) end |
#statistics ⇒ Object
GET /series/id/statistics
62 63 64 |
# File 'lib/orthanc/series.rb', line 62 def statistics handle_response(base_uri["statistics"].get) end |
#study ⇒ Object
GET /series/id/study
67 68 69 |
# File 'lib/orthanc/series.rb', line 67 def study handle_response(base_uri["study"].get) end |