Skip to content

Commit

Permalink
Add individual options as alternative to configuration string (#11)
Browse files Browse the repository at this point in the history
* Draft CLI reorganization.

* Work on the parser.

* Split up extras and combine with extra_kwargs.

* Split out _get_parser function.

* Update usage.rst
  • Loading branch information
tsalo authored Oct 4, 2024
1 parent b34360b commit a002f1e
Show file tree
Hide file tree
Showing 2 changed files with 318 additions and 65 deletions.
90 changes: 90 additions & 0 deletions docs/usage.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
#########################################
Using patch-denoise from the command line
#########################################

``patch-denoise`` minimally requires a path to a NIfTI file,
but it can take advantage of reconstructed phase data and/or noise volumes.

.. argparse::
:ref: patch_denoise.bindings.cli._get_parser
:prog: patch-denoise
:func: _get_parser


================================
Using patch-denoise on BIDS data
================================

.. warning::
These examples assume that the phase data are in radians.
If they are in arbitrary units,
you will need to rescale them before running patch-denoise.


Magnitude only
==============

.. code-block:: bash
patch-denoise \
sub-01/func/sub-01_task-rest_part-mag_bold.nii.gz \
sub-01_task-rest_part-mag_desc-denoised_bold.nii.gz \
--mask auto \
--method optimal-fro \
--patch-shape 11 \
--patch-overlap 5 \
--recombination weighted \
--mask-threshold 1
Magnitude with noise volumes
============================

.. code-block:: bash
patch-denoise \
sub-01/func/sub-01_task-rest_part-mag_bold.nii.gz \
sub-01_task-rest_part-mag_desc-denoised_bold.nii.gz \
--noise-map sub-01/func/sub-01_task-rest_part-mag_noRF.nii.gz \
--mask auto \
--method optimal-fro \
--patch-shape 11 \
--patch-overlap 5 \
--recombination weighted \
--mask-threshold 1
Magnitude and phase
===================

.. code-block:: bash
patch-denoise \
sub-01/func/sub-01_task-rest_part-mag_bold.nii.gz \
sub-01_task-rest_part-mag_desc-denoised_bold.nii.gz \
--input-phase sub-01/func/sub-01_task-rest_part-phase_bold.nii.gz \
--mask auto \
--method optimal-fro \
--patch-shape 11 \
--patch-overlap 5 \
--recombination weighted \
--mask-threshold 1
Magnitude and phase with noise volumes
======================================

.. code-block:: bash
patch-denoise \
sub-01/func/sub-01_task-rest_part-mag_bold.nii.gz \
sub-01_task-rest_part-mag_desc-denoised_bold.nii.gz \
--input-phase sub-01/func/sub-01_task-rest_part-phase_bold.nii.gz \
--noise-map sub-01/func/sub-01_task-rest_part-mag_noRF.nii.gz \
--noise-map-phase sub-01/func/sub-01_task-rest_part-phase_noRF.nii.gz \
--mask auto \
--method optimal-fro \
--patch-shape 11 \
--patch-overlap 5 \
--recombination weighted \
--mask-threshold 1
Loading

0 comments on commit a002f1e

Please sign in to comment.