[Insight-users] Extract char image type from vector<char, dim> image type

wydesenej wydesenej at gmail.com
Mon Nov 12 05:59:24 EST 2012


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.


More information about the Insight-users mailing list