15 #ifndef __itkReadImage_h
16 #define __itkReadImage_h
18 #include <itkImageFileReader.h>
32 template <
typename TInputImage >
35 typename TInputImage::Pointer &
image )
55 template <
typename TInputImage >
58 typename TInputImage::ConstPointer &
image )
78 template <
typename TInputImage >
86 typedef itk::ImageFileReader< TInputImage > FileReaderType;
88 typename FileReaderType::Pointer reader = FileReaderType::New();
90 reader->SetFileName( fileInput );
94 std::cout <<
"Reading " << description <<
" from file: "
95 << fileInput << std::endl;
99 image = reader->GetOutput();
111 template <
typename TInputImage >
119 typedef itk::ImageFileReader< TInputImage > FileReaderType;
121 typename FileReaderType::Pointer reader = FileReaderType::New();
123 reader->SetFileName( fileInput );
127 std::cout <<
"Reading " << description <<
" from file: "
128 << fileInput << std::endl;
132 image = reader->GetOutput();
GLenum GLsizei GLenum GLenum const GLvoid * image
Definition: glew.h:4052
Definition: niftkITKAffineResampleImage.cxx:74
bool ReadImageFromFile(const char *fileInput, const char *description, typename TInputImage::Pointer &image)
Read an ITK image to a file and print a message.
Definition: itkReadImage.h:34
bool FileExists(const std::string &fileName)
Definition: niftkFileHelper.cxx:233
GLsizei const GLcharARB ** string
Definition: glew.h:5194