-
Notifications
You must be signed in to change notification settings - Fork 294
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
FIX: ME | Revise SDC compute graph #2610
Conversation
Although I brought up the issue within #2530 and got some mildly opposed initial opinion from @effigies (#2530 (comment)), I've come to think that we should provide the T2star workflow with HMC'ed and SDC'ed echos (confirmation awaiting: #2608 (review)). This comes as an issue related to #2606. This PR proposes that individual echoes are HMC'ed (and SDC'ed when fieldmaps are available) before calculating the optimal combination and the T2star map. I believe this may be beneficial when we combine SDC with modulation by the Jacobian of the distortion (nipreps/sdcflows#238) because that might help restore some (little, admittedly) of the dropout of the later echoes in distorted regions. I would expect more voxels will be deemed as acceptable for the exponential fitting for this reason. It also conceptually simplifies a little, as both SE and ME paths look more alike, and only the little hacks to generate ME iterables and the ``boldbuffer`` are now necessary. Otherwise, SDC would be inserted at a much later stage for ME only.
From @tsalo in #2542 (comment):
|
Sorry, I was unaware of the conversation. Moving it there. |
The BOLD-T1w coregistration is degraded off master: https://3017-53175327-gh.circle-artifacts.com/0/tmp/ds210/derivatives/fmriprep/sub-02.html#datatype-figures_desc-summary_run-1_suffix-bold_task-cuedSGT Do we need to clear a cache? |
It's possible that it's just that. This problem is what I meant before by needing to revise the generation of the reference. With the original ds210 from ON registration is fine |
b67636b was in response to the error:
Possibly setting |
Turns out that our bold-to-bold resampling workflow has fake inputs and outputs called ``bold_mask``. That made me believe that, if we were joining the bold echoes from the bold-to-bold resampling workflow, we could do the same with the mask. Looking into this in depth made me realize of the confusing i/o spec of the workflow, and also of the fact that it is unnecessary to join anything in the absence of fieldwarp because the mask is the same you calculated with the initial boldref. So I connected that one and locally seems to be functioning okay. Hopefully, this was the last bit of this not-so-trivial attempt to organize the ME-EPI pathway. I'm already shaking by thinking at some point we will need a similar in-depth revision of the SBRef dealings...
Actively working on this - please do not push more commits |
Alright, I had to do this nipy/nipype#3395 in order to find out this: fmriprep/fmriprep/interfaces/multiecho.py Line 59 in 32f7b06
( Basically, our T2map interface fails always if given a mask file. |
c9b15dd
to
7fc382e
Compare
Okay, this is working locally. Perhaps, the final question before going ahead (should tests be all green) is the following: Here I'm connecting a brain mask into the tedana node:
|
boldbuffer = pe.Node(niu.IdentityInterface(fields=["bold_file", "name_source"]), | ||
name="boldbuffer") | ||
if multiecho: | ||
boldbuffer.synchronize = True |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I forget what this does. Can look it up when there's time, or if you want to say a quick word?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup. Because boldbuffer
now has two fields, and both are iterable, synchronize = True
preempts the dot product of the values of the two iterable inputs.
Yes. However, I think we should merge this and come back to the mask at a later time. We might want to calculate the final boldref from the optimal combination of echos to open a window into the OC. We will probably need a simplified calculation (perhaps just the robust average without running hmc, as the echos were HMC'd already). Because these changes seem a bit involved, we are probably better not including them here. WDTY? |
Let's go for it |
Although I brought up the issue within #2530 and got some mildly opposed initial opinion from @effigies (#2530 (comment)), I've come to think that we should provide the T2star workflow with HMC'ed and SDC'ed echos (confirmation awaiting: #2608 (review)).
This comes as an issue related to #2606.
This PR proposes that individual echoes are HMC'ed (and SDC'ed when fieldmaps are available) before calculating the optimal combination and the T2star map.
I believe this may be beneficial when we combine SDC with modulation by the Jacobian of the distortion (nipreps/sdcflows#238) because that might help restore some (little, admittedly) of the dropout of the later echoes in distorted regions. I would expect more voxels will be deemed as acceptable for the exponential fitting for this reason.
It also conceptually simplifies a little, since both SE and ME paths look more alike, and only the little hacks to generate ME iterables and the
boldbuffer
are now necessary. Otherwise, SDC would be inserted at a much later stage for ME only.