Git Product home page Git Product logo

dl-cs's Introduction

Compressed Sensing: From Research to Clinical Practice with Data-Driven Learning

Introduction

Compressed sensing for MRI allows for high subsampling factors while maintaining high image quality. The result is shortened scan durations and/or improved resolutions. Further, compressed sensing increases the diagnostic information from each scan performed. Overall, compressed sensing has significant clinical impact in increasing imaging exams in diagnostic quality and in improving patient experience. However, a number of challenges exist when moving compressed sensing from research to the clinic. These challenges include hand-crafted image priors, sensitive tuning parameters, and long reconstruction times. Data-driven learning provides a compelling solution to address these challenges. As a result, compressed sensing can have maximal clinical impact. The purpose here is to demonstrate an example data-driven reconstruction algorithm using deep convolutional neural networks.

For more details about this work, see arXiv:1903.07824 [eess.IV].

Image of Example Results

Figure 1: Example results of a volumetric knee dataset that is subsampled with an acceleration factor R of 9.4 with corner cutting. In the bottom row, the volume was reconstructed slice by slice using three networks trained with different loss functions. The reconstruction using the network trained using the L1 and L2 losses yielded the best results in terms of PSNR, NRMSE, and SSIM. However, the reconstruction using the network trained with the adversarial loss yielded results with most realistic texture.

Setup

This project uses the open source python toolbox sigpy for generating sampling masks, estimating sensitivity maps, and other MRI specific operations. The functionality of sigpy can be replaced with the bart toolbox. Note that if the bart binary is in the system paths, bart will be used to estimate sensitivity maps using Uecker et al's ESPIRiT algorithm. Otherwise, sensitivity maps will be estimated with sigpy using Ying and Sheng's JSENSE.

Install the required python packages (tested with python 3.6 on Ubuntu 16.04LTS):

pip install -r requirements.txt
pip install pyfftw # optional for faster fft's

Fully sampled datasets can be downloaded from http://mridata.org using the python script and text file.

python3 data_prep.py --verbose mridata_org.txt

The download and pre-processing will take some time! This script will create a data folder with the following sub-folders:

  • raw/ismrmrd: Contains files with ISMRMRD files directly from http://mridata.org
  • raw/npy: Contains the data converted to numpy format, npy
  • tfrecord/train: Training examples converted to TFRecords
  • tfrecord/validate: Validation examples converted to TFRecords
  • tfrecord/test: Test examples converted to TFRecords
  • test_npy: Sub-sampled volumetric test examples in npy format
  • masks: Sampling masks generated using sigpy in npy format

All TFRecords contain fully sampled raw k-space data and sensitivity maps.

Training

The training can be performed using the following command.

python3 --model_dir summary/model recon_train.py

All the parameters (dimensions and etc) assume that the training is performed with the knee datasets from mridata.org. See the --help flag for more information on how to adjust the training for new datasets.

For convenience, the training can be performed using the bash script: train_all.sh. This script will train the reconstruction network with a number of different losses: L1, L2, and L1+Adversarial.

Inference

For file input kspace_input.npy, the data can be reconstructed with the following command. The test data in data/test_npy can be used to test the inference script.

python3 recon_run.py summary/model kspace_input.npy kspace_output.npy

References

  1. Cheng JY, Chen F, Sandino C, Mardani M, Pauly JM, Vasanawala SS. Compressed Sensing: From Research to Clinical Practice with Data-Driven Learning. arXiv:1903.07824 [eess.IV]. 2019 Mar 19.
  2. Ong F, Amin S, Vasanawala SS, Lustig M. An Open Archive for Sharing MRI Raw Data. In: ISMRM & ESMRMB Joint Annual Meeting. Paris, France; 2018. p. 3425.
  3. Ong F, Lustig M. SigPy: A Python Package for High Performance Iterative Reconstruction. In: ISMRM Annual Meeting & Exhibition. Montreal, Canada; 2019.
  4. Uecker et al. BART Toolbox for Computational Magnetic Resonance Imaging, DOI: 10.5281/zenodo.592960
  5. Cheng JY, Chen F, Alley MT, Pauly JM, Vasanawala SS. Highly Scalable Image Reconstruction using Deep Neural Networks with Bandpass Filtering. arXiv:1805.03300 [cs.CV]. 2018 May 8.

dl-cs's People

Contributors

jychengmri avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

dl-cs's Issues

memory requirement

Hey,

What are the memory requirement to train this model? I am providing 187GB of RAm and it fails after

INFO:tensorflow:Saving checkpoints for 0 into summary/knee_l1/model.ckpt.
Here the memory requirement changes from 4GB to more than 187 GB and the job gets killed as it runs out of memory.

I am just running the model based on train_all.sh command, where I have decreased the batch size from 2 to 1 and iteration steps from 10000 to only 10.

python3 recon_train.py
--shape_y 320 --shape_z 256
--num_channels 8 --num_maps 1
--batch_size 1
--model_dir summary/knee_l1
--loss_l1 1
--max_steps 10
--device $device

Can you please help me, I am unable to train the model? I am proving 1 GPU of 16 GB. Does this model design to run on multiple nodes and CPU?

Thank you.

OSError

I am running data_prep.py first to gather the data in my normal computer and I am getting MemorryError: unable to make matrix even tho I have 16GB RAM and GPU of 6GB.

I try this on the cluster and I am getting the following error:

Traceback (most recent call last):
File "data_prep.py", line 363, in
ismrmrd_to_npy(dir_mridata_org, dir_npy)
File "data_prep.py", line 98, in ismrmrd_to_npy
np.save(file_output, kspace.astype(np.complex64))
File "/home/jaykumar/Envjay/lib/python3.6/site-packages/numpy/lib/npyio.py", line 536, in save
pickle_kwargs=pickle_kwargs)
File "/home/jaykumar/Envjay/lib/python3.6/site-packages/numpy/lib/format.py", line 640, in write_array
array.tofile(fp)
OSError: problem writing element 524288 to file

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.