Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Sep 21, 2023
1 parent 22aa342 commit dcde66a
Show file tree
Hide file tree
Showing 213 changed files with 74,836 additions and 0 deletions.
4 changes: 4 additions & 0 deletions dipy.org/pull/10/.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: 70057c64ae68ba8c69c2c1f3e09656d3
tags: 645f666f9bcd5a90fca523b33c5a78b7
Binary file added dipy.org/pull/10/_images/DM-MNIST-112epoch.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added dipy.org/pull/10/_images/colorfa.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added dipy.org/pull/10/_images/dm3d-monai-B8-DM500.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added dipy.org/pull/10/_images/pretty_tracks.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added dipy.org/pull/10/_images/vq-vae-results.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added dipy.org/pull/10/_images/vqvae-monai-B12-CC.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added dipy.org/pull/10/_images/vqvae3d-monai-B10.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added dipy.org/pull/10/_images/vqvae3d-monai-B5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added dipy.org/pull/10/_images/vqvae3d-reconst-f2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added dipy.org/pull/10/_images/vqvae3d-reconst-f3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions dipy.org/pull/10/_sources/blog.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
====
Blog
====
79 changes: 79 additions & 0 deletions dipy.org/pull/10/_sources/developers.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
.. _dipy_developers:

Developers
==========

The core development team consists of the following individuals:

- **Eleftherios Garyfallidis**, Indiana University, IN, USA
- **Ariel Rokem**, University of Washington, WA, USA
- **Matthew Brett**, Birmingham University, Birmingham, UK
- **Bago Amirbekian**, Databricks, San Francisco, CA, USA
- **Omar Ocegueda**, Google, San Francisco, CA
- **Marc-Alexandre Côté**, Microsoft Research, Montreal, QC, CA
- **Serge Koudoro**, Indiana University, IN, USA
- **Gabriel Girard**, Swiss Federal Institute of Technology (EPFL), Lausanne, CH
- **Rafael Neto Henriques**, Cambridge University, UK
- **Matthieu Dumont**, Imeka, Sherbrooke, QC, CA
- **Ranveer Aggarwal**, Microsoft, Hyderabad, Telangana, India

And here is the rest of the wonderful contributors:

- **Ian Nimmo-Smith**, retired, formerly at MRC Cognition and Brain Sciences Unit, Cambridge, UK
- **Maxime Descoteaux**, University of Sherbrooke, QC, CA
- **Stefan Van der Walt**, University of California, Berkeley, CA, USA
- **Jean-Christophe Houde**, University of Sherbrooke, QC, CA and Imeka, Sherbrooke, QC, CA
- **Francois Rhéault**, University of Sherbrooke, QC, CA
- **Samuel St-Jean**, University Medical Center (UMC) Utrecht, Utrecht, NL
- **Michael Paquette**, Max Planck Institute for Human Cognitive and Brain Sciences, Leipzig, DE
- **Christopher Nguyen**, Massachusetts General Hospital, MA, USA
- **Emanuele Olivetti**, NeuroInformatics Laboratory (NILab), Trento, IT
- **Yaroslav Halchenco**, PBS Department, Dartmouth, NH, USA
- **Emmanuel Caruyer**, Institut de Recherche en Informatique et Systèmes Aléatoires (IRISA), University of Rennes I, Rennes, FR
- **Sylvain Merlet**, INRIA, Sophia-Antipolis, FR
- **Erick Ziegler**, Université de Liège, BE
- **Kimberly Chan**, Stanford University, CA, USA
- **Chantal Tax**, Cardiff University, Cardiff, UK
- **Demian Wassermann**, INRIA, Sophia Antipolis, FR
- **Mauro Zucchelli**, INRIA, Sophia-Antipolis, France
- **Rutger Fick**, INRIA, Sophia Antipolis, FR
- **Gregory R. Lee**, Cincinnati Children's Hospital Medical Center, Cincinnati, OH, USA
- **Endolith**, New-York, NY, USA
- **Matthias Ekman**, Donders Institute for Brain, Cognition and Behaviour, Nijmegen, NL
- **Andrew Lawrence**, University of Cambridge, Cambridge, UK
- **Kesshi Jordan**, University of California, San Francisco, CA, USA
- **Maria Luisa Mandelli**, University of California, San Francisco, CA, USA
- **Adam Rybinski**, Jagiellonian University, Krakow, PL
- **Qiyuan Tian**, Stanford University, Stanford, CA, USA
- **Jon Haitz Legarreta Gorroño**, University of Sherbrooke, QC, CA
- **Rafael Neto Henriques**, Champalimaud Neuroscience Programme, Champalimaud Centre for the Unknown, Lisbon, PT
- **Stephan Meesters**, Eindhoven University of Technology, NL
- **Himanshu Mishra**, Indian Institute of Technology, Karaghpur, IN
- **Alexander Gauvin**, University of Sherbrooke, QC, CA
- **Oscar Esteban**, Stanford University, CA, US
- **Bishakh Ghosh**, National Institute of Technology, Durgapur, IN
- **Dimitris Rozakis**, Tomotech, Athens, GR
- **Rohan Prinja**, Indian Institute of Technology, Bombay, IN
- **Sagun Pai**, Indian Institute of Technology, Bombay, IN
- **Vatsala Swaroop**, Mombai, IN
- **Shahnawaz Ahmed**, Birla Institute of Technology and Science, Pilani, Goa, IN
- **Nil Goyette**, Imeka, Sherbrooke, QC, CA
- **Scott Trinkle**, University of Chicago, IL, USA
- **Kevin R. Sitek**, MIT McGovern Institute for Brain Research, MA, USA
- **Derek Pisner**, University of Texas at Austin, USA
- **Ross Lawrence**, Johns Hopkins University, USA
- **Eric Larson**, University of Washington, USA
- **Jakob Wasserthal**, German Cancer Research Center, DE
- **Bramsh Qamar Chandio**, Indiana University, IN, USA
- **Javier Guaje**, Indiana University, IN, USA
- **Shreyas Fadnavis**, Indiana University, IN, USA
- **Matt Cieslak**, University of Pennsylvania, USA
- **Sven Dorkenwald**, Princeton University, USA



