Skip to content

Commit

Permalink
deploy: 9e10e2b
Browse files Browse the repository at this point in the history
  • Loading branch information
mcencini committed Apr 3, 2024
0 parents commit 69ca2f5
Show file tree
Hide file tree
Showing 582 changed files with 146,686 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .buildinfo
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: b683366407baf893adbd59b1e1506c71
tags: 645f666f9bcd5a90fca523b33c5a78b7
Binary file added .doctrees/core/bloch.doctree
Binary file not shown.
Binary file added .doctrees/core/fft.doctree
Binary file not shown.
Binary file added .doctrees/core/generated/deepmr.b0field.doctree
Binary file not shown.
Binary file added .doctrees/core/generated/deepmr.b1field.doctree
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added .doctrees/core/generated/deepmr.brainweb.doctree
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added .doctrees/core/generated/deepmr.fermi.doctree
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added .doctrees/core/generated/deepmr.fft.fft.doctree
Binary file not shown.
Binary file added .doctrees/core/generated/deepmr.fft.ifft.doctree
Binary file not shown.
Binary file added .doctrees/core/generated/deepmr.fft.nufft.doctree
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added .doctrees/core/generated/deepmr.fwt.doctree
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added .doctrees/core/generated/deepmr.iwt.doctree
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added .doctrees/core/generated/deepmr.radial.doctree
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added .doctrees/core/generated/deepmr.resample.doctree
Binary file not shown.
Binary file added .doctrees/core/generated/deepmr.resize.doctree
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added .doctrees/core/generated/deepmr.rosette.doctree
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added .doctrees/core/generated/deepmr.rss.doctree
Binary file not shown.
Binary file added .doctrees/core/generated/deepmr.sensmap.doctree
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added .doctrees/core/generated/deepmr.spiral.doctree
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added .doctrees/core/generated/deepmr.svd.doctree
Binary file not shown.
Binary file not shown.
Binary file added .doctrees/core/io.doctree
Binary file not shown.
Binary file added .doctrees/core/linops.doctree
Binary file not shown.
Binary file added .doctrees/core/optim.doctree
Binary file not shown.
Binary file added .doctrees/core/prox.doctree
Binary file not shown.
Binary file added .doctrees/core/signal.doctree
Binary file not shown.
Binary file added .doctrees/core/vobj.doctree
Binary file not shown.
Binary file added .doctrees/environment.pickle
Binary file not shown.
Binary file added .doctrees/index.doctree
Binary file not shown.
Binary file added .doctrees/misc/changelog.doctree
Binary file not shown.
Binary file added .doctrees/misc/conduct.doctree
Binary file not shown.
Binary file added .doctrees/misc/contributing.doctree
Binary file not shown.
Binary file added .doctrees/recon/alg.doctree
Binary file not shown.
Binary file added .doctrees/recon/calib.doctree
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added .doctrees/recon/inference.doctree
Binary file not shown.
Binary file added .doctrees/tutorials/index.doctree
Binary file not shown.
Binary file added .doctrees/user_guide/getting_started.doctree
Binary file not shown.
Binary file added .doctrees/user_guide/overview.doctree
Binary file not shown.
Empty file added .nojekyll
Empty file.
636 changes: 636 additions & 0 deletions _modules/deepmr/_signal/filter.html

Large diffs are not rendered by default.

784 changes: 784 additions & 0 deletions _modules/deepmr/_signal/fold.html

Large diffs are not rendered by default.

746 changes: 746 additions & 0 deletions _modules/deepmr/_signal/resize.html

Large diffs are not rendered by default.

684 changes: 684 additions & 0 deletions _modules/deepmr/_signal/subspace.html

Large diffs are not rendered by default.

785 changes: 785 additions & 0 deletions _modules/deepmr/_signal/wavelet.html

Large diffs are not rendered by default.

625 changes: 625 additions & 0 deletions _modules/deepmr/_vobj/fields/b0.html

Large diffs are not rendered by default.

821 changes: 821 additions & 0 deletions _modules/deepmr/_vobj/fields/coil.html

Large diffs are not rendered by default.

675 changes: 675 additions & 0 deletions _modules/deepmr/_vobj/motion/rigid.html

Large diffs are not rendered by default.

1,078 changes: 1,078 additions & 0 deletions _modules/deepmr/_vobj/phantoms.html

