This repository provides a Pytorch implementation of the paper SuperFormer: Volumetric Transformer Architectures for MRI Super-Resolution. Presented at the 7th Simulation and Synthesis in Medical Imaging (SASHIMI) workshop in MICCAI 2022. SuperFormer is a novel volumetric visual transformer for MRI Super-Resolution. Our method leverages the 3D and multi-domain information from volume and feature embeddings to reconstruct HR MRIs using a local self-attention mechanism.
SuperFormer: Volumetric Transformer Architectures for MRI Super-Resolution
Cristhian Forigua
- Clone the repo
git clone https://github.com/BCV-Uniandes/SuperFormer.git
cd SuperFormer
- Create environment from .yml file
conda env create -f environment.yml
conda activate superformer
Please refer to the Human Connectome Project to donwload the dataset. Locate the files from ./split into the ./HCP folder before running the code.
To generate the Low-resolution MRIs, we use the code in ./data/kspace.m. The factor_truncate variable controls the magnitude of subsampling the frequency domain space. Please change the "rootdir" path to your path where the data was downloaded. To run this code, you need MATLAB's "NIfTI_20140122" package.
./data/kspace.m
Training command:
sh train.sh
Make sure to change the paths to the HCP folder inside the options files. Please change the parameters "dataroot_H" and "dataroot_L".
The default is to train SuperFormer from scratch. However, you can change the path of the options file inside train.sh to train either the swinIR 2D approach, 3D RRDBNet, or 3D EDSR. See the ./options/train folder.
You can find our pe-trained models here
Before testing, make sure you change the paths of the pretrained models inside the ./options/test files. Change the attribute "pretrained_netG". Also, change the path to the HCP data.
Test 3D command:
sh test.sh
Test 2D command:
sh train.sh
This project borrows heavily from KAIR, we thank the authors for their contributions to the community.
More details about license in LICENSE.
If you have any question, please email [email protected]