[Insight-users] Byte Order Swapping??

Neha D itkneha@yahoo.com
Wed, 7 May 2003 13:07:15 -0700 (PDT)


--0-1117835645-1052338035=:64868
Content-Type: text/plain; charset=us-ascii

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.  ThanksNeha
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 - Faster. Easier. Bingo.
--0-1117835645-1052338035=:64868
Content-Type: text/html; charset=us-ascii

<DIV>Hi Luis,</DIV>
<DIV>&nbsp;</DIV>
<DIV>Actually, I am using MetaImage Rerader for reading raw images.</DIV>
<DIV>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.</DIV>
<DIV>When I apply Discrete Gaussian Filter in such way, and it displays this message "elementByteOrderSwapped".</DIV>
<DIV>So, want to know exactly what function creates this message. </DIV>
<DIV>Other filters such as "Gradient Magnitude Filter" does not display such message.<BR></DIV>
<DIV>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. </DIV>
<DIV>&nbsp;</DIV>
<DIV>Thanks</DIV>
<DIV>Neha<BR><B><I>Luis Ibanez &lt;luis.ibanez@kitware.com&gt;</I></B> wrote:</DIV>
<BLOCKQUOTE style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px solid"><BR>Hi Neha,<BR><BR>1) ITK does not have any endianess default.<BR><BR>2) The DiscreteGaussianFilter does not alter<BR>the endianess of an image.<BR><BR>3) Endianess is a property of the platform you<BR>are using.<BR><BR>4) ITK image filters are unaware and independent<BR>of the endianess used by your platform.<BR><BR>The only classes in ITK that deal with endianess<BR>are the ImageIO classes. Among them you seem to<BR>be using the RawImageIO class.<BR><BR>Please *DON'T* use raw images. Raw images are<BR>dangerous due to their lack of fundamental<BR>information about the image content.<BR><BR>If you have raw files, please write MetaImage<BR>headers for them and use the standard ITK<BR>ImageFileReader and ImageFileWriter to read<BR>and write images. This is illustrated in almost<BR>all the examples in<BR><BR>Insight/Examples<BR><BR>and their associated descriptions in the<BR>software guide:<BR><BR>http://www.itk.org/ItkSoftwareGuide.pdf<BR><BR><BR>Regards,<BR><BR><BR>Luis<BR><BR><BR><BR>--------------------------<BR><BR><BR>Neha D wrote:<BR>&gt; Hi Luis,<BR>&gt; <BR>&gt; I am using "Discrete Gaussian Image Filter" on my raw image which has <BR>&gt; byte order - Big Endian. For this images, when i use filter, this filter <BR>&gt; swaps the byte order ( message : ElementbyteOrder Swapped).<BR>&gt; But I remember somebody saying "ITK's Default byte Order is Big Endian".<BR>&gt; <BR>&gt; Why does this filter swaps the byte order ?<BR>&gt; <BR>&gt; Thanks,<BR>&gt; Neha<BR>&gt; <BR><BR>_______________________________________________<BR>Insight-users mailing list<BR>Insight-users@public.kitware.com<BR>http://public.kitware.com/mailman/listinfo/insight-users</BLOCKQUOTE><p><hr SIZE=1>
Do you Yahoo!?<br>
<a href="http://us.rd.yahoo.com/search/mailsig/*http://search.yahoo.com">The New Yahoo! Search</a> - Faster. Easier. Bingo.
--0-1117835645-1052338035=:64868--