[Insight-users] problem in Getting Started with ITK+VTK

jx x joshjx at yahoo.com
Thu, 19 Feb 2004 19:25:53 -0800 (PST)


--0-1637182847-1077247553=:38906
Content-Type: text/plain; charset=us-ascii
Content-Id: 
Content-Disposition: inline

Hello, I meet a problem when I try to run the example
in "Getting Started II", which is "Getting Started
with ITK+VTK". 

I used Cmake to build the project, and when I open
myProject.dsw and try to build ALL_BUILD, there is a
error:
C:\workSP\testPJSOU\myProject.cxx(3): fatal error
C1083: Cannot open include file:
'itkImageToVTKImageFilter.h': No such file or
directory

I search the whole ITK_1.6 package, and I can not find
"itkImageToVTKImageFilter.h". Am I wrong in some
place? 

Attachment are firstIVTK.cxx and CmakeLists.txt file.
BTW, I changed the project name to firstIVTK. 

Thanks very much!

Josh    

__________________________________
Do you Yahoo!?
Yahoo! Mail SpamGuard - Read only the mail you want.
http://antispam.yahoo.com/tools
--0-1637182847-1077247553=:38906
Content-Type: text/plain; name="firstIVTK.cxx"
Content-Description: firstIVTK.cxx
Content-Disposition: inline; filename="firstIVTK.cxx"

#include "itkImage.h"
#include "itkImageFileReader.h"
#include "itkImageToVTKImageFilter.h"

#include "vtkImageViewer.h"
#include "vtkRenderWindowInteractor.h"

int main( int argc, char **argv) {

	typedef itk::Image<unsigned short,2>           ImageType;
	typedef itk::ImageFileReader<Imagetype>        ReaderType;
	typedef itk::ImageToVTKImageFilter<ImageType>  ConnectorType;

	ReaderType::Pointer reader = readertype::New();
	ConnectorType::Pointer connector = ConnectorType::New();

	reader->setFilename( argv[1] );
	connector->SetInput( reader->GetOutput() );

	vtkImageViewer * viewer = vtkImageViewer::New();
	vtkRenderWindowInteractor * renderWindowInteractor =
		vtkRenderWindowInteractor::New();

	viewer->SetupInteractor( renderWindowInteractor );
	viewer->SetInput( connector->GetOutput() );

	viewer->Render();
	viewer->SetColorWindow( 255 );
	viewer->SetColorLevel( 128 );
	renderWindowInteractor->Start();

	return 0;
}





--0-1637182847-1077247553=:38906
Content-Type: text/plain; name="CmakeLists.txt"
Content-Description: CmakeLists.txt
Content-Disposition: inline; filename="CmakeLists.txt"

# This project is designed to be built outside the Insight source tree.
# It uses ITK and VTK together 
PROJECT(firstIVTK)

# Find ITK.
FIND_PACKAGE(ITK)
IF(ITK_FOUND)
  INCLUDE(${ITK_USE_FILE})
ELSE(ITK_FOUND)
  MESSAGE(FATAL_ERROR
          "Cannot build without ITK.  Please set ITK_DIR.")
ENDIF(ITK_FOUND)

# Find VTK.
FIND_PACKAGE(VTK)
IF(VTK_FOUND)
  INCLUDE(${VTK_USE_FILE})
ELSE(VTK_FOUND)
  MESSAGE(FATAL_ERROR
          "Cannot build without VTK.  Please set VTK_DIR.")
ENDIF(VTK_FOUND)

INCLUDE_DIRECTORIES(${firstIVTK_SOURCE_DIR})   

ADD_EXECUTABLE(firstIVTK firstIVTK.cxx )

TARGET_LINK_LIBRARIES(firstIVTK 
  ITKBasicFilters ITKCommon ITKIO
  vtkRendering vtkGraphics vtkHybrid
  vtkImaging vtkIO vtkFiltering vtkCommon)

--0-1637182847-1077247553=:38906--