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.
Default implementation of initialize
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
()Default implementation of start
stop
()Default implementation of stop
Attributes
DEFAULT_INPUT_FOLDER
DEFAULT_OUTPUT_NAME
SOP_CLASSES_TO_IGNORE
The list of arguments associated with the component.
Conditions associated with the operator.
YAML formatted string describing the operator.
The fragment (
holoscan.core.Fragment
) that the operator belongs to.The identifier of the component.
The name of the operator.
The operator type.
Resources associated with the operator.
The operator spec (
holoscan.core.OperatorSpec
) associated with the operator.- class OperatorType(self: holoscan.core._core.Operator.OperatorType, value: int) None ¶
Bases:
pybind11_builtins.pybind11_object
Enum class for operator types used by the executor.
NATIVE: Native operator.
GXF: GXF operator.
VIRTUAL: Virtual operator. (for internal use, not intended for use by application authors)
Members:
NATIVE
GXF
VIRTUAL
- 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.
add_arg(self: holoscan.core._core.Operator, arg: holoscan.core._core.Arg) -> None
Add an argument to the component.
add_arg(self: holoscan.core._core.Operator, arg: holoscan.core._core.ArgList) -> None
Add a list of arguments to the component.
add_arg(self: holoscan.core._core.Operator, **kwargs) -> None
Add arguments to the component via Python kwargs.
add_arg(self: holoscan.core._core.Operator, arg: holoscan.core._core.Condition) -> None
add_arg(self: holoscan.core._core.Operator, arg: holoscan.core._core.Resource) -> None
Add a condition or resource to the Operator.
This can be used to add a condition or resource to an operator after it has already been constructed.
- argholoscan.core.Condition or holoscan.core.Resource
The condition or resource to add.
- 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 (
holoscan.core.Fragment
) that the operator belongs to.
- 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()¶
Default implementation of initialize
- 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.
- 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.
- property spec¶
The operator spec (
holoscan.core.OperatorSpec
) associated with the operator.
- start()¶
Default implementation of start
- stop()¶
Default implementation of stop