Method: DICOM::DClient#find_images

Defined in:
lib/dicom/d_client.rb

#find_images(query_params = {}) ⇒ Object

Note:

Caution: Calling this method without parameters will instruct your PACS to return info on ALL images in the database!

Queries a service class provider for images (composite object instances) that match the specified criteria.

Instance level attributes for this query:

  • ‘0008,0018’ (SOP Instance UID)

  • ‘0020,0013’ (Instance Number)

In addition to the above listed attributes, a number of “optional” attributes may be specified. For a general list of optional object instance level attributes, please refer to the DICOM standard, PS3.4 C.6.1.1.5, Table C.6-4.

Examples:

Find all images belonging to a given study and series

node.find_images('0020,000D' => '1.2.840.1145.342', '0020,000E' => '1.3.6.1.4.1.2452.6.687844')

Parameters:

  • query_params (Hash) (defaults to: {})

    the query parameters to use

Options Hash (query_params):

  • 'GGGG,EEEE' (String)

    a tag and value pair to be used in the query



96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
# File 'lib/dicom/d_client.rb', line 96

def find_images(query_params={})
  # Study Root Query/Retrieve Information Model - FIND:
  set_default_presentation_context("1.2.840.10008.5.1.4.1.2.2.1")
  # These query attributes will always be present in the dicom query:
  default_query_params = {
    "0008,0018" => "", # SOP Instance UID
    "0008,0052" => "IMAGE", # Query/Retrieve Level: "IMAGE"
    "0020,0013" => "" # Instance Number
  }
  # Raising an error if a non-tag query attribute is used:
  query_params.keys.each do |tag|
    raise ArgumentError, "The supplied tag (#{tag}) is not valid. It must be a string of the form 'GGGG,EEEE'." unless tag.is_a?(String) && tag.tag?
  end
  # Set up the query parameters and carry out the C-FIND:
  set_data_elements(default_query_params.merge(query_params))
  perform_find
  return @data_results
end