nipreps / sdcflows

Susceptibility Distortion Correction (SDC) workflows for EPI MR schemes
https://www.nipreps.org/sdcflows
Apache License 2.0
32 stars 26 forks source link

`init_3dQwarp_wf` expects input that is missing from inputnode #441

Open psadil opened 6 months ago

psadil commented 6 months ago

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_
effigies commented 6 months ago

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.

psadil commented 6 months ago

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 commented 5 months ago

Aim is to have init_3dQwarp_wf outputs match the outputs from init_topup_wf