DIRECTModel#

class deepinv.models.DIRECTModel(model_name='jointicnet_5x', pretrained=True, device='cpu')[source]#

Bases: Reconstructor, MRIMixin

Pretrained MRI reconstruction models from DIRECT library.

Runs a pretrained model from DIRECT for (multi-coil) MRI reconstruction from kspace to images.

Available models:

Models trained on Calgary-Campinas 12-coil brain (downloaded from here)

  • jointicnet_5x (or _10x) [1],

  • recurrentvarnet_5x (or _10x) [2],

  • varnet_5x (or _10x) [3],

  • conjgradnet_5x (or _10x) [4],

  • iterdualnet_5x (or _10x) [5],

  • kikinet_5x (or _10x) [6],

  • lpdnet_5x (or _10x) [7],

  • unet_5x (or _10x) [8],

  • xpdnet_5x (or _10x) [9],

  • multidomainnet [10] (downloaded from DIRECT, repaired locally, uploaded to HF).

Models trained on a mix of MRI datasets (including brain, cardiac, knee and prostate) (downloaded from here)

  • vsharp_brain [11][12],

  • vsharp_cardiac,

  • vsharp_knee,

  • vsharp_prostate

The wrapped models handle the MRI physics and estimate coil maps themselves.

Note

deepinv uses centered FFTs but DIRECT uses uncentered, so we pre-shift y (a checkerboard modulation) into DIRECT’s convention.

Also, the output scale is not preserved, so its intensity is proportional to but not equal to y.

Note

This model requires DIRECT >=2.2.0 and Python >=3.12. Install it with pip install deepinv[direct]. The model should be used on non-CPU devices. CPU support is experimental and depends on your platform due to DIRECT requirement constraints.

Warning

Currently, this model can only be used for evaluation, not training/fine-tuning. If you want to use the model in training mode, please open a feature request issue on GitHub.

Parameters:
  • model_name (str) – model name, see list above.

  • pretrained (bool, str) – If True, the model will be initialized with pretrained weights from DIRECT. If str, load from file.

  • device (torch.device, str) – device.


Example:
>>> import deepinv as dinv
>>> model = dinv.models.DIRECTModel("vsharp_brain")
>>> x_hat = model(y, physics)  # y: multicoil k-space, physics: dinv.physics.MultiCoilMRI


References:

forward(y, physics, **kwargs)[source]#

Reconstruct image from k-space y and physics.

Parameters:

Examples using DIRECTModel:#

Reconstruct undersampled k-space for cardiac and brain MRI

Reconstruct undersampled k-space for cardiac and brain MRI