[ITK] Size of pixel component type

Matt McCormick matt.mccormick at kitware.com
Thu Feb 9 18:11:14 EST 2017


Hi Fijoy,

They are generally pretty consistent, but unfortunately unsigned long
and long are usually 4 bytes on Windows but are 8 bytes on Unix-like
systems.

HTH,
Matt

On Thu, Feb 9, 2017 at 5:54 PM, Fijoy Vadakkumpadan <tofijoy at gmail.com> wrote:
> Hello,
>
> If I read an image file (of unknown pixel type) into an itk::Image object
> using ITK, will the component type of a pixel of that image object be the
> same, regardless of the environment (C++ compiler, hardware, etc.)?
>
> If yes, can I assume that the sizes for each component type are as follows?
>
> UCHAR & CHAR        - 1 byte
> USHORT & SHORT    - 2 bytes
> UINT, INT, & FLOAT    - 4 bytes
> ULONG, LONG, & DOUBLE         - 8 bytes
>
> The method I'm using to read an image of unknown type is similar to the one
> at this link:
> https://itk.org/ITKExamples/src/IO/ImageBase/ReadUnknownImageType/Documentation.html
>
> Thank you,
> --Fijoy
>
> _______________________________________________
> Community mailing list
> Community at itk.org
> http://public.kitware.com/mailman/listinfo/community
>


More information about the Community mailing list