Skip to content
Merged
Show file tree
Hide file tree
Changes from 19 commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/workflows.rst
Original file line number Diff line number Diff line change
Expand Up @@ -568,8 +568,8 @@ A visualization of the AROMA component classification is also included in the HT

.. _bold_t2s:

T2* Driven Coregistration
~~~~~~~~~~~~~~~~~~~~~~~~~
T2*-driven echo combination
~~~~~~~~~~~~~~~~~~~~~~~~~~~
:py:func:`~fmriprep.workflows.bold.t2s.init_bold_t2s_wf`

If multi-echo :abbr:`BOLD (blood-oxygen level-dependent)` data is supplied,
Expand Down
33 changes: 18 additions & 15 deletions fmriprep/interfaces/multiecho.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
>>> os.chdir(datadir)

"""
import os
from nibabel.filename_parser import splitext_addext
import os.path

from nipype import logging
from nipype.interfaces.base import (
Expand All @@ -39,13 +38,22 @@ class T2SMapInputSpec(CommandLineInputSpec):
mandatory=True,
minlen=3,
desc='echo times')
fittype = traits.Enum('curvefit', 'loglin',
argstr='--fittype %s',
position=3,
mandatory=False,
usedefault=True,
desc=('Desired fitting method: '
'"loglin" means that a linear model is fit '
'to the log of the data. '
'"curvefit" means that a more computationally '
'demanding monoexponential model is fit '
'to the raw data.'))


class T2SMapOutputSpec(TraitedSpec):
t2star_map = File(exists=True, desc='limited T2* map')
s0_map = File(exists=True, desc='limited s0 map')
t2star_adaptive_map = File(exists=True, desc='adaptive T2* map')
s0_adaptive_map = File(exists=True, desc='adaptive s0 map')
s0_map = File(exists=True, desc='limited S0 map')
optimal_comb = File(exists=True, desc='optimally combined ME-EPI time series')


Expand All @@ -64,7 +72,7 @@ class T2SMap(CommandLine):
>>> t2smap.inputs.echo_times = [0.013, 0.027, 0.043]
>>> t2smap.cmdline # doctest: +ELLIPSIS
't2smap -d sub-01_run-01_echo-1_bold.nii.gz sub-01_run-01_echo-2_bold.nii.gz \
sub-01_run-01_echo-3_bold.nii.gz -e 13.0 27.0 43.0'
sub-01_run-01_echo-3_bold.nii.gz -e 13.0 27.0 43.0 --fittype curvefit'
"""
_cmd = 't2smap'
input_spec = T2SMapInputSpec
Expand All @@ -77,13 +85,8 @@ def _format_arg(self, name, trait_spec, value):

def _list_outputs(self):
outputs = self._outputs().get()
filename = splitext_addext(os.path.basename(self.inputs.in_files[0]))[0]
out_dir = os.path.abspath('TED.{}'.format(filename))

outputs['t2star_map'] = os.path.join(out_dir, 't2sv.nii')
outputs['s0_map'] = os.path.join(out_dir, 's0v.nii')
outputs['t2star_adaptive_map'] = os.path.join(out_dir, 't2svG.nii')
outputs['s0_adaptive_map'] = os.path.join(out_dir, 's0vG.nii')
outputs['optimal_comb'] = os.path.join(out_dir, 'ts_OC.nii')

out_dir = os.getcwd()
outputs['t2star_map'] = os.path.join(out_dir, 'T2starmap.nii.gz')
outputs['s0_map'] = os.path.join(out_dir, 'S0map.nii.gz')
outputs['optimal_comb'] = os.path.join(out_dir, 'desc-optcom_bold.nii.gz')
return outputs
3 changes: 2 additions & 1 deletion fmriprep/workflows/bold/t2s.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ def init_bold_t2s_wf(echo_times, mem_gb, omp_nthreads,
workflow = Workflow(name=name)
workflow.__desc__ = """\
A T2* map was estimated from the preprocessed BOLD by fitting to a monoexponential signal
decay model with log-linear regression.
decay model with nonlinear regression, using T2*/S0 estimates from a log-linear
regression fit as initial values.
For each voxel, the maximal number of echoes with reliable signal in that voxel were
used to fit the model.
The calculated T2* map was then used to optimally combine preprocessed BOLD across
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ install_requires =
pyyaml
sdcflows @ git+https://github.com/nipreps/sdcflows.git@master
smriprep @ git+https://github.com/poldracklab/smriprep.git@master
tedana >= 0.0.5
tedana ~= 0.0.9a1
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will this pick up 0.0.9? When pinning RCs in the past, we've had to do this manually, i.e.
>= 0.0.9a1, < 0.0.10

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was able to grab 0.0.9a1 in the tests, but I wasn't thinking about 0.0.9. Should I switch to >= 0.0.9a1, < 0.0.10 so it grabs 0.0.9 once it's released, or is it okay to pin to 0.0.9a1?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i would lean towards allowing grabbing a more stable version, but i'm not familiar with tedana's release cycle so whatever you think would be best

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That should be fine. I'm happy to change it.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can always increase/drop the maximum version, thanks!

templateflow ~= 0.6
toml
test_requires =
Expand Down