A large-scale dataset of both raw MRI measurements and clinical MRI images

Overview

fastMRI

LICENSE CircleCI

Website and Leaderboards | Dataset | GitHub | Publications

Accelerating Magnetic Resonance Imaging (MRI) by acquiring fewer measurements has the potential to reduce medical costs, minimize stress to patients and make MR imaging possible in applications where it is currently prohibitively slow or expensive.

fastMRI is a collaborative research project from Facebook AI Research (FAIR) and NYU Langone Health to investigate the use of AI to make MRI scans faster. NYU Langone Health has released fully anonymized knee and brain MRI datasets that can be downloaded from the fastMRI dataset page. Publications associated with the fastMRI project can be found at the end of this README.

This repository contains convenient PyTorch data loaders, subsampling functions, evaluation metrics, and reference implementations of simple baseline methods. It also contains implementations for methods in some of the publications of the fastMRI project.

Documentation

Documentation for the fastMRI dataset and baseline reconstruction performance can be found in our paper on arXiv. The paper is updated on an ongoing basis for dataset additions and new baselines.

For code documentation, most functions and classes have accompanying docstrings that you can access via the help function in IPython. For example:

from fastmri.data import SliceDataset

help(SliceDataset)

Dependencies and Installation

We have tested this code using:

  • Ubuntu 18.04
  • Python 3.8
  • CUDA 10.1
  • CUDNN 7.6.5

First install PyTorch according to the directions at the PyTorch Website for your operating system and CUDA setup.

Then, navigate to the fastmri root directory and run

pip install -e .

pip will handle all package dependencies. After this you should be able to run most of the code in the repository.

Package Structure & Usage

The repository is centered around the fastmri module. The following breaks down the basic structure:

fastmri: Contains a number of basic tools for complex number math, coil combinations, etc.

  • fastmri.data: Contains data utility functions from original data folder that can be used to create sampling masks and submission files.
  • fastmri.models: Contains reconstruction models, such as the U-Net and VarNet.
  • fastmri.pl_modules: PyTorch Lightning modules for data loading, training, and logging.

Examples and Reproducibility

The fastmri_examples and banding_removal folders include code for reproducibility. The baseline models were used in the arXiv paper:

fastMRI: An Open Dataset and Benchmarks for Accelerated MRI ({J. Zbontar*, F. Knoll*, A. Sriram*} et al., 2018)

A brief summary of implementions based on papers with links to code follows. For completeness we also mention work on active acquisition, which is hosted in another repository.

Testing

Run pytest tests. By default integration tests that use the fastMRI data are skipped. If you would like to run these tests, set SKIP_INTEGRATIONS to False in the conftest.

Training a model

The data README has a bare-bones example for how to load data and incorporate data transforms. This jupyter notebook contains a simple tutorial explaining how to get started working with the data.

Please look at this U-Net demo script for an example of how to train a model using the PyTorch Lightning framework.

Submitting to the Leaderboard

Run your model on the provided test data and create a zip file containing your predictions. fastmri has a save_reconstructions function that saves the data in the correct format.

Upload the zip file to any publicly accessible cloud storage (e.g. Amazon S3, Dropbox etc). Submit a link to the zip file on the challenge website. You will need to create an account before submitting.

License

fastMRI is MIT licensed, as found in the LICENSE file.

Cite

If you use the fastMRI data or code in your project, please cite the arXiv paper:

@inproceedings{zbontar2018fastMRI,
    title={{fastMRI}: An Open Dataset and Benchmarks for Accelerated {MRI}},
    author={Jure Zbontar and Florian Knoll and Anuroop Sriram and Tullie Murrell and Zhengnan Huang and Matthew J. Muckley and Aaron Defazio and Ruben Stern and Patricia Johnson and Mary Bruno 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 Nafissa Yakubova and James Pinkerton and Duo Wang 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}
}

List of Papers

The following lists titles of papers from the fastMRI project. The corresponding abstracts, as well as links to preprints and code can be found here.

  1. Zbontar, J., Knoll, F., Sriram, A., Murrell, T., Huang, Z., Muckley, M. J., ... & Lui, Y. W. (2018). fastMRI: An open dataset and benchmarks for accelerated MRI. arXiv preprint arXiv:1811.08839.
  2. Zhang, Z., Romero, A., Muckley, M. J., Vincent, P., Yang, L., & Drozdzal, M. (2019). Reducing uncertainty in undersampled MRI reconstruction with active acquisition. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 2049-2058.
  3. Defazio, A. (2019). Offset Sampling Improves Deep Learning based Accelerated MRI Reconstructions by Exploiting Symmetry. arXiv preprint, arXiv:1912.01101.
  4. Knoll, F., Zbontar, J., Sriram, A., Muckley, M. J., Bruno, M., Defazio, A., ... & Lui, Y. W. (2020). fastMRI: A Publicly Available Raw k-Space and DICOM Dataset of Knee Images for Accelerated MR Image Reconstruction Using Machine Learning. Radiology: Artificial Intelligence, 2(1), page e190007.
  5. Knoll, F., Murrell, T., Sriram, A., Yakubova, N., Zbontar, J., Rabbat, M., ... & Recht, M. P. (2020). Advancing machine learning for MR image reconstruction with an open competition: Overview of the 2019 fastMRI challenge. Magnetic Resonance in Medicine, 84(6), pages 3054-3070.
  6. Sriram, A., Zbontar, J., Murrell, T., Zitnick, C. L., Defazio, A., & Sodickson, D. K. (2020). GrappaNet: Combining parallel imaging with deep learning for multi-coil MRI reconstruction. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 14315-14322.
  7. Recht, M. P., Zbontar, J., Sodickson, D. K., Knoll, F., Yakubova, N., Sriram, A., ... & Zitnick, C. L. (2020). Using Deep Learning to Accelerate Knee MRI at 3T: Results of an Interchangeability Study. American Journal of Roentgenology, 215(6), pages 1421-1429.
  8. Pineda, L., Basu, S., Romero, A., Calandra, R., & Drozdzal, M. (2020). Active MR k-space Sampling with Reinforcement Learning. In International Conference on Medical Image Computing and Computer-Assisted Intervention, pages 23-33.
  9. Sriram, A., Zbontar, J., Murrell, T., Defazio, A., Zitnick, C. L., Yakubova, N., ... & Johnson, P. (2020). End-to-End Variational Networks for Accelerated MRI Reconstruction. In International Conference on Medical Image Computing and Computer-Assisted Intervention, pages 64-73.
  10. Defazio, A., Murrell, T., & Recht, M. P. (2020). MRI Banding Removal via Adversarial Training. In Advances in Neural Information Processing Systems.
  11. Muckley, M. J., Riemenschneider, B., Radmanesh, A., Kim, S., Jeong, G., Ko, J., ... & Knoll, F. (2020). State-of-the-art Machine Learning MRI Reconstruction in 2020: Results of the Second fastMRI Challenge. arXiv preprint arXiv:2012.06318.
