Skip to content

Commit

Permalink
Update read the docs (#35)
Browse files Browse the repository at this point in the history
* add readthedocs.yaml to kick of setup
* added movies
* update docstrings, remove unused methods
* added animations of defaced images
* bump version and tag
  • Loading branch information
bendhouseart authored Dec 18, 2023
1 parent 8d2cf9d commit 393ffdc
Show file tree
Hide file tree
Showing 9 changed files with 186 additions and 82 deletions.
Binary file added docs/_static/3d_rotate.gif
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 docs/_static/sagittal.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
43 changes: 43 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,24 @@
Welcome to petdeface's documentation!
=====================================

petdeface is a nipype implementation of an anatomical MR and PET defacing pipeline for BIDS datasets.
This is a working prototype, in active development denoted by the 0.x.x version number.

.. image:: _static/3d_rotate.gif
:align: center

|
Petdface can be used to deface PET and MR data as well as co-register the two modalities.
Use is encouraged and feedback via Github issues or email to openneuropet@gmail.com is more than welcome.
As is often the case, this medical research software is constrained to testing on data that its developers
have access to.

This software can be installed via source or via pip from PyPi with ``pip install petdeface``

**NOTE:** This project is currently in beta release, some features listed below may
not be available for version numbers < 1.0.0

.. toctree::
installation
modules
Expand All @@ -20,3 +38,28 @@ Indices and tables
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`

Citations
---------

1. Dale A, Fischl B, Sereno MI. Cortical Surface-Based Analysis: I. Segmentation and Surface Reconstruction.
Neuroimage. 1999;9(2):179–94. doi:10.1006/nimg.1998.0395.
2. Fischl B. FreeSurfer. Neuroimage. 2012 Aug 15;62(2):774-81. doi: 10.1016/j.neuroimage.2012.01.021.
Epub 2012 Jan 10. PMID: 22248573; PMCID: PMC3685476.
3. Stefano Cerri, Douglas N. Greve, Andrew Hoopes, Henrik Lundell, Hartwig R. Siebner, Mark Mühlau, Koen Van Leemput,
An open-source tool for longitudinal whole-brain and white matter lesion segmentation,
NeuroImage: Clinical, Volume 38, 2023, 103354, ISSN 2213-1582, https://doi.org/10.1016/j.nicl.2023.103354.
(https://www.sciencedirect.com/science/article/pii/S2213158223000438)
4. Gorgolewski, Krzysztof J. ; Esteban, Oscar ; Burns, Christopher ; Ziegler, Erik ; Pinsard, Basile ; Madison, Cindee ;
Waskom, Michael ; Ellis, David Gage ; Clark, Dav ; Dayan, Michael ; Manhães-Savio, Alexandre ;
Notter, Michael Philipp ; Johnson, Hans ; Dewey, Blake E ; Halchenko, Yaroslav O. ; Hamalainen, Carlo ;
Keshavan, Anisha ; Clark, Daniel ; Huntenburg, Julia M. ; Hanke, Michael ; Nichols, B. Nolan ; Wassermann , Demian ;
Eshaghi, Arman ; Markiewicz, Christopher ; Varoquaux, Gael ; Acland, Benjamin ; Forbes, Jessica ; Rokem, Ariel ;
Kong, Xiang-Zhen ; Gramfort, Alexandre ; Kleesiek, Jens ; Schaefer, Alexander ; Sikka, Sharad ;
Perez-Guevara, Martin Felipe ; Glatard, Tristan ; Iqbal, Shariq ; Liu, Siqi ; Welch, David ; Sharp, Paul ;
Warner, Joshua ; Kastman, Erik ; Lampe, Leonie ; Perkins, L. Nathan ; Craddock, R. Cameron ; Küttner, René ;
Bielievtsov, Dmytro ; Geisler, Daniel ; Gerhard, Stephan ; Liem, Franziskus ; Linkersdörfer, Janosch ;
Margulies, Daniel S. ; Andberg, Sami Kristian ; Stadler, Jörg ; Steele, Christopher John ; Broderick, William ;
Cooper, Gavin ; Floren, Andrew ; Huang, Lijie ; Gonzalez, Ivan ; McNamee, Daniel ; Papadopoulos Orfanos, Dimitri ;
Pellman, John ; Triplett, William ; Ghosh, Satrajit (2016). Nipype: a flexible, lightweight and extensible
neuroimaging data processing framework in Python. 0.12.0-rc1. Zenodo. 10.5281/zenodo.50186
6 changes: 6 additions & 0 deletions docs/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ Or cloned and installed from source::
pip install dist/petdeface-<X.X.X>-py3-none-any.whl
# where X.X.X is the version number of the generated file

.. raw:: html

<script async id="asciicast-626689" src="https://asciinema.org/a/626689.js"
async data-autoplay="true" data-speed="1.5" data-loop="true"></script>


Dependencies
------------

Expand Down
22 changes: 17 additions & 5 deletions docs/usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ After installation PETdeface can be run from as follows::

petdeface /inputfolder --output_dir /outputfolder

.. raw:: html

<script async id="asciicast-626691" src="https://asciinema.org/a/626691.js"
async data-autoplay="true" data-speed="1.5" data-loop="true"></script>

Given a PET BIDS dataset like below::

tree /inputfolder
Expand Down Expand Up @@ -69,8 +74,8 @@ Previously faced files are replaced with defaced images while the registration,

When viewed, a succesfully defaced PET image will have varying intensities in the face region, as shown below:

.. image:: /_static/defaced_pet_side_view.png
:align: left
.. image:: /_static/sagittal.gif
:align: left

-----------------

Expand Down Expand Up @@ -123,14 +128,21 @@ Alternatively, if one is unable to install PETdeface from source or PIP, but can
-v /Data/defaced_pet_data/:/output \
-v /home/user/freesurfer/license.txt:/opt/freesurfer/license.txt \
--platform linux/amd64 \
petdeface:latest /input --output_dir /output --n_procs 16 --skip_bids_validator --placement adjacent --user=$UID:$GID system_platform=Linux
petdeface:latest /input \
--output_dir /output \
--n_procs 16 \
--skip_bids_validator \
--placement adjacent \
--user=$UID:$GID \
system_platform=Linux

One needs to create 3 bind mounts to the docker container when running PETdeface directly from docker:

1. /input needs to mounted to the input BIDS dataset on the host machine
2. /output needs to be mounted to the output directory on the host machine
3. /opt/freesurfer/license.txt needs to be mounted to the freesurfer license file on the host machine

If one is running PETdeface on a linux machine and desires non-root execution of the container,
the `--user` flag needs to be set to the UID and GID of the user running the container.
the ``--user`` flag needs to be set to the UID and GID of the user running the container.

Of course all of the above is done automatically when running PETdeface using the `--docker` flag.
Of course all of the above is done automatically when running PETdeface using the ``--docker`` flag.
Loading

0 comments on commit 393ffdc

Please sign in to comment.