[vtkusers] XCode project?
Francesco Pasqualini
docfra81 at gmail.com
Sun Mar 4 05:41:58 EST 2007
Hi everyBody,
I need some help. I'm from Italy (I apologize for my worst english in
advance)
I reasonably installed VTK & ITK toolkit from the Terminal Utility of
my MacBook.
I need this toolkit for an university course, so I try to compile in
XCode an example that out teacher gave us.
this example was made in C++ for Visual studio suite that are in the
university labs. I try to compile using Xcode->new project -> command
line utility -> C++ tools that may use a Gcc compiler.
I have 30 errors and I do not understand anything else!!!!
Are there some tutorial, guide, stepByStep, XCode&Kitware4Dummies
ecc... resource on the web you think can help me?!
thanks a lot
Francesco Pasqualini
ps: this is the code, consider that I've got errors in the include
part!!!!
//INCLUDE
#include "itkImage.h"
#include "itkImageFileReader.h"
#include "itkImageFileWriter.h"
#include "itkThresholdImageFilter.h"
#include "itkImageToVTKImageFilter.h"
#include "vtkPolyDataMapper.h"
#include "vtkActor.h"
#include "vtkRenderer.h"
#include "vtkRenderWindow.h"
#include "vtkRenderWindowInteractor.h"
#include "vtkInteractorStyleTrackballCamera.h"
#include "vtkImageGaussianSmooth.h"
#include "vtkContourFilter.h"
#include "vtkPolyDataNormals.h"
void main( int argc, char *argv[] )
{
//DEFINIZIONE DEI TIPI ITK
typedef unsigned char PixelType;
const unsigned int Dimension = 3;
typedef itk::Image< PixelType, Dimension > ImageType;
typedef itk::ThresholdImageFilter< ImageType > FilterType;
typedef itk::ImageFileReader< ImageType > ReaderType;
typedef itk::ImageToVTKImageFilter<ImageType> ConnectorType;
//CREO I FILTRI
ReaderType::Pointer reader = ReaderType::New();
FilterType::Pointer filter = FilterType::New();
ConnectorType::Pointer connector = ConnectorType::New();
vtkPolyDataMapper *volumeMapper = vtkPolyDataMapper::New();
vtkActor *volumeActor = vtkActor::New();
vtkRenderer *render = vtkRenderer::New();
vtkRenderWindow *renWin = vtkRenderWindow::New();
vtkRenderWindowInteractor *iren = vtkRenderWindowInteractor::New();
vtkInteractorStyleTrackballCamera *style =
vtkInteractorStyleTrackballCamera::New();
vtkImageGaussianSmooth *smooth = vtkImageGaussianSmooth::New();
vtkContourFilter *isoSurface = vtkContourFilter::New();
vtkPolyDataNormals *normals = vtkPolyDataNormals::New();
//IMPOSTO I PARAMETRI DEI FILTRI
filter->SetOutsideValue( 0 );
filter->ThresholdOutside(110, 255);
volumeMapper->SetScalarRange(0,255);
render->SetBackground( 0.1, 0.2, 0.4 );
iren->SetInteractorStyle(style);
isoSurface->SetValue(0,90);
//COLLEGO LA PIPELINE
reader->SetFileName( "Nuclei.vtk" );
filter->SetInput( reader->GetOutput() );
connector->SetInput( filter->GetOutput() );
smooth->SetInput(connector->GetOutput() );
isoSurface->SetInput(smooth->GetOutput() );
normals->SetInput( isoSurface->GetOutput() );
volumeMapper->SetInput( normals->GetOutput() );
volumeActor->SetMapper( volumeMapper );
render->AddActor( volumeActor );
renWin->AddRenderer( render );
iren->SetRenderWindow(renWin);
//VISUALIZZO LA FINESTRA
iren->Initialize();
iren->Start();
//ELIMINO I FILTRI CREATI
smooth->Delete();
isoSurface->Delete();
normals->Delete();
volumeMapper->Delete();
volumeActor->Delete();
render->Delete();
renWin->Delete();
style->Delete();
iren->Delete();
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20070304/23338979/attachment.htm>
More information about the vtkusers
mailing list