Inpainting Algorithms¶
The following classes provide inpainting algorithms from several BraTS challenges.
- class brats.core.inpainting_algorithms.Inpainter(algorithm: InpaintingAlgorithms = InpaintingAlgorithms.BraTS23_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 inpainting on a batch of subjects with the provided images and save the results to the output folder.
Requires the following structure:
data_folder
┣ A
┃ ┣ A-t1n-voided.nii.gz
┃ ┣ A-mask.nii.gz
┣ B
┃ ┣ B-t1n-voided.nii.gz
┃ ┣ B-mask.nii.gz
┣ C …
- Parameters:
data_folder (Path | str) – Folder containing the subjects with required structure
output_folder (Path | str) – Output folder to save the segmentations
log_file (Path | str, optional) – Save logs to this file
backend (Backends, optional) – Backend to use for inference. Defaults to Backends.DOCKER.
- infer_single(t1n: Path | str, mask: Path | str, output_file: Path | str, log_file: Path | str | None = None, backend: Backends | None = Backends.DOCKER) None¶
Perform inpainting task on a single subject with the provided images and save the result to the output file.
- Parameters:
t1n (Path | str) – Path to the voided T1n image
mask (Path | str) – Path to the mask image
output_file (Path | str) – Path 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.