[vtkusers] polydata-imagedata

yala kaluma yala_aiiii at hotmail.com
Tue Mar 22 18:54:41 EST 2005


Thanks Charles,

But how could i transform a polydata into an  image data?
What kind of filter should i use?

thanks.
YK

>From: Charles Boivin <okeovtk at gmail.com>
>Reply-To: Charles Boivin <okeovtk at gmail.com>
>To: yala kaluma <yala_aiiii at hotmail.com>
>Subject: Re: [vtkusers] source-imagetoimagefilter
>Date: Tue, 22 Mar 2005 12:04:06 -0700
>
>Hello Yala,
>
>I think your main problem here is that a vtkConeSource object returns
>a vtkPolyData pointer, not a vtkImageData pointer. These are two
>different data structures.
>
>Hope this helps,
>
>Charles
>
>On Tue, 22 Mar 2005 01:21:59 +0100, yala kaluma 
<yala_aiiii at hotmail.com> wrote:
> > I am trying to play with filters available in the VTKlibrary as i 
am
> > starting off.
> > It seems like it is not possible to use a source as an input to an 
image to
> > image filter. Why is that? Should I introduce something else 
between the
> > source and the image to image filter?
> >
> > Here is the code i am having problem with...
> >
> > Thank u very much!!!
> > Yala
> >
> > #include "vtkPNGReader.h"
> > #include "vtkImageCast.h"
> > #include "vtkImageThreshold.h"
> > #include "vtkImageEuclideanDistance.h"
> > #include "vtkImageViewer.h"
> > #include "vtkConeSource.h"
> > #include "vtkPolyDataMapper.h"
> >
> > int main(int argc,char *argv[])
> > {
> > vtkConeSource *cone = vtkConeSource::New();
> > cone->SetHeight( 3.0 );
> > cone->SetRadius( 1.0 );
> > cone->SetResolution( 10 );
> >
> > vtkImageCast *cast=vtkImageCast::New();
> > cast->SetOutputScalarTypeToShort();
> > cast->SetInput(cone->GetOutput());
> >
> > vtkImageThreshold *thresh=vtkImageThreshold::New();
> > thresh->SetInput(cast->GetOutput());
> > thresh->ThresholdByUpper(2000.0);
> > thresh->SetInValue(0);
> > thresh->SetOutValue(200);
> > thresh->ReleaseDataFlagOff();
> >
> > vtkImageEuclideanDistance *dist=vtkImageEuclideanDistance::New();
> > dist->SetInput(thresh->GetOutput());
> > dist->SetAlgorithmToSaito();
> >
> > vtkImageViewer *viewer=vtkImageViewer::New();
> > viewer->SetInput(dist->GetOutput());
> > viewer->SetColorWindow(117);
> > viewer->SetColorLevel(43);
> >
> > viewer->Render();
> >
> > //source [file join [file dirname [info script]] 
WindowLevelInterface.tcl]
> >
> > cone->Delete();
> > cast->Delete();
> > thresh->Delete();
> > dist->Delete();
> > viewer->Delete();
> > coneMapper->Delete();
> >
> > return 0;
> > }
> >
> > _________________________________________________________________
> >
> > _______________________________________________
> > This is the private VTK discussion list.
> > Please keep messages on-topic. Check the FAQ at: 
http://www.vtk.org/Wiki/VTK_FAQ
> > Follow this link to subscribe/unsubscribe:
> > http://www.vtk.org/mailman/listinfo/vtkusers
> >

_________________________________________________________________





More information about the vtkusers mailing list