[Insight-users] Filters Input Image Pixel Type

Mauro Maiorca mauromaiorca at gmail.com
Thu Dec 12 04:50:15 EST 2013


Hi Elena,

have a look at the ITK software guide (
http://www.itk.org/ItkSoftwareGuide.pdf), chapter 4 (User's guide -> Data
Representation -> Image), it might answer your question.

Section 4.1.1 shows how to create a 3D image with unsigned short pixel
data, in summary you have to define your image type as:
typedef itk::Image< unsigned short, 3 > ImageType;
If you want to create an image with unsigned int pixel data, you have to
replace "unsigned short" with "unsigned int", i.e.
typedef itk::Image< unsigned int, 3 > ImageType;

You can play with the examples that you can find either in your ITK source
directory (Examples/DataRepresentation/Image/Image1.cxx, etc etc) or online
(
https://github.com/Kitware/ITK/blob/master/Examples/DataRepresentation/Image/Image1.cxxetc
etc)

If you want to cast image types (for example converting from unsigned short
to unsigned int), have a look at section "6.3 Casting and Intensity
Mapping" of the ITK software guide.

Hope it helps.

cheers,
Mauro





On Thu, Dec 12, 2013 at 8:19 PM, elena bresciani <
elena.bresciani87 at gmail.com> wrote:

> Hi to everybody,
>
> I have a (probably really silly) question about which kind of input image
> pixel type does a filter require.
> Is it wrote in the doxygen documentation? If yes, where?
>
> I'm obviously a beginner and I can't understand well how to read the
> documentation...
>
> Thank you in advance,
>
> Elena
>
>
>
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Kitware offers ITK Training Courses, for more information visit:
> http://www.kitware.com/products/protraining.php
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20131212/11308482/attachment.htm>


More information about the Insight-users mailing list