dosma.scan_sequences package¶
Submodules¶
dosma.scan_sequences.cones module¶
Ultra-short Echo Time Cones (UTE-Cones).
-
class
dosma.scan_sequences.cones.Cones(dicom_path=None, load_path=None, **kwargs)[source]¶ Bases:
dosma.scan_sequences.scans.NonTargetSequenceUTE-Cones MRI sequence.
Ultra-short echo time cones (UTE-Cones) is a \(T_2^*\)-weighted sequence. In practice, many of these scans are low resolution and are ofter interregistered with higher-resolution scans. This can be done with
Cones.interregister().References
Qian Y, Williams AA, Chu CR, Boada FE. Multicomponent T2* mapping of knee cartilage: technical feasibility ex vivo. Magnetic resonance in medicine 2010;64(5):1426-1431.”
-
NAME= 'cones'¶
-
classmethod
cmd_line_actions()[source]¶ Provide command line information (such as name, help strings, etc) as list of dictionary.
-
generate_t2_star_map(tissue: dosma.tissues.tissue.Tissue, mask_path: Optional[str] = None, num_workers: int = 0)[source]¶ Generate 3D :math:`T_2^* map and r-squared fit map using mono-exponential fit across subvolumes acquired at different echo times.
:math:`T_2^* map is also added to the tissue.
- Parameters
tissue (Tissue) – Tissue to generate quantitative value for.
mask_path (
str, optional) – File path to mask of ROI to analyze. If specified, only voxels specified by mask will be fit. This can considerably speed up computation.num_workers (int, optional) – Number of subprocesses to use for fitting. If 0, will execute on the main thread.
- Returns
:math:`T_2^* fit for tissue.
- Return type
qv.T2Star
- Raises
ValueError – If
mask_pathcorresponds to non-binary volume.
-
interregister(target_path: str, target_mask_path: Optional[str] = None)[source]¶ Register this scan to the target scan - save as parameter in scan (volumes, subvolumes, etc).
We use the term interregister to refer to registration between volumes of different scans. Conversely, intraregister refers to registering volumes from the same scan.
If there are many subvolumes to interregister with the base scan, typically the following actions are used to reduce error accumulation with multiple registrations:
Pick the volume with the highest SNR. Call this the base moving image.
Register the base moving image to the target image using elastix.
Capture the transformation file(s) detailing the transforms to go from base moving image -> target image.
Apply these transformation(s) to the remaining volumes.
- Parameters
target_path (str) – Path to NIfTI file storing scan. This scan will serve as the base for registration. Note the best target scan will typically have a high SNR.
mask_path (str) – Path to mask to use to use as focus points for registration.
-
load_data(base_load_dirpath: str)[source]¶ Load data from disk.
Data will be loaded from the directory ‘base_load_dirpath/cones’.
- Parameters
base_load_dirpath (str) – Directory path where all data is stored.
- Raises
NotADirectoryError – if base_load_dirpath/cones/ does not exist.
-
save_data(base_save_dirpath: str, data_format: dosma.data_io.format_io.ImageDataFormat = <ImageDataFormat.nifti: 1>)[source]¶ Save data to disk.
Data will be saved in the directory ‘base_save_dirpath/cones/’.
Serializes variables specified in by self.__serializable_variables__().
- Parameters
base_save_dirpath (str) – Directory path where all data is stored.
data_format (ImageDataFormat) – Format to save data.
-
dosma.scan_sequences.cube_quant module¶
-
class
dosma.scan_sequences.cube_quant.CubeQuant(dicom_path=None, load_path=None, **kwargs)[source]¶ Bases:
dosma.scan_sequences.scans.NonTargetSequenceCubeQuant MRI sequence.
Cubequant is a 3D fast-spin-echo (FSE) \(T_{1\rho}\)-weighted sequence. Acquisitions between spin-locks are susceptible to motion, and as a result, volumes within the scan have to be registered to each other (i.e. intra-registered). Intra-registration across different spin-locks is done by default upon construction.
Moreover, CubeQuant scans often have lower resolution to increase SNR in practice. Because of the low-resolution, these scans are often registered to higher resolution target scans. This can be done using
CubeQuant.interregister().-
NAME= 'cubequant'¶
-
classmethod
cmd_line_actions()[source]¶ Provide command line information (such as name, help strings, etc) as list of dictionary.
-
generate_t1_rho_map(tissue: dosma.tissues.tissue.Tissue, mask_path: Optional[str] = None, num_workers: int = 0)[source]¶ Generate 3D T1-rho map and r-squared fit map using mono-exponential fit across subvolumes acquired at different spin lock times.
- Parameters
tissue (Tissue) – Tissue to generate quantitative value for.
mask_path (
str, optional) – File path to mask of ROI to analyze. If specified, only voxels specified by mask will be fit. This can considerably speeds up computation.num_workers (int, optional) – Number of subprocesses to use for fitting. If 0, will execute on the main thread.
- Returns
T1-rho fit for tissue.
- Return type
qv.T1Rho
- Raises
ValueError – If mask_path specifies non-binary volume.
-
interregister(target_path: str, target_mask_path: Optional[str] = None)[source]¶ Register this scan to the target scan - save as parameter in scan (volumes, subvolumes, etc).
We use the term interregister to refer to registration between volumes of different scans. Conversely, intraregister refers to registering volumes from the same scan.
If there are many subvolumes to interregister with the base scan, typically the following actions are used to reduce error accumulation with multiple registrations:
Pick the volume with the highest SNR. Call this the base moving image.
Register the base moving image to the target image using elastix.
Capture the transformation file(s) detailing the transforms to go from base moving image -> target image.
Apply these transformation(s) to the remaining volumes.
- Parameters
target_path (str) – Path to NIfTI file storing scan. This scan will serve as the base for registration. Note the best target scan will typically have a high SNR.
mask_path (str) – Path to mask to use to use as focus points for registration.
-
load_data(base_load_dirpath: str)[source]¶ Load data from disk.
Data will be loaded from the directory ‘base_load_dirpath/cubequant’.
- Parameters
base_load_dirpath (str) – Directory path where all data is stored.
- Raises
NotADirectoryError – if base_load_dirpath/cubequant/ does not exist.
-
save_data(base_save_dirpath: str, data_format: dosma.data_io.format_io.ImageDataFormat = <ImageDataFormat.nifti: 1>)[source]¶ Save data to disk.
Data will be saved in the directory ‘base_save_dirpath/cubequant/’.
Serializes variables specified in by self.__serializable_variables__().
- Parameters
base_save_dirpath (str) – Directory path where all data is stored.
data_format (ImageDataFormat) – Format to save data.
-
dosma.scan_sequences.mapss module¶
-
class
dosma.scan_sequences.mapss.Mapss(dicom_path=None, load_path=None, **kwargs)[source]¶ Bases:
dosma.scan_sequences.scans.TargetSequenceMAPSS MRI sequence.
Magnetization‐prepared angle‐modulated partitioned k‐space spoiled gradient echo snapshots (3D MAPSS) is a spoiled gradient (SPGR) sequence that reduce specific absorption rate (SAR), increase SNR, and reduce the extent of retrospective correction of contaminating T1 effects.
The MAPSS sequence can be used to estimate both T1𝜌 and T2 quantitative values. MAPSS scans must also be intra-registered to ensure alignment between all volumes acquired at different echos and spin-lock times. Intra-registration is performed automatically upon construction. \(T_2\) and :T_{1rho} fitting is also supported.
References
X Li, ET Han, RF Busse, S Majumdar. In vivo t1ρ mapping in cartilage using 3d magnetization-prepared angle-modulated partitioned k-space spoiled gradient echo snapshots (3d mapss). Magnetic Resonance in Medicine, 59(2):298–307 (2008).
-
NAME= 'mapss'¶
-
classmethod
cmd_line_actions()[source]¶ Provide command line information (such as name, help strings, etc) as list of dictionary.
-
generate_t1_rho_map(tissue: Optional[dosma.tissues.tissue.Tissue] = None, mask_path: Optional[str] = None, num_workers: int = 0)[source]¶ Generate 3D T1-rho map and r-squared fit map using mono-exponential fit across subvolumes acquired at different echo times.
- Parameters
tissue (Tissue) – Tissue to generate quantitative value for.
mask_path (str) – File path to mask of ROI to analyze
num_workers (int, optional) – Number of subprocesses to use for fitting. If 0, will execute on the main thread.
- Returns
T1-rho fit for tissue.
- Return type
qv.T1Rho
-
generate_t2_map(tissue: Optional[dosma.tissues.tissue.Tissue] = None, mask_path: Optional[str] = None, num_workers: int = 0)[source]¶ Generate 3D T2 map and r-squared fit map using mono-exponential fit across subvolumes acquired at different echo times.
- Parameters
tissue (Tissue) – Tissue to generate quantitative value for.
mask_path (str) – File path to mask of ROI to analyze
num_workers (int, optional) – Number of subprocesses to use for fitting. If 0, will execute on the main thread.
- Returns
T2 fit for tissue.
- Return type
qv.T2
-
load_data(base_load_dirpath)[source]¶ Load data from disk.
Data will be loaded from the directory ‘base_load_dirpath/mapss’.
- Parameters
base_load_dirpath (str) – Directory path where all data is stored.
- Raises
NotADirectoryError – if base_load_dirpath/mapss/ does not exist.
-
save_data(base_save_dirpath: str, data_format: dosma.data_io.format_io.ImageDataFormat = <ImageDataFormat.nifti: 1>)[source]¶ Save data to disk.
Data will be saved in the directory ‘base_save_dirpath/mapss/’.
Serializes variables specified in by self.__serializable_variables__().
- Parameters
base_save_dirpath (str) – Directory path where all data is stored.
data_format (ImageDataFormat) – Format to save data.
-
segment(model: dosma.models.seg_model.SegModel, tissue: dosma.tissues.tissue.Tissue)[source]¶ Currently not implemented.
-
dosma.scan_sequences.qdess module¶
Quantitative Double Echo in Steady State (qDESS) sequence.
-
class
dosma.scan_sequences.qdess.QDess(dicom_path, load_path=None, **kwargs)[source]¶ Bases:
dosma.scan_sequences.scans.TargetSequenceqDESS MRI sequence.
Quantitative double echo in steady state (qDESS) is a high-resolution scan that consists of two echos (S1, S2) that has shown high efficacy for analytic \(T_2\) mapping. Because of its high resolution, qDESS has been shown to be a good candidate for automatic segmentation.
DOSMA supports both automatic segmentation and analytical T2 solving for qDESS scans. Automated segmentation uses pre-trained convolutional neural networks (CNNs).
References
B Sveinsson, AS Chaudhari, GE Gold, BA Hargreaves. A simple analytic method for estimating \(T_2\) in the knee from DESS. Magnetic Resonance in Medicine, 38:63-70 (2017). [link]
-
NAME= 'qdess'¶
-
calc_rms()[source]¶ Calculate root-mean-square (RMS) of two echos.
- Returns
Volume with RMS of two echos.
- Return type
-
classmethod
cmd_line_actions()[source]¶ Provide command line information (such as name, help strings, etc) as list of dictionary.
-
generate_t2_map(tissue: dosma.tissues.tissue.Tissue, suppress_fat: bool = False, suppress_fluid: bool = False, beta: float = 1.2, gl_area: Optional[float] = None, tg: Optional[float] = None)[source]¶ Generate 3D T2 map.
- Parameters
tissue (Tissue) – Tissue to generate T2 map for.
suppress_fat (bool, optional) – Suppress fat region in T2 computation. Can help reduce noise.
suppress_fluid (bool, optional) – Suppress fluid region in T2 computation. Fluid-nulled image is calculated as
S1 - beta*S2.beta (float, optional) – Beta value used for suppressing fluid. Defaults to 1.2.
gl_area (float, optional) – GL Area. Required if not provided in the dicom. Defaults to value in dicom tag ‘0x001910b6’.
tg (float, optional) – tg value (in microseconds). Required if not provided in the dicom. Defaults to value in dicom tag ‘0x001910b7’.
- Returns
T2 fit for tissue.
- Return type
qv.T2
-
load_data(base_load_dirpath)[source]¶ Load data from disk.
Data will be loaded from the directory ‘base_load_dirpath/qdess’.
- Parameters
base_load_dirpath (str) – Directory path where all data is stored.
- Raises
NotADirectoryError – if base_load_dirpath/qdess/ does not exist.
-
save_data(base_save_dirpath: str, data_format: dosma.data_io.format_io.ImageDataFormat = <ImageDataFormat.nifti: 1>)[source]¶ Save data to disk.
Data will be saved in the directory ‘base_save_dirpath/qdess/’.
Serializes variables specified in by self.__serializable_variables__().
- Parameters
base_save_dirpath (str) – Directory path where all data is stored.
data_format (ImageDataFormat) – Format to save data.
-
segment(model: dosma.models.seg_model.SegModel, tissue: dosma.tissues.tissue.Tissue, use_rms: bool = False)[source]¶ Segment tissue in scan.
- Parameters
- Returns
Binary mask for segmented region.
- Return type
-
dosma.scan_sequences.scans module¶
Abstract classes interface implementation of scan.
This module defines the abstract interfaces that can be extended by concrete scan types.
Different scan types produce images with different qualities (different quantitative parameters, resolutions, etc.). These scan types have different actions (or processing) associated with them.
A scan can have multiple volumes if multiple phases or echo times are used to image in the scan.
-
class
dosma.scan_sequences.scans.NonTargetSequence(dicom_path: Optional[str] = None, load_path: Optional[str] = None, **kwargs)[source]¶ Bases:
dosma.scan_sequences.scans.ScanSequenceAbstract class for scans that cannot serve as targets and have to be registered to some other target scan.
Examples: Cubequant, Cones
-
abstract
interregister(target_path: str, mask_path: Optional[str] = None)[source]¶ Register this scan to the target scan - save as parameter in scan (volumes, subvolumes, etc).
We use the term interregister to refer to registration between volumes of different scans. Conversely, intraregister refers to registering volumes from the same scan.
If there are many subvolumes to interregister with the base scan, typically the following actions are used to reduce error accumulation with multiple registrations:
Pick the volume with the highest SNR. Call this the base moving image.
Register the base moving image to the target image using elastix.
Capture the transformation file(s) detailing the transforms to go from base moving image -> target image.
Apply these transformation(s) to the remaining volumes.
- Parameters
target_path (str) – Path to NIfTI file storing scan. This scan will serve as the base for registration. Note the best target scan will typically have a high SNR.
mask_path (str) – Path to mask to use to use as focus points for registration.
-
abstract
-
class
dosma.scan_sequences.scans.ScanSequence(dicom_path: Optional[str] = None, load_path: Optional[str] = None, **kwargs)[source]¶ Bases:
abc.ABCAbstract class for scan sequences and corresponding analysis.
All scan sequence classes should inherit from this abstract classes.
In practice, only either dicom_path or load_path should be specified.
If both are specified, the dicom_path is used, and all information in load_path is ignored.
- Parameters
dicom_path (str) – Folder path to DICOM files.
load_path (str) – Base path where data is stored.
**kwargs – Arbitrary keyword arguments.
Kwargs:
- split_by (str or tuple, optional): DICOM field tag name or tag number
used to group dicoms. Default depends on scan sequence - typically EchoNumber.
dicom_pathmust be specified.- ignore_ext (bool, optional): Ignore extension when loading DICOM files.
dicom_pathmust be specified.
- Raises
NotADirectoryError – If dicom_path is not a valid directory.
ValueError – If dicoms do not correspond to the expected sequence.
-
NAME= ''¶
-
get_dimensions()[source]¶ Get shape of volumes.
All volumes in scan are assumed to be same dimension.
- Returns
Shape of volumes in scan.
- Return type
tuple[int]
-
load_data(base_load_dirpath: str)[source]¶ Load data from disk.
Data will be loaded from the directory ‘base_load_dirpath/scan.NAME’ (e.g. ‘`base_load_dirpath’/dess/’).
Override this method to load additional information such as volumes, subvolumes, quantitative maps, etc. In override, Call this function
super().save_data(base_load_dirpath)before adding code to override this method.- Parameters
base_load_dirpath (str) – Directory path where all data is stored.
- Raises
NotADirectoryError – if base_load_dirpath/scan.NAME/ does not exist.
-
save_data(base_save_dirpath: str, data_format: dosma.data_io.format_io.ImageDataFormat = <ImageDataFormat.nifti: 1>)[source]¶ Save data to disk.
- Data will be saved in the directory ‘base_save_dirpath/scan.NAME_data/’
(e.g. ‘base_save_dirpath/dess_data/’).
Serializes variables specified in by self.__serializable_variables__().
Override this method to save additional information such as volumes, subvolumes, quantitative maps, etc. In override, Call this function
super().save_data(base_save_dirpath)before adding code to override this method.- Parameters
base_save_dirpath (str) – Directory path where all data is stored.
data_format (ImageDataFormat) – Format to save data.
-
class
dosma.scan_sequences.scans.TargetSequence(dicom_path: Optional[str] = None, load_path: Optional[str] = None, **kwargs)[source]¶ Bases:
dosma.scan_sequences.scans.ScanSequenceAbstract class for scans that support segmentation of tissues.
Scans that have high resolution & signal-to-noise ratio (SNR) are typically used for segmentation. Because of this property, they are often referred to as targets. This allows them to serve as a good template that other lower SNR/resolution scans can be registered to.
-
abstract
segment(model: dosma.models.seg_model.SegModel, tissue: dosma.tissues.tissue.Tissue) → dosma.data_io.med_volume.MedicalVolume[source]¶ Segment tissue in scan.
- Parameters
- Returns
Binary mask for segmented region.
- Return type
-
abstract
Module contents¶
-
class
dosma.scan_sequences.Cones(dicom_path=None, load_path=None, **kwargs)[source]¶ Bases:
dosma.scan_sequences.scans.NonTargetSequenceUTE-Cones MRI sequence.
Ultra-short echo time cones (UTE-Cones) is a \(T_2^*\)-weighted sequence. In practice, many of these scans are low resolution and are ofter interregistered with higher-resolution scans. This can be done with
Cones.interregister().References
Qian Y, Williams AA, Chu CR, Boada FE. Multicomponent T2* mapping of knee cartilage: technical feasibility ex vivo. Magnetic resonance in medicine 2010;64(5):1426-1431.”
-
NAME= 'cones'¶
-
classmethod
cmd_line_actions()[source]¶ Provide command line information (such as name, help strings, etc) as list of dictionary.
-
generate_t2_star_map(tissue: dosma.tissues.tissue.Tissue, mask_path: Optional[str] = None, num_workers: int = 0)[source]¶ Generate 3D :math:`T_2^* map and r-squared fit map using mono-exponential fit across subvolumes acquired at different echo times.
:math:`T_2^* map is also added to the tissue.
- Parameters
tissue (Tissue) – Tissue to generate quantitative value for.
mask_path (
str, optional) – File path to mask of ROI to analyze. If specified, only voxels specified by mask will be fit. This can considerably speed up computation.num_workers (int, optional) – Number of subprocesses to use for fitting. If 0, will execute on the main thread.
- Returns
:math:`T_2^* fit for tissue.
- Return type
qv.T2Star
- Raises
ValueError – If
mask_pathcorresponds to non-binary volume.
-
interregister(target_path: str, target_mask_path: Optional[str] = None)[source]¶ Register this scan to the target scan - save as parameter in scan (volumes, subvolumes, etc).
We use the term interregister to refer to registration between volumes of different scans. Conversely, intraregister refers to registering volumes from the same scan.
If there are many subvolumes to interregister with the base scan, typically the following actions are used to reduce error accumulation with multiple registrations:
Pick the volume with the highest SNR. Call this the base moving image.
Register the base moving image to the target image using elastix.
Capture the transformation file(s) detailing the transforms to go from base moving image -> target image.
Apply these transformation(s) to the remaining volumes.
- Parameters
target_path (str) – Path to NIfTI file storing scan. This scan will serve as the base for registration. Note the best target scan will typically have a high SNR.
mask_path (str) – Path to mask to use to use as focus points for registration.
-
load_data(base_load_dirpath: str)[source]¶ Load data from disk.
Data will be loaded from the directory ‘base_load_dirpath/cones’.
- Parameters
base_load_dirpath (str) – Directory path where all data is stored.
- Raises
NotADirectoryError – if base_load_dirpath/cones/ does not exist.
-
save_data(base_save_dirpath: str, data_format: dosma.data_io.format_io.ImageDataFormat = <ImageDataFormat.nifti: 1>)[source]¶ Save data to disk.
Data will be saved in the directory ‘base_save_dirpath/cones/’.
Serializes variables specified in by self.__serializable_variables__().
- Parameters
base_save_dirpath (str) – Directory path where all data is stored.
data_format (ImageDataFormat) – Format to save data.
-
-
class
dosma.scan_sequences.CubeQuant(dicom_path=None, load_path=None, **kwargs)[source]¶ Bases:
dosma.scan_sequences.scans.NonTargetSequenceCubeQuant MRI sequence.
Cubequant is a 3D fast-spin-echo (FSE) \(T_{1\rho}\)-weighted sequence. Acquisitions between spin-locks are susceptible to motion, and as a result, volumes within the scan have to be registered to each other (i.e. intra-registered). Intra-registration across different spin-locks is done by default upon construction.
Moreover, CubeQuant scans often have lower resolution to increase SNR in practice. Because of the low-resolution, these scans are often registered to higher resolution target scans. This can be done using
CubeQuant.interregister().-
NAME= 'cubequant'¶
-
classmethod
cmd_line_actions()[source]¶ Provide command line information (such as name, help strings, etc) as list of dictionary.
-
generate_t1_rho_map(tissue: dosma.tissues.tissue.Tissue, mask_path: Optional[str] = None, num_workers: int = 0)[source]¶ Generate 3D T1-rho map and r-squared fit map using mono-exponential fit across subvolumes acquired at different spin lock times.
- Parameters
tissue (Tissue) – Tissue to generate quantitative value for.
mask_path (
str, optional) – File path to mask of ROI to analyze. If specified, only voxels specified by mask will be fit. This can considerably speeds up computation.num_workers (int, optional) – Number of subprocesses to use for fitting. If 0, will execute on the main thread.
- Returns
T1-rho fit for tissue.
- Return type
qv.T1Rho
- Raises
ValueError – If mask_path specifies non-binary volume.
-
interregister(target_path: str, target_mask_path: Optional[str] = None)[source]¶ Register this scan to the target scan - save as parameter in scan (volumes, subvolumes, etc).
We use the term interregister to refer to registration between volumes of different scans. Conversely, intraregister refers to registering volumes from the same scan.
If there are many subvolumes to interregister with the base scan, typically the following actions are used to reduce error accumulation with multiple registrations:
Pick the volume with the highest SNR. Call this the base moving image.
Register the base moving image to the target image using elastix.
Capture the transformation file(s) detailing the transforms to go from base moving image -> target image.
Apply these transformation(s) to the remaining volumes.
- Parameters
target_path (str) – Path to NIfTI file storing scan. This scan will serve as the base for registration. Note the best target scan will typically have a high SNR.
mask_path (str) – Path to mask to use to use as focus points for registration.
-
load_data(base_load_dirpath: str)[source]¶ Load data from disk.
Data will be loaded from the directory ‘base_load_dirpath/cubequant’.
- Parameters
base_load_dirpath (str) – Directory path where all data is stored.
- Raises
NotADirectoryError – if base_load_dirpath/cubequant/ does not exist.
-
save_data(base_save_dirpath: str, data_format: dosma.data_io.format_io.ImageDataFormat = <ImageDataFormat.nifti: 1>)[source]¶ Save data to disk.
Data will be saved in the directory ‘base_save_dirpath/cubequant/’.
Serializes variables specified in by self.__serializable_variables__().
- Parameters
base_save_dirpath (str) – Directory path where all data is stored.
data_format (ImageDataFormat) – Format to save data.
-
-
class
dosma.scan_sequences.Mapss(dicom_path=None, load_path=None, **kwargs)[source]¶ Bases:
dosma.scan_sequences.scans.TargetSequenceMAPSS MRI sequence.
Magnetization‐prepared angle‐modulated partitioned k‐space spoiled gradient echo snapshots (3D MAPSS) is a spoiled gradient (SPGR) sequence that reduce specific absorption rate (SAR), increase SNR, and reduce the extent of retrospective correction of contaminating T1 effects.
The MAPSS sequence can be used to estimate both T1𝜌 and T2 quantitative values. MAPSS scans must also be intra-registered to ensure alignment between all volumes acquired at different echos and spin-lock times. Intra-registration is performed automatically upon construction. \(T_2\) and :T_{1rho} fitting is also supported.
References
X Li, ET Han, RF Busse, S Majumdar. In vivo t1ρ mapping in cartilage using 3d magnetization-prepared angle-modulated partitioned k-space spoiled gradient echo snapshots (3d mapss). Magnetic Resonance in Medicine, 59(2):298–307 (2008).
-
NAME= 'mapss'¶
-
classmethod
cmd_line_actions()[source]¶ Provide command line information (such as name, help strings, etc) as list of dictionary.
-
generate_t1_rho_map(tissue: Optional[dosma.tissues.tissue.Tissue] = None, mask_path: Optional[str] = None, num_workers: int = 0)[source]¶ Generate 3D T1-rho map and r-squared fit map using mono-exponential fit across subvolumes acquired at different echo times.
- Parameters
tissue (Tissue) – Tissue to generate quantitative value for.
mask_path (str) – File path to mask of ROI to analyze
num_workers (int, optional) – Number of subprocesses to use for fitting. If 0, will execute on the main thread.
- Returns
T1-rho fit for tissue.
- Return type
qv.T1Rho
-
generate_t2_map(tissue: Optional[dosma.tissues.tissue.Tissue] = None, mask_path: Optional[str] = None, num_workers: int = 0)[source]¶ Generate 3D T2 map and r-squared fit map using mono-exponential fit across subvolumes acquired at different echo times.
- Parameters
tissue (Tissue) – Tissue to generate quantitative value for.
mask_path (str) – File path to mask of ROI to analyze
num_workers (int, optional) – Number of subprocesses to use for fitting. If 0, will execute on the main thread.
- Returns
T2 fit for tissue.
- Return type
qv.T2
-
load_data(base_load_dirpath)[source]¶ Load data from disk.
Data will be loaded from the directory ‘base_load_dirpath/mapss’.
- Parameters
base_load_dirpath (str) – Directory path where all data is stored.
- Raises
NotADirectoryError – if base_load_dirpath/mapss/ does not exist.
-
save_data(base_save_dirpath: str, data_format: dosma.data_io.format_io.ImageDataFormat = <ImageDataFormat.nifti: 1>)[source]¶ Save data to disk.
Data will be saved in the directory ‘base_save_dirpath/mapss/’.
Serializes variables specified in by self.__serializable_variables__().
- Parameters
base_save_dirpath (str) – Directory path where all data is stored.
data_format (ImageDataFormat) – Format to save data.
-
segment(model: dosma.models.seg_model.SegModel, tissue: dosma.tissues.tissue.Tissue)[source]¶ Currently not implemented.
-
-
class
dosma.scan_sequences.QDess(dicom_path, load_path=None, **kwargs)[source]¶ Bases:
dosma.scan_sequences.scans.TargetSequenceqDESS MRI sequence.
Quantitative double echo in steady state (qDESS) is a high-resolution scan that consists of two echos (S1, S2) that has shown high efficacy for analytic \(T_2\) mapping. Because of its high resolution, qDESS has been shown to be a good candidate for automatic segmentation.
DOSMA supports both automatic segmentation and analytical T2 solving for qDESS scans. Automated segmentation uses pre-trained convolutional neural networks (CNNs).
References
B Sveinsson, AS Chaudhari, GE Gold, BA Hargreaves. A simple analytic method for estimating \(T_2\) in the knee from DESS. Magnetic Resonance in Medicine, 38:63-70 (2017). [link]
-
NAME= 'qdess'¶
-
calc_rms()[source]¶ Calculate root-mean-square (RMS) of two echos.
- Returns
Volume with RMS of two echos.
- Return type
-
classmethod
cmd_line_actions()[source]¶ Provide command line information (such as name, help strings, etc) as list of dictionary.
-
generate_t2_map(tissue: dosma.tissues.tissue.Tissue, suppress_fat: bool = False, suppress_fluid: bool = False, beta: float = 1.2, gl_area: Optional[float] = None, tg: Optional[float] = None)[source]¶ Generate 3D T2 map.
- Parameters
tissue (Tissue) – Tissue to generate T2 map for.
suppress_fat (bool, optional) – Suppress fat region in T2 computation. Can help reduce noise.
suppress_fluid (bool, optional) – Suppress fluid region in T2 computation. Fluid-nulled image is calculated as
S1 - beta*S2.beta (float, optional) – Beta value used for suppressing fluid. Defaults to 1.2.
gl_area (float, optional) – GL Area. Required if not provided in the dicom. Defaults to value in dicom tag ‘0x001910b6’.
tg (float, optional) – tg value (in microseconds). Required if not provided in the dicom. Defaults to value in dicom tag ‘0x001910b7’.
- Returns
T2 fit for tissue.
- Return type
qv.T2
-
load_data(base_load_dirpath)[source]¶ Load data from disk.
Data will be loaded from the directory ‘base_load_dirpath/qdess’.
- Parameters
base_load_dirpath (str) – Directory path where all data is stored.
- Raises
NotADirectoryError – if base_load_dirpath/qdess/ does not exist.
-
save_data(base_save_dirpath: str, data_format: dosma.data_io.format_io.ImageDataFormat = <ImageDataFormat.nifti: 1>)[source]¶ Save data to disk.
Data will be saved in the directory ‘base_save_dirpath/qdess/’.
Serializes variables specified in by self.__serializable_variables__().
- Parameters
base_save_dirpath (str) – Directory path where all data is stored.
data_format (ImageDataFormat) – Format to save data.
-
segment(model: dosma.models.seg_model.SegModel, tissue: dosma.tissues.tissue.Tissue, use_rms: bool = False)[source]¶ Segment tissue in scan.
- Parameters
- Returns
Binary mask for segmented region.
- Return type
-