sdcflows icon indicating copy to clipboard operation
sdcflows copied to clipboard

`init_3dQwarp_wf` expects input that is missing from inputnode

Open psadil opened this issue 1 year ago • 3 comments

What happened?

I was attempting to configure a workflow with init_3dQwarp_wf but was unable to get it to run. As I understand it, this may be an issue with the workflow expecting inputnode to provide in_reference

https://github.com/nipreps/sdcflows/blob/245648997022fabcfa218a3eb4716d7f304ba645/sdcflows/workflows/fit/pepolar.py#L384-L385

but also that inputnode is not looking for in_reference https://github.com/nipreps/sdcflows/blob/245648997022fabcfa218a3eb4716d7f304ba645/sdcflows/workflows/fit/pepolar.py#L295-L297

What command did you use?

from pathlib import Path

from sdcflows.workflows.fit import pepolar

afni_wf = pepolar.init_3dQwarp_wf(omp_nthreads=1, name="qwarp")
afni_wf.base_dir = Path.cwd()
afni_wf.inputs.inputnode.in_data = [
    "sub-travel2_dir-AP_epi.nii.gz",
    "sub-travel2_dir-PA_epi.nii.gz",
]

afni_wf.inputs.inputnode.metadata = [
    {"PhaseEncodingDirection": "j-"},
    {"PhaseEncodingDirection": "j"},
]

afni_wf.run()

# now try adding in_reference
afni_wf.inputs.inputnode.in_reference = "sub-travel2_dir-AP_epi.nii.gz"

What version of the software are you running?

2.8.1

How are you running this software?

Local installation ("bare-metal")

Is your data BIDS valid?

Yes

Are you reusing any previously computed results?

No

Please copy and paste any relevant log output.

First attempt at running

AttributeError: 'DynamicTraitedSpec' object has no attribute 'in_reference'

Attempt at adding in_reference

AttributeError: 'NoneType' object has no attribute 'set_input'


### Additional information / screenshots

_No response_

psadil avatar May 23 '24 15:05 psadil

Looks like that's been there since the beginning: https://github.com/nipreps/sdcflows/commit/368bbc04ce1c7c3f04b1bb206cd3c1dd36eb9648

So this is an untested workflow. I guess I would just add in_reference to the inputnode and pass an appropriate reference. I'm not sure which direction is assumed to be the reference, but you could probably guess and check.

effigies avatar May 23 '24 16:05 effigies

I'm a bit confused; is this workflow aiming to unwarp one of the elements of in_data or some other epi that is referred to by in_reference? It looks like it's designed to treat as a reference whichever file is first in in_data, based on this sort_pe node, but I'm not sure whether that's the one that should be unwarped.

FWIW, this is a version of the 3dqwarp workflow back when it was used by fmriprep

psadil avatar May 23 '24 16:05 psadil

Aim is to have init_3dQwarp_wf outputs match the outputs from init_topup_wf

psadil avatar Jun 22 '24 00:06 psadil