Skip to content

Commit

Permalink
[FIX] Change to Linear for upsampling (#820)
Browse files Browse the repository at this point in the history
* Change to Linear for upsampling

* Update docs/quickstart.rst

Co-authored-by: Taylor Salo <[email protected]>

---------

Co-authored-by: Taylor Salo <[email protected]>
  • Loading branch information
mattcieslak and tsalo authored Sep 16, 2024
1 parent aa43d3b commit 8802df4
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
20 changes: 14 additions & 6 deletions docs/quickstart.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,14 @@ One way to process these data would be to call ``qsiprep`` like this::

qsiprep \
/path/to/inputs /path/to/outputs participant \
--output-resolution 1.2 \
--output-resolution X \
--fs-license-file /path/to/license.txt

.. warning::
The above example sets the ``--output-resolution`` to ``X``, where in
real usage this number should be set to a value in millimeters.
See :ref:`output_resolution` for specifics.


Grouping scans
==============
Expand Down Expand Up @@ -53,15 +58,14 @@ Specifying outputs
==================

.. note::
This section covers ``--output-resolution 1.2``, and
This section covers ``--output-resolution X``, and
``--skip-t1-based-spatial-normalization``.

Unlike with fMRI, which can be coregistered to a T1w image and warped to a
template using the T1w image's spatial normalization, the T1w images do not
contain enough contrast to accurately align white matter structures to a
template. For this reason, spatial normalization is typically done *after*
models are fit. Therefore we omit the ``--output-spaces`` argument from
preprocessing: i.e. **no template warping takes place by default**.
models are fit.

All outputs will be registered to the T1w image (or the
AC-PC aligned b=0 template if ``--dwi-only`` was specified) but will have
Expand All @@ -79,15 +83,19 @@ brain graphs. If you want to save ~20 minutes of computation time, this
normalization can be disabled with the
``--skip-t1-based-spatial-normalization`` option.

.. _output_resolution:
Output Resolution and Resampling
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

The ``--output-resolution`` argument determines the spatial resolution of the
preprocessed dwi series. You can specify the resolution of the original data
or choose to upsample the dwi to a higher spatial resolution. Some
post-processing pipelines such as fixel-based analysis recommend resampling
your output to at least 1.3mm resolution. By choosing this resolution here,
it means your data will only be interpolated once: head motion correction,
susceptibility distortion correction, coregistration and upsampling will be
done in a single step. If your are upsampling your data by more than 10%,
QSIPrep will use BSpline interpolation instead of Lanczos windowed sinc
done in a single step. If you are upsampling your data by more than 10%,
QSIPrep will use Linear interpolation instead of Lanczos windowed Sinc
interpolation.


Expand Down
4 changes: 2 additions & 2 deletions qsiprep/interfaces/images.py
Original file line number Diff line number Diff line change
Expand Up @@ -501,8 +501,8 @@ def _run_interface(self, runtime):
resolution_cutoff = 0.9 * np.array(nb.load(input_file).header.get_zooms()[:3])
print(output_resolution, resolution_cutoff)
if np.any(output_resolution < resolution_cutoff):
interpolator = "BSpline"
LOGGER.warning("Using BSpline interpolation for upsampling")
interpolator = "Linear"
LOGGER.warning("Using Linear interpolation for upsampling")
break
self._results["interpolation_method"] = interpolator
return runtime
Expand Down

0 comments on commit 8802df4

Please sign in to comment.