1
/*=========================================================================
3
Program: Insight Segmentation & Registration Toolkit
4
Module: $RCSfile: itkImageIOBaseTest.cxx,v $
6
Date: $Date: 2008-05-27 12:07:34 $xgoto-l
8
Version: $Revision: 1.3 $
10
Copyright (c) 2002 Insight Consortium. All rights reserved.
11
See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
13
This software is distributed WITHOUT ANY WARRANTY; without even
14
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15
PURPOSE. See the above copyright notices for more information.
17
=========================================================================*/
19
#pragma warning ( disable : 4786 )
21
#include "itkImageIOBase.h"
22
#include "itkMetaImageIO.h"
24
int itkImageIOBaseTest( int , char * [] )
26
typedef itk::ImageIOBase BaseReaderType;
27
typedef BaseReaderType BaseReaderPointerType;
29
typedef itk::MetaImageIO ReaderType;
30
typedef ReaderType::Pointer ReaderPointerType;
32
itk::MetaImageIO::Pointer reader = itk::MetaImageIO::New();
33
reader->SetNumberOfDimensions(3);
35
bool gotException = false;
38
reader->SetDimensions(3,1);
40
catch ( itk::ExceptionObject& e )
42
std::cerr << "Caught expected exception " << e << std::endl;
47
std::cerr << "Failed to catch expected exception in method SetDimensions"
55
reader->SetOrigin(3,1.0);
57
catch ( itk::ExceptionObject& e )
59
std::cerr << "Caught expected exception " << e << std::endl;
64
std::cerr << "Failed to catch expected exception in method SetOrigin"
72
reader->SetSpacing(3,1.0);
74
catch ( itk::ExceptionObject& e )
76
std::cerr << "Caught expected exception " << e << std::endl;
81
std::cerr << "Failed to catch expected exception in method SetSpacing"
89
std::vector<double> direction(3);
93
reader->SetDirection(3,direction);
95
catch ( itk::ExceptionObject& e )
97
std::cerr << "Caught expected exception " << e << std::endl;
102
std::cerr << "Failed to catch expected exception in method SetDirection"
107
gotException = false;
110
vnl_vector<double> direction(3);
114
reader->SetDirection(3,direction);
116
catch ( itk::ExceptionObject& e )
118
std::cerr << "Caught expected exception " << e << std::endl;
123
std::cerr << "Failed to catch expected exception in method SetDirection"