I’m not sure why Osprey (or SPM?) places the mask in the wrong place- and it only happens to two particiapants. Any advice on why this could be happening?
Hi Julia,
is it measured with a Siemens Scanner? Which version?
Have you used fixed table position?
What I could most likely imagine is that there has been a change in the table position and this is stored in a different position than the one used in the Osprey script.
Yes, it’s Siemens Magnetom Prisma 3T. The software versions for my data are both syngo MR XA30 and syngo MR E11. The errors for both scans are for files recorded with the new (latter) version of the software.
I don’t know what table position we use. When you say change in table position do you mean between the anat and mrs scans? Is that something I can check by looking at the sidecar metadata? I uploaded one sidecar file in case that might help; (I’m having issues with accessing the private tags in the new software version, which is why so many don’t have names).
Hi Julia,
have you had a fixed table position between your anatomical scans and the spectroscopy (in the isocenter) or has the table been moved between the measurements? In the coregistration script (osprey/coreg/coreg_siemens.m at develop · schorschinho/osprey · GitHub), in line 60f a change in the table position is taken into account. For Twix files, I see that Osprey reads in this value, but I can’t see it for rda. Also when I look in some files I see this field in twix, but not in rda. I don’t know if rda considers this in another way. Which format have you used? From your file, I would say that your table was repositioned by 43mm (see tag (0021,105f) ‘TP H43’ (TP Table positioning?), from dicm2nii/dicm_dict.m at master · xiangruili/dicm2nii · GitHub this text should be RelativeTablePositionText). I see the same number in the tag (0021,105d) , (0021, 1059) and (0021, 1005). When you add these 43mm in head direction, the voxel positioning could be better.
I don’t think the table moved betweet anatomical and MRS scans. My MRS data is a Siemens dicom scan, which wasn’t in the Osprey job file examples, so I just adapted them as best as I can. For anatomical images I use dicom files that were coverted to nifti. You can examples of the MRS data here, including sidecar file.
In the MRSCont.raw{1,27}.geometry.pos file I can only see the PosCor, PosSag, PosTra values (no TablePosTra field), so it would mean that in line 60 of the code it doesn’t use the table position values for calculating VoxOffs.
I couldn’t find any of the tags you mentioned. I’ve been having problems with accessing private and CSA headers for my data (see the linked repo), so I wonder if it’s possible that Osprey might not be able to access some of the tags? Although then I’d expect to see this problem for more than 2 participants.
Can you try converting your MRS data to NIfTI-MRS (with wtclarke/spec2nii: Multi-format in vivo MR spectroscopy conversion to NIFTI (github.com)) and see if the voxel mask it generates looks better? I can’t rule out that our DICOM co-registration routine is indeed missing a private header field - we haven’t seen that much Siemens DICOM data over the years tbh.
Hi Julia,
what was the ‘positioning mode’ (System → Misc.) for your measurement? For example, with ‘ISO’, the table positioning don’t have to be the same. In the dicom tag (0021,1059) I have a table position of 45mm for proband 217 and 22mm for proband 223 (you get these information for example in Matlab with dicominfo → .PerFrameFunctionalGroupsSequence.Item_1_Private_0021_10fe…). Maybe @admin 's suggestion will be a good step. Also a .json header from proband 217/223 would be interesting to see the differences between dicom and nifti format.
I just re-run the analysis with nifti data. I used the exact same job file, only changed the paths, so that nifti rather than dicom files are selected. I got to the segmentation stage and I got this error message:
Timestamp October 07, 2024 18:02:55 Osprey 2.8.1 OspreyCoreg
Coregistering voxel from dataset 27 out of 27 total datasets...
... done.
Elapsed time 125.571671 seconds
Timestamp October 07, 2024 18:05:07 Osprey 2.8.1 OspreySeg
Vendor not supported. Please contact the Osprey team (gabamrs@gmail.com).Error using OspreySeg
Vendor not supported. Please contact the Osprey team (gabamrs@gmail.com).
I never got this error before. Is it because Siemens nifti data is not supported?
The good news is that the voxel masks are in the same location as the original mrs file- so the coordinates are not shifted anymore.
Hi Julia,
can you check the field ‘manufacturer’ in the .json file. If it is not ‘siemens’, in osp_LOADNII MRSCont.vendor will be set to ‘NIFTI’ and this results in your error.
I checked the .mat file (I assume .json is only when you use the GUI?) and the vendor field is empty and datatype is ‘NIfTI-MRS’.
I tried setting it manually by typing MRSCont.vendor='Siemens' and then running OspreySeg again, which did work- I didn’t get the above error, but then it’s as if Osprey doesn’t see the segmentation files it created and after OspreyQuantify I don’t get any partial-volume corrected results
Hi Julia,
I’m a little confused. For your proband 223, in the dicom file you have at (0021,1059) (0,0,22) and in the sidecar file (0,0,43) and in other fields, there are also differences. Are these two different measurements? In the sidecar, I have a studydate of 20240703 and in the dicom header 20240626.
Hi Heiner,
sorry, yes these are two different scans. I should have selected MRI2, not MRI1 (as MRI2 is the one I mentioned is having issues with voxel placement).
I have managed to run it with nifti files recently but with some workarounds.
I select no PDF output in the job file (per errors mentioned here)
I have to specify the basis file, because unlike with dicoms it can no longer identify the right one automatically.
When it gets to coregistration and segmentation I get an error about unknown vendor so I just type MRSCont.vendor = 'Siemens'; in the terminal and then I continue running the script with:
Hi Julia,
good to hear that you have found a solution. The interesting difference between NIfTI and DICOM is the mid slab position. For DICOM, you have [8.18,-87.9,-30.4] and for NIfTI [8.18,-87.9,12.6]. When you convert your data from DICOM to NIfTI, the table position has been taken into account. To your third point, your manufacturer in the sidecar is ‘Siemens Healthineers’, but the data will only be loaded correctly if the manufacturer is ‘siemens’ (see osp_LoadNII line 250). That should be easy for the Osprey team to solve (@admin,@Helge). You can also try to replace ‘siemens’ with {‘siemens’,‘Siemens Healthineers’} to solve this problem for your own.