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
Scout Projection from one hemisphere to another #566
Conversation
I was not aware of this contralateral registration in FreeSurfer, it would be a nice feature to add to Brainstorm! However, it looks like keeping the indices is not needed for projecting the scouts to the contralateral hemisphere: the variable Please move the menu inside "Project to...", with the name "Contralateral hemisphere". Can this option be used in all cases? Does it add significant computation time? When this is merged, we should also edit the tutorials (I'll do that):
Thanks! |
Hello,
Yes, since this is not computed by default it seems very few people know about its existence. I also discovered it quite randomly :) Thank you for having provided a review so quickly :). I think I addressed all the comments. Let me know if you have any other comments on the PR. Out of completeness, I also added the visualization of the sphere.
It has been removed. I think I will open a new PR after this one as I think it might make the importation of other spheres in the future easier. But it's not mandatory for this PR.
Done; I am not sure about how to test for non-cortical sources. I tried to look at the function but_project_scout to see how it was handled but I have not found anything useful.
Yes. According to FS website, it is adding ~1 hour of computation per hemisphere so I think it is reasonable. With the current code, it can be deactivated by specifying -nocontrasurfreg in the options
I think one thing that we will get asked (and that the question I am already facing) is: what steps do we suggest for people who already have a Brainstorm database with source analysis and who would like to use this feature? Computing the sphere can be done outside Brainstorm with : The main question is then how to import them into Brainstorm without breaking already done analysis ? If someone reimport the anatomy with the exact same fiducials; are the previous source-map still valid ? HS: Maybe a less important point; but are you ok with storing those extra spheres in reg.sphereLR? I have the impression that the name sphereLR could be better but I have no better idea. I thought about transforming reg.sphere into a list of spheres with an additional name attribute to differentiate spheres but that might break some existing code. But If you are happy with having another variable in reg; then that's fine :) Edouard |
Do you need this
I'm not sure why this was disabled...
I don't think there would be any workflow that would involve importing more spheres after downsampling the surfaces. This would be too complex to track. What is enforced in the current pipeline is: first you run FreeSurfer, then you import the output in Brainstorm. There is no going back and forth between the two.
By construction, now we shouldn't have spheres if there are non-cortical sources, so ignore this comment.
Messing around with the existing files is not a good idea, this would be calling for trouble, in case the cortex surfaces are not downsampled in the same way. For the general users, I would say that this is not possible and would recommend to reimport the anatomy and restart the analysis. For advanced users, maybe something like:
I thought about renaming it to "SphereContra", but that was not going to be much clearer... |
One thing I don't like much is the modified visualization. Can you please double-check my other modifications? |
No: it was based on another attempt I did using the chemo toolbox. I will recompute a clean version of ICBM to make sure xhemi didn't create any other files. I am not sure about the changes made in 092c006 Otherwise, everything looks good :) I think we should keep:
to make sure contrasurfreg is added to param, even when FreeSurfer is not called from the process
Yes, I think that should work. another way I was thinking was :
Transfert can be done either by simply doing export/import from Matlab; or if it doesn't work by using projection between subjects.
Yes. no problem with me.
Actually, I was wondering if we would not like to preserve the sphere but complete it with NAN for the surface that doesn't have a sphere. The idea is that for cortex_cereb some users might still want to project a scout from the left to the right hemisphere of the cortical surface. Same when projecting from a subject to a template, we can use the sphere for the cortical surface and approximation for the cerebellum. But it can be done in another PR. Especially we would need a function similar to tess_hemisplit but to separate between cerebellum and cortex. |
This is not a standard parameter for people running FreeSurfer recon-all, therefore it would be weird to force it for everybody.
Indeed. And at the moment, the projections to/from It would require some more work to make a cleaner version of this, but at the moment it seems to work, and we can probably leave it like this for now. Is there anything else to change before I merge this? |
Ok. Looks good to me. I just relaunched free surfer on the Template. Will send you the file tomorrow |
Hello Francois, I just realized something weird when reimporting the output of Freesurfer segmentation of ICBM152 template. The head mesh doesn't seem to correspond to the one imported by Brainstorm. If we look at the MRI it seems that it is cut at the nose level, but the head mesh still goes down to the neck. So I was wondering how was the head mesh generated? (top: Freesurfer output and MRI / down: Brainstorm head mesh) |
This is a old surface generated by Matti Hamalainen in MNE-C many years ago. |
Thanks for this great contribution! |
Here is the FS output for ICBM 152: https://drive.google.com/file/d/10YyLnwbwFOgm61UWcERJt7e2WQM6pzy6/view?usp=sharing . Let me know if you would like me to compute the new sphere on other templates. Do you know if the non-truncated MRI can be found somewhere ? it might be better to have it rather than the truncated one. Have a good day :) |
Thanks.
No it doesn't exist. |
Hello Francois, I just made a small script for a collegue to be able to project to the controlateral hemisphere even if the original freesurfer processing didnt include the --contrasurfreg option : https://gist.github.com/Edouard2laire/513d198888642a67e90fdfe73030cb38 The idea is to create a new subject and to import the recomputed freesurfer segmentation with contrasurfreg; then project the scout from the first subject to this new subject, do the controlateral projection before projecting back to the first subject. Seems to work quite well. Btw, you can remove 'Project from one hemisphere to the other using registered spheres/squares (http://neuroimage.usc.edu/forums/t/how-to-create-mirror-roi-in-the-other-hemisphere/5910/8)' from the todo list now :) Edouard |
This makes complete sense. Let's link this to this other forum post:
Done, thanks! |
@Edouard2laire https://www.mail-archive.com/freesurfer@nmr.mgh.harvard.edu/msg73768.html |
Hello, I am using Freesurfer 6.0.0. I didn't saw anything in the release about removing the option: https://surfer.nmr.mgh.harvard.edu/fswiki/ReleaseNotes . Can you run recon-all --help and check if you still have : " Same as ipsilateral but registers to the contralateral atlas. |
Hello Francois, I attached the script that is executed when running Freesurfer on my computer. Espetially the interesting lines are:
Can you try to execute the following:
You can also check if this file: /average/rh.folding.atlas.acfb40.noaparc.i12.2016-08-02.tif also exist in FreeSurfer7 folder (maybe not?). They seems to exist on my version:
Link to mris_register: https://surfer.nmr.mgh.harvard.edu/fswiki/mris_register it's a tool for surface to template coregistration :) |
I tried to anwser in the FS list but in case it didn't worked: Hello Francois, It seems that the option was removed in 2019 in this commit: freesurfer/freesurfer@c827a2d . I am curious to know the reason for this removal. I guess the sphere can still be obtained manually using mris_register : Edouard |
This solution seems to be working well with FreeSurfer 7.X ! The discussion on the FreeSurfer mailing list doesn't seem to go anywhere. I tried with Xhemi, but it doesn't work well. I'll need some more time to finish a new ICBM152 template, as I realize there are a lot more issues to bring everything in the current ICBM152 space in Brainstorm (the MRI dimensions are not 256x256x256...) |
Hello :)
Yes; i followed the conversation (not sure still on how to contribute to the discussion in FS mailing list though). I would love to know the reason why he is saying it was a bad idea.
Yes; i also tried Xhemi when i started to investigate this but was also not very convinced by the resutls.
Which MRI are you using? Also, I think one of the first steps of recon-all is to move the MRI to free-surfer space (resampling the MRI at 1x1x1 mm resolution and 256x256x256 matrix I recently came across a website called Template Flow that is used by fMRIprep (https://fmriprep.org/en/stable/spaces.html) for their template: https://www.templateflow.org and it seems there is multiple version of the ICBM template. Do you think we should propose them all in Brainstorm ? From MNI website (https://www.bic.mni.mcgill.ca/ServicesAtlases/ICBM152NLin2009) it seems there is actually multiple version of the ICBM template; so it might be good anyway to clarify which one we are using :) Actually, it seems there is an extended version of the ICBM atlas with the neck : https://nist.mni.mcgill.ca/icbm-152-extended-nonlinear-atlases-2020/ Edouard |
It would have been interested too, but I guess we'll never know.
I've been using the T1 ICBM152 2009c: https://www.bic.mni.mcgill.ca/ServicesAtlases/ICBM152NLin2009
The documentation is quite explicit:
No. The differences between these models are much smaller than what we care about in non-invasive imaging.
Yes, but I'd like to keep the original MRI size for optimization reasons: lots of display and computation functions would work much faster if the volume has 50 less voxels in each direction. And the Brainstorm package would be smaller. |
Indeed but then why use the asymmetric version and not the symmetric one? :)
Then maybe the extended version with the neck might be a good option :)
Maybe https://surfer.nmr.mgh.harvard.edu/fswiki/FsAnat-to-NativeAnat can help. However, this is in contradiction with the rest of the software that seems to prefer to have the MRI in the FS space (ie when we import a folder from FreeSurfer). Or we should have the option when importing / computing segmentation using FreeSurfer to import MRI / segmentation in FS space or in native space ? |
Because most of the other programs using the ICBM152 2009c templates are using the asymmetric ones.
There is no ICBM152 2009c volume including a neck. |
I'm finally moving forward... It is not part of the Brainstorm main distribution yet, but it will be soon. In the meantime, you can set a subject to use it manually: update Brainstorm, then right-click on a subject (or the default anatomy) > Use template > MNI > ICBM152 2022. DO NOT DO THIS ON A EXISTING PROTOCOL! |
I wrapped up the projection between hemispheres through the anatomy template: The last thing I need to do is to update the ICBM152 template in the Brainstorm distribution. I'll work on this soon. |
Great. Thanks a lot ! |
Hello,
This PR is here to implement the scout projection from one hemisphere to another using FreeSurfer Sphere (https://surfer.nmr.mgh.harvard.edu/fswiki/recon-all#ContralateralSurfaceRegistation.28SphericalMorph.29.28-.3Cno.3Econtasurfreg.29) .
The changes are the following :
Importation from FreeSurfer:
Projection of scout
This example show projection of the red scout from right to left :
NOTE:
By default, rh.lh.sphere.reg and lh.rh.sphere.reg doesn't seems to be computed. -contrasurfreg needs to be specified when launching FreeSurfer. If a subject is already analysed using FreeSurfer, it is possible to relaunch only -autorecon3 (eg :
recon-all -subjid subjid -autorecon3 -contrasurfreg [+ OPTIONS]
It might be possible to achieve this by only calling "mris_register"; but I haven't found how to yet :)
NOTE 2:
Here is the FS folder of the subject (ICBM512) if you want to do some tests without needing to launch FreeSurfer:
https://drive.google.com/file/d/1X2gwZP-gUfycOwJWoyQ-ZZGkUXAA1vyN/view?usp=sharing
Regards,
Edouard