Skip to content
This repository has been archived by the owner on Apr 29, 2024. It is now read-only.

Commit

Permalink
quantitative (#82)
Browse files Browse the repository at this point in the history
* implemented quantitative imaging 
* added  qRIM, qCIRIM & qE2EVN models and ahead dataset preprocessing scripts
  • Loading branch information
wdika authored Sep 12, 2022
1 parent 51d190f commit c0fdae4
Show file tree
Hide file tree
Showing 60 changed files with 8,411 additions and 144 deletions.
46 changes: 26 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
is provided for MRI data analysis. Primarily it focuses on the following tasks:**

### **Reconstruction**:
The following models are implemented for accelerated MRI reconstruction:
1.[Cascades of Independently Recurrent Inference Machines (CIRIM)](https://iopscience.iop.org/article/10.1088/1361-6560/ac6cc2),
2.[Compressed Sensing (CS)](https://ieeexplore.ieee.org/document/4472246),
3.[Convolutional Recurrent Neural Networks (CRNN)](https://ieeexplore.ieee.org/document/8425639),
Expand All @@ -30,17 +31,22 @@ is provided for MRI data analysis. Primarily it focuses on the following tasks:*
16.[XPDNet](https://arxiv.org/abs/2010.07290),
17.and Zero-Filled reconstruction (ZF).

### **Quantitative Imaging**:
The following models are implemented for quantitative imaging:
1.[quantitative Cascades of Independently Recurrent Inference Machines (qCIRIM)](https://iopscience.iop.org/article/10.1088/1361-6560/ac6cc2),
2.[quantitative End-to-End Variational Network (qE2EVN)](https://link.springer.com/chapter/10.1007/978-3-030-59713-9_7),
3.[quantitative Independently Recurrent Inference Machines (qIRIM)](http://arxiv.org/abs/2012.07819),
4.[quantitative Recurrent Inference Machines (qRIM)](https://www.sciencedirect.com/science/article/abs/pii/S1361841518306078?via%3Dihub),

_Note: Currently only the above models are implemented. More models can be added by extending the reconstruction models
for quantitative imaging. If you wish to extend the toolbox, please open an issue._

### **Segmentation**:
_Coming soon..._

### **Acknowledgements**

MRIDC is based on the [NeMo](https://github.com/NVIDIA/NeMo) framework, using PyTorch Lightning for feasible
high-performance multi-GPU/multi-node mixed-precision training.
## Usage

For the reconstruction methods:
- the implementations of 6 and 14 are thanks to and based on the [fastMRI repo](https://github.com/facebookresearch/fastMRI).
- The implementations of 7, 9, 10, 11, 13, and 16 are thanks to and based on the [DIRECT repo](https://github.com/NKI-AI/direct).
Check the [projects](https://github.com/wdika/mridc/blob/main/projects/README.md) page for more information of how to use **mridc**.

## Installation

Expand All @@ -66,17 +72,6 @@ cd mridc
./reinstall.sh
```

## Usage

Check the [projects](https://github.com/wdika/mridc/blob/main/projects/README.md) page for more information of how to use **mridc**.

### Datasets

Recommended public datasets to use with this repo:

- [fastMRI](http://arxiv.org/abs/1811.08839),
- [Fully Sampled Knees](http://old.mridata.org/fullysampled/knees/).

## API Documentation

[![Documentation Status](https://readthedocs.org/projects/mridc/badge/?version=latest)](https://mridc.readthedocs.io/en/latest/?badge=latest)
Expand All @@ -87,15 +82,24 @@ Access the API Documentation [here](https://mridc.readthedocs.io/en/latest/modul

[![License: Apache 2.0](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)

## Acknowledgements

MRIDC is based on the [NeMo](https://github.com/NVIDIA/NeMo) framework, using PyTorch Lightning for feasible
high-performance multi-GPU/multi-node mixed-precision training.

For the reconstruction methods:
- the implementations of 6 and 14 are thanks to and based on the [fastMRI repo](https://github.com/facebookresearch/fastMRI).
- The implementations of 7, 9, 10, 11, 13, and 16 are thanks to and based on the [DIRECT repo](https://github.com/NKI-AI/direct).

## Citation

Please cite MRIDC using the "_Cite this repository_" button or as

```BibTeX
@misc{mridc,
author = {Karkalousos, Dimitrios and Caan, Matthan},
author = {Karkalousos Dimitrios, Zhang Chaoping, and Caan Matthan},
title = {MRIDC: Data Consistency for Magnetic Resonance Imaging},
year = {2021},
year = {2022},
url = {https://github.com/wdika/mridc},
}
```
Expand All @@ -106,3 +110,5 @@ The following papers use the MRIDC repo:

[1] [Karkalousos, D. et al. (2021) ‘Assessment of Data Consistency through Cascades of Independently Recurrent
Inference Machines for fast and robust accelerated MRI reconstruction’](https://iopscience.iop.org/article/10.1088/1361-6560/ac6cc2)

[2] Zhang, C. et al. (2022) 'A unified model for reconstruction and R2* mapping of accelerated 7T data using the quantitative Recurrent Inference Machine'
21 changes: 21 additions & 0 deletions docs/source/mridc.collections.quantitative.data.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
mridc.collections.quantitative.data package
===========================================

Submodules
----------

mridc.collections.quantitative.data.qmri\_data module
-----------------------------------------------------

.. automodule:: mridc.collections.quantitative.data.qmri_data
:members:
:undoc-members:
:show-inheritance:

Module contents
---------------

.. automodule:: mridc.collections.quantitative.data
:members:
:undoc-members:
:show-inheritance:
29 changes: 29 additions & 0 deletions docs/source/mridc.collections.quantitative.models.qrim.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
mridc.collections.quantitative.models.qrim package
==================================================

Submodules
----------

mridc.collections.quantitative.models.qrim.qrim\_block module
-------------------------------------------------------------

.. automodule:: mridc.collections.quantitative.models.qrim.qrim_block
:members:
:undoc-members:
:show-inheritance:

mridc.collections.quantitative.models.qrim.utils module
-------------------------------------------------------

.. automodule:: mridc.collections.quantitative.models.qrim.utils
:members:
:undoc-members:
:show-inheritance:

Module contents
---------------

.. automodule:: mridc.collections.quantitative.models.qrim
:members:
:undoc-members:
:show-inheritance:
21 changes: 21 additions & 0 deletions docs/source/mridc.collections.quantitative.models.qvarnet.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
mridc.collections.quantitative.models.qvarnet package
=====================================================

Submodules
----------

mridc.collections.quantitative.models.qvarnet.qvn\_block module
---------------------------------------------------------------

.. automodule:: mridc.collections.quantitative.models.qvarnet.qvn_block
:members:
:undoc-members:
:show-inheritance:

Module contents
---------------

.. automodule:: mridc.collections.quantitative.models.qvarnet
:members:
:undoc-members:
:show-inheritance:
46 changes: 46 additions & 0 deletions docs/source/mridc.collections.quantitative.models.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
mridc.collections.quantitative.models package
=============================================

Subpackages
-----------

.. toctree::
:maxdepth: 4

mridc.collections.quantitative.models.qrim
mridc.collections.quantitative.models.qvarnet

Submodules
----------

mridc.collections.quantitative.models.base module
-------------------------------------------------

.. automodule:: mridc.collections.quantitative.models.base
:members:
:undoc-members:
:show-inheritance:

mridc.collections.quantitative.models.qcirim module
---------------------------------------------------

.. automodule:: mridc.collections.quantitative.models.qcirim
:members:
:undoc-members:
:show-inheritance:

mridc.collections.quantitative.models.qvn module
------------------------------------------------

.. automodule:: mridc.collections.quantitative.models.qvn
:members:
:undoc-members:
:show-inheritance:

Module contents
---------------

.. automodule:: mridc.collections.quantitative.models
:members:
:undoc-members:
:show-inheritance:
21 changes: 21 additions & 0 deletions docs/source/mridc.collections.quantitative.parts.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
mridc.collections.quantitative.parts package
============================================

Submodules
----------

mridc.collections.quantitative.parts.transforms module
------------------------------------------------------

.. automodule:: mridc.collections.quantitative.parts.transforms
:members:
:undoc-members:
:show-inheritance:

Module contents
---------------

.. automodule:: mridc.collections.quantitative.parts
:members:
:undoc-members:
:show-inheritance:
20 changes: 20 additions & 0 deletions docs/source/mridc.collections.quantitative.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
mridc.collections.quantitative package
======================================

Subpackages
-----------

.. toctree::
:maxdepth: 4

mridc.collections.quantitative.data
mridc.collections.quantitative.models
mridc.collections.quantitative.parts

Module contents
---------------

.. automodule:: mridc.collections.quantitative
:members:
:undoc-members:
:show-inheritance:
1 change: 1 addition & 0 deletions docs/source/mridc.collections.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Subpackages
:maxdepth: 4

mridc.collections.common
mridc.collections.quantitative
mridc.collections.reconstruction

Module contents
Expand Down
4 changes: 3 additions & 1 deletion mridc/collections/common/losses/ssim.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,11 @@ def forward(self, X: torch.Tensor, Y: torch.Tensor, data_range: torch.Tensor):
-------
SSIM loss.
"""
if not isinstance(self.w, torch.Tensor):
if not isinstance(self.w, torch.Tensor): # type: ignore
raise AssertionError

self.w = self.w.to(X) # type: ignore

data_range = data_range[:, None, None, None]
C1 = (self.k1 * data_range) ** 2
C2 = (self.k2 * data_range) ** 2
Expand Down
12 changes: 12 additions & 0 deletions mridc/collections/quantitative/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# encoding: utf-8

from mridc.package_info import __version__

# Set collection version equal to MRIDC version.
__version = __version__

# Authorship.
__author__ = "Dimitrios Karkalousos, Chaoping Zhang"

# Set collection name.
__description__ = "Quantitative models collection"
2 changes: 2 additions & 0 deletions mridc/collections/quantitative/data/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# encoding: utf-8
__author__ = "Dimitrios Karkalousos, Chaoping Zhang"
Loading

0 comments on commit c0fdae4

Please sign in to comment.