Skip to content

Commit

Permalink
Merge pull request #29 from DelinteNicolas/doc
Browse files Browse the repository at this point in the history
Doc
  • Loading branch information
DelinteNicolas authored Apr 11, 2023
2 parents a5fb576 + 37f8b8a commit 07e7263
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 1 deletion.
9 changes: 9 additions & 0 deletions docs/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,12 @@ utils
:members:
:undoc-members:
:show-inheritance:

viz
^^^^^^^^^^^^^^^^^^^

.. automodule:: unravel.viz
:members:
:undoc-members:
:show-inheritance:

Binary file added docs/imgs/rgb3.webp
Binary file not shown.
Binary file added docs/imgs/stream.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 9 additions & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,18 @@
Welcome to UNRAVEL's documentation!
================================

Welcome to the documentation of Tractography Informed Multi-fascicle microstructure Estimation!
Welcome to the documentation of UtiliziNg tRActography to uncoVEr muLti-fixel microstructure (UNRAVEL)!

The code is available at https://github.com/DelinteNicolas/UNRAVEL

To unravel has two meanings :

- to disentangle the fibers of
- to resolve the intricacy, complexity, or obscurity of
With the UNRAVEL framework, we utilize tractography to unravel the microstructure of multi-fixel models.

This repository contains the documentation of the code used to combine macroscopic tractography information with microscopic multi-fixel model estimates in order to improve the accuracy in the estimation of the microstructural properties of neural fibers in a specified tract.

.. toctree::
:caption: Getting Started

Expand Down
33 changes: 33 additions & 0 deletions docs/tutorials.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ Fixel weights maps can be obtained using the :meth:`unravel.core.get_fixel_weigh
t1 = nib.load("peak_file_1.nii.gz").get_fdata()

trk = load_tractogram("trk_file.trk", 'same')
trk.to_vox()
trk.to_corner()

fixel_weights,_,_ = get_fixel_weight(trk, [t0, t1])

Expand All @@ -27,4 +29,35 @@ A complete example code of the main functions is available in the :class:`unrave
:language: python
:lines: 13-

Adding color to streamline trajectory
-------------------------------------

The `color` parameter can be set to `True` to add directional colors::

plot_streamline_trajectory(trk, resolution_increase=2,
streamline_number=500, axis=1,
color=True, norm_all_voxels=True)

.. image:: imgs/stream.png
:width: 800
:align: center

Create GIFs from 3D volumes
---------------------------

Short videos can be created using the :meth:`unravel.viz.convert_to_gif` function::

import nibabel as nib

rgb = get_streamline_density(trk, resolution_increase = 4, color = True)
t1 = nib.load('path_to/registered_T1.nii.gz').get_fdata()

# rgb = overlap_volumes([rgb, t1], order=0)

convert_to_gif(rgb, output_folder='output/path', transparency=True, keep_frames=False,extension='gif', axis=0)

.. image:: imgs/rgb3.webp
:width: 600
:align: center

.. note:: More tutorials will be added in the near future.

0 comments on commit 07e7263

Please sign in to comment.