[vtkusers] (no subject)

gte631d at mail.gatech.edu gte631d at mail.gatech.edu
Wed Jul 2 09:02:43 EDT 2003


Hi,
I'm trying to use vtkImageMask and have problems.  Seems like it should be 
pretty straightforward.  I'm using VTK 4.2 with Python 2.2PROBLEM:

PROBELM STATEMENT:
It appears that my "mask" is being disregarded and my ImageInput is being 
rejected.

Example Code:
## We have two images:
## "inim" is the input grayscale 3D image (Scalar type is SHORT)
## "binim" is a binary image of the same dimensions etc... (Scalar type is 
SHORT)

mask = vtkImageMask()
mask.SetImageInput(inim) ## inim is a vtkImageData object with scalar type of 
short.
binim.SetScalarTypeToUnsignedChar() ## binim has Scalar Values of 0 and 1
                              ## same structure as inim. Scalar type is short
mask.SetMaskInput(binim) 
                   ## the scalar type for Masked input must be Unsigned Char??
mask.SetMaskedOutputValue(555) #
mask.Update()
maskout = mask.GetOutput()

** The output scalars are all is all 555.  It is like it is disregarding the 
MaskInput and just "rejecting" all scalars of ImageInput

For what I need to do, I could easlily use vtkImageDotProduct
dotim = vtkImageDotProduct()
dotim.SetInput1(inim)
dotim.SetInput2(binim)
dotim.Update()
dotprodout = dotim.GetOutput()

**While this works, I feel like vtkImageMask will be more efficient.

I would appreciate any pointers on what I could do to correct the problem I 
have with vtkImageMask.

Thanks,
Sarju
-- 





More information about the vtkusers mailing list