Skip to content

Commit ef9af9f

Browse files
authored
Merge pull request #89 from nipreps/update_documentation
WIP: Update documentation
2 parents 92be3e6 + 5126a7a commit ef9af9f

File tree

5 files changed

+70
-51
lines changed

5 files changed

+70
-51
lines changed

README.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,3 +139,13 @@ This was supported by the BRAIN Initiative
139139
grant (OpenNeuroPET, grant ID 1R24MH120004-01A1); the Novo Nordisk Foundation (OpenNeuroPET, grant ID NN20OC0063277); the Laura and John Arnold Foundation,
140140
the NIH (grant NBIB R01EB020740, PI: Ghosh);
141141
and NIMH (R24MH114705, R24MH117179, R01MH121867, PI: Poldrack)
142+
143+
.. _FSL: https://fsl.fmrib.ox.ac.uk/fsl/fslwiki
144+
.. _ANTs: http://stnava.github.io/ANTs/
145+
.. _FreeSurfer: https://surfer.nmr.mgh.harvard.edu/
146+
.. _AFNI: https://afni.nimh.nih.gov/
147+
.. _PETSurfer: https://surfer.nmr.mgh.harvard.edu/fswiki/PetSurfer
148+
.. _PETPVC: https://github.com/UCL/PETPVC
149+
.. _kinfitr: https://github.com/mathesong/kinfitr
150+
.. _PMOD: https://www.pmod.com/
151+
.. _BIDS: https://bids.neuroimaging.io/

docs/license.rst

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ projects of the framework.
66

77
License information
88
-------------------
9-
Copyright (c) 2023, the *NiPreps* Developers.
9+
Copyright (c) 2025, the *NiPreps* Developers.
1010

11-
As of the 21.0.x pre-release and release series, *PETPrep* is
11+
As of the 0.0.x pre-release and release series, *PETPrep* is
1212
licensed under the Apache License, Version 2.0 (the "License");
1313
you may not use this file except in compliance with the License.
1414
You may obtain a copy of the License at
@@ -20,20 +20,14 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2020
See the License for the specific language governing permissions and
2121
limitations under the License.
2222

23-
Copyright (c) 2015-2023, the *PETPrep* developers and the CRN.
23+
Copyright (c) 2025-, the *NiPreps* developers.
2424
All rights reserved.
2525

26-
*PETPrep* 20.2 series and earlier are
27-
licensed under the BSD 3-clause license.
28-
You may obtain a copy of the License at
29-
https://opensource.org/licenses/BSD-3-Clause
30-
3126
All trademarks referenced herein are property of their respective holders.
3227

3328
The ``petprep-wrapper`` for Docker
3429
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
35-
Copyright (c) 2020-2023, the *NiPreps* Developers.
36-
Copyright (c) 2015-2020, the *PETPrep* developers and the CRN.
30+
Copyright (c) 2025-, the *NiPreps* Developers.
3731
All rights reserved.
3832

3933
*PETPrep-wrapper* is

docs/usage.rst

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,39 @@ This feature has several intended use-cases:
176176
See also the ``--level`` flag, which can be used to control which derivatives are
177177
generated.
178178

179+
Head motion correction
180+
----------------------
181+
*PETPrep* can correct for head motion in the PET data.
182+
The head motion is estimated using a frame-based robust registration approach to an unbiased mean
183+
volume implemented in FreeSurfer's mri_robust_register (Reuter et al., 2010), combined with
184+
preprocessing steps using tools from FSL (Jenkinson et al., 2012). Specifically, for the estimation
185+
of head motion, each frame is initially smoothed with a Gaussian filter (full-width half-maximum [FWHM] of 10 mm, --hmc-fwhm 10),
186+
followed by thresholding at 20% of the intensity range to reduce noise and improve registration
187+
accuracy (removing stripe artefacts from filtered back projection reconstructions).
188+
Per default, the motion is estimated selectively of frames acquired after 120 seconds post-injection of the tracer (--hmc-start-time 120),
189+
as frames before this often contain low count statistics. Frames preceding 120 seconds were corrected
190+
using identical transformations as derived for the first frame after 120 seconds. The robust
191+
registration (mri_robust_register) algorithm utilized settings optimized for PET data: intensity
192+
scaling was enabled, automated sensitivity detection was activated, and the Frobenius norm threshold
193+
for convergence was set at 0.0001, ensuring precise and consistent alignment across frames.
194+
195+
To edit the motion correction parameters and run the workflow, use: ::
196+
197+
$ petprep /data/bids_root /out participant --hmc-fwhm 8 --hmc-start-time 60
198+
199+
Segmentation
200+
----------------
201+
*PETPrep* can segment the brain into different brain regions and extract time activity curves from these regions.
202+
The ``--seg`` flag selects the segmentation method to use.
203+
Available options are ``gtm`` (default) whole-brain segmentation from freesurfer, ``brainstem``, ``wm`` (white matter), ``thalamicNuclei``, ``hippocampusAmygdala``, ``raphe``, and ``limbic``.
204+
205+
The ``gtm`` segmentation is a whole-brain segmentation that includes the
206+
cerebral cortex, subcortical structures, and cerebellum.
207+
208+
To run the segmentation with the default ``gtm`` method, use: ::
209+
210+
$ petprep /data/bids_root /out participant --seg gtm
211+
179212
Partial volume correction
180213
-------------------------
181214
*PETPrep* can optionally correct PET images for partial volume effects.
@@ -223,6 +256,8 @@ Use ``--ref-mask-name`` to select a predefined region and
223256
The available masks are and do not require ``--ref-mask-index`` to be specified:
224257
- ``cerebellum``: Cerebellar gray matter (requires the ``--seg gtm`` option).
225258
- ``semiovale``: White matter in the centrum semiovale (requires the ``--seg wm`` option).
259+
- ``neocortex``: Neocortical gray matter (requires the ``--seg gtm`` option).
260+
- ``thalamus``: Thalamic gray matter (requires the ``--seg gtm`` option).
226261