Large diffs are not rendered by default.

854 changes: 854 additions & 0 deletions _modules/deepmr/_vobj/sampling/cartesian.html

Large diffs are not rendered by default.

700 changes: 700 additions & 0 deletions _modules/deepmr/_vobj/sampling/radial.html

Large diffs are not rendered by default.

760 changes: 760 additions & 0 deletions _modules/deepmr/_vobj/sampling/radial_proj.html

Large diffs are not rendered by default.

758 changes: 758 additions & 0 deletions _modules/deepmr/_vobj/sampling/radial_stack.html

Large diffs are not rendered by default.

699 changes: 699 additions & 0 deletions _modules/deepmr/_vobj/sampling/rosette.html

Large diffs are not rendered by default.

760 changes: 760 additions & 0 deletions _modules/deepmr/_vobj/sampling/rosette_proj.html

Large diffs are not rendered by default.

758 changes: 758 additions & 0 deletions _modules/deepmr/_vobj/sampling/rosette_stack.html

Large diffs are not rendered by default.

743 changes: 743 additions & 0 deletions _modules/deepmr/_vobj/sampling/spiral.html

Large diffs are not rendered by default.

806 changes: 806 additions & 0 deletions _modules/deepmr/_vobj/sampling/spiral_proj.html

Large diffs are not rendered by default.

783 changes: 783 additions & 0 deletions _modules/deepmr/_vobj/sampling/spiral_stack.html

Large diffs are not rendered by default.

723 changes: 723 additions & 0 deletions _modules/deepmr/_vobj/trains/flip.html

Large diffs are not rendered by default.

598 changes: 598 additions & 0 deletions _modules/deepmr/_vobj/trains/phase.html

Large diffs are not rendered by default.

645 changes: 645 additions & 0 deletions _modules/deepmr/bloch/blocks/prep.html

Large diffs are not rendered by default.

875 changes: 875 additions & 0 deletions _modules/deepmr/bloch/blocks/readout.html

Large diffs are not rendered by default.

853 changes: 853 additions & 0 deletions _modules/deepmr/bloch/model/bssfpmrf.html

Large diffs are not rendered by default.

860 changes: 860 additions & 0 deletions _modules/deepmr/bloch/model/fse.html

Large diffs are not rendered by default.

924 changes: 924 additions & 0 deletions _modules/deepmr/bloch/model/memprage.html

Large diffs are not rendered by default.

905 changes: 905 additions & 0 deletions _modules/deepmr/bloch/model/mprage.html

Large diffs are not rendered by default.

913 changes: 913 additions & 0 deletions _modules/deepmr/bloch/model/ssfpmrf.html

Large diffs are not rendered by default.

771 changes: 771 additions & 0 deletions _modules/deepmr/bloch/model/t1t2shuffling.html

Large diffs are not rendered by default.

642 changes: 642 additions & 0 deletions _modules/deepmr/bloch/ops/_adc_op.html

Large diffs are not rendered by default.

671 changes: 671 additions & 0 deletions _modules/deepmr/bloch/ops/_epg.html

Large diffs are not rendered by default.

616 changes: 616 additions & 0 deletions _modules/deepmr/bloch/ops/_gradient_op.html

Large diffs are not rendered by default.

1,013 changes: 1,013 additions & 0 deletions _modules/deepmr/bloch/ops/_motion_op.html

Large diffs are not rendered by default.

843 changes: 843 additions & 0 deletions _modules/deepmr/bloch/ops/_relaxation_op.html

Large diffs are not rendered by default.

1,117 changes: 1,117 additions & 0 deletions _modules/deepmr/bloch/ops/_rf_pulses_op.html

Large diffs are not rendered by default.

826 changes: 826 additions & 0 deletions _modules/deepmr/fft.html

Large diffs are not rendered by default.

715 changes: 715 additions & 0 deletions _modules/deepmr/fft/fft.html

Large diffs are not rendered by default.

1,209 changes: 1,209 additions & 0 deletions _modules/deepmr/fft/nufft.html

Large diffs are not rendered by default.

1,045 changes: 1,045 additions & 0 deletions _modules/deepmr/fft/sparse_fft.html

Large diffs are not rendered by default.

675 changes: 675 additions & 0 deletions _modules/deepmr/io/generic/hdf5.html

Large diffs are not rendered by default.

612 changes: 612 additions & 0 deletions _modules/deepmr/io/generic/matlab.html

Large diffs are not rendered by default.

822 changes: 822 additions & 0 deletions _modules/deepmr/io/header/api.html

Large diffs are not rendered by default.

1,011 changes: 1,011 additions & 0 deletions _modules/deepmr/io/image/api.html

Large diffs are not rendered by default.

1,000 changes: 1,000 additions & 0 deletions _modules/deepmr/io/kspace/api.html

Large diffs are not rendered by default.

745 changes: 745 additions & 0 deletions _modules/deepmr/linops/coil.html

Large diffs are not rendered by default.

887 changes: 887 additions & 0 deletions _modules/deepmr/linops/fft.html

Large diffs are not rendered by default.

781 changes: 781 additions & 0 deletions _modules/deepmr/linops/nufft.html

Large diffs are not rendered by default.

728 changes: 728 additions & 0 deletions _modules/deepmr/optim/admm.html

Large diffs are not rendered by default.

719 changes: 719 additions & 0 deletions _modules/deepmr/optim/cg.html

Large diffs are not rendered by default.

722 changes: 722 additions & 0 deletions _modules/deepmr/optim/pgd.html

Large diffs are not rendered by default.

706 changes: 706 additions & 0 deletions _modules/deepmr/prox/llr.html

Large diffs are not rendered by default.

1,058 changes: 1,058 additions & 0 deletions _modules/deepmr/prox/tgv.html

Large diffs are not rendered by default.

903 changes: 903 additions & 0 deletions _modules/deepmr/prox/tv.html

Large diffs are not rendered by default.

1,291 changes: 1,291 additions & 0 deletions _modules/deepmr/prox/wavelet.html

Large diffs are not rendered by default.

777 changes: 777 additions & 0 deletions _modules/deepmr/recon/alg/classic_recon.html

Large diffs are not rendered by default.

685 changes: 685 additions & 0 deletions _modules/deepmr/recon/alg/linop.html

Large diffs are not rendered by default.

753 changes: 753 additions & 0 deletions _modules/deepmr/recon/calib/espirit.html

Large diffs are not rendered by default.

582 changes: 582 additions & 0 deletions _modules/deepmr/recon/calib/scaling.html

Large diffs are not rendered by default.

609 changes: 609 additions & 0 deletions _modules/deepmr/recon/inference/fse.html

Large diffs are not rendered by default.

607 changes: 607 additions & 0 deletions _modules/deepmr/recon/inference/mpnrage.html

Large diffs are not rendered by default.

600 changes: 600 additions & 0 deletions _modules/index.html

Large diffs are not rendered by default.

139 changes: 139 additions & 0 deletions _sources/core/bloch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
# Bloch Simulation

```{eval-rst}
.. automodule:: deepmr.bloch
```

## Numerical Models
```{eval-rst}
.. currentmodule:: deepmr.bloch
.. autosummary::
:toctree: generated
:nosignatures:
deepmr.bloch.mprage
deepmr.bloch.memprage
deepmr.bloch.bssfpmrf
deepmr.bloch.ssfpmrf
deepmr.bloch.fse
deepmr.bloch.t1t2shuffling
```

## Custom signal models

DeepMR also contains helper classes to define custom signal models. The main class for analytical and numerical models are `deepmr.bloch.AnalyticalSimulator`
and `deepmr.bloch.EPGSimulator`, respectively.

Users can define a custom signal model by subclassing it and overloading ``sequence`` method. Base class already handle spin parameters (e.g., ``T1``, ``T2``, ...)
as well as simulation properties (e.g., computational ``device``, maximum ``number of batches``...) so the user has only to care about specific sequence arguments (e.g., ``flip angle``, ``TR``, ... for GRE or ``flip angle``, ``ETL``, for FSE). In order to work properly, ``sequence`` method must be a ``staticmethod`` and the arguments must follow this order:

1. sequence parameters (``flip angle``, ``TE``, ``TR``, ``nrepetitions``, ...)
2. spin parameters (``T1``, ``T2``, ``B1``, ...)
3. (mandatory) buffer for output signal (analytical) or EPG states and output signal (numerical): ``signal`` / `` states``, ``signal``

```python
from deepmr import bloch
from deepmr.bloch import ops

class SSFP(bloch.EPGSimulator):

@staticmethod
def signal(flip, TR, T1, T2, states, signal):

# get device and sequence length
device = flip.device
npulses = flip.shape[-1]

# define operators
T = ops.RFPulse(device, alpha=flip) # RF pulse
E = ops.Relaxation(device, TR, T1, T2) # relaxation until TR
S = ops.Shift() # gradient spoil

# apply sequence
for n in range(npulses):
states = T(states)
signal[n] = ops.observe(states)
states = E(states)
states = S(states)

# return output
return signal
```

The resulting class can be used to perform simulation by instantiating an object (spin properties as input)and using the ``__call__`` method (sequence properties as input):

```python
ssfp = SSFP(device=device, T1=T1, T2=T2) # build simulator
signal = ssfp(flip=flip, TR=TR) # run simulation
```

For convenience, simulator instantiation and actual simulation can (and should) be wrapped in a wrapper function:

```python
def simulate_ssfp(flip, TR, T1, T2, device="cpu"):
mysim = SSFP(device=device, T1=T1, T2=T2)
return ssfp(flip=flip, TR=TR)
```

The class also enable automatic forward differentiation wrt to input spin parameters via ``diff`` argument:

```python
import numpy as np

def simulate_ssfp(flip, TR, T1, T2, diff=None, device="cpu"):
ssfp = SSFP(device=device, T1=T1, T2=T2, diff=diff)
return ssfp(flip=flip, TR=TR)

# this will return signal only (evolution towards steady state of unbalanced SSFP sequence)
signal = simulate_ssfp(flip=10.0*np.ones(1000, dtype=np.float32), TR=4.5, T1=500.0, T2=50.0)

# this will also return derivatives
signal, dsignal = simulate_ssfp(flip=10.0*np.ones(1000, dtype=np.float32), TR=8.5, T1=500.0, T2=50.0, diff=("T1", "T2"))

# dsignal[0] = dsignal / dT1 (derivative of signal wrt T1)
# dsignal[1] = dsignal / dT2 (derivative of signal wrt T2)
```

This is useful e.g. for nonlinear fitting and for calculating objective functions (CRLB) for sequence optimization.

To facilitate the development of signal models, we include basic sequence building blocks (e.g., Inversion Preparation, SSFP Propagator) and low-level Extended Phase Graphs operators:


## Sequence Blocks

```{eval-rst}
.. currentmodule:: deepmr.bloch
.. autosummary::
:toctree: generated
:nosignatures:
deepmr.bloch.InversionPrep
deepmr.bloch.T2Prep
deepmr.bloch.ExcPulse
deepmr.bloch.bSSFPStep
deepmr.bloch.SSFPFidStep
deepmr.bloch.SSFPEchoStep
deepmr.bloch.FSEStep
```

## Low-level Operators

```{eval-rst}
.. currentmodule:: deepmr.bloch
.. autosummary::
:toctree: generated
:nosignatures:
deepmr.bloch.EPGstates
deepmr.bloch.RFPulse
deepmr.bloch.AdiabaticPulse
deepmr.bloch.Relaxation
deepmr.bloch.Shift
deepmr.bloch.Spoil
deepmr.bloch.DiffusionDamping
deepmr.bloch.FlowDephasing
deepmr.bloch.FlowWash
deepmr.bloch.observe
deepmr.bloch.susceptibility
deepmr.bloch.t1sat
```
39 changes: 39 additions & 0 deletions _sources/core/fft.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Fourier Transform

```{eval-rst}
.. automodule:: deepmr.fft
```

## Centered FFT
```{eval-rst}
.. autosummary::
:toctree: generated
:nosignatures:
deepmr.fft.fft
deepmr.fft.ifft
```

## Sparse FFT
```{eval-rst}
.. autosummary::
:toctree: generated
:nosignatures:
deepmr.fft.sparse_fft
deepmr.fft.sparse_ifft
deepmr.fft.plan_toeplitz_fft
deepmr.fft.apply_sparse_fft_selfadj
```

## Non-Uniform FFT (NUFFT)
```{eval-rst}
.. autosummary::
:toctree: generated
:nosignatures:
deepmr.fft.nufft
deepmr.fft.nufft_adj
deepmr.fft.plan_toeplitz_nufft
deepmr.fft.apply_nufft_selfadj
```
6 changes: 6 additions & 0 deletions _sources/core/generated/deepmr.b0field.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
deepmr.b0field
==============

.. currentmodule:: deepmr

.. autofunction:: b0field
6 changes: 6 additions & 0 deletions _sources/core/generated/deepmr.b1field.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
deepmr.b1field
==============

.. currentmodule:: deepmr

.. autofunction:: b1field
25 changes: 25 additions & 0 deletions _sources/core/generated/deepmr.bloch.AdiabaticPulse.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
deepmr.bloch.AdiabaticPulse
===========================

.. currentmodule:: deepmr.bloch

.. autoclass:: AdiabaticPulse


.. automethod:: __init__


.. rubric:: Methods

.. autosummary::

~AdiabaticPulse.__init__
~AdiabaticPulse.apply
~AdiabaticPulse.prepare_rotation
~AdiabaticPulse.prepare_saturation






23 changes: 23 additions & 0 deletions _sources/core/generated/deepmr.bloch.DiffusionDamping.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
deepmr.bloch.DiffusionDamping
=============================

.. currentmodule:: deepmr.bloch

.. autoclass:: DiffusionDamping


.. automethod:: __init__


.. rubric:: Methods

.. autosummary::

~DiffusionDamping.__init__
~DiffusionDamping.apply






6 changes: 6 additions & 0 deletions _sources/core/generated/deepmr.bloch.EPGstates.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
deepmr.bloch.EPGstates
======================

.. currentmodule:: deepmr.bloch

.. autofunction:: EPGstates
6 changes: 6 additions & 0 deletions _sources/core/generated/deepmr.bloch.ExcPulse.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
deepmr.bloch.ExcPulse
=====================

.. currentmodule:: deepmr.bloch

.. autofunction:: ExcPulse
6 changes: 6 additions & 0 deletions _sources/core/generated/deepmr.bloch.FSEStep.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
deepmr.bloch.FSEStep
====================

.. currentmodule:: deepmr.bloch

.. autofunction:: FSEStep
23 changes: 23 additions & 0 deletions _sources/core/generated/deepmr.bloch.FlowDephasing.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
deepmr.bloch.FlowDephasing
==========================

.. currentmodule:: deepmr.bloch

.. autoclass:: FlowDephasing


.. automethod:: __init__


.. rubric:: Methods

.. autosummary::

~FlowDephasing.__init__
~FlowDephasing.apply






23 changes: 23 additions & 0 deletions _sources/core/generated/deepmr.bloch.FlowWash.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
deepmr.bloch.FlowWash
=====================

.. currentmodule:: deepmr.bloch

.. autoclass:: FlowWash


.. automethod:: __init__


.. rubric:: Methods

.. autosummary::

~FlowWash.__init__
~FlowWash.apply






6 changes: 6 additions & 0 deletions _sources/core/generated/deepmr.bloch.InversionPrep.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
deepmr.bloch.InversionPrep
==========================

.. currentmodule:: deepmr.bloch

.. autofunction:: InversionPrep
25 changes: 25 additions & 0 deletions _sources/core/generated/deepmr.bloch.RFPulse.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
deepmr.bloch.RFPulse
====================

.. currentmodule:: deepmr.bloch

.. autoclass:: RFPulse


.. automethod:: __init__


.. rubric:: Methods

.. autosummary::

~RFPulse.__init__
~RFPulse.apply
~RFPulse.prepare_rotation
~RFPulse.prepare_saturation






23 changes: 23 additions & 0 deletions _sources/core/generated/deepmr.bloch.Relaxation.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
deepmr.bloch.Relaxation
=======================

.. currentmodule:: deepmr.bloch

.. autoclass:: Relaxation


.. automethod:: __init__


.. rubric:: Methods

.. autosummary::

~Relaxation.__init__
~Relaxation.apply






6 changes: 6 additions & 0 deletions _sources/core/generated/deepmr.bloch.SSFPEchoStep.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
deepmr.bloch.SSFPEchoStep
=========================

.. currentmodule:: deepmr.bloch

.. autofunction:: SSFPEchoStep
Loading

0 comments on commit 69ca2f5

Please sign in to comment.