[Insight-users] Cannot display image using ITKVTKGlue
Chr. Rossmanith
cr at neuro.ma.uni-heidelberg.de
Fri Oct 5 07:50:52 EDT 2012
Since ItkVtkGlue displaying an image is quite easy:
-----------------
#include <itkImageFileReader.h>
#include "QuickView.h"
int main(int argc, char **argv) {
typedef itk::Image< unsigned short, 2> ImageType;
typedef itk::ImageFileReader<ImageType> ReaderType;
ReaderType::Pointer reader = ReaderType::New();
reader->SetFileName(argv[1]);
reader->Update();
QuickView viewer;
viewer.AddImage( reader->GetOutput());
viewer.Visualize();
return 0;
}
------------------------
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
PROJECT( itkGlue)
FIND_PACKAGE ( ITK REQUIRED)
INCLUDE( ${USE_ITK_FILE} )
find_package(ItkVtkGlue REQUIRED)
include(${ItkVtkGlue_USE_FILE})
INCLUDE_DIRECTORIES(${main_SOURCE_DIR})
ADD_EXECUTABLE( itkGlue itkGlue.cxx )
TARGET_LINK_LIBRARIES ( itkGlue ItkVtkGlue ${ITK_LIBRARIES}
${VTK_LIBRARIES})
Christina Rossmanith
--
Dept. of Neurology
University Medical Center Mannheim
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20121005/4d48f4e1/attachment.htm>
More information about the Insight-users
mailing list