227262
The presets are defined in ``petprep/data/reference_mask/config.json``.
228263

@@ -251,7 +286,7 @@ All bugs, concerns and enhancement requests for this software can be submitted h
251286
https://github.com/nipreps/petprep/issues.
252287

253288
If you have a problem or would like to ask a question about how to use *PETPrep*,
254-
please submit a question to `NeuroStars.org <https://neurostars.org/tag/petprep>`_ with an ``petprep`` tag.
289+
please submit a question to `NeuroStars.org <https://neurostars.org/tag/petprep>`_ with a ``petprep`` tag.
255290
NeuroStars.org is a platform similar to StackOverflow but dedicated to neuroinformatics.
256291

257292
Previous questions about *PETPrep* are available here:

docs/workflows.rst

Lines changed: 4 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ available and are used as the input.
88
Certain processing steps will run only when the required metadata is
99
available in the input dataset.
1010

11-
A (very) high-level view of the simplest pipeline (for a single-band dataset with only
12-
one task, single-run, with no slice-timing information nor fieldmap acquisitions)
11+
A (very) high-level view of the simplest pipeline (for a single dataset with only
12+
a single tracer and single baseline)
1313
is presented below:
1414

1515
.. workflow::
@@ -394,27 +394,6 @@ customized via the :option:`--hmc-fwhm` and :option:`--hmc-start-time`
394394
command line options. By default a 10 mm FWHM Gaussian is applied and
395395
estimation begins at 120 s.
396396

397-
Susceptibility Distortion Correction (SDC)
398-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
399-
One of the major problems that affects :abbr:`EPI (echo planar imaging)` data
400-
is the spatial distortion caused by the inhomogeneity of the field inside
401-
the scanner.
402-
403-
.. figure:: _static/unwarping.svg
404-
405-
Applying susceptibility-derived distortion correction, based on
406-
fieldmap estimation.
407-
408-
Please note that all routines for susceptibility-derived distortion correction
409-
have been excised off of *PETPrep* for utilization on other projects
410-
(e.g., `dMRIPrep <https://www.nipreps.org/dmriprep>`__).
411-
For more detailed documentation on
412-
:abbr:`SDC (susceptibility-derived distortion correction)`
413-
routines, check on the `SDCFlows component <https://www.nipreps.org/sdcflows>`__.
414-
415-
Theory, methods and references are found within the
416-
`SDCFlows documentation <https://www.nipreps.org/sdcflows/master/api/sdcflows.workflows.fit.fieldmap.html>`__.
417-
418397
Pre-processed PET in native space
419398
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
420399
:py:func:`~petprep.workflows.pet.fit.init_pet_native_wf`
@@ -435,14 +414,13 @@ A new *preproc* :abbr:`PET (positron emission tomography)` series is generated
435414
from the original data in the original space.
436415
All volumes in the :abbr:`PET (positron emission tomography)` series are
437416
resampled in their native space by concatenating the mappings found in previous
438-
correction workflows (:abbr:`HMC (head-motion correction)` and
439-
:abbr:`SDC (susceptibility-derived distortion correction)` if executed)
417+
correction workflows (:abbr:`HMC (head-motion correction)`)
440418
for a one-shot interpolation process.
441419
Interpolation uses a Lanczos kernel.
442420

443421
.. _pet_reg:
444422

445-
EPI to T1w registration
423+
PET to T1w registration
446424
~~~~~~~~~~~~~~~~~~~~~~~
447425
:py:func:`~petprep.workflows.pet.registration.init_bbreg_wf`
448426

petprep/cli/parser.py

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -360,20 +360,6 @@ def _bids_filter(value, parser):
360360
action=DeprecatedAction,
361361
help='Deprecated - use `--force no-bbr` instead.',
362362
)
363-
g_conf.add_argument(
364-
'--hmc-fwhm',
365-
action='store',
366-
default=10,
367-
type=float,
368-
help='FWHM for Gaussian smoothing applied during head-motion estimation.',
369-
)
370-
g_conf.add_argument(
371-
'--hmc-start-time',
372-
action='store',
373-
default=120,
374-
type=float,
375-
help='Time (in seconds) after which head-motion estimation is performed.',
376-
)
377363
g_conf.add_argument(
378364
'--random-seed',
379365
dest='_random_seed',
@@ -536,6 +522,22 @@ def _bids_filter(value, parser):
536522
'The user is responsible for ensuring that all necessary files are present.',
537523
)
538524

525+
g_hmc = parser.add_argument_group('Options for head motion correction')
526+
g_hmc.add_argument(
527+
'--hmc-fwhm',
528+
action='store',
529+
default=10,
530+
type=float,
531+
help='FWHM for Gaussian smoothing applied during head-motion estimation.',
532+
)
533+
g_hmc.add_argument(
534+
'--hmc-start-time',
535+
action='store',
536+
default=120,
537+
type=float,
538+
help='Time (in seconds) after which head-motion estimation is performed.',
539+
)
540+
539541
g_seg = parser.add_argument_group('Segmentation options')
540542
g_seg.add_argument(
541543
'--seg',

0 commit comments

Comments
 (0)