[vtkusers] displaying .raw data

tony hakki tony2007vtk at yahoo.com
Mon Jan 29 06:55:32 EST 2007


here is my code. When I run it without vtkPolyDataMapper ,a black window appears and an error appear on an another window like that"ERROR: In ..\..\vtk-src-windows\Rendering\vtkImageActor.cxx, line 182
vtkOpenGLImageActor (01654BB0): This filter requires unsigned char scalars as input". When I use vtkPolyDataMapper It gives an converting parameter error. like that"
vtkPolyDataMapper::SetInput' : cannot convert parameter 1 from 'vtkImageData *' to 'vtkPolyData *'


vtkImageReader *read=vtkImageReader::New();
read->SetFileName( "3Ddata.raw");

vtkPolyDataMapper *readmap2=vtkPolyDataMapper::New();
readmap2->SetInput(read->GetOutput());

vtkImageActor *lodactor=vtkImageActor::New();
lodactor->SetInput(read->GetOutput());
lodactor->InterpolateOff();

vtkRenderer *ren1=vtkRenderer::New();
vtkRenderWindow *renwin=vtkRenderWindow::New();
renwin->AddRenderer(ren1); 
vtkRenderWindowInteractor *iren=vtkRenderWindowInteractor::New();

iren->SetRenderWindow(renwin);
ren1->AddActor(lodactor);
ren1->SetBackground(0,0,0);

renwin->SetSize(500,500); 
ren1->ResetCamera();
ren1->GetActiveCamera()->Zoom(1.5);
renwin->Render();
iren->Start();

----- Original Message ----
From: Peter Spring <meancity at gmail.com>
To: tony hakki <tony2007vtk at yahoo.com>
Cc: VTK Ortak mail hesabi <vtkusers at vtk.org>
Sent: Monday, January 29, 2007 2:14:49 AM
Subject: Re: [vtkusers] displaying .raw data


if not mistaken , you might try vtkPolyDataMapper..

what kind of rendering r u doing ? iso or vol


On 1/29/07, tony hakki <tony2007vtk at yahoo.com> wrote:
>
> hi;
> I want to display  my 3D data which is .raw extension on the screen.  I read
> it by itkRawImageIO.h  then what kind of mapper should I use to add it to
> actor?
> thank you
> Tony
>
> ________________________________
> Don't pick lemons.
> See all the new 2007 cars at Yahoo! Autos.
> _______________________________________________
> 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
>
>
>


 
____________________________________________________________________________________
Looking for earth-friendly autos? 
Browse Top Cars by "Green Rating" at Yahoo! Autos' Green Center.
http://autos.yahoo.com/green_center/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20070129/ff6175dd/attachment.htm>


More information about the vtkusers mailing list