monai.deploy.operators.DICOMSeriesSelectorOperator

class monai.deploy.operators.DICOMSeriesSelectorOperator(fragment, *args, rules='', all_matched=False, **kwargs)[source]

Bases: holoscan.core.Operator

This operator selects a list of DICOM Series in a DICOM Study for a given set of selection rules.

Named input:

dicom_study_list: A list of DICOMStudy objects.

Named output:

study_selected_series_list: A list of StudySelectedSeries objects. Downstream receiver optional.

This class can be considered a base class, and a derived class can override the ‘filer’ function to with custom logics.

In its default implementation, this class
  1. selects a series or all matched series within the scope of a study in a list of studies

  2. uses rules defined in JSON string, see below for details

  3. supports DICOM Study and Series module attribute matching, including regex for string types

  4. supports multiple named selections, in the scope of each DICOM study

  5. outputs a list of SutdySelectedSeries objects, as well as a flat list of SelectedSeries (to be deprecated)

The selection rules are defined in JSON,
  1. attribute “selections” value is a list of selections

  2. each selection has a “name”, and its “conditions” value is a list of matching criteria

  3. each condition has uses the implicit equal operator, except for regex for str type and union for set type

  4. DICOM attribute keywords are used, and only for those defined as DICOMStudy and DICOMSeries properties

An example selection rules: {

“selections”: [
{

“name”: “CT Series 1”, “conditions”: {

“StudyDescription”: “(?i)^Spleen”, “Modality”: “(?i)CT”, “SeriesDescription”: “(?i)^No series description|(.*?)”

}

}, {

“name”: “CT Series 2”, “conditions”: {

“Modality”: “CT”, “BodyPartExamined”: “Abdomen”, “SeriesDescription” : “Not to be matched. For illustration only.”

}

}

]

}

Instantiate an instance.

Parameters
  • fragment (Fragment) – An instance of the Application class which is derived from Fragment.

  • rules (Text) – Selection rules in JSON string.

  • all_matched (bool) – Gets all matched series in a study. Defaults to False for first match only.

Methods

__init__(fragment, *args[, rules, all_matched])

Instantiate an instance.

add_arg(*args, **kwargs)

Overloaded function.

compute(op_input, op_output, context)

Performs computation for this operator.

filter(selection_rules, dicom_study_list[, …])

Selects the series with the given matching rules.

initialize(self)

Operator initialization method.

setup(spec)

Default implementation of setup method.

start(self)

Operator start method.

stop(self)

Operator stop method.

Attributes

args

The list of arguments associated with the component.

conditions

Conditions associated with the operator.

description

YAML formatted string describing the operator.

fragment

The fragment that the operator belongs to.

id

The identifier of the component.

name

The name of the operator.

operator_type

The operator type.

resources

Resources associated with the operator.

spec

class OperatorType(self: holoscan.core._core.Operator.OperatorType, value: int) None

Bases: pybind11_builtins.pybind11_object

Members:

NATIVE

GXF

property name
__init__(fragment, *args, rules='', all_matched=False, **kwargs)[source]

Instantiate an instance.

Parameters
  • fragment (Fragment) – An instance of the Application class which is derived from Fragment.

  • rules (Text) – Selection rules in JSON string.

  • all_matched (bool) – Gets all matched series in a study. Defaults to False for first match only.

add_arg(*args, **kwargs)

Overloaded function.

  1. add_arg(self: holoscan.core._core.Component, arg: holoscan.core._core.Arg) -> None

Add an argument to the component.

  1. add_arg(self: holoscan.core._core.Component, arg: holoscan.core._core.ArgList) -> None

Add a list of arguments to the component.

property args

The list of arguments associated with the component.

arglist : holoscan.core.ArgList

compute(op_input, op_output, context)[source]

Performs computation for this operator.

property conditions

Conditions associated with the operator.

property description

YAML formatted string describing the operator.

filter(selection_rules, dicom_study_list, all_matched=False)[source]

Selects the series with the given matching rules.

If rules object is None, all series will be returned with series instance UID as the selection name.

Simplistic matching is used for demonstration:

Number: exactly matches String: matches case insensitive, if fails then tries RegEx search String array matches as subset, case insensitive

Parameters
  • selection_rules (object) – JSON object containing the matching rules.

  • dicom_study_list (list) – A list of DICOMStudiy objects.

  • all_matched (bool) – Gets all matched series in a study. Defaults to False for first match only.

Returns

A list of objects of type StudySelectedSeries.

Return type

list

Raises

ValueError – If the selection_rules object does not contain “selections” attribute.

property fragment

The fragment that the operator belongs to.

name : holoscan.core.Fragment

property id

The identifier of the component.

The identifier is initially set to -1, and will become a valid value when the component is initialized.

With the default executor (holoscan.gxf.GXFExecutor), the identifier is set to the GXF component ID.

id : int

initialize(self: holoscan.core._core.Operator) None

Operator initialization method.

property name

The name of the operator.

name : str

property operator_type

The operator type.

holoscan.core.Operator.OperatorType enum representing the type of the operator. The two types currently implemented are native and GXF.

property resources

Resources associated with the operator.

setup(spec)[source]

Default implementation of setup method.

start(self: holoscan.core._core.Operator) None

Operator start method.

stop(self: holoscan.core._core.Operator) None

Operator stop method.