#include "itkImage.h"
#include "itkImageFileReader.h"
#include "itkImageFileWriter.h"
int main (int argc, char *argv[]) {

  if (argc < 3) {
    std::cerr << "Usage: " << argv[0] << std::endl;
    std::cerr << " inputImageFile  outputImageFile " << std::endl;
    return EXIT_FAILURE;
  }

  const unsigned int Dimension = 3;

  //  typedef unsigned char   PixelType;
  //  typedef unsigned int    PixelType;
  //  typedef short          PixelType;
  typedef float PixelType;

  typedef itk::Image < PixelType, Dimension > ImageType;
  typedef itk::ImageFileReader < ImageType > ReaderType;
  typedef itk::ImageFileWriter < ImageType > WriterType;

  ReaderType::Pointer reader = ReaderType::New ();
  WriterType::Pointer writer = WriterType::New ();

  reader->SetFileName (argv[1]);
  writer->SetFileName (argv[2]);

  writer->SetInput (reader->GetOutput ());
  writer->Update ();

  try {
    writer->Update ();
  }
  catch (itk::ExceptionObject & exp) {
    std::cerr << "Exception caught !" << std::endl;
    std::cerr << exp << std::endl;
  }

  return EXIT_SUCCESS;
}