Boundless collaboration is in the heart of DIPY_. We encourage everyone from anywhere in the world to join the team. You can start sharing your code `here`__. If you want to contribute but you don't know in area to focus, please send us an e-mail. We will be more than happy to help.

__ `dipy github`_

.. include:: links_names.inc
18 changes: 18 additions & 0 deletions dipy.org/pull/10/_sources/documentation.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
.. _documentation:

Documentation
===============

.. This tree is helping populate the side navigation panel
.. toctree::
:maxdepth: 2

introduction
mission
installation
faq
developers

.. Main content will be displayed using the jinja template
157 changes: 157 additions & 0 deletions dipy.org/pull/10/_sources/faq.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,157 @@
.. _faq:

==========================
Frequently Asked Questions
==========================

-----------
Theoretical
-----------

1. **What is a b-value?**

The b-value $b$ or *diffusion weighting* is a function of the
strength, duration and temporal spacing and timing parameters of the
specific paradigm. This function is derived from the Bloch-Torrey
equations. In the case of the classical Stejskal-Tanner
pulsed gradient spin-echo (PGSE) sequence, at the time of readout
$b=\gamma^{2}G^{2}\delta^{2}\left(\Delta-\frac{\delta}{3}\right)$
where $\gamma$ is the gyromagnetic ratio, $\delta$ denotes the pulse
width, $G$ is the gradient amplitude and $\Delta$ the center-to-center
spacing. $\gamma$ is a constant, but we can change the other
three parameters and in that way control the b-value.

2. **What is q-space?**

Q-space is the space of one or more 3D spin displacement wave vectors
$\mathbf{q}$. The vector $\mathbf{q}$
parametrizes the space of diffusion gradients. It is related to the
applied magnetic gradient $\mathbf{g}$ by the formula
$\mathbf{q}=(2\pi)^{-1}\gamma\delta\mathbf{g}$.
Every single vector $\mathbf{q}$ has the same orientation as the
direction of diffusion gradient $\mathbf{g}$ and length proportional
to the strength $g$ of the gradient field. Every single point in
q-space corresponds to a possible 3D volume of the MR signal for a specific
gradient direction and strength. Therefore if, for example, we have
programmed the scanner to apply 60 gradient directions, then our data
should have 60 diffusion volumes, with each volume obtained for a specific
gradient. A Diffusion Weighted Image (DWI) is the volume acquired
from only one direction gradient.

