mrpro.phantoms.FastMRIImageDataset
- class mrpro.phantoms.FastMRIImageDataset[source]
Bases:
Dataset
FastMRI Image Dataset.
This dataset returns image tensors for single slices of the FastMRI brain or knee dataset. It filteres and resamples the files such that the returned images have a consistent shape of 320x320 before augmentations.
The returned images are complex valued and will have shape
(1, 1, 1, 320, 320)
if coil combined or(1, n_coils, 1, 320, 320)
otherwise.The data has to be downloaded beforehand. See https://fastmri.med.nyu.edu/ for more information.
- __init__(path: str | PathLike | Sequence[str | PathLike], coil_combine: bool = False, augment: Callable[[Tensor, int], Tensor] | None = None, allowed_n_coils: Sequence[int] | None = (16, 15))[source]
Initialize the dataset.
- Parameters:
path (PathLike) – Either a path to a directory containing the FastMRI data as .h5 files or a sequence of paths of individual files.
coil_combine (bool) – Whether to perform coil combination sensitivity maps obtained using the Inati method. Note that this is not comonly used as the target for FastMRI challenges. Instead, as target the RSS combination of the coil images is used.
augment (
Callable
[[Tensor
,int
],Tensor
] |None
, default:None
) – Augmentation function. Will be called with the image and the index of the slices. Ifcoil_combine
isTrue
, the function will be called with the complex valued coil combined image with shape (1, 320, 320) otherwise with the complex valued coil images with shape (n_coils, 320, 320).None
means no augmentation.allowed_n_coils (
Sequence
[int
] |None
, default:(16, 15)
) – List of allowed number of coils. IfNone
, all coils are allowed. The knee training set has 15 coils consistently, while the brain dataset has roughly 1300 files with 16 coils, 1100 files with 20 coils and 800 files with 4 coils. Only used ifcoil_combine
isFalse
.
- __eq__(value, /)
Return self==value.
- __new__(**kwargs)