Skip to main content

Machine Enhanced Reconstruction Learning and Interpretation Networks (MERLIN) - merlintf

Project description

MERLIN - Machine Enhanced Reconstruction Learning and Interpretation Networks

MERLIN logo

This repository contains machine learning (ML) tools for PyTorch, TensorFlow and Python in three modules:

  • merlinth: ML extensions to PyTorch
  • merlintf: ML extensions to TensorFlow
  • merlinpy: ML extensions to Python

If you use this code, please cite

@inproceedings{HammernikKuestner2022,
  title={Machine Enhanced Reconstruction Learning and Interpretation Networks (MERLIN)},
  author={Hammernik, K. and K{\"u}stner, T.},
  booktitle={Proceedings of the International Society for Magnetic Resonance in Medicine (ISMRM)},
  year={2022}
}

Requirements

git clone https://github.com/midas-tum/optox.git
cd optox
python3 install.py

follow build instructions on the github.

Installation

PyPi

pip3 install merlinpy-mri merlinth-mri merlintf-mri

In case you want to use the sampling codes (C++), please use the direct way installation below for direct compilation according to your system setup.

Direct way

git clone https://github.com/midas-tum/merlin.git
python3 install.py

Verification

Run unittests to ensure proper working of sub-modules

python3 -m unittest discover -s merlinpy.test
python3 -m unittest discover -s merlinth.test
python3 -m unittest discover -s merlintf.test

Contents

!!! Attention !!! This package is work in progress and still under construction. Major changes in structure will appear. If you experience any issues, if you have any feature requests or if you found any bugs, please let us know and raise an issue and/or pull request in github :)

Please watch the Issues space and look for the latest updates regularly! :)

merlinth

merlinth
    |--- layers     # Data-driven regularizer following (https://github.com/VLOGroup/tdv), extended to complex-valued layers and similar setup as layers in `merlintf.keras`
        |-- Complex-valued convolutions
        |-- Complex-valued activations
        |-- Complex-valued pooling
        |-- Complex-valued normalization
        |-- FFT operations
        |-- Data consistency
        |-- ...
    |-- losses     # Common and custom loss functions
    |-- models     # Model zoo
        |-- Fields-of-Experts (FOE) regularizer
        |-- Total deep variation (TDV) regularizer
        |-- UNet
    |-- optim      # Custom optimizers such as BlockAdam

merlintf

merlintf
    |-- keras
        |-- layers      # basic building blocks, focusing on complex valued operations
            |-- Complex-valued convolutions
            |-- Complex-valued activations
            |-- Complex-valued pooling
            |-- Complex-valued normalization
            |-- FFT operations
            |-- Data consistency
            |-- ...
        |-- models      # several layers are put together into networks for complex-valued processing (2-channel-real networks, complex networks)
            |-- Convolutional Neural Network
            |-- Fields-of-Experts (FOE) regularizer
            |-- Total deep variation (TDV) regularizer
            |-- UNet
        |-- optimizers       # custom optimizers    
    |-- optim                # custom optimizers

merlinpy

merlinpy
    |-- datapipeline        # collection of datapipelines and transform functions
        |-- sampling        # subsampling codes and sampling trajectories
    |-- fastmri             # dataloader and processing related to fastMRI database
    |-- losses              # losses/metrics
    |-- recon               # conventional reconstructions
    |-- wandb               # logging via wandb.ai

Common mistakes and best practices

writing own keras modules and layers

  • tf.keras.Model cannot hold any trainable parameters. All trainable weights have to be defined in tf.keras.layers.Layers. Wrong implementation will cause weird behaviour when saving and re-loading the model weights!
  • Do not define weights in the __init__ function. Weights should be only created and initialized in the def build(self, input_shape) function of the Layer. Wrong implementation will cause weird behaviour when saving and re-loading the model weights!
  • The online documentation is a good orientation point to write own modules. Make use of keras Constraints and Initializers.

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

merlintf_mri-0.4.2.tar.gz (79.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

merlintf_mri-0.4.2-py2.py3-none-any.whl (103.4 kB view details)

Uploaded Python 2Python 3

File details

Details for the file merlintf_mri-0.4.2.tar.gz.

File metadata

  • Download URL: merlintf_mri-0.4.2.tar.gz
  • Upload date:
  • Size: 79.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.8.19

File hashes

Hashes for merlintf_mri-0.4.2.tar.gz
Algorithm Hash digest
SHA256 1190eb3b333c64ef5f81cd0a7dac927e0fedf2345acb00f9518ef4547526c7d5
MD5 31a68a11e2c51fa85b531b5e99d68be4
BLAKE2b-256 f880617a1133a1e4210ba2ab6faecbd156dac165d4542c43fcca90a0a1416407

See more details on using hashes here.

File details

Details for the file merlintf_mri-0.4.2-py2.py3-none-any.whl.

File metadata

  • Download URL: merlintf_mri-0.4.2-py2.py3-none-any.whl
  • Upload date:
  • Size: 103.4 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.8.19

File hashes

Hashes for merlintf_mri-0.4.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 6013b14feb25193843ef298f3fc3029f2cac485ae87deccdad319c533415a716
MD5 0e562c66427ec954d7ae342a6f010762
BLAKE2b-256 ad5d97414cd90e5e2a2cd3a147c984589c31c86a91ea4ea0d80069dbf41e0058

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page