3. **What does DWI stand for?**

Diffusion Weighted Imaging (DWI) is MRI imaging designed to be sensitive
to diffusion. A diffusion weighted image is a volume of voxel data gathered
by applying only one gradient direction
using a diffusion sequence. We expect that the signal in any voxel
should be low if there is greater mobility of water molecules along
the specified gradient direction and it should be high if there is
less movement in that direction. Yes, it is counterintuitive but correct!
However, greater mobility gives greater opportunity for the proton spins to
be dephased, producing a smaller RF signal.

4. **Why dMRI and not DTI?**

Diffusion MRI (dMRI or dwMRI) are the preferred terms if you want to speak
about diffusion weighted MRI in general. DTI (diffusion tensor imaging) is
just one of the many ways you can reconstruct the voxel from your measured
signal. There are plenty of others, for example DSI, GQI, QBI, etc.

5. **What is the difference between Image coordinates and World coordinates?**

Image coordinates have positive integer values and represent the centres
$(i, j, k)$ of the voxels. There is an affine transform (stored in the
nifti file) that takes the image coordinates and transforms them into
millimeter (mm) in real world space. World coordinates have floating point
precision and your dataset has 3 real dimensions e.g. $(x, y, z)$.

6. **We generated dMRI datasets with nonisotropic voxel sizes. What do we do?**

You need to resample your raw data to an isotropic size. Have a look at
the module ``dipy.align.aniso2iso``. (We think it is a mistake to
acquire nonisotropic data because the directional resolution of the data
will depend on the orientation of the gradient with respect to the
voxels, being lower when aligned with a longer voxel dimension.)

7. **Why are non-isotropic voxel sizes a bad idea in diffusion?**

If, for example, you have $2 \times 2 \times 4\ \textrm{mm}^3$ voxels, the
last dimension will be averaged over the double distance and less detail
will be captured compared to the other two dimensions. Furthermore, with
very anisotropic voxels the uncertainty on orientation estimates will
depend on the position of the subject in the scanner.

---------
Practical
---------

1. **Why Python and not MATLAB or some other language?**

Python is free, batteries included, very well-designed, painless to read
and easy to use.
There is nothing else like it. Give it a go.
Once with Python, always with Python.

2. **Isn't Python slow?**

True, sometimes Python can be slow if you are using multiple nested
``for`` loops, for example.
In that case, we use Cython_, which takes execution up to C speed.

3. **What numerical libraries do you use in Python?**

The best ever designed numerical library - NumPy_.

2. **Which Python console do you recommend?**

IPython_

3. **What do you use for visualization?**

For 3D visualization, we use ``dipy.viz`` which depends in turn on ``FURY``::

from dipy.viz import window, actor

For 2D visualization we use matplotlib_.

4. **Which file formats do you support?**

Nifti (.nii), Dicom (Siemens(read-only)), Trackvis (.trk), DIPY (.dpy),
Numpy (.npy, ,npz), text and any other formats supported by nibabel and
pydicom.

You can also read/save in Matlab version v4 (Level 1.0), v6 and v7 to 7.2,
using `scipy.io.loadmat`. For higher versions >= 7.3, you can use pytables_
or any other python-to-hdf5 library e.g. h5py.

For object serialization, you can use ``dipy.io.pickles`` functions
``load_pickle``, ``save_pickle``.

5. **What is dpy**?

``dpy`` is an ``hdf5`` file format that we use in DIPY to store
tractography and other information. This allows us to store huge
tractography and load different parts of the datasets
directly from the disk as if it were in memory.

6. **Which python editor should I use?**

Any text editor would do the job but we prefer the following: PyCharm, Sublime, Aptana, Emacs, Vim and Eclipse (with PyDev).

7. **I have problems reading my dicom files using nibabel, what should I do?**

Use Chris Rorden's dcm2nii to transform them into nifti files.
http://www.cabiatl.com/mricro/mricron/dcm2nii.html
Or you can make your own reader using pydicom.
http://code.google.com/p/pydicom/
and then use nibabel to store the data as nifti.

8. **Where can I find diffusion data?**

