Error message when opening a saved Segmentation file

347 views
Skip to first unread message

Guy

unread,
Mar 16, 2009, 11:10:12 PM3/16/09
to itksnap-users
I am using v1.8.0 to segment CT images of the shoulder. I just tried
to open a Segmentation file in Analyze format (the first Segmentation
file that I have created). I got an error that reads:

"There is a mismatch between the header of the image that you are
loading and the header of the 'grey' image currently open in SNAP.
The images have a different origin and orientation. SANP will ignore
the header information in the image you are loading."

I am wondering why this might occur?

Thanks,
Guy

Kashif Rajpoot

unread,
Mar 17, 2009, 10:45:34 AM3/17/09
to itksna...@googlegroups.com
Hi Guy,
I think ITK-SNAP assumes that original and segmentation images have the same header information. If there is a mis-match between the two, it brings up this error.
For example, I got this error when I tried to load a segmentation image on top of a grey-scale image, both have different dimensions.
Best,
Kashif

--
Kashif Mahmood Rajpoot
DPhil Student
Institute of Biomedical Engineering (IBME)
University of Oxford
UK
URL: http://www.robots.ox.ac.uk/~kashif


2009/3/17 Guy <GLomb...@optonline.net>

Paul Yushkevich

unread,
Mar 17, 2009, 2:00:28 PM3/17/09
to itksna...@googlegroups.com
Hi Guy

The message is intended to warn you if you load a segmentation image that does not match the header of your gray image. However, it seems that you saved your segmentation image in SNAP, and SNAP should have saved the segmentation image with exactly the same header as the gray image, so this warning should not have occurred. There is one catch - Analyze images are not very flexible in terms of what image orientation they allow you to encode. So perhaps if you save your images as NifTI instead, you won't get that problem

Paul.
--
Paul A. Yushkevich, Ph.D.
Research Assistant Professor
Penn Image Computing and Science Laboratory
Department of Radiology
University of Pennsylvania

Guy

unread,
Mar 17, 2009, 12:32:38 PM3/17/09
to itksnap-users
Kashif,

Thanks for your reply. What you describe is exactly what I tried to
do. I am new to this software, and I thought that the way to see a
segmentation file is to 1st load the greyscale file then to load the
segmentation file. I came to that conclusion when I saw that "Open/
Segmentation Image" is greyed-out when I first load the program.
After I load my DICOM image, the Open/Segemtnation Image is activated
as an option.

That's the way I loaded a segmentation file that I had saved in NIfTI
format: First the DICOM, then the *.nii segmentation file.

Is there a way to load a Segmentation Image saved in Analyze without
first opening a greyscale image?

Thanks,
Guy

On Mar 17, 10:45 am, Kashif Rajpoot <iamka...@gmail.com> wrote:
> Hi Guy,
> I think ITK-SNAP assumes that original and segmentation images have the same
> header information. If there is a mis-match between the two, it brings up
> this error.
> For example, I got this error when I tried to load a segmentation image on
> top of a grey-scale image, both have different dimensions.
> Best,
> Kashif
>
> --
> Kashif Mahmood Rajpoot
> DPhil Student
> Institute of Biomedical Engineering (IBME)
> University of Oxford
> UK
> URL:http://www.robots.ox.ac.uk/~kashif
>
> 2009/3/17 Guy <GLombard...@optonline.net>
>
>
>
>
>
> > I am using v1.8.0 to segment CT images of the shoulder.  I just tried
> > to open a Segmentation file in Analyze format (the first Segmentation
> > file that I have created).  I got an error that reads:
>
> > "There is a mismatch between the header of the image that you are
> > loading and the header of the 'grey' image currently open in SNAP.
> > The images have a different origin and orientation.  SANP will ignore
> > the header information in the image you are loading."
>
> > I am wondering why this might occur?
>
> > Thanks,
> > Guy- Hide quoted text -
>
> - Show quoted text -

Guy

unread,
Mar 17, 2009, 3:02:25 PM3/17/09
to itksnap-users
Paul,

Thanks for your reply. I will save as NifTI.

Guy
> > 2009/3/17 Guy <GLombard...@optonline.net>
>
> >> I am using v1.8.0 to segment CT images of the shoulder.  I just tried
> >> to open a Segmentation file in Analyze format (the first Segmentation
> >> file that I have created).  I got an error that reads:
>
> >> "There is a mismatch between the header of the image that you are
> >> loading and the header of the 'grey' image currently open in SNAP.
> >> The images have a different origin and orientation.  SANP will ignore
> >> the header information in the image you are loading."
>
> >> I am wondering why this might occur?
>
> >> Thanks,
> >> Guy
>
> --
> Paul A. Yushkevich, Ph.D.
> Research Assistant Professor
> Penn Image Computing and Science Laboratory
> Department of Radiology
> University of Pennsylvania- Hide quoted text -

Guy

unread,
Mar 17, 2009, 3:02:25 PM3/17/09
to itksnap-users
Paul,

Thanks for your reply. I will save as NifTI.

Guy

On Mar 17, 2:00 pm, Paul Yushkevich <pyushkev...@gmail.com> wrote:
> > 2009/3/17 Guy <GLombard...@optonline.net>
>
> >> I am using v1.8.0 to segment CT images of the shoulder.  I just tried
> >> to open a Segmentation file in Analyze format (the first Segmentation
> >> file that I have created).  I got an error that reads:
>
> >> "There is a mismatch between the header of the image that you are
> >> loading and the header of the 'grey' image currently open in SNAP.
> >> The images have a different origin and orientation.  SANP will ignore
> >> the header information in the image you are loading."
>
> >> I am wondering why this might occur?
>
> >> Thanks,
> >> Guy
>
> --
> Paul A. Yushkevich, Ph.D.
> Research Assistant Professor
> Penn Image Computing and Science Laboratory
> Department of Radiology

John Chang

unread,
Jun 26, 2024, 5:59:56 PM (10 days ago) Jun 26
to itksnap-users
Hi Paul,

I and one of my student uses ITK-SNAP to segment lesion on CT of Abdomen and pelvis.  for some reason, some of the NifTi files saved has different origin than the original DICOM files.  the student uses a mac and i use a PC.  Is there a way to manually change the origin of the nifti file so that the origin of the NifTi matches that of the DICOM?  

John

Patrick Fuchs

unread,
Jun 28, 2024, 2:38:07 AM (8 days ago) Jun 28
to itksnap-users
You can use convert3D's (c3d) -origin function. convert3D is bundled with ITK-Snap, depending on how it is installed it may be in different locations but should be within your ITK-SNAP/bin folder.
syntax is: c3d input.img -origin vector -o output.img

Below is the help text (c3d -h origin):

-origin                         : Set image origin

Syntax: `-origin vector `

Set the origin of the image. The origin is the world coordinate (in NIfTI coordinate space) of the center of the voxel (0,0,0) in the image. The origin should be specified in millimeters.

    c3d input.img -origin 100x100x100mm -o output.img


John Chang

unread,
Jun 28, 2024, 5:42:04 AM (8 days ago) Jun 28
to itksna...@googlegroups.com
Patrick,

Thanks for the suggestion.  I will try that!

John


--
You received this message because you are subscribed to a topic in the Google Groups "itksnap-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/itksnap-users/EJsWyl04FIM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to itksnap-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/itksnap-users/442d9458-c4cc-463c-8234-e6156f1add37n%40googlegroups.com.


--
Reply all
Reply to author
Forward
0 new messages