-
Notifications
You must be signed in to change notification settings - Fork 13
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
segmentator does not export gradient image when run with the --nogui option #94
Comments
Hi @torbenelund , Thanks! Indeed this is the behavior. I have been meaning to renovate this project but ended up not having enough time yet. However, recently, I have implemented a gradient magnitude program in LayNii v 2.4.0 : https://github.com/layerfMRI/LAYNII/releases See the release comment:
And thanks to this, I have switched to computing the gradient magnitude using LayNii in cases where I am not using the Segmentator GUI. Let me know if this LayNii v2.4.0 pre-release works for you (I am going to add compiled binaries into the pre-release and turn it into a full release soon). Let me know if this works for you. |
I have ended up uploading the compiled LayNii programs now. You can find |
Excellent, thanks |
Dear Omer
I wanted to try out your gradient approach on MP2RAGE images denonised with various beta values to see if it would be beneficial to use gradient values from an image denonised with one beta, value together with magnitude values from an image denoised with another beta value.
The motivation is that with the regularisation used to create the Robust T1-Weighted image, one effectively trades image homogeneity for SNR. The gradient image should be less affected by bias, whereas the it could be affected by noise (depending on the kernel you use). The magnitude on the other hand is very sensitive to bias (and SNR).
As you can see from the attached histograms (with and without brain masking) It does not seem to be the case that gradient image from one beta performs better with magnitude image from another beta. It is however clear, that the magnitude gets more smeared with higher beta-values (more bias field).
Best
Torben
[2DHistogramsNoBrainmask.pdf](https://github.com/ofgulban/segmentator/files/11679736/2DHistogramsNoBrainmask.pdf)
[2DHistogramsWithBrainmask.pdf](https://github.com/ofgulban/segmentator/files/11679738/2DHistogramsWithBrainmask.pdf)
… Den 7. jun. 2023 kl. 14.05 skrev Omer Faruk Gulban ***@***.***>:
I have ended up uploading the compiled LayNii programs now. You can find LN2_GRAMAG within https://github.com/layerfMRI/LAYNII/releases/tag/v2.4.0 <https://github.com/layerfMRI/LAYNII/releases/tag/v2.4.0>
—
Reply to this email directly, view it on GitHub <#94 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AG3ZCJDOKJM4M54NCNCMNDTXKBVADANCNFSM6AAAAAAY5VKHLI>.
You are receiving this because you were mentioned.
|
Interesting. I think by "beta", you refer to the beta parameter used by O’Brien K.R. et al. (2014) Robust T1-Weighted Structural Brain Imaging and Morphometry at 7T Using MP2RAGE. PLoS ONE 9(6): e99676 DOI:10.1371/journal.pone.0099676 , right?
I would agree with this.
Indeed, the low frequency bias field in the magnitude image is always troublesome for histograms (causes smearing). So it makes sense to me that higher beta leads to stronger bias field which leads to more smeared magnitude x axis.
Gradient magnitude computation with small kernels (e.g. 3x3x3) -in a way- mean-normalize within kernel, so the gradient magnitudes derived from different betas not having much effect on the histograms makes sense to me as well. Maybe tangentially related, in my experience, the largest difference in the histograms (on decently bial-field removed images) arise after doing high spatial frequency focused filtering on the magnitude images. One example is given at Supp. Fig. 5 from Gulban, O.F., Schneider, M., Marquardt, I., Haast, R.A.M., De Martino, F., 2018. A scalable method to improve gray matter segmentation at ultra high field MRI. PloS one 13, e0198335. https://doi.org/10.1371/journal.pone.0198335 ![]() |
Dear Faruk
I have tried to use segmentation to create gradient magnitude images using the command:
which works fine, but when I run it with:
it instead creates a file which I guess is the 2D histogram in some python format I don't know:
Thanks again for your efforts:
Torben
The text was updated successfully, but these errors were encountered: