I wonder how I can project the MRS voxel to the MNI space with Osprey?
If I provide the anatomical image in native space, then they align perfectly. But if I provide the anatomical image in MNI space, then they misalign where the MRS voxel is still in native space instead of normalizing to the template.
Another thing, after the processing, I can not use the osp_plotVoxelOverlap function because the overlapfile does not exist. What did I miss in the job file? Thank you! (Osprey 2.4.0 with Matlab2022b)
Thanks for reaching out.
If you want to use the
osp_plotVoxelOverlap function you have to run the following steps:
MRSCont = OspreyJob('PathToYourJob.m');
MRSCont = OspreyLoad(MRSCont);
MRSCont = OspreyProcess(MRSCont);
MRSCont = OspreyCoreg(MRSCont);
MRSCont = OspreySeg(MRSCont);
or the equivalent GUI buttons.
In the jobfile you should include the MRS data and T1 images in subject space. And you have to make sure that there are no SPM segmentation results from a prior SPM/Osprey analysis in the output folder.
Afterward, you should be able to run the
osp_plotVoxelOverlap function. See more details about options for this function in this post (Osprey Voxel Overlap Heatmap Problem).
I ran all the steps you listed, but when running osp_plotVoxelOverlap, I get the error
Unrecognized field name "overlapfile".
Any idea why the overlap image is not created?
Thank you for your answer. But I still have some questions:
- I encountered the same issue as @Meredith described, I ran all the steps, but the overlapfile was not created. Any reasons for this?
- How can I report the MRS voxel in the MNI coordinate with Osprey? (Maybe the normalization process can be integrated into the next version of Osprey?)
- After loading the data, can Osprey extract the info about how many repetitions in the MRS data and how long the data is?
Looks like @Wang and I are having similar issues with OspreySeg. I ran a few subjects with a debug breakpoint at line 491 of OspreySeg, and the DeformField value was 0, so the overlap image is not being created. Stepping through OspreySeg, I think the issue is at line 294: should PreFix be PreFixMask?
If you run those subjects do you actually see the SPM segmentation being run by looking at the console? And are the files with ‘_spm12-transforamtion_field’.nii actually created in the Output folder?
Yes, the segmentation runs and outputs the transformation field. The voxel masks and seg maps are created for each subject, but the MNI voxels and the overlap voxel are not created. I changed line 294 to PreFixMask and re-ran the subjects (deleted the old segmentation first), and it generated the voxel overlap image and the individual subjects’ MNI voxel images.
Thanks for figuring that out! I guess this slipped my testing case because I usually have fully BIDSified data and don’t end up in this part of the if statement.
Thanks @Helge! And thank you @Wang for posting about it!
The solution works like a charm! You guys made my day!
Thank you @Meredith for figuring this out, and thank you @Helge for your answers!
A minor correction for GitHub. Both the PreFix in that line should be PreFixMask:
PreFixMask = [PreFixMask '_'];
Sorry I wasn’t clearer.