dosma.scan_sequences.ScanSequence

class dosma.scan_sequences.ScanSequence(volumes: Union[dosma.core.med_volume.MedicalVolume, Sequence[dosma.core.med_volume.MedicalVolume]])[source]

The class for scan sequences and corresponding analysis.

This is the base class for scan-specific analysis. All classes implementing scan-specific image processing/analysis methods should inherit from this class.

Parameters

volumes (MedicalVolume(s)) – The medical image(s) that this scan is composed of. Note these are typically the different 2D/3D image(s) . For example, for a multi-echo MRI scan, each volume in volumes would correspond to the spatial volume acquired at different echo times.

Variables
  • volumes (MedicalVolume(s)) – See volume in Args.

  • temp_path (str) – The directory path where temporary results are written. This will be under dosma.file_constants.TEMP_FOLDER_PATH.

Raises
  • NotADirectoryError – If dicom_path is not a valid directory.

  • ValueError – If dicoms do not correspond to the expected sequence.

__init__(volumes: Union[dosma.core.med_volume.MedicalVolume, Sequence[dosma.core.med_volume.MedicalVolume]])[source]

Initialize self. See help(type(self)) for accurate signature.

Methods

__init__(volumes)

Initialize self.

from_dicom(dir_or_files[, group_by, …])

Load scan from dicom files.

from_dict(data[, force])

Loads class from data dictionary.

get_dimensions()

Get shape of volumes.

get_metadata(key[, default])

Get metadata for the scan.

load(path_or_data[, num_workers])

Load scan.

load_custom_data(data, **kwargs)

Recursively converts data to appropriate types.

save(path[, save_custom, image_data_format, …])

Saves scan data to disk with option for custom saving.

save_custom_data(metadata, paths[, fname_fmt])

Finds all attributes of type MedicalVolume or Sequence/Mapping to MedicalVolume and saves them.

save_data(base_save_dirpath[, data_format])

Deprecated: Alias for self.save().

Attributes

NAME

ref_dicom

The reference dicom.