Data pipelines for the fastMRI dataset in TensorFlow.
Project description
tf-fastmri-data
Built around the tf.data
API, tf-fastmri-data
offers reliable, unit-tested, datasets for the fastMRI dataset.
Installation
Currently, you need to install the package from source:
git clone https://github.com/zaccharieramzi/tf-fastmri-data.git
cd tf-fastmri-data
pip install .
Example use
from tf_fastmri_data.datasets.cartesian import CartesianFastMRIDatasetBuilder
train_dataset = CartesianFastMRIDatasetBuilder(path='/path/to/singlecoil_train').preprocessed_ds
Data
To download the data, you need to consent to the fastMRI terms listed here. Afterwards, you should receive an email with data download links.
You can then use the environment variable FASTMRI_DATA_DIR
to indicate where your fastMRI is.
This will allow you to not have to specify the path when instantiating a FastMRIDatasetBuilder
.
PyTorch
The PyTorch equivalent of this library is simply the official fastMRI repository. In particular, the data folder is where you find the data utils.
Benchmark
You can run the benchmark script with the following command:
FASTMRI_DATA_DIR=/path/to/fastmri python benchmark.py
Currently the benchmark gives the following output:
Multi coil with tfio loading (random slice): 0.369743709564209s per-file.
Single coil with tfio loading (random slice): 0.02855397939682007s per-file.
Multi coil with h5py loading (random slice, without preprocessing): 0.010439331208042165s per-file.
Single coil with h5py loading (random slice, without preprocessing): 0.0015996736497735258s per-file.
Single coil training with tfio loading: 0.04578723907470703s per-step.
You can also see the recommendation of TensorBoard regarding the single coil dataset (with a very simple model):
Citation
If you use the fastMRI data or this code in your research, please consider citing the fastMRI dataset paper:
@inproceedings{zbontar2018fastMRI,
title={{fastMRI}: An Open Dataset and Benchmarks for Accelerated {MRI}},
author={Jure Zbontar and Florian Knoll and Anuroop Sriram and Matthew J. Muckley and Mary Bruno and Aaron Defazio and Marc Parente and Krzysztof J. Geras and Joe Katsnelson and Hersh Chandarana and Zizhao Zhang and Michal Drozdzal and Adriana Romero and Michael Rabbat and Pascal Vincent and James Pinkerton and Duo Wang and Nafissa Yakubova and Erich Owens and C. Lawrence Zitnick and Michael P. Recht and Daniel K. Sodickson and Yvonne W. Lui},
journal = {ArXiv e-prints},
archivePrefix = "arXiv",
eprint = {1811.08839},
year={2018}
}
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file tf-fastmri-data-0.0.2.tar.gz
.
File metadata
- Download URL: tf-fastmri-data-0.0.2.tar.gz
- Upload date:
- Size: 11.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.6.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 39df6a3276a9a0ffa099693390db264c4cc1db74a46da773d427210d1264a7c6 |
|
MD5 | f8715617e0e1842f34573abd127a3e9c |
|
BLAKE2b-256 | ae6c4b3cd8b30f288028fbf0dc1363e34b229f4f5d01bdf62d78189c3deda721 |
File details
Details for the file tf_fastmri_data-0.0.2-py3-none-any.whl
.
File metadata
- Download URL: tf_fastmri_data-0.0.2-py3-none-any.whl
- Upload date:
- Size: 17.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.6.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 537533e25a0b843768731d05458aa9561c4cf69cf85bda9639a614388a271c6b |
|
MD5 | 6f8cff9ebb1b7c95966659e0812aea5c |
|
BLAKE2b-256 | 5139204e7c75efdc49c0a9fbf49b5f02ce07b6958c752e8b428d4f76dbc74a89 |