This project works with the fastMRI dataset for MRI reconstruction tasks. The repository contains a Jupyter notebook for exploring and processing the fastMRI knee singlecoil dataset.
Follow these instructions to set up your development environment and get the project running locally.
- Python 3.10
- Conda or Miniconda (recommended for environment management)
- fastMRI dataset (can be downloaded from https://fastmri.med.nyu.edu/)
-
Clone the repository:
git clone <repository-url> cd cs7643-fastmri
-
Create and activate the conda environment using the provided environment.yml file:
conda env create -f environment.yml conda activate cs7643-fastmri
-
Create a copy of the example environment file:
cp .env.example .env
-
Open the
.envfile and update the paths to match your local setup:SINGLECOIL_TRAIN_PATH=/path/to/your/singlecoil_train SINGLECOIL_VAL_PATH=/path/to/your/singlecoil_val
-
Start Jupyter Notebook:
jupyter notebook
-
Open the
fastMRI_knee_singlecoil.ipynbnotebook -
Run the cells to explore and process the fastMRI dataset
- don't forget to update .env file (data location)
- when using a new system (with data on the mounted filesystem and not on the local SSD) make sure to copy data to local SSD
- get the environment set up on the mounted filesystem
This assumes that a filesystem (or other directory) is available at ~/fastmri on remote system
rsync -avz --exclude='.git/' --exclude='checkpoints/' --exclude='wandb/' --exclude='__pycache__/' ~/projects/cs7643-fastmri/ ubuntu@<remote-ip>:~/fastmri/code
sudo apt install -y pv pixz
mkdir ~/data
rsync -ah --progress ~/fastmri/data/knee_singlecoil_train.tar.xz ~/fastmri/data/knee_singlecoil_val.tar.xz ~/data/
pixz -d < ~/data/knee_singlecoil_train.tar.xz | tar -x -C ~/data
pixz -d < ~/data/knee_singlecoil_val.tar.xz | tar -x -C ~/data
echo "done"
curl -O https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
bash Miniconda3-latest-Linux-x86_64.sh
source ~/.bashrc
conda env create --prefix ~/fastmri/env --file ~/fastmri/code/environment.yml
conda activate ~/fastmri/env
To get a persistent remote session:
tmux new -s fastmri
To attach to a persistent remote session:
tmux attach -t fastmri
To detach from a persistent remote session:
Ctrl+b d
cd ~/fastmri/code
conda activate ~/fastmri/env
python train_model_SCKSCWMT.py