Multitask MRI Reconstruction & Segmentation Parts#

class atommic.collections.multitask.rs.parts.transforms.RSMRIDataTransforms(complex_data: bool = True, dataset_format: Optional[str] = None, apply_prewhitening: bool = False, find_patch_size: bool = True, prewhitening_scale_factor: float = 1.0, prewhitening_patch_start: int = 10, prewhitening_patch_length: int = 30, apply_gcc: bool = False, gcc_virtual_coils: int = 10, gcc_calib_lines: int = 24, gcc_align_data: bool = True, apply_random_motion: bool = False, random_motion_type: str = 'gaussian', random_motion_percentage: Sequence[int] = (10, 10), random_motion_angle: int = 10, random_motion_translation: int = 10, random_motion_center_percentage: float = 0.02, random_motion_num_segments: int = 8, random_motion_random_num_segments: bool = True, random_motion_non_uniform: bool = False, estimate_coil_sensitivity_maps: bool = False, coil_sensitivity_maps_type: str = 'ESPIRiT', coil_sensitivity_maps_gaussian_sigma: float = 0.0, coil_sensitivity_maps_espirit_threshold: float = 0.05, coil_sensitivity_maps_espirit_kernel_size: int = 6, coil_sensitivity_maps_espirit_crop: float = 0.95, coil_sensitivity_maps_espirit_max_iters: int = 30, coil_combination_method: str = 'SENSE', dimensionality: int = 2, mask_func: Optional[List] = None, shift_mask: bool = False, mask_center_scale: Optional[float] = 0.02, partial_fourier_percentage: float = 0.0, remask: bool = False, ssdu: bool = False, ssdu_mask_type: str = 'Gaussian', ssdu_rho: float = 0.4, ssdu_acs_block_size: Sequence[int] = (4, 4), ssdu_gaussian_std_scaling_factor: float = 4.0, ssdu_outer_kspace_fraction: float = 0.0, ssdu_export_and_reuse_masks: bool = False, n2r: bool = False, n2r_supervised_rate: float = 0.0, n2r_probability: float = 0.0, n2r_std_devs: Optional[Tuple[float, float]] = None, n2r_rhos: Optional[Tuple[float, float]] = None, n2r_use_mask: bool = False, unsupervised_masked_target: bool = False, crop_size: Optional[Tuple[int, int]] = None, kspace_crop: bool = False, crop_before_masking: bool = True, kspace_zero_filling_size: Optional[Tuple] = None, normalize_inputs: bool = True, normalization_type: str = 'max', kspace_normalization: bool = False, fft_centered: bool = False, fft_normalization: str = 'backward', spatial_dims: Optional[Sequence[int]] = None, coil_dim: int = 0, consecutive_slices: int = 1, use_seed: bool = True)[source]#

Bases: object

Data transforms for accelerated-MRI reconstruction and MRI segmentation.

Returns

Preprocessed data for accelerated-MRI reconstruction and MRI segmentation.

Return type

RSMRIDataTransforms

__init__(complex_data: bool = True, dataset_format: Optional[str] = None, apply_prewhitening: bool = False, find_patch_size: bool = True, prewhitening_scale_factor: float = 1.0, prewhitening_patch_start: int = 10, prewhitening_patch_length: int = 30, apply_gcc: bool = False, gcc_virtual_coils: int = 10, gcc_calib_lines: int = 24, gcc_align_data: bool = True, apply_random_motion: bool = False, random_motion_type: str = 'gaussian', random_motion_percentage: Sequence[int] = (10, 10), random_motion_angle: int = 10, random_motion_translation: int = 10, random_motion_center_percentage: float = 0.02, random_motion_num_segments: int = 8, random_motion_random_num_segments: bool = True, random_motion_non_uniform: bool = False, estimate_coil_sensitivity_maps: bool = False, coil_sensitivity_maps_type: str = 'ESPIRiT', coil_sensitivity_maps_gaussian_sigma: float = 0.0, coil_sensitivity_maps_espirit_threshold: float = 0.05, coil_sensitivity_maps_espirit_kernel_size: int = 6, coil_sensitivity_maps_espirit_crop: float = 0.95, coil_sensitivity_maps_espirit_max_iters: int = 30, coil_combination_method: str = 'SENSE', dimensionality: int = 2, mask_func: Optional[List] = None, shift_mask: bool = False, mask_center_scale: Optional[float] = 0.02, partial_fourier_percentage: float = 0.0, remask: bool = False, ssdu: bool = False, ssdu_mask_type: str = 'Gaussian', ssdu_rho: float = 0.4, ssdu_acs_block_size: Sequence[int] = (4, 4), ssdu_gaussian_std_scaling_factor: float = 4.0, ssdu_outer_kspace_fraction: float = 0.0, ssdu_export_and_reuse_masks: bool = False, n2r: bool = False, n2r_supervised_rate: float = 0.0, n2r_probability: float = 0.0, n2r_std_devs: Optional[Tuple[float, float]] = None, n2r_rhos: Optional[Tuple[float, float]] = None, n2r_use_mask: bool = False, unsupervised_masked_target: bool = False, crop_size: Optional[Tuple[int, int]] = None, kspace_crop: bool = False, crop_before_masking: bool = True, kspace_zero_filling_size: Optional[Tuple] = None, normalize_inputs: bool = True, normalization_type: str = 'max', kspace_normalization: bool = False, fft_centered: bool = False, fft_normalization: str = 'backward', spatial_dims: Optional[Sequence[int]] = None, coil_dim: int = 0, consecutive_slices: int = 1, use_seed: bool = True)[source]#

Inits RSMRIDataTransforms.

Parameters
  • complex_data (bool, optional) – Whether to use complex data. If False the data are assumed to be magnitude only. Default is True.

  • dataset_format (str, optional) – The format of the dataset. For example, 'custom_dataset' or 'public_dataset_name'. Default is None.

  • apply_prewhitening (bool, optional) – Apply prewhitening. If True then the prewhitening arguments are used. Default is False.

  • find_patch_size (bool, optional) – Find optimal patch size (automatically) to calculate psi. If False, patch_size must be defined. Default is True.

  • prewhitening_scale_factor (float, optional) – Prewhitening scale factor. Default is 1.0.

  • prewhitening_patch_start (int, optional) – Prewhitening patch start. Default is 10.

  • prewhitening_patch_length (int, optional) – Prewhitening patch length. Default is 30.

  • apply_gcc (bool, optional) – Apply Geometric Decomposition Coil Compression. If True then the GCC arguments are used. Default is False.

  • gcc_virtual_coils (int, optional) – GCC virtual coils. Default is 10.

  • gcc_calib_lines (int, optional) – GCC calibration lines. Default is 24.

  • gcc_align_data (bool, optional) – GCC align data. Default is True.

  • apply_random_motion (bool, optional) – Simulate random motion in k-space. Default is False.

  • random_motion_type (str, optional) – Random motion type. It can be one of the following: piecewise_transient, piecewise_constant, gaussian. Default is gaussian.

  • random_motion_percentage (Sequence[int], optional) – Random motion percentage. For example, 10%-20% motion can be defined as (10, 20). Default is (10, 10).

  • random_motion_angle (float, optional) – Random motion angle. Default is 10.0.

  • random_motion_translation (float, optional) – Random motion translation. Default is 10.0.

  • random_motion_center_percentage (float, optional) – Random motion center percentage. Default is 0.0.

  • random_motion_num_segments (int, optional) – Random motion number of segments to partition the k-space. Default is 8.

  • random_motion_random_num_segments (bool, optional) – Whether to randomly generate the number of segments. Default is True.

  • random_motion_non_uniform (bool, optional) – Random motion non-uniform sampling. Default is False.

  • estimate_coil_sensitivity_maps (bool, optional) – Automatically estimate coil sensitivity maps. Default is False. If True then the coil sensitivity maps arguments are used. Note that this is different from the estimate_coil_sensitivity_maps_with_nn argument, which uses a neural network to estimate the coil sensitivity maps. The estimate_coil_sensitivity_maps estimates the coil sensitivity maps with methods such as ESPIRiT, RSS or UNit. ESPIRiT is the Eigenvalue to Self-Consistent Parallel Imaging Reconstruction Technique method. RSS is the Root Sum of Squares method. UNit returns a uniform coil sensitivity map.

  • coil_sensitivity_maps_type (str, optional) – Coil sensitivity maps type. It can be one of the following: ESPIRiT, RSS or UNit. Default is ESPIRiT.

  • coil_sensitivity_maps_gaussian_sigma (float, optional) – Coil sensitivity maps Gaussian sigma. Default is 0.0.

  • coil_sensitivity_maps_espirit_threshold (float, optional) – Coil sensitivity maps ESPRIT threshold. Default is 0.05.

  • coil_sensitivity_maps_espirit_kernel_size (int, optional) – Coil sensitivity maps ESPRIT kernel size. Default is 6.

  • coil_sensitivity_maps_espirit_crop (float, optional) – Coil sensitivity maps ESPRIT crop. Default is 0.95.

  • coil_sensitivity_maps_espirit_max_iters (int, optional) – Coil sensitivity maps ESPRIT max iterations. Default is 30.

  • coil_combination_method (str, optional) – Coil combination method. Default is "SENSE".

  • dimensionality (int, optional) – Dimensionality. Default is 2.

  • mask_func (Optional[List["MaskFunc"]], optional) – Mask function to retrospectively undersample the k-space. Default is None.

  • shift_mask (bool, optional) – Whether to shift the mask. This needs to be set alongside with the fft_centered argument. Default is False.

  • mask_center_scale (Optional[float], optional) – Center scale of the mask. This defines how much densely sampled will be the center of k-space. Default is 0.02.

  • partial_fourier_percentage (float, optional) – Whether to simulate a half scan. Default is 0.0.

  • remask (bool, optional) – Use the same mask. Default is False.

  • ssdu (bool, optional) – Whether to apply Self-Supervised Data Undersampling (SSDU) masks. Default is False.

  • ssdu_mask_type (str, optional) – Mask type. It can be one of the following: - “Gaussian”: Gaussian sampling. - “Uniform”: Uniform sampling. Default is “Gaussian”.

  • ssdu_rho (float, optional) – Split ratio for training and loss masks. Default is 0.4.

  • ssdu_acs_block_size (tuple, optional) – Keeps a small acs region fully-sampled for training masks, if there is no acs region. The small acs block should be set to zero. Default is (4, 4).

  • ssdu_gaussian_std_scaling_factor (float, optional) – Scaling factor for standard deviation of the Gaussian noise. If Uniform is select this factor is ignored. Default is 4.0.

  • ssdu_outer_kspace_fraction (float, optional) – Fraction of the outer k-space to be kept/unmasked. Default is 0.0.

  • ssdu_export_and_reuse_masks (bool, optional) – Whether to export and reuse the masks. Default is False.

  • n2r (bool, optional) – Whether to apply Noise to Reconstruction (N2R) masks. Default is False.

  • n2r_supervised_rate (Optional[float], optional) – A float between 0 and 1. This controls what fraction of the subjects should be loaded for Noise to Reconstruction (N2R) supervised loss, if N2R is enabled. Default is 0.0.

  • n2r_probability (float, optional) – Probability of applying N2R. Default is 0.0.

  • n2r_std_devs (Tuple[float, float], optional) – Standard deviations for the noise. Default is (0.0, 0.0).

  • n2r_rhos (Tuple[float, float], optional) – Rho values for the noise. Default is (0.0, 0.0).

  • n2r_use_mask (bool, optional) – Whether to use a mask for N2R. Default is False.

  • unsupervised_masked_target (bool, optional) – Whether to use the masked initial estimation for unsupervised learning. Default is False.

  • crop_size (Optional[Tuple[int, int]], optional) – Center crop size. It applies cropping in image space. Default is None.

  • kspace_crop (bool, optional) – Whether to crop in k-space. Default is False.

  • crop_before_masking (bool, optional) – Whether to crop before masking. Default is True.

  • kspace_zero_filling_size (Optional[Tuple], optional) – Whether to apply zero filling in k-space. Default is None.

  • normalize_inputs (bool, optional) – Whether to normalize the inputs. Default is True.

  • normalization_type (str, optional) – Normalization type. Can be max or mean or minmax. Default is max.

  • kspace_normalization (bool, optional) – Whether to normalize the k-space. Default is False.

  • fft_centered (bool, optional) – Whether to center the FFT. Default is False.

  • fft_normalization (str, optional) – FFT normalization. Default is "backward".

  • spatial_dims (Sequence[int], optional) – Spatial dimensions. Default is None.

  • coil_dim (int, optional) – Coil dimension. Default is 0, meaning that the coil dimension is the first dimension before applying batch.

  • consecutive_slices (int, optional) – Consecutive slices. Default is 1.

  • use_seed (bool, optional) – Whether to use seed. Default is True.