[Insight-users] a question about reading an image from a file

knoppix corn knoppixc at yahoo.com
Thu Jun 19 05:30:04 EDT 2008


haii.. i have a question about reading an image from a file,
according to itkSoftwareGuide page 70, i have a source code like this : 

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

int main( int , char * argv[])
{ 
  typedef unsigned char          PixelType;
  const unsigned int             Dimension = 3;

  typedef itk::Image< PixelType, Dimension >   ImageType;  

  typedef itk::ImageFileReader< ImageType >  ReaderType;
  
  ReaderType::Pointer reader = ReaderType::New();  
  
  const char * filename = argv[1];
  reader->SetFileName( filename );
  
  reader->Update();
  
  ImageType::Pointer image = reader->GetOutput();
  
  return 0;
}

i have a few question :
 1). how to write a CMakeLists.txt ???
 2). how with the image file?? , is the image file 3D?? , where can i get the file??
 3). to view the image, is it need VTK??
 4). what is the input an output from this system or program???


      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20080619/e68a41a8/attachment.htm>


More information about the Insight-users mailing list