Skip to content

Commit

Permalink
Keep working.
Browse files Browse the repository at this point in the history
  • Loading branch information
tsalo committed Jan 2, 2025
1 parent 83fd5fa commit 86dcbb8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/fmripost_phase/data/io_spec.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"queries": {
"raw": {
"bold_raw": {
"magnitude_raw": {
"datatype": "func",
"echo": null,
"part": "mag",
Expand All @@ -21,7 +21,7 @@
".nii"
]
},
"bold_norf": {
"magnitude_norf": {
"datatype": "func",
"echo": null,
"part": "mag",
Expand Down
15 changes: 10 additions & 5 deletions src/fmripost_phase/workflows/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ def init_single_subject_wf(subject_id: str):
allow_multiple=True,
spaces=None,
)
subject_data['bold'] = listify(subject_data['bold_raw'])
subject_data['bold'] = listify(subject_data['magnitude_raw'])
else:
# Derivatives dataset only
config.loggers.workflow.info('Derivatives-only workflow mode enabled')
Expand Down Expand Up @@ -333,7 +333,7 @@ def init_single_run_wf(bold_file):
)

# TODO: Calculate motion parameters from motion correction transform
raise ValueError('Motion parameters cannot be extracted from transforms yet.')
raise NotImplementedError('Motion parameters cannot be extracted from transforms yet.')

config.loggers.workflow.info(
(
Expand All @@ -354,15 +354,20 @@ def init_single_run_wf(bold_file):
skip_vols = get_nss(functional_cache['confounds'])

validate_bold = pe.Node(
ValidateImage(in_file=functional_cache['bold_raw']),
ValidateImage(in_file=functional_cache['magnitude_raw']),
name='validate_bold',
)

phase_buffer = pe.Node(
niu.IdentityInterface(fields=['phase', 'phase_norf']),
name='phase_buffer',
)
if ('norf' not in config.workflow.ignore) and ('phase_norf' in functional_cache):
has_norf = (
('norf' not in config.workflow.ignore) and
('phase_norf' in functional_cache) and
('magnitude_norf' in functional_cache)
)
if has_norf:
from fmripost_phase.interfaces.complex import ConcatenateNoise, SplitNoise

# Concatenate phase and noRF data before rescaling
Expand Down Expand Up @@ -413,7 +418,7 @@ def init_single_run_wf(bold_file):
niu.IdentityInterface(fields=['magnitude', 'phase', 'magnitude_norf', 'phase_norf']),
name='thermal_denoise',
)
thermal_denoise.inputs.magnitude_norf = functional_cache['bold_norf']
thermal_denoise.inputs.magnitude_norf = functional_cache['magnitude_norf']
workflow.connect([
(validate_bold, thermal_denoise, [('out_file', 'magnitude')]),
(phase_buffer, thermal_denoise, [
Expand Down

0 comments on commit 86dcbb8

Please sign in to comment.