image origin on z axis

image origin on z axis  

  By: valentina.giannini on July 27, 2022, 1 p.m.

Hi, I've noticed some issues regarding the z origin. I'm trying to automatically upsample and crop T2w and adc images using information on spacing and origin. Everything works fine with x and y axis, while something wrong happens on z-axis. For example in patient 10005 T2 origin is = -115.1, -76.8334, 1.15233, while ADC origin is = -103.1, -108.567, 5.27379. If you look at z origin, it seems that ADC image starts after one slice (z resolution is 3 mm), however if you look at the images they are perfectly aligned based on the number of slices rather than based on position. I hope I made myself clear enough, but how we should analyse images? Should we considered t2w and adc images aligned along the z-axis regardeless the real position is or should we use the physical coordinate?

Thank you very much, bests valentina

Re: image origin on z axis  

  By: joeran.bosma on July 27, 2022, 2:09 p.m.

Hi Valentina,

I've checked out the case you reference, 10005_1000005. When opening this case in ITK-SNAP, the T2-weighted imaging and ADC map line up perfectly. Each slice has a one-to-one correspondence between these two scans, as you observed as well. ITK-SNAP takes the physical origin into account (if you load a scan from a different patient study, it is often completely out of view.), so this means that both images are actually perfectly aligned despite the different physical origins.

I would like to point out that prostate MR acquisitions are typically in an oblique axis system (including case 10005_1000005). This means that maths with the exact coordinates is tricky. Additionally, the origin of a scan is not in the centre, but rather one of the corners (I forgot which one). At least for this case, the field-of-view is different between the T2-weighted and ADC map, meaning that the origins are not close to each other. I think these properties (oblique axis system + difference in field of view) are the reasons behind the difference in origins, while being well-aligned in e.g. ITK-SNAP. I must say, though, that I'm not very familiar with interacting with the physical properties directly.

I would advice to employ tools such as SimpleITK to perfom upsampling etc. This ensures that the physical metadata is handled and propagated correctly. We employ this for example in the picai_prep preprocessing. During the MHA Archive → nnU-Net Raw Data Archive preprocessing we resample the images to a shared spacing and field of view and optionally perfom a centre crop. We also provide additional instructions on resampling and performing a centre crop in the context of PI-CAI in the U-Net baseline instructions.

Hope this helps, Joeran

 Last edited by: anindo on Aug. 15, 2023, 12:57 p.m., edited 1 time in total.