Method: RTKIT::Study#iseries

Defined in:
lib/rtkit/study.rb

#iseries(*args) ⇒ Object

Returns the ImageSeries instance mathcing the specified Series Instance UID (if an argument is used). If a specified UID doesn’t match, nil is returned. If no argument is passed, the first ImageSeries instance associated with the Study is returned.

Parameters

  • uid – String. The value of the Series Instance UID element.

Raises:

  • (ArgumentError)


160
161
162
163
164
165
166
167
168
169
# File 'lib/rtkit/study.rb', line 160

def iseries(*args)
  raise ArgumentError, "Expected one or none arguments, got #{args.length}." unless [0, 1].include?(args.length)
  if args.length == 1
    raise ArgumentError, "Expected String (or nil), got #{args.first.class}." unless [String, NilClass].include?(args.first.class)
    return @associated_iseries[args.first]
  else
    # No argument used, therefore we return the first ImageSeries instance:
    return @image_series.first
  end
end