How to project the MRS location to the MNI template

Hi,
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.
PastedGraphic-2

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)

Best,
Meng-Yun

Hi @Wang,

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).

Best,
Helge

Hi @Helge,

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?

Thanks!
Meredith

Hi @Helge,

Thank you for your answer. But I still have some questions:

  1. I encountered the same issue as @Meredith described, I ran all the steps, but the overlapfile was not created. Any reasons for this?
  2. 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?)
  3. After loading the data, can Osprey extract the info about how many repetitions in the MRS data and how long the data is?

Thank you!

Best,
Meng-Yun

Hi @Wang,

  1. That is strange. Are you sure that you have deleted all old SPM results before running it? I’ll double-check on my side if there could be any other reason why it is not created.
  2. If the OspreySeg is working correctly it will already produce the MRS voxel in MNI space. This is used to generate the overlap plot.
  3. Yes - Osprey automatically extracts the header information including the number of averages and the number of points.

Best,
Helge

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.

1 Like

Hey both,

I have just updated the develop branch (GitHub - schorschinho/osprey: All-in-one toolbox for processing of magnetic resonance spectroscopy data.) to include the fix.

Best,
Helge

1 Like

Thanks @Helge! And thank you @Wang for posting about it!

Hi,

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!

Best,
M.Y.

2 Likes

Hi @Helge,

A minor correction for GitHub. Both the PreFix in that line should be PreFixMask:

PreFixMask = [PreFixMask '_'];

Sorry I wasn’t clearer.

Thanks!
Meredith

2 Likes