There are many sources for openly available diffusion MRI. the :mod:`dipy.data` module can be used to download some sample datasets that we use in our examples. In addition there are a lot of large research-grade datasets available through the following sources:

- http://fcon_1000.projects.nitrc.org/
- https://www.humanconnectome.org/
- https://openneuro.org/

.. include:: links_names.inc
119 changes: 119 additions & 0 deletions dipy.org/pull/10/_sources/gimbal_lock.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
.. _gimbal-lock:

=============
Gimbal lock
=============

See also: http://en.wikipedia.org/wiki/Gimbal_lock

Euler angles have a major deficiency, and that is, that it is possible,
in some rotation sequences, to reach a situation where two of the three
Euler angles cause rotation around the same axis of the object. In the
case below, rotation around the $x$ axis becomes indistinguishable in
its effect from rotation around the $z$ axis, so the $z$ and $x$ axis
angles collapse into one transformation, and the rotation reduces from
three degrees of freedom to two.

Imagine that we are using the Euler angle convention of starting with a
rotation around the $x$ axis, followed by the $y$ axis, followed by the
$z$ axis.

Here we see a Spitfire aircraft, flying across the screen. The $x$ axis
is left to right (tail to nose), the $y$ axis is from the left wing tip
to the right wing tip (going away from the screen), and the $z$ axis is
from bottom to top:

.. image:: images/spitfire_0.png

Imagine we wanted to do a slight roll with the left wing tilting down
(rotation about $x$) like this:

.. image:: images/spitfire_x.png

followed by a violent pitch so we are pointing straight up (rotation
around $y$ axis):

.. image:: images/spitfire_y.png

Now we'd like to do a turn of the nose towards the viewer (and the tail
away from the viewer):

.. image:: images/spitfire_hoped.png

But, wait, let's go back over that again. Look at the result of the
rotation around the $y$ axis. Notice that the $x$ axis, as was, is now
aligned with the $z$ axis, as it is now. Rotating around the $z$ axis
will have exactly the same effect as adding an extra rotation around the
$x$ axis at the beginning. That means that when there is a $y$ axis
rotation that rotates the $x$ axis onto the $z$ axis (a rotation of
$\pm\pi/2$ around the $y$ axis) - the $x$ and $y$ axes are "locked"
together.

Mathematics of gimbal lock
==========================

We see gimbal lock for this type of Euler axis convention, when
$\cos(\beta) = 0$, where $\beta$ is the angle of rotation around the $y$
axis. By "this type of convention" we mean using rotation around all 3
of the $x$, $y$ and $z$ axes, rather than using the same axis twice -
e.g. the physics convention of $z$ followed by $x$ followed by $z$ axis
rotation (the physics convention has different properties to its gimbal
lock).

We can show how gimbal lock works by creating a rotation matrix for the
three component rotations. Recall that, for a rotation of $\alpha$
radians around $x$, followed by a rotation $\beta$ around $y$, followed
by rotation $\gamma$ around $z$, the rotation matrix $R$ is:

.. math::
R = \left(\begin{smallmatrix}\operatorname{cos}\left(\beta\right) \operatorname{cos}\left(\gamma\right) & - \operatorname{cos}\left(\alpha\right) \operatorname{sin}\left(\gamma\right) + \operatorname{cos}\left(\gamma\right) \operatorname{sin}\left(\alpha\right) \operatorname{sin}\left(\beta\right) & \operatorname{sin}\left(\alpha\right) \operatorname{sin}\left(\gamma\right) + \operatorname{cos}\left(\alpha\right) \operatorname{cos}\left(\gamma\right) \operatorname{sin}\left(\beta\right)\\\operatorname{cos}\left(\beta\right) \operatorname{sin}\left(\gamma\right) & \operatorname{cos}\left(\alpha\right) \operatorname{cos}\left(\gamma\right) + \operatorname{sin}\left(\alpha\right) \operatorname{sin}\left(\beta\right) \operatorname{sin}\left(\gamma\right) &- \operatorname{cos}\left(\gamma\right) \operatorname{sin}\left(\alpha\right) + \operatorname{cos}\left(\alpha\right) \operatorname{sin}\left(\beta\right) \operatorname{sin}\left(\gamma\right)\\- \operatorname{sin}\left(\beta\right) & \operatorname{cos}\left(\beta\right) \operatorname{sin}\left(\alpha\right) & \operatorname{cos}\left(\alpha\right) \operatorname{cos}\left(\beta\right)\end{smallmatrix}\right)
When $\cos(\beta) = 0$, $\sin(\beta) = \pm1$ and $R$ simplifies to:

.. math::
R = \left(\begin{smallmatrix}0 & - \operatorname{cos}\left(\alpha\right) \operatorname{sin}\left(\gamma\right) + \pm{1} \operatorname{cos}\left(\gamma\right) \operatorname{sin}\left(\alpha\right) & \operatorname{sin}\left(\alpha\right) \operatorname{sin}\left(\gamma\right) + \pm{1} \operatorname{cos}\left(\alpha\right) \operatorname{cos}\left(\gamma\right)\\0 & \operatorname{cos}\left(\alpha\right) \operatorname{cos}\left(\gamma\right) + \pm{1} \operatorname{sin}\left(\alpha\right) \operatorname{sin}\left(\gamma\right) & - \operatorname{cos}\left(\gamma\right) \operatorname{sin}\left(\alpha\right) + \pm{1} \operatorname{cos}\left(\alpha\right) \operatorname{sin}\left(\gamma\right)\\- \pm{1} & 0 & 0\end{smallmatrix}\right)
When $\sin(\beta) = 1$:

.. math::
R = \left(\begin{smallmatrix}0 & \operatorname{cos}\left(\gamma\right) \operatorname{sin}\left(\alpha\right) - \operatorname{cos}\left(\alpha\right) \operatorname{sin}\left(\gamma\right) & \operatorname{cos}\left(\alpha\right) \operatorname{cos}\left(\gamma\right) + \operatorname{sin}\left(\alpha\right) \operatorname{sin}\left(\gamma\right)\\0 & \operatorname{cos}\left(\alpha\right) \operatorname{cos}\left(\gamma\right) + \operatorname{sin}\left(\alpha\right) \operatorname{sin}\left(\gamma\right) & \operatorname{cos}\left(\alpha\right) \operatorname{sin}\left(\gamma\right) - \operatorname{cos}\left(\gamma\right) \operatorname{sin}\left(\alpha\right)\\-1 & 0 & 0\end{smallmatrix}\right)
From the `angle sum and difference identities
<http://en.wikipedia.org/wiki/List_of_trigonometric_identities#Angle_sum_and_difference_identities>`_
(see also `geometric proof
<http://www.themathpage.com/atrig/sum-proof.htm>`_, `Mathworld treatment
<http://mathworld.wolfram.com/TrigonometricAdditionFormulas.html>`_) we
remind ourselves that, for any two angles $\alpha$ and $\beta$:

.. math::
\sin(\alpha \pm \beta) = \sin \alpha \cos \beta \pm \cos \alpha \sin \beta \,
\cos(\alpha \pm \beta) = \cos \alpha \cos \beta \mp \sin \alpha \sin \beta
We can rewrite $R$ as:

.. math::
R = \left(\begin{smallmatrix}0 & V_{1} & V_{2}\\0 & V_{2} & - V_{1}\\-1 & 0 & 0\end{smallmatrix}\right)
where:

.. math::
V_1 = \operatorname{cos}\left(\gamma\right) \operatorname{sin}\left(\alpha\right) - \operatorname{cos}\left(\alpha\right) \operatorname{sin}\left(\gamma\right) = \sin(\alpha - \gamma) \,
V_2 = \operatorname{cos}\left(\alpha\right) \operatorname{cos}\left(\gamma\right) + \operatorname{sin}\left(\alpha\right) \operatorname{sin}\left(\gamma\right) = \cos(\alpha - \gamma)
We immediately see that $\alpha$ and $\gamma$ are going to lead the same
transformation - the mathematical expression of the observation on the
spitfire above, that rotation around the $x$ axis is equivalent to
rotation about the $z$ axis.

It's easy to do the same set of reductions, with the same conclusion,
for the case where $\sin(\beta) = -1$ - see
http://www.gregslabaugh.name/publications/euler.pdf.

Loading

0 comments on commit dcde66a

Please sign in to comment.