-
Notifications
You must be signed in to change notification settings - Fork 52
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
A new workflow for calculating EPI references #601
Comments
Actually, I'm thinking that the last (BBR) / ANTs could be better addressed outside this particular workflow. For instance, if we want to eventually implement an anatomical-free pipeline (for legacy datasets), then the final alignment to anatomical is not necessary. |
If I'm understanding correctly, this unifies essentially all steps up to T1w registration, which we currently have as estimate reference, run hmc and apply sdc. A few notes:
|
Yes, this seems like a fair description.
Seems very reasonable. Let's start with the maxSNR idea but being mindful that it should be easily replaceable by alternatives.
Yes, the idea is to run single-channel (T1w template) to single-channel (the overall EPI average) registration - and hence, run antsRegistration/bbregister just once. With this question, I think you are pointing at that node with the label "Resample displacements field into each reference and volume", right?
General case: You can skip HMC only under the assumption that, because you are selecting contiguous volumes (hence, little chance for large movements) in the beginning of the scan (hence, the subject is not yet so uncomfortable, less motion), the selected volumes will be aligned (or that HMC is going to actually introduce motion rather than correcting). However, that is not the case in DWI (b=0 references are typically scattered along the sequence), and may not be the case for BOLD - if you don't select just a few volumes. I agree this is something we might want to consider more carefully. That said, the first HMC pass (i.e., intra-run) should be optional and therefore we could set a skip for references selected with the nonsteady state detector code (for instance, to keep it closer to current fMRIPrep's behavior). Directly answering the proposed use-case: I guess I have little to counter-argue. One of the assumptions under the proposed workflow is that you will obtain a session-wise reference of the EPI (one longstanding request from a good bunch of fMRIPrep users), and it seems that use case would advise against parallelizing runs (because you need to ensure all those identical HMC runs will be repeatable to the last bit between processes). Other than that, I guess that running 3dVolReg on the same 5 volumes 5 times is not computationally the end of the world or a big waste. If still interested in the parallelization and worried about replicability across parallel processes, we could recommend those users to use bids-filters for the parallelization so that the EPI references generated are single-run.
Yup, forgot to mention EPInorm here but I definitely had it in mind when sketching out the workflow.
I would add a trivial output that is the same as the list of inputs, but dropping their paths. All the multiple outputs will have the same length so that downstream workflows can select a set of outputs using the Is STC = slice timing correction? If so, this would be the only one I'd take out of the list. AFAIK, DWIs are not corrected for slice timing in general (cc/ @arokem, @garikoitz, @josephmje, @mattcieslak). I might be missing the point of having it here, so please elaborate more. Forwarding a reference to the original EPI series seems like something reasonable that may also help Nipype internal signaling. |
(thanks a lot for the feedback!) |
Reordering for clarity.
No, I'm talking about "Resample all runs into reference grid". In general, fMRIPrep has resampled the references only until a final single-shot interpolation could be done. If this approach requires moving to multiple interpolation steps, I'm not sure it's worth the generalizability. But I don't think it's necessary. As long as we prepare the EPI-T1w registration reference, and keep track of the displacements from the per-run references to that one, then that seems like it's enough. We then concatenate (HMC, SDC, EPI-to-reference, reference-to-T1w, T1w-to-template) as usual.
The point is that fMRIPrep currently does
It appears that what you're describing is running HMC on reference scans only. If that is the case, and we will calculate intra-run HMC elsewhere, then I misunderstood. That will also resolve the HMC/STC issue just discussed, since those will be handled outside this workflow. To try to restate my position clearly: We should run the minimum required HMC in order to effectively calculate the reference volumes. Full-run HMC should either not take place within this workflow (my preference), or we should at least code in such a way that it would not be difficult to add a feature where we perform full-run HMC on only a subset of runs. |
Oh, right. The plan is definitely not using this reference as a source to accumulate transformations, this is fundamentally to have the best reference possible for the alignment to the anatomical image and HM estimation of full-runs (see towards the end of this comment).
Yup, but please note that, as proposed, the workflow does not really resample full timeseries, just the selected volumes to build the reference ("template" if you wish to use a nomenclature consistent to sMRIPrep's). I'm not very sure that missing STC of the selected reference volumes will make a big difference... but it is not undoable, that is true. Regarding the STC problem itself, I'm pretty convinced that allowing 4D transformations in NiTransforms is the best route - especially because the nipy code is a bit out of shape. But even if you resurrect it, you will want to be able to also apply other transforms at the same time.
Yes, here HMC is proposed for only the reference volumes that end up building the "session-template". This "session-template" is then the target for HM estimation of each individual run (we could actually generate a reference without SDC to make this HM estimation easier, otherwise they will be potentially mismatched and there's no need for that).
Yup, confirming this is the actual proposal :) - it is not done in this workflow. |
Currently, this is blocked by the absence of a general solution to the reference generation issue (see nipreps/niworkflows#601). Once adequate DWI references are connected to the estimation workflow, this feature should work out. We can test the new feature with ds000206. Resolves: #111.
This has been quite a high-level discussion, so apologies for taking so long to comment; I've been getting my head around the ideas suggested from across the framework. If I understand correctly, once #602 is merged, then we need to implement it in a workflow that first arranges inputs by phase encoding direction (what is t_RO? read out time?) into a list of lists, which are fed into Then, in a higher-order workflow, the outputs of the rigid registration are passed forward for SDC and registration (either to an anatomical image, or to an EPItemplate in the future case of EPInorm). Have I got that right? The only thing I have to note, is that if we are still using |
This dataset is added to set the ground for testing the new reference calculation workflow (#601). Additionally, I will upload derivatives from fMRIPrep with the objective of setting up some regressions tests for nipreps/fmriprep#2307. Related: #601, nipreps/fmriprep#2307.
@mgxd can you port your prelim work over here (https://github.com/nipreps/nibabies/blob/582d07f530e0c9b33151677f98db9c84c9da4da0/nibabies/workflows/bold/reference.py) and start using #609 for integration testing? I'd do it myself, but I don't want to take credit for your commit - I guess I could override the |
Okay, done! I'll give it a crack. |
This dataset is added to set the ground for testing the new reference calculation workflow (#601). Additionally, I will upload derivatives from fMRIPrep with the objective of setting up some regressions tests for nipreps/fmriprep#2307. Related: #601, nipreps/fmriprep#2307.
Currently, this is blocked by the absence of a general solution to the reference generation issue (see nipreps/niworkflows#601). Once adequate DWI references are connected to the estimation workflow, this feature should work out. We can test the new feature with ds000206. Resolves: #111.
Currently, this is blocked by the absence of a general solution to the reference generation issue (see nipreps/niworkflows#601). Once adequate DWI references are connected to the estimation workflow, this feature should work out. We can test the new feature with ds000206. Resolves: #111.
Currently, this is blocked by the absence of a general solution to the reference generation issue (see nipreps/niworkflows#601). Once adequate DWI references are connected to the estimation workflow, this feature should work out. We can test the new feature with ds000206. Resolves: #111.
With the integration of new modalities (dMRIPrep) and specimens (babies, rodents) we are realizing of two problems with how fMRIPrep generates "BOLDRefs":
Here, I propose to discuss the following workflow to be implemented in niworkflows, to be used by all downstream nipreps:
EstimateReference
modality-agnostic #600 for the manipulation of potential references.Assigning Mathias & @eilidhmacnicol.
Requesting feedback from @effigies, @mattcieslak, @josephmje, @dPys, @tsalo.
The text was updated successfully, but these errors were encountered: