Method: RTKIT::Study#fseries

Defined in:
lib/rtkit/study.rb

#fseries(*args) ⇒ Object

Returns the Series instance mathcing the specified unique identifier (if an argument is used). The unique identifier is either a Series Instance UID (for ImageSeries) or a SOP Instance UID (for other kinds). If a specified UID doesn’t match, nil is returned. If no argument is passed, the first Series instance associated with the Study is returned.

Parameters

  • uid – The Series’ unique identifier string.

Raises:

  • (ArgumentError)


180
181
182
183
184
185
186
187
188
189
# File 'lib/rtkit/study.rb', line 180

def fseries(*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_series[args.first]
  else
    # No argument used, therefore we return the first Series instance:

    return @series.first
  end
end