[Insight-users] ITK function problem

RJ Stevens rj.stevens at gmail.com
Thu Jan 6 18:38:01 EST 2005


I am using ITK 1.8 on a suse 9.2 system. I have set the correct ITK
directory for cmake, but the ITK funtions are giving errors as
undefined functions. My program is a simple image file creator based
on the image 2 example. I am also getting errors for unsigned chars. I
get errors on every step of the make process. It seems like the
compiler doesn't know where to link to even though its been
configured.

Thanks in advance for any advice. here is my code:

#include "itkImage.h"
#include "itkImageFileReader.h"
#include <iostream>

int main(int , char ** argv)
{

//define variables for image def
typedef unsigned char		PixelType;
const unsigned int		Dimension = 2;

//set pixel type and dimension
typedef itk::Image< PixelType, Dimension > ImageType;

//instantiate the image reader class
typedef itk::ImageFileReader< ImageType > ReaderType;

//use reader class to create a reader object
ReaderType::Pointer reader = ReaderType::New();

//give reader oject filename of image to be loaded into memory
const char * filename = argv[1];
reader->SetFileName(filename);

//reader object is a pipeline source object and responds to pipeline
//update requests. Since this pipeline is of length 1, we must send the
//update reqest manually
reader->Update();

//put the image into an image object
ImageType::Pointer image = reader -> GetOutput();


return 0;
}


More information about the Insight-users mailing list