Missing MRI Algorithms¶
The following classes provide algorithms from the BraTS Global synthesis challenge to predict missing MRI modalities.
- class brats.core.missing_mri_algorithms.MissingMRI(algorithm: MissingMRIAlgorithms = MissingMRIAlgorithms.BraTS24_1, cuda_devices: str | None = '0', force_cpu: bool = False)¶
Bases:
BraTSAlgorithm- infer_batch(data_folder: Path | str, output_folder: Path | str, log_file: Path | str | None = None, backend: Backends | None = Backends.DOCKER) None¶
Perform synthesis on a batch of subjects with the provided images and save the results to the output folder.
Requires the following structure (if e.g. t2f should be synthesized):
data_folder
┣ A
┃ ┣ A-t1c.nii.gz
┃ ┣ A-t1n.nii.gz
┃ ┗ A-t2w.nii.gz
┣ B
┃ ┣ B-t1c.nii.gz
┃ ┣ …
- Parameters:
data_folder (Path | str) – Folder containing the subjects with required structure
output_folder (Path | str) – Output folder to save the segmentation
log_file (Path | str, optional) – Save logs to this file
backend (Backends, optional) – Backend to use for inference. Defaults to Backends.DOCKER.
- infer_single(output_file: Path | str, t1c: Path | str | None = None, t1n: Path | str | None = None, t2f: Path | str | None = None, t2w: Path | str | None = None, log_file: Path | str | None = None, backend: Backends | None = Backends.DOCKER) None¶
Perform synthesis of the missing modality for a single subject with the provided images and save the result to the output file.
Note
Exactly 3 input modalities are required to perform synthesis of the missing modality.
- Parameters:
output_file (Path | str) – Output file to save the synthesized image
t1c (Optional[Union[Path, str]], optional) – Path to the T1c image. Defaults to None.
t1n (Optional[Union[Path, str]], optional) – Path to the T1n image. Defaults to None.
t2f (Optional[Union[Path, str]], optional) – Path to the T2f image. Defaults to None.
t2w (Optional[Union[Path, str]], optional) – Path to the T2w image. Defaults to None.
log_file (Optional[Path | str], optional) – Save logs to this file. Defaults to None.
backend (Backends, optional) – Backend to use for inference. Defaults to Backends.DOCKER.