[vtkusers] problem with vtkVolumeReader!!!!!
Pingkun
pingkun at ieee.org
Mon Sep 27 22:35:28 EDT 2004
Hi,
Your code
--------------------------------------------------------------------------------------------------------------
vtkVolumeReader *vol = 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();
-------------------------------------------------------------------------
looks strange. Why do you use "v16" but declare "*vol" instead? Isn't it a compile error?
Pingkun
----- Original Message -----
From: ai amano
To: vtkusers at vtk.org
Sent: Tuesday, September 28, 2004 6:54 AM
Subject: [vtkusers] problem with vtkVolumeReader!!!!!
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 *vol = 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. Más Útil Cada Día Haz clic aquí
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20040928/d1e9ced8/attachment.htm>
More information about the vtkusers
mailing list