[Insight-users] pixel type -- slcalar or non-scalar?

Julien Jomier jjomier at cs.unc.edu
Wed Dec 8 13:11:16 EST 2004


Hi Patrick,

This is correct. ITK doesn't have a general way of initializing both 
scalar and vector type at this point. You can initialize scalar and 
RGBPixel in the same function, but you have to create a separate 
function/class for images of vectors.

Hope that helps,

Julien

Peng (Patrick) Cheng wrote:
> hi all,
> I have following code:
> 
>  InputPixelType p;
>  if(InputPixelType::GetNumberOfComponents()>1){
>    p.Fill(0);
>  }
>  else{
>    p = NumericTraits<InputPixelType>::Zero;
>  }
> 
> When I pass the scalar pixel to this, it doesn't work.  Is that becasue 
> of scalar type don't have GetNumberOfComponents() method?
> 
> How to rewrite this code?
> 
> Thanks
> 
> Patrick
> 


More information about the Insight-users mailing list