Comments
  • About Unable to open file Error in Implementation of  Variational Network

    About Unable to open file Error in Implementation of Variational Network

    Hello,

    In my implementation of Variational Network, I have been always facing OSError: Unable to open file (file signature not found). (Especially retrieving and reading the metadata in mri_data.py). I used it for getting metadata and have never used an error like this. I don't understand what was updated there last days.

    Have anyone encountered an error like this?

    If anyone has any idea, could it be shared with me, too?

    Best,

    opened by fharman 28
  • Add fastMRI+ data compatibility to SliceDataset

    Add fastMRI+ data compatibility to SliceDataset

    1. The function 'Download_csv' uses given hash of annotations (can be git hash if it's better) to download csv from github and store it locally (~/.annotation/.csv).
    2. If fname can't be found in annotation, it'll not be added into self.examples in the beginning.
    CLA Signed 
    opened by Gaskell-1206 20
  • Varnet training default parameters

    Varnet training default parameters

    Hello, I have been training the e2e varnet on 1 GPU with all the arguments set as default, except the sample rate is changed to 0.2. While the model performs quite well on the validation set (around 0.95 SSIM), it performs quite poorly on the public leaderboard for brain data (SSIM of 0.86 for 4x acceleration and 0.76 for 8x), and the images produced have lots of artifacts. My guess is that this occurs because the default acceleration rate is 4x and I should change it to either 8x or [4, 8], but I feel like there is more to this issue.

    Apart from the sample and acceleration rate, are there any other potential reasons that might cause this issue?

    opened by asaksena98 15
  • Results are not quite matched with the manuscript in the NMSE and PSNR scores.

    Results are not quite matched with the manuscript in the NMSE and PSNR scores.

    Great work in accelerating MRI. Thanks for releasing the first large-scale raw MRI dataset and benchmarks with source codes. We tried to reproduce benchmarks results using the provided code. Compared to the results mentioned in Table 8, the Single-coil U-Net baseline applied to knee validation data, our experiment results are quite different from the benchmarks in terms of the NMSE and PSNR metrics. The Details are listed as follows:

    image

    Results of our experiments achieved the same SSIM score but disagreed in NMSE and PSNR scores. I am very curious about such divergence and kindly asking if you would like to help me solve the puzzle. Thank you very much.

    opened by lpzhang 13
  • I am trying to repeat the Unet but have  [Errno 32] Broken pipe issue

    I am trying to repeat the Unet but have [Errno 32] Broken pipe issue

    Please:

    • [x] Check for duplicate issues.
    • [x] Provide a simple example for how to reproduce the bug.
    • [x] If applicable, include full error messages/tracebacks.
    bug 
    opened by tianxiangli1924 10
  • Variational Network Implementation Problem in Dataset Loading Images

    Variational Network Implementation Problem in Dataset Loading Images

    Hi,

    In test dataset, It gives TypeError: default_collate: batch must contain tensors, numpy arrays, numbers, dicts or lists; found <class 'NoneType'>. There is a problem in dataset loading images with the PIL library and does not convert them into necessary types like list or Tensor. Is there anyone who overcome this problem? Because I could not overcome with editting transform = transforms.Compose([ transforms.ToTensor() ]).

    opened by mattnsoleil 10
  • Varying Inputsize leads to NaNs during training

    Varying Inputsize leads to NaNs during training

    Hey, I'm using the banding_removal codebase and run the scripts/pretrain.py script with the same configuration. As a training dataset I use the fastmri multicoil knee dataset.

    I currently have two scenarios leading to NaNs in some ConvBlocks and in the losses, both are caused by the same underlaying problem.

    First, running with batch_size > 1 on the non-distributed setup: After a few steps in the first epoch the losses get NaN, because the input shape in that step changed (i.e. from [15, 640, 372, 2], to [15, 640, 322, 2]). I assume the different input size (particularly smaller ones) cause that some NaN values sneak in and propagate, leading to NaN losses and everything being NaN.

    Second, in distributed mode spawn_dist.run(args)with batch_size = 1: RuntimeError: stack expects each tensor to be equal size, but got [15, 640, 372, 2] at entry 0 and [15, 322, 640, 2] at entry 1 The issue here is that the different input sizes cant be stacked.

    So the underlaying issue is, that the training data has varying input sizes.

    I thought that the resize_type argument in args.py by default ('crop') already handles this issue, but as I saw it only affects the display_data.

    How can I fix this issue? I thought that I could somehow pad each input in the KSpaceDataTransform but that didn't work. Somehow __call__ is not executed so I can't apply a transformation.

    opened by tobiasvitt 10
  • RuntimeError: CUDA out of memory while training VarNet

    RuntimeError: CUDA out of memory while training VarNet

    Hello,

    Since mid 2020, I have been using the fastMRI project, modifying the subsampling scripts to accommodate a custom undersampling pattern and compare the reconstructions to the Varden and equispaced undersampled data. Training and testing the UNet model in the remote GPU server has not been a problem, everything works well (as seen in the below image).

    Figure_gt Figure_1

    During the training of the VarNet model, I am encountering the following error after 7-9 iterations of the 1st epoch;

    RuntimeError: CUDA out of memory Tried to allocate 28.00 MiB (GPU 0; 10.76 GiB total capacity; 9.73 GiB already allocated; 11.76 MiB free; 9.89 GiB reserved in total by PyTorch) 
    

    I checked if anyone had raised a similar issue, but the closest thing I could find was https://github.com/facebookresearch/fastMRI/issues/44#issuecomment-649439714 and the partial solutionn suggested in https://github.com/facebookresearch/fastMRI/issues/44#issuecomment-649546413 was to "decreasing the size of the model - e.g., --num-cascades 4".

    I followed the suggestion and the model training runs without any errors, but the results look bad (as seen in the below image) because of reducing the model size?

    Figure_1_2

    I am training the model on 150 volumes of multi-coil brain datasets for 50 epochs, I would like to know how to tackle this problem. I kindly request you to provide some suggestions/solutions to overcome this issue

    Ever since I pulled the project in mid 2020, I have been working with the same version of python libraries suggested in the requirement.txt file.

    Environment Python3, torch 1.5.0, PyTorch-lightning 0.7.6 and torchvision 0.6.0

    Desktop (Remote server): OS: Manjaro Linux 64bit / Linux 5.10.2-2-MANJARO Graphics: GeForce RTX 2080 Ti 10GB

    opened by adithyaOvGu 10
  • ssim score for unet model

    ssim score for unet model

    Hello, I am training the baseline unet model on the provided singlecoil data but even after 40 epochs, the ssim score remains relatively unchanged at around 0.667 (same with the nmse which is roughly around 0.033). Is this the expected result? The results of the paper distinguish between PD and PDFS, and different acceleration factors, but I assume that the singlecoil training data includes all of these differences and aggregates the results.

    opened by asaksena98 10
  • ValueError: when running VarNet

    ValueError: when running VarNet

    I get the following ValueError when I attempt to run the VarNet. Any idea why? I am using the NYU multi-coil knee dataset but just limited (10 training h5py files). I have in my environment pytorch-lightning 0.6.0 and torch 1.3.1 with torchvision 0.4.2.

    This is what I am using to train:

    python models/varnet/varnet.py --resolution 320 --mode train --challenge multicoil --exp var_net --mask-type random --data-path /media/iva19/multicoil_train/

    and that's the error:

    INFO:root:gpu available: True, used: True
    INFO:root:VISIBLE GPUS: 0
    Traceback (most recent call last):
      File "models/varnet/varnet.py", line 374, in <module>
        main()
      File "models/varnet/varnet.py", line 371, in main
        run(args)
      File "models/varnet/varnet.py", line 342, in run
        trainer.fit(model)
      File "/home/iva19/usr/local/miniconda3/envs/fastMRI/lib/python3.6/site-packages/pytorch_lightning/trainer/trainer.py", line 687, in fit
        mp.spawn(self.ddp_train, nprocs=self.num_gpus, args=(model,))
      File "/home/iva19/usr/local/miniconda3/envs/fastMRI/lib/python3.6/site-packages/torch/multiprocessing/spawn.py", line 171, in spawn
        while not spawn_context.join():
      File "/home/iva19/usr/local/miniconda3/envs/fastMRI/lib/python3.6/site-packages/torch/multiprocessing/spawn.py", line 118, in join
        raise Exception(msg)
    Exception: 
    
    -- Process 0 terminated with the following error:
    Traceback (most recent call last):
      File "/home/iva19/usr/local/miniconda3/envs/fastMRI/lib/python3.6/site-packages/torch/multiprocessing/spawn.py", line 19, in _wrap
        fn(i, *args)
      File "/home/iva19/usr/local/miniconda3/envs/fastMRI/lib/python3.6/site-packages/pytorch_lightning/trainer/distrib_data_parallel.py", line 331, in ddp_train
        self.run_pretrain_routine(model)
      File "/home/iva19/usr/local/miniconda3/envs/fastMRI/lib/python3.6/site-packages/pytorch_lightning/trainer/trainer.py", line 757, in run_pretrain_routine
        self.logger.log_hyperparams(ref_model.hparams)
      File "/home/iva19/usr/local/miniconda3/envs/fastMRI/lib/python3.6/site-packages/pytorch_lightning/logging/base.py", line 14, in wrapped_fn
        fn(self, *args, **kwargs)
      File "/home/iva19/usr/local/miniconda3/envs/fastMRI/lib/python3.6/site-packages/pytorch_lightning/logging/tensorboard.py", line 88, in log_hyperparams
        self.experiment.add_hparams(hparam_dict=params, metric_dict={})
      File "/home/iva19/usr/local/miniconda3/envs/fastMRI/lib/python3.6/site-packages/torch/utils/tensorboard/writer.py", line 292, in add_hparams
        exp, ssi, sei = hparams(hparam_dict, metric_dict)
      File "/home/iva19/usr/local/miniconda3/envs/fastMRI/lib/python3.6/site-packages/torch/utils/tensorboard/summary.py", line 156, in hparams
        raise ValueError('value should be one of int, float, str, bool, or torch.Tensor')
    ValueError: value should be one of int, float, str, bool, or torch.Tensor
    
    
    opened by wizofe 9
  • Error when running CS BART example

    Error when running CS BART example

    I have been trying to run the cs example, but I keep getting the following error. I have looked upon BART's documentation and GitHub page, but I couldn't find much information about it. I am running this from inside a docker.

    I am running in a docker with:

    • BART 0.7.0
    • Python 3.8
    • Ubuntu 18.04
    • No GPUs

    my command:

    python3.8 ./fastMRI/fastmri_examples/cs/run_bart.py \
        --challenge "singlecoil" \
        --data_path "data/FastMRI/knee/" \
        --out_path "pred-recons" \
        --reg_wt 0.01 \
        --mask_type "random" \
        --split val
    

    If I try the advised steps

    Once BART is installed, set the TOOLBOX_PATH environment variable and point PYTHONPATH to the python wrapper for BART:

    export TOOLBOX_PATH=$(which bart) # here I have tried a bunch of different options like /usr/local/bin, /usr/local/bin/bart, etc
    export PYTHONPATH=${TOOLBOX_PATH}/python:${PYTHONPATH}
    

    BART still can't be found via python even though I can call it from shell and I get:

    Traceback (most recent call last):
      File "run_bart.py", line 15, in <module>
        import bart
    ModuleNotFoundError: No module named 'bart'
    

    My fix

    I did manage to run the experiment by hardcoding the repository with sys.path.append inside run_bart.py

    import sys
    sys.path.append("./bart/python")      
    

    What did I miss? I can probably fix this myself, but I am not aware of what exactly I missed.

    EDIT: I forgot to mention that the correct argument for the script is out_path and not output_path as cited in the CS example README

    opened by gabrielziegler3 7
  • Add ZSNet

    Add ZSNet

    opened by mmuckley 0
  • Error related to raw_sample_filter in _create_data_loader

    Error related to raw_sample_filter in _create_data_loader

    Discussed in https://github.com/facebookresearch/fastMRI/discussions/263

    Creating an issue with this - seems like some aspects of sample filtering are bugged with recent changes.

    Originally posted by mouryarahul August 24, 2022 Hi, I'm trying to run python train_unet_demo.py \ --mode test \ --test_split test \ --challenge singlecoil \ --data_path ../../../FastMRI_DATASET/knee_singlecoil_train/ \ --resume_from_checkpoint unet/unet_demo/checkpoints/epoch=1-step=69484.ckpt

    where ../../../FastMRI_DATASET/knee_singlecoil_train/ contains all three folders: singlecoil_test, singlecoil_train and singlecoil_val

    However, I'm getting an error related to raw_sample_filter in the case of the test dataset. Maybe I am missing something or doing something silly. Can someone please point out the mistake? Thanks!

    Info about my environment: PyTorch version: 1.12.0+cu116 Is debug build: False CUDA used to build PyTorch: 11.6 ROCM used to build PyTorch: N/A

    OS: Ubuntu 22.04 LTS (x86_64) GCC version: (Ubuntu 11.2.0-19ubuntu1) 11.2.0 Clang version: Could not collect CMake version: version 3.22.1 Libc version: glibc-2.35

    Python version: 3.10.4 (main, Mar 31 2022, 08:41:55) [GCC 7.5.0] (64-bit runtime) Python platform: Linux-5.15.0-46-generic-x86_64-with-glibc2.35 Is CUDA available: True CUDA runtime version: Could not collect GPU models and configuration: GPU 0: NVIDIA GeForce GTX 1070 Nvidia driver version: 515.65.01 cuDNN version: Could not collect HIP runtime version: N/A MIOpen runtime version: N/A Is XNNPACK available: True

    Versions of relevant libraries: [pip3] numpy==1.22.3 [pip3] pytorch-lightning==1.7.2 [pip3] torch==1.12.0+cu116 [pip3] torchaudio==0.12.0+cu116 [pip3] torchmetrics==0.9.2 [pip3] torchvision==0.13.0+cu116 [conda] blas 1.0 mkl
    [conda] mkl 2021.4.0 h06a4308_640
    [conda] mkl-service 2.4.0 py310h7f8727e_0
    [conda] mkl_fft 1.3.1 py310hd6ae3a3_0
    [conda] mkl_random 1.2.2 py310h00e6091_0
    [conda] numpy 1.22.3 py310hfa59a62_0
    [conda] numpy-base 1.22.3 py310h9585f30_0
    [conda] pytorch-lightning 1.7.2 pypi_0 pypi [conda] torch 1.12.0+cu116 pypi_0 pypi [conda] torchaudio 0.12.0+cu116 pypi_0 pypi [conda] torchmetrics 0.9.2 pypi_0 pypi [conda] torchvision 0.13.0+cu116 pypi_0 pypi

    The full error msg:

    Global seed set to 42 /home/rahul/anaconda3/envs/pytorch/lib/python3.10/site-packages/torchmetrics/utilities/prints.py:36: UserWarning: Torchmetrics v0.9 introduced a new argument class property called full_state_update that has not been set for this class (DistributedMetricSum). The property determines if update by default needs access to the full metric state. If this is not the case, significant speedups can be achieved and we recommend setting this to False. We provide an checking function from torchmetrics.utilities import check_forward_no_full_state that can be used to check if the full_state_update=True (old and potential slower behaviour, default for now) or if full_state_update=False can be used safely. warnings.warn(*args, **kwargs) /home/rahul/anaconda3/envs/pytorch/lib/python3.10/site-packages/pytorch_lightning/trainer/connectors/accelerator_connector.py:446: LightningDeprecationWarning: Setting Trainer(gpus=1) is deprecated in v1.7 and will be removed in v2.0. Please use Trainer(accelerator='gpu', devices=1) instead. rank_zero_deprecation( /home/rahul/anaconda3/envs/pytorch/lib/python3.10/site-packages/pytorch_lightning/trainer/connectors/checkpoint_connector.py:52: LightningDeprecationWarning: Setting Trainer(resume_from_checkpoint=) is deprecated in v1.5 and will be removed in v1.7. Please pass Trainer.fit(ckpt_path=) directly instead. rank_zero_deprecation( GPU available: True (cuda), used: True TPU available: False, using: 0 TPU cores IPU available: False, using: 0 IPUs HPU available: False, using: 0 HPUs Global seed set to 42 Initializing distributed: GLOBAL_RANK: 0, MEMBER: 1/1

    distributed_backend=nccl All distributed processes registered. Starting with 1 processes

    LOCAL_RANK: 0 - CUDA_VISIBLE_DEVICES: [0] Traceback (most recent call last): File "/media/rahul/DATA/WorkSpace/Multimodal-Data-Processing/Projects/fastMRI/fastmri_examples/unet/train_unet_demo.py", line 191, in run_cli() File "/media/rahul/DATA/WorkSpace/Multimodal-Data-Processing/Projects/fastMRI/fastmri_examples/unet/train_unet_demo.py", line 187, in run_cli cli_main(args) File "/media/rahul/DATA/WorkSpace/Multimodal-Data-Processing/Projects/fastMRI/fastmri_examples/unet/train_unet_demo.py", line 75, in cli_main trainer.test(model, datamodule=data_module) File "/home/rahul/anaconda3/envs/pytorch/lib/python3.10/site-packages/pytorch_lightning/trainer/trainer.py", line 864, in test return self._call_and_handle_interrupt(self._test_impl, model, dataloaders, ckpt_path, verbose, datamodule) File "/home/rahul/anaconda3/envs/pytorch/lib/python3.10/site-packages/pytorch_lightning/trainer/trainer.py", line 648, in _call_and_handle_interrupt return self.strategy.launcher.launch(trainer_fn, *args, trainer=self, **kwargs) File "/home/rahul/anaconda3/envs/pytorch/lib/python3.10/site-packages/pytorch_lightning/strategies/launchers/subprocess_script.py", line 93, in launch return function(*args, **kwargs) File "/home/rahul/anaconda3/envs/pytorch/lib/python3.10/site-packages/pytorch_lightning/trainer/trainer.py", line 911, in _test_impl results = self._run(model, ckpt_path=self.ckpt_path) File "/home/rahul/anaconda3/envs/pytorch/lib/python3.10/site-packages/pytorch_lightning/trainer/trainer.py", line 1168, in _run results = self._run_stage() File "/home/rahul/anaconda3/envs/pytorch/lib/python3.10/site-packages/pytorch_lightning/trainer/trainer.py", line 1251, in _run_stage return self._run_evaluate() File "/home/rahul/anaconda3/envs/pytorch/lib/python3.10/site-packages/pytorch_lightning/trainer/trainer.py", line 1291, in _run_evaluate self._evaluation_loop._reload_evaluation_dataloaders() File "/home/rahul/anaconda3/envs/pytorch/lib/python3.10/site-packages/pytorch_lightning/loops/dataloader/evaluation_loop.py", line 234, in _reload_evaluation_dataloaders self.trainer.reset_test_dataloader() File "/home/rahul/anaconda3/envs/pytorch/lib/python3.10/site-packages/pytorch_lightning/trainer/trainer.py", line 1944, in reset_test_dataloader self.num_test_batches, self.test_dataloaders = self._data_connector._reset_eval_dataloader( File "/home/rahul/anaconda3/envs/pytorch/lib/python3.10/site-packages/pytorch_lightning/trainer/connectors/data_connector.py", line 348, in _reset_eval_dataloader dataloaders = self._request_dataloader(mode) File "/home/rahul/anaconda3/envs/pytorch/lib/python3.10/site-packages/pytorch_lightning/trainer/connectors/data_connector.py", line 436, in _request_dataloader dataloader = source.dataloader() File "/home/rahul/anaconda3/envs/pytorch/lib/python3.10/site-packages/pytorch_lightning/trainer/connectors/data_connector.py", line 513, in dataloader return method() File "/media/rahul/DATA/WorkSpace/Multimodal-Data-Processing/Projects/fastMRI/fastmri/pl_modules/data_module.py", line 325, in test_dataloader return self._create_data_loader( File "/media/rahul/DATA/WorkSpace/Multimodal-Data-Processing/Projects/fastMRI/fastmri/pl_modules/data_module.py", line 262, in _create_data_loader raw_sample_filter=raw_sample_filter, UnboundLocalError: local variable 'raw_sample_filter' referenced before assignment

    opened by mmuckley 0
  • Failed submissions to fastmri.org when using Google Drive

    Failed submissions to fastmri.org when using Google Drive

    This is something we identified in Discussion #220. It seems Google has changed their API recently so that our old code will fail to download a submission. Until I get some time to fix this, please submit to fastmri.org using Dropbox or an S3 bucket.

    bug 
    opened by mmuckley 17
  • Memory leak with `h5py` from `pip` and conversion to `torch.Tensor`

    Memory leak with `h5py` from `pip` and conversion to `torch.Tensor`

    I recently tried to do some experiments on my model with multi-coil FastMRI brain data. Due to the need for flexibility (and also because I don't have the extra time to learn how to use Pytorch lighting), I didn't use Pytorch Lighting directly. Instead, I chose normal Pytorch, but during the iterating process, I only set num_worker=2, and my memory footprint was quite large at the beginning. As the number of iterations increased, an error occurred: RuntimeError: DataLoader worker (PID 522908) is killed by signal: killed. I checked the training codes of other parts, but no obvious memory accumulation error was found. Therefore, I thought there was a large probability of a problem in siliceDataset. I simply used "pass" to traverse the Dataloader loop, and found that the memory occupation kept rising.

    bug 
    opened by Breeze-Zero 29
  • Add code for emulated single coil

    Add code for emulated single coil

    This issue would add code for simulating the single-coil data from multi-coil data described in the following paper:

    Tygert M, Zbontar J. Simulating single-coil MRI from the responses of multiple coils. Communications in Applied Mathematics and Computational Science. 2020 Nov 19;15(2):115-27. https://msp.org/camcos/2020/15-2/p01.xhtml

    enhancement 
    opened by mmuckley 2
  • Add google colab export link

    Add google colab export link

    It would be nice to add a colab link to the project, so that it is easier for everyone to access. It should be relatively easy to host the fastMRI_tutorial.ipynb in colab.

    Thanks, Abish Pius

    enhancement 
    opened by abishpius 1
Releases(v0.2.0)
  • v0.2.0(Jun 17, 2022)

    This release of fastMRI includes PyTorch Lightning modules for the paper On learning adaptive acquisition policies for undersampled multi-coil MRI reconstruction by Bakker et al., to be presented at the upcoming MIDL conference. A list of changes is below:

    • Add Adaptive VarNet implementation (PR #205)
    • Compatibility for fastMRI+ in SliceDataset (PR #192) - currently in beta.
    • Masking API updates (PR #167).
    • Various smaller bug fixes and improvements.

    Contributors: @Timsey @luisenp @michaldrozdzal

    Source code(tar.gz)
    Source code(zip)
  • v0.1.1(Jul 20, 2021)

    • Includes a fix for packaging that removes fastmri_examples from distributed sources. (#145).
    • Updates the FFT API to allow the user to adjust normalizations (#146).
    Source code(tar.gz)
    Source code(zip)
  • v0.1.0.post210716(Jul 16, 2021)

    This release does not introduce any major changes - it merely includes metadata for publishing the project on PyPI. The creation of this release also tests the GitHub release action.

    Source code(tar.gz)
    Source code(zip)
Owner
Facebook Research
Facebook Research
Django helper application to easily and non-destructively crop arbitrarily large images in admin and frontend.

django-image-cropping django-image-cropping is an app for cropping uploaded images via Django's admin backend using Jcrop. Screenshot: django-image-cr

Jonas und der Wolf GmbH 546 Jan 3, 2023
Easily turn large sets of image urls to an image dataset. Can download, resize and package 100M urls in 20h on one machine.

img2dataset Easily turn large sets of image urls to an image dataset. Can download, resize and package 100M urls in 20h on one machine. Also supports

Romain Beaumont 1.4k Jan 1, 2023
A utility for quickly cropping large collections of images.

Crop Tool A utility for quickly cropping large collections of images. Inspired by Derrick Schultz's dataset-tools. Setup It's suggested that you use A

dusk (they/them) 6 Nov 14, 2021
This app finds duplicate to near duplicate images by generating a hash value for each image stored with a specialized data structure called VP-Tree which makes searching an image on a dataset of 100Ks almost instantanious

Offline Reverse Image Search Overview This app finds duplicate to near duplicate images by generating a hash value for each image stored with a specia

null 53 Nov 15, 2022
This repository will help you get label for images in Stanford Cars Dataset.

STANFORD CARS DATASET stanford-cars "The Cars dataset contains 16,185 images of 196 classes of cars. The data is split into 8,144 training images and

Nguyễn Trường Lâu 3 Sep 20, 2022
missing-pixel-filler is a python package that, given images that may contain missing data regions (like satellite imagery with swath gaps), returns these images with the regions filled.

Missing Pixel Filler This is the official code repository for the Missing Pixel Filler by SpaceML. missing-pixel-filler is a python package that, give

SpaceML 11 Jul 19, 2022
Seaborn-image is a Python image visualization library based on matplotlib and provides a high-level API to draw attractive and informative images quickly and effectively.

seaborn-image: image data visualization Description Seaborn-image is a Python image visualization library based on matplotlib and provides a high-leve

null 48 Jan 5, 2023
HtmlWebShot - A python3 package which Can Create Images From url, Html-CSS, Svg and from any readable file and texts with many setup features.

A python3 package which Can Create Images From url, Html-CSS, Svg and from any readable file and texts with many setup features

Danish 24 Dec 14, 2022
Fast batch image resizer and rotator for JPEG and PNG images.

imgp is a command line image resizer and rotator for JPEG and PNG images.

Terminator X 921 Dec 25, 2022
A drop-in replacement for django's ImageField that provides a flexible, intuitive and easily-extensible interface for quickly creating new images from the one assigned to the field.

django-versatileimagefield A drop-in replacement for django's ImageField that provides a flexible, intuitive and easily-extensible interface for creat

Jonathan Ellenberger 490 Dec 13, 2022
Python Image Morpher (PIM) is a program that can take two images and blend them to whatever extent or precision that you like

Python Image Morpher (PIM) is a program that can take two images and blend them to whatever extent or precision that you like! It is designed to emulate some of Python's OpenCV image processing from scratch without reference.

David Dowd 108 Dec 19, 2022
A python program to generate ANSI art from images and videos

ANSI Art Generator A python program that creates ASCII art (with true color support if enabled) from images and videos Dependencies The program runs u

Pratyush Kumar 12 Nov 8, 2022
QSIprep: Preprocessing and analysis of q-space images

QSIprep: Preprocessing and analysis of q-space images Full documentation at https://qsiprep.readthedocs.io About qsiprep configures pipelines for proc

 Lifespan Informatics and Neuroimaging Center 88 Dec 15, 2022
MetaStalk is a tool that can be used to generate graphs from the metadata of JPEG, TIFF, and HEIC images

MetaStalk About MetaStalk is a tool that can be used to generate graphs from the metadata of JPEG, TIFF, and HEIC images, which are tested. More forma

Cyb3r Jak3 1 Jul 5, 2021
HTML2Image is a lightweight Python package that acts as a wrapper around the headless mode of existing web browsers to generate images from URLs and from HTML+CSS strings or files.

A package acting as a wrapper around the headless mode of existing web browsers to generate images from URLs and from HTML+CSS strings or files.

null 176 Jan 1, 2023
Image Reading, Metadata Conversion, and Image Writing for Microscopy Images in Python

AICSImageIO Image Reading, Metadata Conversion, and Image Writing for Microscopy Images in Pure Python Features Supports reading metadata and imaging

Allen Institute for Cell Science - Modeling 137 Dec 14, 2022
Script for the creation of metadatas and the randomization of images of MekaVerse

MekaVerse-random Script for the creation of metadata and the randomization of images of MekaVerse Step to replay the random : Create a folder : output

Miinded 8 Sep 7, 2022
View images in the terminal using ansi escape codes and python

terminal-photo-viewer view images in the terminal using ansi escape codes and python !! Only tested on Ubuntu 20.04.3 LTS with python version 3.8.10 D

null 1 Nov 30, 2021
Console images in 48 colors, 216 colors and full rgb

console_images Console images in 48 colors, 216 colors and full rgb Full RGB 216 colors 48 colors If it does not work maybe you should change color_fu

Урядов Алексей 5 Oct 11, 2022