[Insight-users] Extract char image type from vector<char, dim> image type
Bradley Lowekamp
blowekamp at mail.nih.gov
Mon Nov 12 09:32:00 EST 2012
Hello,
I believe the VectorIndexSelectionCastImageFilter is what you are looking for:
http://www.itk.org/Doxygen/html/classitk_1_1VectorIndexSelectionCastImageFilter.html
Brad
On Nov 12, 2012, at 5:59 AM, wydesenej <wydesenej at gmail.com> wrote:
> Hi,
>
> i have itk image types defined as follows:
>
> typedef itk::Vector< unsigned char, 10 > VectorPixelType;
> typedef itk::Image< VectorPixelType, 3 > VectorImageType;
> typedef itk::Image< unsigned char, 3 > UCharImageType;
>
> On input i have number of vector component to extract (number from 0 to 9)
> and pointer to VectorImageType.
> I want to extract UCharImageType from VectorImageType with scalar values
> based on extracted component of vector image.
>
> Example:
>
> input VectorImageType
> pixel [0,0,0] = <4,5,7,0,4,5,6,0,4,7>
> pixel [0,0,1] = <0,4,0,0,1,3,5,9,0,0>
> pixel [0,0,2] = <1,1,0,0,0,0,7,0,6,0>
> etc.
>
> extract component 0:
> UCharImageType
> pixel [0,0,0] = 4
> pixel [0,0,1] = 0
> pixel [0,0,2] = 1
>
> extract component 1:
> UCharImageType
> pixel [0,0,0] = 5
> pixel [0,0,1] = 4
> pixel [0,0,2] = 1
>
> etc.
>
>
> I didnt found any filter to do this.
> Please any suggestions?
>
>
>
> --
> View this message in context: http://itk-insight-users.2283740.n2.nabble.com/Extract-char-image-type-from-vector-char-dim-image-type-tp7581607.html
> Sent from the ITK Insight Users mailing list archive at Nabble.com.
> _____________________________________
> 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
More information about the Insight-users
mailing list