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

Peng (Patrick) Cheng peng-cheng at uiowa.edu
Wed Dec 8 12:54:34 EST 2004


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

-- 

Peng (Patrick) Cheng
Research Assistant
Radiology, Magnetic Resonance Imaging (MRI) Center
University of Iowa Hospital and Clinics
Iowa City, IA 52246

Office:  0453-E JCP
Phone:   (319)356-7808 (O)
         (319)400-7442 (C)
Email:   peng-cheng at uiowa.edu
Website: http://css.engineering.uiowa.edu/~pcheng/





More information about the Insight-users mailing list