direct.config package#
Submodules#
direct.config.defaults module#
- class direct.config.defaults.CheckpointerConfig(checkpoint_steps: int = 500)[source][source]#
Bases:
BaseConfig
-
checkpoint_steps:
int
= 500#
-
checkpoint_steps:
- class direct.config.defaults.DefaultConfig(model: direct.config.defaults.ModelConfig = '???', additional_models: Optional[Any] = None, physics: direct.config.defaults.PhysicsConfig = PhysicsConfig(forward_operator='fft2', backward_operator='ifft2', use_noise_matrix=False, noise_matrix_scaling=1.0), training: direct.config.defaults.TrainingConfig = TrainingConfig(datasets=[DatasetConfig(name='???', transforms=TransformsConfig(masking=MaskingConfig(name='???', accelerations=(5.0,), center_fractions=(0.1,), uniform_range=False, mode=<MaskFuncMode.STATIC: 'static'>, val_accelerations=(5.0, 10.0), val_center_fractions=(0.1, 0.05)), cropping=CropTransformConfig(crop=None, crop_type='uniform', image_center_crop=False), augmentation=AugmentationTransformConfig(rescale=None, rescale_mode=<RescaleMode.NEAREST: 'nearest'>, rescale_2d_if_3d=False, pad=None), random_augmentations=RandomAugmentationTransformsConfig(random_rotation_degrees=(-90, 90), random_rotation_probability=0.0, random_flip_type=<RandomFlipType.RANDOM: 'random'>, random_flip_probability=0.0, random_reverse_probability=0.0), padding_eps=0.001, estimate_body_coil_image=False, sensitivity_map_estimation=SensitivityMapEstimationTransformConfig(estimate_sensitivity_maps=True, sensitivity_maps_type=<SensitivityMapType.RSS_ESTIMATE: 'rss_estimate'>, sensitivity_maps_espirit_threshold=0.05, sensitivity_maps_espirit_kernel_size=6, sensitivity_maps_espirit_crop=0.95, sensitivity_maps_espirit_max_iters=30, sensitivity_maps_gaussian=0.7), normalization=NormalizationTransformConfig(scaling_key='masked_kspace', scale_percentile=0.99), delete_acs_mask=True, delete_kspace=True, image_recon_type=<ReconstructionType.RSS: 'rss'>, compress_coils=None, pad_coils=None, use_seed=True, transforms_type=<TransformsType.SUPERVISED: 'supervised'>, mask_split_ratio=(0.4,), mask_split_acs_region=(0, 0), mask_split_keep_acs=False, mask_split_type=<MaskSplitterType.GAUSSIAN: 'gaussian'>, mask_split_gaussian_std=3.0, mask_split_half_direction=<HalfSplitType.VERTICAL: 'vertical'>), text_description=None)], model_checkpoint=None, optimizer='Adam', lr=0.0005, weight_decay=1e-06, batch_size=2, lr_step_size=5000, lr_gamma=0.5, lr_warmup_iter=500, swa_start_iter=None, num_iterations=50000, validation_steps=1000, gradient_steps=1, gradient_clipping=0.0, gradient_debug=False, loss=LossConfig(crop=None, losses=[FunctionConfig(function='???', multiplier=1.0)]), checkpointer=CheckpointerConfig(checkpoint_steps=500), metrics=[], regularizers=[]), validation: direct.config.defaults.ValidationConfig = ValidationConfig(datasets=[DatasetConfig(name='???', transforms=TransformsConfig(masking=MaskingConfig(name='???', accelerations=(5.0,), center_fractions=(0.1,), uniform_range=False, mode=<MaskFuncMode.STATIC: 'static'>, val_accelerations=(5.0, 10.0), val_center_fractions=(0.1, 0.05)), cropping=CropTransformConfig(crop=None, crop_type='uniform', image_center_crop=False), augmentation=AugmentationTransformConfig(rescale=None, rescale_mode=<RescaleMode.NEAREST: 'nearest'>, rescale_2d_if_3d=False, pad=None), random_augmentations=RandomAugmentationTransformsConfig(random_rotation_degrees=(-90, 90), random_rotation_probability=0.0, random_flip_type=<RandomFlipType.RANDOM: 'random'>, random_flip_probability=0.0, random_reverse_probability=0.0), padding_eps=0.001, estimate_body_coil_image=False, sensitivity_map_estimation=SensitivityMapEstimationTransformConfig(estimate_sensitivity_maps=True, sensitivity_maps_type=<SensitivityMapType.RSS_ESTIMATE: 'rss_estimate'>, sensitivity_maps_espirit_threshold=0.05, sensitivity_maps_espirit_kernel_size=6, sensitivity_maps_espirit_crop=0.95, sensitivity_maps_espirit_max_iters=30, sensitivity_maps_gaussian=0.7), normalization=NormalizationTransformConfig(scaling_key='masked_kspace', scale_percentile=0.99), delete_acs_mask=True, delete_kspace=True, image_recon_type=<ReconstructionType.RSS: 'rss'>, compress_coils=None, pad_coils=None, use_seed=True, transforms_type=<TransformsType.SUPERVISED: 'supervised'>, mask_split_ratio=(0.4,), mask_split_acs_region=(0, 0), mask_split_keep_acs=False, mask_split_type=<MaskSplitterType.GAUSSIAN: 'gaussian'>, mask_split_gaussian_std=3.0, mask_split_half_direction=<HalfSplitType.VERTICAL: 'vertical'>), text_description=None)], batch_size=8, metrics=[], regularizers=[], crop='training'), inference: Optional[direct.config.defaults.InferenceConfig] = None, logging: direct.config.defaults.LoggingConfig = LoggingConfig(log_as_image=None, tensorboard=TensorboardConfig(num_images=8)))[source][source]#
Bases:
BaseConfig
-
additional_models:
Optional
[Any
] = None#
-
inference:
Optional
[InferenceConfig
] = None#
-
logging:
LoggingConfig
= LoggingConfig(log_as_image=None, tensorboard=TensorboardConfig(num_images=8))#
-
model:
ModelConfig
= '???'#
-
physics:
PhysicsConfig
= PhysicsConfig(forward_operator='fft2', backward_operator='ifft2', use_noise_matrix=False, noise_matrix_scaling=1.0)#
-
training:
TrainingConfig
= TrainingConfig(datasets=[DatasetConfig(name='???', transforms=TransformsConfig(masking=MaskingConfig(name='???', accelerations=(5.0,), center_fractions=(0.1,), uniform_range=False, mode=<MaskFuncMode.STATIC: 'static'>, val_accelerations=(5.0, 10.0), val_center_fractions=(0.1, 0.05)), cropping=CropTransformConfig(crop=None, crop_type='uniform', image_center_crop=False), augmentation=AugmentationTransformConfig(rescale=None, rescale_mode=<RescaleMode.NEAREST: 'nearest'>, rescale_2d_if_3d=False, pad=None), random_augmentations=RandomAugmentationTransformsConfig(random_rotation_degrees=(-90, 90), random_rotation_probability=0.0, random_flip_type=<RandomFlipType.RANDOM: 'random'>, random_flip_probability=0.0, random_reverse_probability=0.0), padding_eps=0.001, estimate_body_coil_image=False, sensitivity_map_estimation=SensitivityMapEstimationTransformConfig(estimate_sensitivity_maps=True, sensitivity_maps_type=<SensitivityMapType.RSS_ESTIMATE: 'rss_estimate'>, sensitivity_maps_espirit_threshold=0.05, sensitivity_maps_espirit_kernel_size=6, sensitivity_maps_espirit_crop=0.95, sensitivity_maps_espirit_max_iters=30, sensitivity_maps_gaussian=0.7), normalization=NormalizationTransformConfig(scaling_key='masked_kspace', scale_percentile=0.99), delete_acs_mask=True, delete_kspace=True, image_recon_type=<ReconstructionType.RSS: 'rss'>, compress_coils=None, pad_coils=None, use_seed=True, transforms_type=<TransformsType.SUPERVISED: 'supervised'>, mask_split_ratio=(0.4,), mask_split_acs_region=(0, 0), mask_split_keep_acs=False, mask_split_type=<MaskSplitterType.GAUSSIAN: 'gaussian'>, mask_split_gaussian_std=3.0, mask_split_half_direction=<HalfSplitType.VERTICAL: 'vertical'>), text_description=None)], model_checkpoint=None, optimizer='Adam', lr=0.0005, weight_decay=1e-06, batch_size=2, lr_step_size=5000, lr_gamma=0.5, lr_warmup_iter=500, swa_start_iter=None, num_iterations=50000, validation_steps=1000, gradient_steps=1, gradient_clipping=0.0, gradient_debug=False, loss=LossConfig(crop=None, losses=[FunctionConfig(function='???', multiplier=1.0)]), checkpointer=CheckpointerConfig(checkpoint_steps=500), metrics=[], regularizers=[])#
-
validation:
ValidationConfig
= ValidationConfig(datasets=[DatasetConfig(name='???', transforms=TransformsConfig(masking=MaskingConfig(name='???', accelerations=(5.0,), center_fractions=(0.1,), uniform_range=False, mode=<MaskFuncMode.STATIC: 'static'>, val_accelerations=(5.0, 10.0), val_center_fractions=(0.1, 0.05)), cropping=CropTransformConfig(crop=None, crop_type='uniform', image_center_crop=False), augmentation=AugmentationTransformConfig(rescale=None, rescale_mode=<RescaleMode.NEAREST: 'nearest'>, rescale_2d_if_3d=False, pad=None), random_augmentations=RandomAugmentationTransformsConfig(random_rotation_degrees=(-90, 90), random_rotation_probability=0.0, random_flip_type=<RandomFlipType.RANDOM: 'random'>, random_flip_probability=0.0, random_reverse_probability=0.0), padding_eps=0.001, estimate_body_coil_image=False, sensitivity_map_estimation=SensitivityMapEstimationTransformConfig(estimate_sensitivity_maps=True, sensitivity_maps_type=<SensitivityMapType.RSS_ESTIMATE: 'rss_estimate'>, sensitivity_maps_espirit_threshold=0.05, sensitivity_maps_espirit_kernel_size=6, sensitivity_maps_espirit_crop=0.95, sensitivity_maps_espirit_max_iters=30, sensitivity_maps_gaussian=0.7), normalization=NormalizationTransformConfig(scaling_key='masked_kspace', scale_percentile=0.99), delete_acs_mask=True, delete_kspace=True, image_recon_type=<ReconstructionType.RSS: 'rss'>, compress_coils=None, pad_coils=None, use_seed=True, transforms_type=<TransformsType.SUPERVISED: 'supervised'>, mask_split_ratio=(0.4,), mask_split_acs_region=(0, 0), mask_split_keep_acs=False, mask_split_type=<MaskSplitterType.GAUSSIAN: 'gaussian'>, mask_split_gaussian_std=3.0, mask_split_half_direction=<HalfSplitType.VERTICAL: 'vertical'>), text_description=None)], batch_size=8, metrics=[], regularizers=[], crop='training')#
-
additional_models:
- class direct.config.defaults.FunctionConfig(function: str = '???', multiplier: float = 1.0)[source][source]#
Bases:
BaseConfig
-
function:
str
= '???'#
-
multiplier:
float
= 1.0#
-
function:
- class direct.config.defaults.InferenceConfig(dataset: direct.data.datasets_config.DatasetConfig = DatasetConfig(name='???', transforms=TransformsConfig(masking=MaskingConfig(name='???', accelerations=(5.0, ), center_fractions=(0.1, ), uniform_range=False, mode=<MaskFuncMode.STATIC: 'static'>, val_accelerations=(5.0, 10.0), val_center_fractions=(0.1, 0.05)), cropping=CropTransformConfig(crop=None, crop_type='uniform', image_center_crop=False), augmentation=AugmentationTransformConfig(rescale=None, rescale_mode=<RescaleMode.NEAREST: 'nearest'>, rescale_2d_if_3d=False, pad=None), random_augmentations=RandomAugmentationTransformsConfig(random_rotation_degrees=(-90, 90), random_rotation_probability=0.0, random_flip_type=<RandomFlipType.RANDOM: 'random'>, random_flip_probability=0.0, random_reverse_probability=0.0), padding_eps=0.001, estimate_body_coil_image=False, sensitivity_map_estimation=SensitivityMapEstimationTransformConfig(estimate_sensitivity_maps=True, sensitivity_maps_type=<SensitivityMapType.RSS_ESTIMATE: 'rss_estimate'>, sensitivity_maps_espirit_threshold=0.05, sensitivity_maps_espirit_kernel_size=6, sensitivity_maps_espirit_crop=0.95, sensitivity_maps_espirit_max_iters=30, sensitivity_maps_gaussian=0.7), normalization=NormalizationTransformConfig(scaling_key='masked_kspace', scale_percentile=0.99), delete_acs_mask=True, delete_kspace=True, image_recon_type=<ReconstructionType.RSS: 'rss'>, compress_coils=None, pad_coils=None, use_seed=True, transforms_type=<TransformsType.SUPERVISED: 'supervised'>, mask_split_ratio=(0.4, ), mask_split_acs_region=(0, 0), mask_split_keep_acs=False, mask_split_type=<MaskSplitterType.GAUSSIAN: 'gaussian'>, mask_split_gaussian_std=3.0, mask_split_half_direction=<HalfSplitType.VERTICAL: 'vertical'>), text_description=None), batch_size: int = 1, crop: Optional[str] = None)[source][source]#
Bases:
BaseConfig
-
batch_size:
int
= 1#
-
crop:
Optional
[str
] = None#
-
dataset:
DatasetConfig
= DatasetConfig(name='???', transforms=TransformsConfig(masking=MaskingConfig(name='???', accelerations=(5.0,), center_fractions=(0.1,), uniform_range=False, mode=<MaskFuncMode.STATIC: 'static'>, val_accelerations=(5.0, 10.0), val_center_fractions=(0.1, 0.05)), cropping=CropTransformConfig(crop=None, crop_type='uniform', image_center_crop=False), augmentation=AugmentationTransformConfig(rescale=None, rescale_mode=<RescaleMode.NEAREST: 'nearest'>, rescale_2d_if_3d=False, pad=None), random_augmentations=RandomAugmentationTransformsConfig(random_rotation_degrees=(-90, 90), random_rotation_probability=0.0, random_flip_type=<RandomFlipType.RANDOM: 'random'>, random_flip_probability=0.0, random_reverse_probability=0.0), padding_eps=0.001, estimate_body_coil_image=False, sensitivity_map_estimation=SensitivityMapEstimationTransformConfig(estimate_sensitivity_maps=True, sensitivity_maps_type=<SensitivityMapType.RSS_ESTIMATE: 'rss_estimate'>, sensitivity_maps_espirit_threshold=0.05, sensitivity_maps_espirit_kernel_size=6, sensitivity_maps_espirit_crop=0.95, sensitivity_maps_espirit_max_iters=30, sensitivity_maps_gaussian=0.7), normalization=NormalizationTransformConfig(scaling_key='masked_kspace', scale_percentile=0.99), delete_acs_mask=True, delete_kspace=True, image_recon_type=<ReconstructionType.RSS: 'rss'>, compress_coils=None, pad_coils=None, use_seed=True, transforms_type=<TransformsType.SUPERVISED: 'supervised'>, mask_split_ratio=(0.4,), mask_split_acs_region=(0, 0), mask_split_keep_acs=False, mask_split_type=<MaskSplitterType.GAUSSIAN: 'gaussian'>, mask_split_gaussian_std=3.0, mask_split_half_direction=<HalfSplitType.VERTICAL: 'vertical'>), text_description=None)#
-
batch_size:
- class direct.config.defaults.LoggingConfig(log_as_image: List[str] | None = None, tensorboard: direct.config.defaults.TensorboardConfig = TensorboardConfig(num_images=8))[source][source]#
Bases:
BaseConfig
-
log_as_image:
Optional
[List
[str
]] = None#
-
tensorboard:
TensorboardConfig
= TensorboardConfig(num_images=8)#
-
log_as_image:
- class direct.config.defaults.LossConfig(crop: Optional[str] = None, losses: List[Any] = <factory>)[source][source]#
Bases:
BaseConfig
-
crop:
Optional
[str
] = None#
-
losses:
List
[Any
]#
-
crop:
- class direct.config.defaults.ModelConfig(model_name: str = '???', engine_name: str | None = None)[source][source]#
Bases:
BaseConfig
-
engine_name:
Optional
[str
] = None#
-
model_name:
str
= '???'#
-
engine_name:
- class direct.config.defaults.PhysicsConfig(forward_operator: str = 'fft2', backward_operator: str = 'ifft2', use_noise_matrix: bool = False, noise_matrix_scaling: float | None = 1.0)[source][source]#
Bases:
BaseConfig
-
backward_operator:
str
= 'ifft2'#
-
forward_operator:
str
= 'fft2'#
-
noise_matrix_scaling:
Optional
[float
] = 1.0#
-
use_noise_matrix:
bool
= False#
-
backward_operator:
- class direct.config.defaults.TensorboardConfig(num_images: int = 8)[source][source]#
Bases:
BaseConfig
-
num_images:
int
= 8#
-
num_images:
- class direct.config.defaults.TrainingConfig(datasets: List[Any] = <factory>, model_checkpoint: Optional[str] = None, optimizer: str = 'Adam', lr: float = 0.0005, weight_decay: float = 1e-06, batch_size: int = 2, lr_step_size: int = 5000, lr_gamma: float = 0.5, lr_warmup_iter: int = 500, swa_start_iter: Optional[int] = None, num_iterations: int = 50000, validation_steps: int = 1000, gradient_steps: int = 1, gradient_clipping: float = 0.0, gradient_debug: bool = False, loss: direct.config.defaults.LossConfig = LossConfig(crop=None, losses=[FunctionConfig(function='???', multiplier=1.0)]), checkpointer: direct.config.defaults.CheckpointerConfig = CheckpointerConfig(checkpoint_steps=500), metrics: List[str] = <factory>, regularizers: List[str] = <factory>)[source][source]#
Bases:
BaseConfig
-
batch_size:
int
= 2#
-
checkpointer:
CheckpointerConfig
= CheckpointerConfig(checkpoint_steps=500)#
-
datasets:
List
[Any
]#
-
gradient_clipping:
float
= 0.0#
-
gradient_debug:
bool
= False#
-
gradient_steps:
int
= 1#
-
loss:
LossConfig
= LossConfig(crop=None, losses=[FunctionConfig(function='???', multiplier=1.0)])#
-
lr:
float
= 0.0005#
-
lr_gamma:
float
= 0.5#
-
lr_step_size:
int
= 5000#
-
lr_warmup_iter:
int
= 500#
-
metrics:
List
[str
]#
-
model_checkpoint:
Optional
[str
] = None#
-
num_iterations:
int
= 50000#
-
optimizer:
str
= 'Adam'#
-
regularizers:
List
[str
]#
-
swa_start_iter:
Optional
[int
] = None#
-
validation_steps:
int
= 1000#
-
weight_decay:
float
= 1e-06#
-
batch_size:
- class direct.config.defaults.ValidationConfig(datasets: List[Any] = <factory>, batch_size: int = 8, metrics: List[str] = <factory>, regularizers: List[str] = <factory>, crop: Optional[str] = 'training')[source][source]#
Bases:
BaseConfig
-
batch_size:
int
= 8#
-
crop:
Optional
[str
] = 'training'#
-
datasets:
List
[Any
]#
-
metrics:
List
[str
]#
-
regularizers:
List
[str
]#
-
batch_size: