Skip to content

Commit

Permalink
Merge pull request #59 from plaresmedima/development
Browse files Browse the repository at this point in the history
update docs
  • Loading branch information
plaresmedima authored Dec 3, 2024
2 parents f672c4e + 0ff7e19 commit dad40b6
Show file tree
Hide file tree
Showing 32 changed files with 145,643 additions and 144,300 deletions.
2 changes: 1 addition & 1 deletion dev/sops.txt
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ Building release notes
- Save the token in the environment variable GH_TOKEN. On windows:
>>> $env:GH_TOKEN='token'
- Build the changelog from current version to current dev. For instance:
>>> changelist QIB-Sheffield/mdreg 0.4.0 dev --format rst
>>> changelist QIB-Sheffield/mdreg 0.4.0 development --format rst
- Copy-paste the terminal output in an .rst file and save it in docs/source/releases
- Edit the content of the file manually as needed
- Add an entry in the index of docs/source/releases
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

#%%
# Import packages and data
# ----------------------------
# ------------------------
# Example data can be easily loaded in using the `fetch` function.

import numpy as np
Expand All @@ -31,14 +31,14 @@

#%%
# Extract the desired slice from the data array
# ----------------------------
# ---------------------------------------------
# As an intial step, we will extract the 4D data (x,y,z,t) from the fetched data dictionary.

array = data['array']

#%%
# Signal model theory
# ----------------------------
# -------------------
# The signal model used in this example is the non-linear variable flip angle
# SPGR model. The signal model is defined by the following equation:
#
Expand All @@ -52,7 +52,7 @@

#%%
# Define model fit parameters
# ----------------------------
# ---------------------------
# The image fitting settings dictionary (`vfa_fit` in this case) is required by
# `mdreg.fit` to fit a specific signal model to the data. Leaving this as None
# will fit a constant model to the data as a default.
Expand All @@ -71,7 +71,7 @@

#%%
# Define the coregistration parameters
# ----------------------------
# ------------------------------------
# The coregistration parameters are set in the `coreg_params` dictionary.
# The `package` key specifies the coregistration package to be used, with a
# choice of elastix, skimage, or dipy.
Expand All @@ -91,7 +91,7 @@

#%%
# Define the plotting parameters
# ----------------------------
# ------------------------------
# The plotting parameters are set in the `plot_settings` dictionary.
#
# The `interval` key specifies the time interval between frames in
Expand Down Expand Up @@ -121,7 +121,7 @@

#%%
# Perform model-driven coregistration
# ----------------------------
# -----------------------------------
# The `mdreg.fit` function is used to perform the model-driven coregistration.
# The function requires the 4D data array, the fit_image dictionary, and the
# coregistration parameters we have already defined.
Expand All @@ -142,7 +142,7 @@

#%%
# Visualise coregistration results
# ---------------------------------
# --------------------------------
# To easily visualise the output of the employ the `mdreg.plot` module to
# easily produce animations that render on screen or save as a gif.
# Here we utilise `mdreg.plot_series` which accepts both 2D and 3D spatial data
Expand All @@ -167,7 +167,7 @@

#%%
# Export all series at once
# ----------------------------
# -------------------------
# The `mdreg.plot_series` function can be used to plot the original, fitted and
# coregistered data for all slices in the data array. This function can also
# be used to save the animations to a file.
Expand All @@ -178,7 +178,7 @@
# >>> anims = mdreg.plot_series(array, fit, coreg, **plot_settings)

#%%
# Identifiying poor model fitting
# Identifying poor model fitting
# ------------------------------
#
# The coregistration results show significant defects in the coregistered data.
Expand Down Expand Up @@ -256,7 +256,7 @@

#%%
# Goodness of fit
# ----------------------------
# ---------------
# The chi squared values in the figure above show large regions of poor fit
# across the data array. These regions are highlighted in red as above the 99th
# percentile of the chi squared values. These region also correspond to the
Expand Down
14 changes: 14 additions & 0 deletions docs/examples/use_cases/deformationField.mhd
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
ObjectType = Image
NDims = 3
BinaryData = True
BinaryDataByteOrderMSB = False
CompressedData = False
TransformMatrix = 1 0 0 0 1 0 0 0 1
Offset = 0 0 0
CenterOfRotation = 0 0 0
AnatomicalOrientation = RAI
ElementSpacing = 5 4.6875 4.6875
DimSize = 36 96 78
ElementNumberOfChannels = 3
ElementType = MET_FLOAT
ElementDataFile = deformationField.raw
Binary file added docs/examples/use_cases/deformationField.raw
Binary file not shown.
18 changes: 9 additions & 9 deletions docs/examples/use_cases/plot_3Dexample_vfa.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

#%%
# Import packages and data
# ----------------------------
# ------------------------
# Example data can be easily loaded in using the `fetch` function.

import numpy as np
Expand All @@ -24,15 +24,15 @@

#%%
# Extract the desired slice from the data array
# ----------------------------
# ---------------------------------------------
# As an intial step, we will extract the 4D data (x,y,z,t) from the fetched
# data dictionary.

array = data['array']

#%%
# Signal model theory
# ----------------------------
# -------------------
# The signal model used in this example is the variable flip angle
# SPGR model. The signal model is defined by the following equation:
#
Expand Down Expand Up @@ -64,7 +64,7 @@

#%%
# Define model fit parameters
# ----------------------------
# ---------------------------
# The image fitting settings dictionary (`vfa_fit` in this case) is
# required by `mdreg.fit` to fit a specific signal model to the data. Leaving
# this as None will fit a constant model to the data as a default.
Expand All @@ -80,7 +80,7 @@
}
#%%
# Define the coregistration parameters
# ----------------------------
# ------------------------------------
# The coregistration parameters are set in the `coreg_params` dictionary.
# The `package` key specifies the coregistration package to be used, with a
# choice of elastix, skimage, or dipy.
Expand All @@ -99,7 +99,7 @@

#%%
# Define the plotting parameters
# ----------------------------
# ------------------------------
# The plotting parameters are set in the `plot_settings` dictionary.
#
# The `interval` key specifies the time interval between frames in
Expand Down Expand Up @@ -136,7 +136,7 @@

#%%
# Perform model-driven coregistration
# ----------------------------
# -----------------------------------
# The `mdreg.fit` function is used to perform the model-driven coregistration.
# The function requires the 4D data array, the fit_image dictionary, and the
# coregistration parameters we have already defined.
Expand All @@ -158,7 +158,7 @@

#%%
# Visualize the results
# ----------------------------
# ---------------------
# To easily visualise the output of the employ the `mdreg.plot` module to
# easily produce animations that render on screen or save as a gif.
# Here we utilise `mdreg.plot_series` which accepts both 2D and 3D spatial data
Expand All @@ -179,7 +179,7 @@

#%%
# Export all series at once
# ----------------------------
# -------------------------
# The `mdreg.plot_series` function can be used to plot the original, fitted and
# coregistered data for all slices in the data array. This function can also
# be used to save the animations to a file.
Expand Down
10 changes: 5 additions & 5 deletions docs/source/generated/backreferences/mdreg.animation.examples
Original file line number Diff line number Diff line change
Expand Up @@ -15,24 +15,24 @@ Examples using ``mdreg.animation``

.. raw:: html

<div class="sphx-glr-thumbcontainer" tooltip="By default, dcmri uses free-form deformation implemented in the package itk.elastix, which default settings for all configuration parameters. ">
<div class="sphx-glr-thumbcontainer" tooltip="This example illustrates the effect of poor model fitting on coregistration for the 3D Variable Flip Angle (VFA) dataset used in the 3D data example.">

.. only:: html

.. image:: /generated/examples/tutorials/images/thumb/sphx_glr_plot_getting_started_defo_thumb.gif
.. image:: /generated/examples/use_cases/images/thumb/sphx_glr__plot_poor_model_fitting_thumb.png
:alt:

:ref:`sphx_glr_generated_examples_tutorials_plot_getting_started_defo.py`
:ref:`sphx_glr_generated_examples_use_cases__plot_poor_model_fitting.py`

.. raw:: html

<div class="sphx-glr-thumbnail-title">Customizing the coregistration</div>
<div class="sphx-glr-thumbnail-title">Example: Poor Model Fitting</div>
</div>


.. only:: not html

* :ref:`sphx_glr_generated_examples_tutorials_plot_getting_started_defo.py`
* :ref:`sphx_glr_generated_examples_use_cases__plot_poor_model_fitting.py`

.. thumbnail-parent-div-close

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,24 +15,24 @@ Examples using ``mdreg.elastix.params``

.. raw:: html

<div class="sphx-glr-thumbcontainer" tooltip="By default, dcmri uses free-form deformation implemented in the package itk.elastix, which default settings for all configuration parameters. ">
<div class="sphx-glr-thumbcontainer" tooltip="This example illustrates the effect of poor model fitting on coregistration for the 3D Variable Flip Angle (VFA) dataset used in the 3D data example.">

.. only:: html

.. image:: /generated/examples/tutorials/images/thumb/sphx_glr_plot_getting_started_defo_thumb.gif
.. image:: /generated/examples/use_cases/images/thumb/sphx_glr__plot_poor_model_fitting_thumb.png
:alt:

:ref:`sphx_glr_generated_examples_tutorials_plot_getting_started_defo.py`
:ref:`sphx_glr_generated_examples_use_cases__plot_poor_model_fitting.py`

.. raw:: html

<div class="sphx-glr-thumbnail-title">Customizing the coregistration</div>
<div class="sphx-glr-thumbnail-title">Example: Poor Model Fitting</div>
</div>


.. only:: not html

* :ref:`sphx_glr_generated_examples_tutorials_plot_getting_started_defo.py`
* :ref:`sphx_glr_generated_examples_use_cases__plot_poor_model_fitting.py`

.. thumbnail-parent-div-close

Expand Down
10 changes: 5 additions & 5 deletions docs/source/generated/backreferences/mdreg.fetch.examples
Original file line number Diff line number Diff line change
Expand Up @@ -15,24 +15,24 @@ Examples using ``mdreg.fetch``

.. raw:: html

<div class="sphx-glr-thumbcontainer" tooltip="By default, dcmri uses free-form deformation implemented in the package itk.elastix, which default settings for all configuration parameters. ">
<div class="sphx-glr-thumbcontainer" tooltip="This example illustrates the effect of poor model fitting on coregistration for the 3D Variable Flip Angle (VFA) dataset used in the 3D data example.">

.. only:: html

.. image:: /generated/examples/tutorials/images/thumb/sphx_glr_plot_getting_started_defo_thumb.gif
.. image:: /generated/examples/use_cases/images/thumb/sphx_glr__plot_poor_model_fitting_thumb.png
:alt:

:ref:`sphx_glr_generated_examples_tutorials_plot_getting_started_defo.py`
:ref:`sphx_glr_generated_examples_use_cases__plot_poor_model_fitting.py`

.. raw:: html

<div class="sphx-glr-thumbnail-title">Customizing the coregistration</div>
<div class="sphx-glr-thumbnail-title">Example: Poor Model Fitting</div>
</div>


.. only:: not html

* :ref:`sphx_glr_generated_examples_tutorials_plot_getting_started_defo.py`
* :ref:`sphx_glr_generated_examples_use_cases__plot_poor_model_fitting.py`

.. thumbnail-parent-div-close

Expand Down
10 changes: 5 additions & 5 deletions docs/source/generated/backreferences/mdreg.fit.examples
Original file line number Diff line number Diff line change
Expand Up @@ -15,24 +15,24 @@ Examples using ``mdreg.fit``

.. raw:: html

<div class="sphx-glr-thumbcontainer" tooltip="By default, dcmri uses free-form deformation implemented in the package itk.elastix, which default settings for all configuration parameters. ">
<div class="sphx-glr-thumbcontainer" tooltip="This example illustrates the effect of poor model fitting on coregistration for the 3D Variable Flip Angle (VFA) dataset used in the 3D data example.">

.. only:: html

.. image:: /generated/examples/tutorials/images/thumb/sphx_glr_plot_getting_started_defo_thumb.gif
.. image:: /generated/examples/use_cases/images/thumb/sphx_glr__plot_poor_model_fitting_thumb.png
:alt:

:ref:`sphx_glr_generated_examples_tutorials_plot_getting_started_defo.py`
:ref:`sphx_glr_generated_examples_use_cases__plot_poor_model_fitting.py`

.. raw:: html

<div class="sphx-glr-thumbnail-title">Customizing the coregistration</div>
<div class="sphx-glr-thumbnail-title">Example: Poor Model Fitting</div>
</div>


.. only:: not html

* :ref:`sphx_glr_generated_examples_tutorials_plot_getting_started_defo.py`
* :ref:`sphx_glr_generated_examples_use_cases__plot_poor_model_fitting.py`

.. thumbnail-parent-div-close

Expand Down
6 changes: 3 additions & 3 deletions docs/source/generated/backreferences/mdreg.plot.examples
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ Examples using ``mdreg.plot``

.. only:: html

.. image:: /generated/examples/use_cases/images/thumb/sphx_glr_plot_poor_model_fitting_thumb.png
.. image:: /generated/examples/use_cases/images/thumb/sphx_glr__plot_poor_model_fitting_thumb.png
:alt:

:ref:`sphx_glr_generated_examples_use_cases_plot_poor_model_fitting.py`
:ref:`sphx_glr_generated_examples_use_cases__plot_poor_model_fitting.py`

.. raw:: html

Expand All @@ -32,7 +32,7 @@ Examples using ``mdreg.plot``

.. only:: not html

* :ref:`sphx_glr_generated_examples_use_cases_plot_poor_model_fitting.py`
* :ref:`sphx_glr_generated_examples_use_cases__plot_poor_model_fitting.py`

.. thumbnail-parent-div-close

Expand Down
10 changes: 5 additions & 5 deletions docs/source/generated/backreferences/mdreg.plot_series.examples
Original file line number Diff line number Diff line change
Expand Up @@ -15,24 +15,24 @@ Examples using ``mdreg.plot_series``

.. raw:: html

<div class="sphx-glr-thumbcontainer" tooltip="By default, dcmri uses free-form deformation implemented in the package itk.elastix, which default settings for all configuration parameters. ">
<div class="sphx-glr-thumbcontainer" tooltip="This example illustrates the effect of poor model fitting on coregistration for the 3D Variable Flip Angle (VFA) dataset used in the 3D data example.">

.. only:: html

.. image:: /generated/examples/tutorials/images/thumb/sphx_glr_plot_getting_started_defo_thumb.gif
.. image:: /generated/examples/use_cases/images/thumb/sphx_glr__plot_poor_model_fitting_thumb.png
:alt:

:ref:`sphx_glr_generated_examples_tutorials_plot_getting_started_defo.py`
:ref:`sphx_glr_generated_examples_use_cases__plot_poor_model_fitting.py`

.. raw:: html

<div class="sphx-glr-thumbnail-title">Customizing the coregistration</div>
<div class="sphx-glr-thumbnail-title">Example: Poor Model Fitting</div>
</div>


.. only:: not html

* :ref:`sphx_glr_generated_examples_tutorials_plot_getting_started_defo.py`
* :ref:`sphx_glr_generated_examples_use_cases__plot_poor_model_fitting.py`

.. thumbnail-parent-div-close

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ Examples using ``mdreg.spgr_vfa_nonlin``

.. only:: html

.. image:: /generated/examples/use_cases/images/thumb/sphx_glr_plot_poor_model_fitting_thumb.png
.. image:: /generated/examples/use_cases/images/thumb/sphx_glr__plot_poor_model_fitting_thumb.png
:alt:

:ref:`sphx_glr_generated_examples_use_cases_plot_poor_model_fitting.py`
:ref:`sphx_glr_generated_examples_use_cases__plot_poor_model_fitting.py`

.. raw:: html

Expand All @@ -32,7 +32,7 @@ Examples using ``mdreg.spgr_vfa_nonlin``

.. only:: not html

* :ref:`sphx_glr_generated_examples_use_cases_plot_poor_model_fitting.py`
* :ref:`sphx_glr_generated_examples_use_cases__plot_poor_model_fitting.py`

.. thumbnail-parent-div-close

Expand Down
Loading

0 comments on commit dad40b6

Please sign in to comment.