SKMTEASliceDataset#

class deepinv.datasets.SKMTEASliceDataset(root, echo=0, acc=6, load_metadata_from_cache=False, save_metadata_to_cache=False, metadata_cache_file='skmtea_dataset_cache.pkl', filter_id=None)[source]#

Bases: FastMRISliceDataset, MRIMixin

SKM-TEA dataset for raw multicoil MRI kspace data.

Wraps the SKM-TEA dataset proposed in Desai et al.[1]. The dataset returns 2D slices from a dataset of 3D MRI volumes.

To download raw data as h5 files, see the SKM-TEA website.

The dataset is loaded as tuples (x, y, params) where:

  • y are the undersampled kspace measurements of shape (2, N, H, W) where N is the coil dimension.

  • x are the complex SENSE reconstructions from fully-sampled kspace of shape (2, H, W).

  • params is a dict containing parameters mask and coil_maps provided by the dataset, where mask are elliptical Poisson disc undersampling masks and coil_maps are sensitivity maps estimated using JSENSE.

Tip

The data can be directly related with deepinv.physics.MultiCoilMRI

x, y, params = next(iter(DataLoader(SKMTEADataset())))
from deepinv.physics import MultiCoilMRI
physics = MultiCoilMRI(**params)
y1 = physics(x)

Then y and y1 are almost identical.

Raw data file structure: (each file contains the k-space data and some metadata related to the scan)

self.root --- xxx0.h5
           |
           -- xxx1.h5.

When using this class, consider using the metadata_cache options to speed up class initialisation after the first initialisation.

Parameters:
  • root (str, pathlib.Path) – Path to the dataset.

  • echo (int) – which qDESS echo to use, defaults to 0.

  • acc (int) – acceleration of mask to load, choose from 4, 6, 8, 10, 12 or 16.

  • load_metadata_from_cache (bool) – Whether to load dataset metadata from cache.

  • save_metadata_to_cache (bool) – Whether to cache dataset metadata.

  • metadata_cache_file (str, pathlib.Path) – A file used to cache dataset information for faster load times.

  • filter_id (Callable) – optional function that takes SliceSampleID named tuple and returns whether this id should be included.


Examples:

Load data:

>>> from deepinv.datasets import SKMTEADataset
>>> from torch.utils.data import DataLoader
>>> dataset = SKMTEADataset(".")
>>> len(dataset) # Number of slices * number of volumes
512
>>> x, y, params = next(iter(DataLoader(dataset)))
>>> x.shape # (B, 2, H, W)
torch.Size([1, 2, 512, 160])
>>> y.shape # (B, 2, N, H, W) # N coils
torch.Size([1, 2, 8, 512, 160])


References:

zero_pad(x, shape, mode='constant', value=0)[source]#

Perform zero padding.

Code taken from ad12/meddlr