[Insight-users] Byte Order Swapping??
Luis Ibanez
luis.ibanez@kitware.com
Wed, 07 May 2003 17:30:00 -0400
Hi Neha,
The message is probably produced by the MetaImageReader.
From the file:
Insight/Utilities/MetaIO/metaImage.cxx
in line 355.
The message is just a notification, and not an error in itself.
It actually shouldn't be printed out except when debugging the
class. A META_DEBUG gard was just added to it.
It seems that the reader is just notifying that the swap
took place. If you think that your data doesn't really
needed to be swapped then you need to edit your MetaImage
header and change the value of
ElementByteOrderMSB
About the comparision of images, you may want to take
a look at the filter:
http://www.itk.org/Insight/Doxygen/html/classitk_1_1DifferenceImageFilter.html
and the SquaredDifference image filter
http://www.itk.org/Insight/Doxygen/html/classitk_1_1SquaredDifferenceImageFilter.html
Regards,
Luis
------------------
Neha D wrote:
> Hi Luis,
>
> Actually, I am using MetaImage Rerader for reading raw images.
> What I do is - first read RAW image using Meta Image Reader and then
> once image is loaded into memory, i apply different filters on it.
> When I apply Discrete Gaussian Filter in such way, and it displays this
> message "elementByteOrderSwapped".
> So, want to know exactly what function creates this message.
> Other filters such as "Gradient Magnitude Filter" does not display such
> message.
> Also, I want to know if there is any example which reads the image and
> then after writing it to the disk, compares the written images with
> original image that was read by reader.
>
> Thanks
> Neha
> */Luis Ibanez <luis.ibanez@kitware.com>/* wrote:
>
>
> Hi Neha,
>
> 1) ITK does not have any endianess default.
>
> 2) The DiscreteGaussianFilter does not alter
> the endianess of an image.
>
> 3) Endianess is a property of the platform you
> are using.
>
> 4) ITK image filters are unaware and independent
> of the endianess used by your platform.
>
> The only classes in ITK that deal with endianess
> are the ImageIO classes. Among them you seem to
> be using the RawImageIO class.
>
> Please *DON'T* use raw images. Raw images are
> dangerous due to their lack of fundamental
> information about the image content.
>
> If you have raw files, please write MetaImage
> headers for them and use the standard ITK
> ImageFileReader and ImageFileWriter to read
> and write images. This is illustrated in almost
> all the examples in
>
> Insight/Examples
>
> and their associated descriptions in the
> software guide:
>
> http://www.itk.org/ItkSoftwareGuide.pdf
>
>
> Regards,
>
>
> Luis
>
>
>
> --------------------------
>
>
> Neha D wrote:
> > Hi Luis,
> >
> > I am using "Discrete Gaussian Image Filter" on my raw image which
> has
> > byte order - Big Endian. For this images, when i use filter, this
> filter
> > swaps the byte order ( message : ElementbyteOrder Swapped).
> > But I remember somebody saying "ITK's Default byte Order is Big
> Endian".
> >
> > Why does this filter swaps the byte order ?
> >
> > Thanks,
> > Neha
> >
>
> _______________________________________________
> Insight-users mailing list
> Insight-users@public.kitware.com
> http://public.kitware.com/mailman/listinfo/insight-users
>
> ------------------------------------------------------------------------
> Do you Yahoo!?
> The New Yahoo! Search
> <http://us.rd.yahoo.com/search/mailsig/*http://search.yahoo.com> -
> Faster. Easier. Bingo.