fmriprep icon indicating copy to clipboard operation
fmriprep copied to clipboard

Track immediate `Sources` when possible

Open tsalo opened this issue 1 year ago • 6 comments

What would you like to see added in fMRIPrep?

  1. Standard-space and T1w-space outputs do not include Sources.
    • The Sources should probably be the boldref-space outputs, when those are requested. Otherwise, they should include the original data, the HMC transforms, the coreg transforms, the ref2anat transform, and the anat2std transform.
  2. Echo-wise outputs do not include Sources.
    • The echo-wise datasinks are wrapped in a MapNode. DerivativesDataSinks cannot iterate over metadata fields (e.g., Sources), so we need to compile the meta_dict beforehand. This has come up a lot in XCP-D, so I've been working on an interface that can handle it (see GenerateMetadata in https://github.com/PennLINC/xcp_d/pull/1104).
  3. Surface files don't seem to include Sources.

Do you have any interest in helping implement the feature?

Yes

Additional information / screenshots

No response

tsalo avatar Mar 25 '24 14:03 tsalo

@effigies do you think it would be worth it to try incorporating the TemplateFlow templates into the DatasetLinks and Sources?

tsalo avatar Mar 28 '24 21:03 tsalo

Yes, I think including templateflow would be very helpful both for sources and spatial references.

effigies avatar Mar 29 '24 22:03 effigies

Want to note that from-orig_to-boldref_mode-image_desc-hmc_xfm.txt isn't in the Sources.

from-boldref_to-auto00000_mode-image_xfm.txt isn't either, but I can't tell if that's accounted for by including from-boldref_to-T1w_mode-image_xfm.txt in the Sources. @effigies do you know? If orig-to-boldref, boldref-to-fmap and boldref-to-T1w are all strung together, then I think boldref-to-T1w might be mislabeled.

tsalo avatar Apr 01 '24 17:04 tsalo

Each of these is an atomic transform. orig-to-boldref + boldref-T1w are strung together to get the individual volume there, but boldref-to-fmap is used to transform the fieldmap into the boldref space and calculate a voxel-shift-map. We do not save the VSM, so it would be appropriate to include both the fieldmap and the transform as inputs. The exact provenance would be better modeled using prov.jsonld.

effigies avatar Apr 01 '24 17:04 effigies

Ah, thanks! I think SDCFlows will need to pass its fmap file from its derivatives workflow in order to use it as a source in fMRIPrep.

tsalo avatar Apr 01 '24 18:04 tsalo

I'd forgotten about this and opened #3534. I made it a sub-issue so it's linked prominently.

effigies avatar Sep 26 '25 16:09 effigies