monai.deploy.operators.DICOMDataLoaderOperator

class monai.deploy.operators.DICOMDataLoaderOperator(fragment, *args, input_folder=PosixPath('/home/docs/checkouts/readthedocs.org/user_builds/monai-deploy-app-sdk/checkouts/stable/docs/source/input'), output_name='dicom_study_list', must_load=True, **kwargs)[source]

Bases: holoscan.core.Operator

This operator loads DICOM studies into memory from a folder of DICOM instance files.

Named Input:
input_folder: Path to the folder containing DICOM instance files. Optional and not requiring input.

If present, data from this input will be used as the input folder of DICOM instance files.

Name Output:

dicom_study_list: A list of DICOMStudy objects in memory. The name can be changed via attribute, output_name.

Creates an instance of this class.

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

  • input_folder (Path) – Folder containing DICOM instance files to load from. Defaults to input in the current working directory. Can be overridden by via the named input receiving from other’s output.

  • output_name (str) – The name for the output, which is list of DICOMStudy objects. Defaults to dicom_study_list, and if None or blank passed in.

  • must_load (bool) – If true, raise exception if no study is loaded. Defaults to True.

Methods

__init__(fragment, *args[, input_folder, …])

Creates an instance of this class.

add_arg(*args, **kwargs)

Overloaded function.

compute(op_input, op_output, context)

Performs computation for this operator and handlesI/O.

initialize(self)

Operator initialization method.

load_data_to_studies(input_path)

Load DICOM data from files into DICOMStudy objects in a list.

populate_series_attributes(series, sop_instance)

Populates series level attributes in the study data structure.

populate_study_attributes(study, sop_instance)

Populates study level attributes in the study data structure.

setup(spec)

Default implementation of setup method.

start(self)

Operator start method.

stop(self)

Operator stop method.

Attributes

DEFAULT_INPUT_FOLDER

DEFAULT_OUTPUT_NAME

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, input_folder=PosixPath('/home/docs/checkouts/readthedocs.org/user_builds/monai-deploy-app-sdk/checkouts/stable/docs/source/input'), output_name='dicom_study_list', must_load=True, **kwargs)[source]

Creates an instance of this class.

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

  • input_folder (Path) – Folder containing DICOM instance files to load from. Defaults to input in the current working directory. Can be overridden by via the named input receiving from other’s output.

  • output_name (str) – The name for the output, which is list of DICOMStudy objects. Defaults to dicom_study_list, and if None or blank passed in.

  • must_load (bool) – If true, raise exception if no study is loaded. Defaults to True.

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 and handlesI/O.

property conditions

Conditions associated with the operator.

property description

YAML formatted string describing the operator.

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.

load_data_to_studies(input_path)[source]

Load DICOM data from files into DICOMStudy objects in a list.

It scans through the input directory for all SOP instances. It groups them by a collection of studies where each study contains one or more series. This method returns a list of studies. If there is no studies loaded, an exception will be thrown if set to must load.

Parameters

input_path (Path) – The folder containing DICOM instance files.

Returns

List of DICOMStudy.

Return type

List[DICOMStudy]

Raises
  • ValueError – If the folder to load files from does not exist.

  • ItemNotExistsError – If no studies loaded and must_load is True.

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.

populate_series_attributes(series, sop_instance)[source]

Populates series level attributes in the study data structure.

Parameters
  • study – A DICOM Series instance that needs to be filled-in with series level attribute values

  • sop_instance – A sample DICOM SOP Instance that contains the list of attributed which will be parsed

populate_study_attributes(study, sop_instance)[source]

Populates study level attributes in the study data structure.

Parameters
  • study – A DICOM Study instance that needs to be filled-in with study level attribute values

  • sop_instance – A sample DICOM SOP Instance that contains the list of attributed which will be parsed

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.