Documentation for active-mri-acquisition

active-mri-acquisition is a package that facilitates the application of reinforcement learning to the problem active MRI acquisition. In particular, active-mri-acquisition provides a gym-like environment for simulating the execution of policies for k-space sampling, allowing users to experiment with their own reconstruction models and RL algorithms, without worrying about implementing the core k-space acquisition logic.

Getting started

Installation

active-mri-acquisition is a Python 3.7+ library. To install it, clone the repository,

git clone https://github.com/facebookresearch/active-mri-acquisition.git

then run

cd active-mri-acquisition
pip install -e .

If you also want the developer tools for contributing, run

pip install -e ".[dev]"

Finally, make sure your Python environment has PyTorch (>= 1.6) installed with the appropriate CUDA configuration for your system.

To test your installation, run

python -m pytest tests/core

Global configuration

The first time you try to run any of our RL environments (for example, see our intro notebook), you will see a message asking you to add some entries to the defaults.json file. This file will be created automatically the first time you run an environemnt, and it will be located at $HOME/.activemri/defaults.json. It will look like this:

{
  "data_location": "",
  "saved_models_dir": ""
}

To run the RL environments, you need to fill these two entries. Entry data_location must point to the root folder in which you will store the fastMRI dataset (for instructions on how to download the dataset, please visit https://fastmri.med.nyu.edu/). Entry saved_models_dir indicates the folder where the environment will look for the checkpoints of reconstruction models. Note that saved_models_dir does not need to be set to use your own reconstruction model, but it is required to use our example environments. For more details see Environment’s JSON configuration.

Indices and tables