Slicer  4.8
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
itkImageToImageRegistrationMethodTestingHelper.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Surface Extraction Program
4  Module: $RCSfile: ExtractSurface.cxx,v $
5 
6  Copyright (c) Kitware Inc.
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
15 #ifndef itkImageToImageRegistrationMethodTestingHelper_h
16 #define itkImageToImageRegistrationMethodTestingHelper_h
17 
18 #include "itkImageFileReader.h"
19 #include "itkImageFileWriter.h"
20 #include "itkResampleImageFilter.h"
21 #include "itkTestingComparisonImageFilter.h"
22 
23 namespace itk
24 {
25 
31 template <class TRegistrationMethod>
33 {
34 
35  typedef TRegistrationMethod RegistrationMethodType;
36  typedef typename RegistrationMethodType::ImageType ImageType;
37  typedef typename RegistrationMethodType::Pointer RegistrationMethodPointer;
38 
39  typedef itk::ImageFileReader<ImageType> ImageReaderType;
40  typedef itk::ImageFileWriter<ImageType> ImageWriterType;
41 
42  typedef typename ImageReaderType::Pointer ImageReaderPointer;
43  typedef typename ImageWriterType::Pointer ImageWriterPointer;
44 
45  typedef ResampleImageFilter<ImageType, ImageType> ResampleFilterType;
46  typedef typename ResampleFilterType::Pointer ResampleFilterPointer;
47 
48  typedef itk::Testing::ComparisonImageFilter<ImageType, ImageType> DifferenceFilterType;
49  typedef typename DifferenceFilterType::Pointer DifferenceFilterPointer;
50 public:
51 
54 
56  RegistrationMethodType * GetRegistrationMethod();
57 
60  void SetFixedImageFileName( const char * filename );
61 
64  void SetMovingImageFileName( const char * filename );
65 
69  void SetResampledImageFileName( const char * filename );
70 
73  void SetBaselineImageFileName( const char * filename );
74 
76  void SetDifferenceImageFileName( const char * filename );
77 
81  void PrepareRegistration();
82 
85  void RunRegistration();
86 
91  void ReportResults();
92 
95  void ReportImagesMetaData();
96 
100  void ResampleOutputImage();
101 
105  void PerformRegressionTest();
106 
109  void PrintTest();
110 
112  int GetTestResult() const;
113 
116  void SetNumberOfFailedPixelsTolerance( unsigned long numberOfPixels );
117 
120  void SetRadiusTolerance( unsigned long radius );
121 
124  void SetIntensityTolerance( double intensity );
125 
126 protected:
127 private:
128 
129  RegistrationMethodPointer m_RegistrationMethod;
130  ImageReaderPointer m_FixedImageReader;
131  ImageReaderPointer m_MovingImageReader;
132  ImageWriterPointer m_MovingImageWriter;
133  ImageReaderPointer m_BaselineImageReader;
134  ImageWriterPointer m_DifferenceImageWriter;
135  DifferenceFilterPointer m_DifferenceFilter;
136  ResampleFilterPointer m_ResampleFilter;
137  unsigned long m_NumberOfFailedPixelsTolerance;
138  unsigned long m_RadiusTolerance;
139  double m_IntensityTolerance;
140 
141  bool m_ErrorState;
142 };
143 
144 } // end namespace itk
145 
146 #ifndef ITK_MANUAL_INSTANTIATION
147 #include "itkImageToImageRegistrationMethodTestingHelper.txx"
148 #endif
149 
150 #endif
Simplified inverse ITK transforms.
void SetNumberOfFailedPixelsTolerance(unsigned long numberOfPixels)
void SetMovingImageFileName(const char *filename)
RegistrationMethodType * GetRegistrationMethod()
void SetFixedImageFileName(const char *filename)
void SetResampledImageFileName(const char *filename)
void SetBaselineImageFileName(const char *filename)
void SetDifferenceImageFileName(const char *filename)