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

ENH: Implement Jacobian weighting during unwarp [backport gh-391] #397

Closed
wants to merge 1 commit into from

Conversation

effigies
Copy link
Member

@effigies effigies commented Oct 4, 2023

Slightly different shaping than in the latest master, but I believe this is the equivalent. It would be good to get a test. @themeo would you be able to test? If you're using fmriprep-docker, it's pretty easy:

$ git clone https://github.com/effigies/sdcflows.git
$ git -C sdcflows checkout bp/2.5.x/391
$ pipx run "fmriprep-docker==23.1.4" [usual arguments] --patch sdcflows=$PWD/sdcflows/sdcflows

This will mount the sdcflows directory into the correct location to be picked up by fMRIPrep.

@themeo
Copy link

themeo commented Oct 4, 2023

I'd be happy to give it a spin, but our cluster doesn't have docker (we use singularity). Is it possible to put the patched version together using singularity?

@effigies
Copy link
Member Author

effigies commented Oct 4, 2023

Yes, it's just a little bit less automated. You'll need to add the following flag to your binds, before the image:

-B $PWD/sdcflows/sdcflows:/opt/conda/envs/fmriprep/lib/python3.10/site-packages/sdcflows

You can replace $PWD/sdcflows with the full path to wherever you clone the repository. Note that on the left side of the colon sdcflows should appear twice, like sdcflows/sdcflows:...

@themeo
Copy link

themeo commented Oct 5, 2023

This fix led to a dramatic improvement in how fmriprep handles SDC.

original raw bold:
image

topup/applytopup on the raw image:
image

fmriprep with the fix:
image

This is not an entirely clean comparison, as the fmriprep-processed image has also undergone motion correction etc.

Congrats on cracking this!

@amirhusseinab
Copy link

Thanks for the fix! The boldref is SDCed now, but the T1w and MNI space outputs are still extra-distorted. Is it because the pipelines are not totally merged? PE-dir is RL, SDC with PEPOLAR.
Raw bold:
image

fmriprep 23.1.4. "vannila" boldref:
image

fmriprep 23.1.4. SDC-fixed boldref:
image

fmriprep 23.1.4 vannila and SDC-fixed T1w space boldref:
image

@effigies
Copy link
Member Author

effigies commented Oct 5, 2023

This is a good point, this will currently only affect files resampled into boldref space, since the resampling to other spaces is handled differently. I'm currently working on a tool that will resample directly to any volumetric space, but that will only be available with fmriprep 23.2.

@effigies
Copy link
Member Author

effigies commented Nov 9, 2023

This will need to wait for a later fMRIPrep.

@effigies effigies closed this Nov 9, 2023
@effigies effigies deleted the bp/2.5.x/391 branch November 9, 2023 16:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants