-
I have some images created from a different program that only produces the old analyze format (paired .hdr/.img, and lacking the orientation info in the header). When I read them into ITKSNAP, it displays them flipped superior-inferior and anterior-posterior (also with the voxel dimensions rounded off - but I know how to correct that). I've tried to flip these by using ITKSNAP's Reorient Image, after which in ITKSNAP they appear to be correctly oriented. However, when I save these out and read them back in over the original images (read in from dicoms, and for which I know the orientation is correct), ITKSNAP reports that "These images have different orientation. ITKSNAP will ignore the header in the image you are loading". Investigating the headers using ANTS PrintHeader, it seems that ITKSNAP simply changes "Direction Cos Mtx." from: to: But when these images are read in over the original images (which have the Direction Cos Mtx values of the first example above), ITKSNAP complains and ignores the new image header info, thereby displaying them incorrectly flipped A-P and S-I. Perhaps naively, it seems to me that it should be simple to flip the orientation around so that they are displayed correctly in ITKSNAP (and therefore in ANTS and ANTsR). I'm wondering if there is a tool in ANTS (or ANTsR) that would allow me to do this in a simple way. My preference is to literally just edit the header in some way, rather than use registration tools and then apply transforms, since I know these are the same space and that its stupid AnalyzePro image export issues that are causing the issue. FYI I'd be happy to avoid using AnalyzePro for these reasons, but unfortunately there are elegant image processing tools that I really want to be able to use that are not in ANTS/ANTsR. Thanks for any suggestions anyone might have. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
I found reflectImage in ANTsR, however this doesn't simply reorder the data so as to create a mirror image of a particular dimension (which is what I need). It takes a binary image and creates a version that is no longer binary - so it is morphing the image in some way (again - not what I'm after) |
Beta Was this translation helpful? Give feedback.
-
Probably something like this:
|
Beta Was this translation helpful? Give feedback.
-
I also found PermuteFlipImageOrientationAxes in ANTS, and this works for images read into ITKSNAP. However, the same images plotted in ANTsR are still incorrectly oriented. Looking at the headers, PermuteFlipImageOrientationAxes just changes the Direction Cos Mtx. without actually reordering the data. |
Beta Was this translation helpful? Give feedback.
Probably something like this: