Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

23.2.0 breaks anat-fast-track on dataset without T1w #3201

Closed
bpinsard opened this issue Jan 13, 2024 · 0 comments · Fixed by #3202
Closed

23.2.0 breaks anat-fast-track on dataset without T1w #3201

bpinsard opened this issue Jan 13, 2024 · 0 comments · Fixed by #3202
Assignees
Labels

Comments

@bpinsard
Copy link
Collaborator

bpinsard commented Jan 13, 2024

What happened?

In the previous versions it was possible to have precomputed anat smriprep output from another dataset being used for a fMRI-only dataset with anat fast-track (with the same participants of course). This is a critical feature for the neuromod dataset.

The full refactor did break that feature, as it run BIDSDataGrabber without passing anat_derivatives

bidssrc = pe.Node(
BIDSDataGrabber(
subject_data=subject_data,
anat_only=config.workflow.anat_only,
subject_id=subject_id,
),
name='bidssrc',
)

raising:
FileNotFoundError: No T1w images found for subject sub-01

As it seems that anatomical_cache can be filled from multiple source derivative folders.

anatomical_cache = {}
if config.execution.derivatives:
from smriprep.utils.bids import collect_derivatives as collect_anat_derivatives
std_spaces = spaces.get_spaces(nonstandard=False, dim=(3,))
std_spaces.append("fsnative")
for deriv_dir in config.execution.derivatives:
anatomical_cache.update(
collect_anat_derivatives(
derivatives_dir=deriv_dir,
subject_id=subject_id,
std_spaces=std_spaces,
)
)

it looks like it would be necessary to check that this cache is complete (likely using the smriprep io_spec.json) to be able to skip the need for T1w by setting bidssrc.inputs.anat_derivatives to anything but None.
Unless the anatomical_cache only needs to contain a minimally preprocessed T1w for the rest of the smriprep workflow to be able to run.

Before I try to fix that, @effigies am I missing anything in the whole fit/apply refactor that could cause it to break somewhere even after such minor changes?
Would that make sense to have an integration test that cover that use-case ( should be simple to implement, using existing test dataset, trying to run with anat fast-track after deleting the T1w from the source BIDS dataset)?

What command did you use?

datalad containers-run -m 'fMRIPrep_sub-01/ses-002' -n bids-fmriprep --input sourcedata/templateflow/tpl-MNI152NLin2009cAsym/ --input sourcedata/templateflow/tpl-OASIS30ANTs/ --input sourcedata/templateflow/tpl-fsLR/ --input sourcedata/templateflow/tpl-fsaverage/ --input sourcedata/templateflow/tpl-MNI152NLin6Asym/ --output . --input 'sourcedata/cneuromod.emotion-videos/sub-01/ses-002/fmap/' --input 'sourcedata/cneuromod.emotion-videos/sub-01/ses-002/func/' --input 'sourcedata/cneuromod.anat.smriprep.longitudinal/sub-01/anat/' --input sourcedata/cneuromod.anat.smriprep.longitudinal/sourcedata/cneuromod.anat.freesurfer_longitudinal/sub-01/ -- -w ./workdir --participant-label 01 --derivatives sourcedata/cneuromod.anat.smriprep.longitudinal --fs-subjects-dir sourcedata/cneuromod.anat.smriprep.longitudinal/sourcedata/cneuromod.anat.freesurfer_longitudinal --bids-filter-file code/fmriprep_study-cneuromod.emotion-videos_sub-01_ses-002_bids_filters.json --output-layout bids --ignore slicetiming --use-syn-sdc --output-spaces MNI152NLin2009cAsym T1w:res-iso2mm --cifti-output 91k --notrack --write-graph --skip_bids_validation --omp-nthreads 8 --nprocs 12 --mem_mb 49152 --fs-license-file code/freesurfer.license \--me-output-echos sourcedata/cneuromod.emotion-videos ./ participant

What version of fMRIPrep are you running?

23.2.0

How are you running fMRIPrep?

Singularity

Is your data BIDS valid?

Yes

Are you reusing any previously computed results?

FreeSurfer, Anatomical derivatives

Please copy and paste any relevant log output.

No response

Additional information / screenshots

No response

@bpinsard bpinsard added the bug label Jan 13, 2024
@bpinsard bpinsard self-assigned this Jan 13, 2024
bpinsard added a commit to bpinsard/fmriprep that referenced this issue Jan 15, 2024
effigies added a commit that referenced this issue Jan 18, 2024
Re-enables the possibility to run fMRIPrep on a fMRI only dataset using anat derivatives from another (anatomical) dataset with the same participant.

Tries to implement integration test for that feature.

fixes #3201 

related to #2201
tsalo pushed a commit to tsalo/fmriprep that referenced this issue Feb 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant