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

Add RIRO and Static masks to realtime zshimming #221

Merged
merged 8 commits into from Feb 22, 2021
Merged

Conversation

po09i
Copy link
Member

@po09i po09i commented Feb 3, 2021

Description

With the goal of improving our realtime zshimming workflow, we can enhance our masking capability. We currently mask the shimming region we want to improve. Adding the ability to mask the riro component and the static component independently would be a nice feature and a lead to further investigations.

This PR adds nii_mask_anat_static and nii_mask_anat_riro to the realtime_zshim() API and appropriately masks the relevant components. The PR also adds mask_riro and mask_static options to the st_realtime_zshim CLI. The relevant tests were modified and the demo shell script was updated.

Linked issues

Fixes #220

@po09i po09i added the enhancement New feature or request label Feb 3, 2021
@po09i po09i self-assigned this Feb 3, 2021
@po09i po09i marked this pull request as ready for review February 3, 2021 21:37
@evaalonsoortiz
Copy link
Member

evaalonsoortiz commented Feb 4, 2021

I am trying to test this out an getting the following error:

The filename for the output mask is: /Users/evaalonsoortiz/Documents/Academic/Postdoc_Julien/Projects/Realtime_zShimming/Data/acdc_123p/rt_zshim_nifti/sub-example/fmap/sub-example_anat_mask.nii.gz
Usage: st_realtime_zshim [OPTIONS]
Try 'st_realtime_zshim -h' for help.

Error: no such option: -m

Note: I'm not using -m as an option in the call to st_realtime_zshim

@po09i
Copy link
Member Author

po09i commented Feb 4, 2021

Can you post the shell call you are using so I can try to reproduce the error

@evaalonsoortiz
Copy link
Member

Can you post the shell call you are using so I can try to reproduce the error

st_prepare_fieldmap "sub-example_phasediff.nii.gz" -mag "sub-example_magnitude1.nii.gz" -unwrapper "prelude" -output "sub-example_fieldmap.nii.gz" -gaussian_filter=True || exit

st_mask box -input "../anat/sub-example_unshimmed_e1.nii.gz" -size 20 20 30 -center 60 32 7 -output "sub-example_anat_mask.nii.gz" || exit

st_realtime_zshim -fmap "sub-example_fieldmap.nii.gz" -anat "../anat/sub-example_unshimmed_e1.nii.gz" -resp "../../../realtime_zshimming_data/PMUresp_signal.resp" -mask_anat "sub-example_anat_mask.nii.gz" -mask_riro "sub-example_anat_mask.nii.gz" -output "." || exit

@jcohenadad
Copy link
Member

@evaalonsoortiz no need for the "" in the syntax (quicker to type without them 😊 )

@po09i
Copy link
Member Author

po09i commented Feb 5, 2021

@evaalonsoortiz There was a typo in the shell script, the option was -mask_anat but it should have been -mask_static. I corrected it and it should work now.

@jcohenadad
Copy link
Member

i didn't realize there was a mix of "-" and "_" in CLI flags. We should stick to "-" only-- can someone pls open an issue @charjl @po09i

@evaalonsoortiz
Copy link
Member

@evaalonsoortiz There was a typo in the shell script, the option was -mask_anat but it should have been -mask_static. I corrected it and it should work now.

Just gave it another go, but still getting the same error ...

@po09i
Copy link
Member Author

po09i commented Feb 15, 2021

@evaalonsoortiz There was a typo in the shell script, the option was -mask_anat but it should have been -mask_static. I corrected it and it should work now.

Just gave it another go, but still getting the same error ...

Problem is now fixed. The error was the one described above here

Copy link
Member

@evaalonsoortiz evaalonsoortiz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested it out, looks good.

@po09i po09i merged commit 1f458a2 into master Feb 22, 2021
@po09i po09i deleted the ad/rtzshim-masks branch February 22, 2021 23:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add masks for RIRO and Static in realtime_zshimming
3 participants