dosma.scan_sequences.ScanSequence
- class dosma.scan_sequences.ScanSequence(volumes: Union[MedicalVolume, Sequence[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
volumeswould correspond to the spatial volume acquired at different echo times.- Variables:
volumes (MedicalVolume(s)) – See
volumein 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[MedicalVolume, Sequence[MedicalVolume]])[source]
Methods
__init__(volumes)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().to(device)Moves volumes of this scan onto the appropriate device.
Attributes
NAMEref_dicomThe reference dicom.