[vtkusers] problem with vtkVolumereader!!!!

Mathieu Malaterre mathieu.malaterre at kitware.com
Wed Sep 29 15:27:09 EDT 2004


Ai,

	This is an abstract class you can not allocate such class. Use a 
concrete class instead: vtkVolume16Reader. And also correct you other 
c++ mistakes
- missing ';'
- aCamera is never declared
...

HTH
Mathieu

ai amano wrote:
> 
> hello
> 
> I am working in an application that reads volumenes thus I want to 
> occupy to vtkVolumeReader to read them but when initializing I have a 
> problem with vtkVolumeReader.
> 
> I have a problem with vtkVolumeReader, to I want to read a volume with 
> it but when inicilizar it it says to me that a conversion of * vtkObject 
> cannot be made in * vtkVolumeReader.
> 
> help me.
> 
> #include "vtkPolyDataMapper.h"
> #include "vtkActor.h"
> #include "vtkRenderer.h"
> #include "vtkRenderWindow.h"
> #include "vtkRenderWindowInteractor.h"
> #include "vtkProperty.h"
> #include "vtkCamera.h"
> #include "vtkContourFilter.h"
> #include "vtkVolumeReader.h"
> #include "vtkPolyDataNormals.h"
> 
> int main (int argc, char **argv)
> {
> 
> vtkRenderer *aRenderer = vtkRenderer::New();
> vtkRenderWindow *renWin = vtkRenderWindow::New();
>     renWin->AddRenderer(aRenderer);
> vtkRenderWindowInteractor *iren = vtkRenderWindowInteractor::New();
>     iren->SetRenderWindow(renWin);
> 
> vtkVolumeReader *v16 = vtkVolumeReader::New();  
>         v16->SetDataDimensions(64,64);                                
>         v16->SetImageRange (1,217)
>         v16->SetDataByteOrderToLittleEndian();
>         v16->SetFilePrefix("brain");
>         v16->SetDataSpacing (3.5,3.5,1.2);
>         v16->Update();
> 
>  vtkContourFilter *skinExtractors = vtkContourFilter::New();
>     skinExtractors->SetInput((vtkDataSet *) v16->GetOutput());
>     skinExtractors->SetValue(0, 500);
>   vtkPolyDataNormals *skinNormals = vtkPolyDataNormals::New();
>     skinNormals->SetInput(skinExtractors->GetOutput());
>     skinNormals->SetFeatureAngle(60.0);
>   vtkPolyDataMapper *skinMapper = vtkPolyDataMapper::New();
>     skinMapper->SetInput(skinNormals->GetOutput());
>     skinMapper->ScalarVisibilityOff();
>   vtkActor *skin = vtkActor::New();
>     skin->SetMapper(skinMapper);
> 
>   aRenderer->AddActor(skin);
>   aRenderer->SetActiveCamera(aCamera);
>   aRenderer->ResetCamera ();
>   aCamera->Dolly(1.5);
> 
> 
>   aRenderer->SetBackground(1,1,1);
>   renWin->SetSize(640, 480);
> 
> 
>   aRenderer->ResetCameraClippingRange ();
> 
>   iren->Initialize();
>   iren->Start();
> 
> 
>   v16->Delete();
>   skinExtractors->Delete();
>   skinNormals->Delete();
>   skinMapper->Delete();
>   skin->Delete();
>   aCamera->Delete();
>   iren->Delete();
>   renWin->Delete();
>   aRenderer->Delete();
> 
>   return 0;
> }
> 
> vtkVolumereader *vol = vtkVolumeReader::New();
> 
> 
> 
> "Ganar no es solo vencer al enemigo
> 
>  sino vencerse a si mismo  "
> 
> 
> ------------------------------------------------------------------------
> T1msn Fotos: Todo lo que quieres saber sobre fotografía digital Haz clic 
> aquí <http://g.msn.com/8HMBESMX/2749??PS=47575>
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> 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://www.vtk.org/mailman/listinfo/vtkusers






More information about the vtkusers mailing list