[vtkusers] More filters question

Amy Henderson amy.henderson at kitware.com
Fri Mar 14 12:06:53 EST 2003


At 11:54 AM 3/14/2003 -0500, Arun Nagarajan wrote:
>Thanks Amy. So this is what I am trying now:
>
>package require vtk
>
>vtkStructuredPointsReader reader
>reader SetFileName ThalamusS1002.defAtlas.vtk
>
>vtkImageCast imagecast
>imagecast SetInput [reader GetOutput]
>imagecast SetOutputScalarTypeToUnsignedChar
>
>vtkImageToPolyDataFilter filter
>filter SetInput [imagecast GetOutput]
>
>vtkPolyDataWriter writer
>writer SetFileName out.poly.vtk
>writer SetInput [filter GetOutput]
>writer Write
>
>
>But I am still getting an error saying: Wrong input scalar type  from the
>ImageToPolyDataFilter class. Does SetOutputScalarTypeToUnsignedChar not set
>it to the 3 component unsigned char that I need? If not, what could I do to
>make this work.

No, vtkImageCast does not change the number of components in your data; it 
only changes the type.  You should pass the output of you 
vtkStructuredPointsReader directly to your vtkImageToPolyDataFilter.  Then 
call SetColorModeToLUT on that filter, and pass it an instance of 
vtkLookupTable (where you specify the color map for your data).

- Amy

>Thanks.
>
>Arun
>
>
>
>----- Original Message -----
>From: "Amy Henderson" <amy.henderson at kitware.com>
>To: "Arun Nagarajan" <arun at cis.jhu.edu>; <vtkusers at public.kitware.com>
>Sent: Friday, March 14, 2003 11:39 AM
>Subject: Re: [vtkusers] Using filters
>
>
> > At 11:24 AM 3/14/2003 -0500, Arun Nagarajan wrote:
> > >Ah, ok. That makes more sense. Another question. In the man page for
> > >ImageToPolyDataFilter class, there is a note saying:
> > >
> > >The input linear lookup table must be of the form of 3-component unsigned
> > >char
> > >
> > >What exactly is a 3-component unsigned char?
> >
> > Each entry in the lookup table is made up of 3 unsigned chars -- to
>specify
> > RGB colors.
> >
> > >Thanks.
> > >
> > >Arun
> > >
> > >----- Original Message -----
> > >From: "Amy Henderson" <amy.henderson at kitware.com>
> > >To: "Arun Nagarajan" <arun at cis.jhu.edu>; <vtkusers at public.kitware.com>
> > >Sent: Friday, March 14, 2003 11:18 AM
> > >Subject: Re: [vtkusers] Using filters
> > >
> > >
> > > > Hi Arun,
> > > >
> > > > vtkStructuredPointsToPolyDataFilter is an abstract superclass for
>various
> > > > filters that take a vtkStructuredPoints as input and produce a
>vtkPolyData
> > > > as output.  You're probably looking for something like
> > > > vtkImageToPolyDataFilter (a concrete subclass of
> > > > vtkStructuredPointsToPolyDataFilter).
> > > >
> > > > - Amy
> > > >
> > > > At 11:07 AM 3/14/2003 -0500, Arun Nagarajan wrote:
> > > > >Hi,
> > > > >
> > > > >I am new to filters and I am trying to read in a structured points
>file
> > >and
> > > > >write it out as a polygonal data file. I am basically trying to use
>the
> > > > >StructuredPointsToPolyDataFilter class located at
> > > >
> > >
> >http://www.vtk.org/doc/nightly/html/classvtkStructuredPointsToPolyDataFilte
> > >r
> > > > >.html. There are no examples there and I was wondering if anyone can
>show
> > >me
> > > > >a basic skeleton of how a filter works.
> > > > >
> > > > >Thanks.
> > > > >
> > > > >Arun
> > > > >
> > > > >_______________________________________________
> > > > >This is the private VTK discussion list.
> > > > >Please keep messages on-topic. Check the FAQ at:
> > > > ><http://public.kitware.com/cgi-bin/vtkfaq>
> > > > >Follow this link to subscribe/unsubscribe:
> > > > >http://public.kitware.com/mailman/listinfo/vtkusers
> > > >
> > > >
> > > >
> > > >
> > >
> > >_______________________________________________
> > >This is the private VTK discussion list.
> > >Please keep messages on-topic. Check the FAQ at:
> > ><http://public.kitware.com/cgi-bin/vtkfaq>
> > >Follow this link to subscribe/unsubscribe:
> > >http://public.kitware.com/mailman/listinfo/vtkusers
> >
> >
> >
> >
>
>_______________________________________________
>This is the private VTK discussion list.
>Please keep messages on-topic. Check the FAQ at: 
><http://public.kitware.com/cgi-bin/vtkfaq>
>Follow this link to subscribe/unsubscribe:
>http://public.kitware.com/mailman/listinfo/vtkusers







More information about the vtkusers mailing list