mimxRegisterVersorRigidFilter.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef __mimxRegisterVersorRigidFilter_h
00025 #define __mimxegisterVersorRigidFilter_h
00026
00027 #include "itkObject.h"
00028 #include "itkImage.h"
00029 #include "itkImageToImageFilter.h"
00030 #include "itkIOCommon.h"
00031 #include "vtkMimxCommonWin32Header.h"
00032 #include <itkExtractImageFilter.h>
00033 #include <itkMetaDataDictionary.h>
00034 #include <itkMetaDataObject.h>
00035 #include <itkVersorRigid3DTransformOptimizer.h>
00036 #include <itkImageRegistrationMethod.h>
00037 #include <itkMattesMutualInformationImageToImageMetric.h>
00038 #include <itkLinearInterpolateImageFunction.h>
00039 #include <itkVersorRigid3DTransform.h>
00040 #include <itkCenteredTransformInitializer.h>
00041 #include <itkTimeProbesCollectorBase.h>
00042 #include <itkTransformFactory.h>
00043
00044 #include <map>
00045 #include <string>
00046
00047 namespace itk {
00048
00059 class mimxRegisterVersorRigidFilter : public itk::Object
00060 {
00061 public:
00063 typedef mimxRegisterVersorRigidFilter Self;
00064 typedef itk::Object Superclass;
00065 typedef SmartPointer<Self> Pointer;
00066 typedef SmartPointer<const Self> ConstPointer;
00067
00069 typedef itk::Image<signed short,3> FixedImageType;
00070 typedef FixedImageType::Pointer FixedImagePointer;
00071 typedef FixedImageType::ConstPointer FixedImageConstPointer;
00072 typedef FixedImageType::RegionType FixedImageRegionType;
00073 typedef FixedImageType::SizeType FixedImageSizeType;
00074 typedef FixedImageType::SpacingType FixedImageSpacingType;
00075 typedef FixedImageType::PointType FixedImagePointType;
00076 typedef FixedImageType::PixelType FixedImagePixelType;
00077 typedef FixedImageType::DirectionType FixedImageDirectionType;
00078 typedef FixedImageType::IndexType FixedImageIndexType;
00079
00081 typedef itk::Image<signed short,3> MovingImageType;
00082 typedef MovingImageType::Pointer MovingImagePointer;
00083 typedef MovingImageType::ConstPointer MovingImageConstPointer;
00084 typedef MovingImageType::RegionType MovingImageRegionType;
00085 typedef MovingImageType::SizeType MovingImageSizeType;
00086 typedef MovingImageType::SpacingType MovingImageSpacingType;
00087 typedef MovingImageType::PointType MovingImagePointType;
00088 typedef MovingImageType::PixelType MovingImagePixelType;
00089 typedef MovingImageType::DirectionType MovingImageDirectionType;
00090 typedef MovingImageType::IndexType MovingImageIndexType;
00091
00092
00094 typedef itk::VersorRigid3DTransform< double > TransformType;
00095 typedef itk::VersorRigid3DTransformOptimizer OptimizerType;
00096 typedef itk::MattesMutualInformationImageToImageMetric<
00097 FixedImageType,
00098 MovingImageType > MetricType;
00099
00100 typedef itk:: LinearInterpolateImageFunction<
00101 MovingImageType,
00102 double > InterpolatorType;
00103
00104 typedef itk::ImageRegistrationMethod<
00105 FixedImageType,
00106 MovingImageType > RegistrationType;
00107
00108 typedef itk::CenteredTransformInitializer< TransformType,
00109 FixedImageType,
00110 MovingImageType
00111 > TransformInitializerType;
00112 typedef TransformType::Pointer TransformTypePointer;
00113 typedef TransformType::VersorType VersorType;
00114 typedef VersorType::VectorType VectorType;
00115 typedef MetricType::Pointer MetricTypePointer;
00116 typedef OptimizerType::Pointer OptimizerTypePointer;
00117 typedef OptimizerType::ParametersType OptimizerParameterType;
00118 typedef OptimizerType::ScalesType OptimizerScalesType;
00119 typedef InterpolatorType::Pointer InterpolatorTypePointer;
00120 typedef RegistrationType::Pointer RegistrationTypePointer;
00121 typedef TransformInitializerType::Pointer TransformInitializerTypePointer;
00122
00123 #if 0
00124 / ** ImageDimension constants * /
00125 itkStaticConstMacro(InputImageDimension, unsigned int,
00126 TInputImage::ImageDimension);
00127 itkStaticConstMacro(OutputImageDimension, unsigned int,
00128 TOutputImage::ImageDimension);
00129
00130 / ** The dimensions of the input image must equal those of the
00131 output image. * /
00132 itkConceptMacro(SameDimension,
00133 (Concept::SameDimension<itkGetStaticConstMacro(InputImageDimension),itkGetStaticConstMacro(OutputImageDimension)>));
00134
00135 / ** The dimension of the input image must be 4. * /
00136 itkConceptMacro(DimensionShouldBe4,
00137 (Concept::SameDimension<itkGetStaticConstMacro(InputImageDimension),4>));
00138 */
00139 #endif
00140
00141 itkNewMacro(Self);
00142
00144 itkTypeMacro(RegisterVersorRigidFilter, itk::Object);
00145
00146
00147 itkSetObjectMacro (FixedImage, FixedImageType);
00148 itkSetObjectMacro (MovingImage, MovingImageType);
00149 itkGetObjectMacro (Output, TransformType);
00150
00151 itkSetMacro (NumberOfSpatialSamples, int);
00152 itkSetMacro (NumberOfIterations, int);
00153 itkSetMacro (TranslationScale, float);
00154 itkSetMacro (MaximumStepLength, float);
00155 itkSetMacro (MinimumStepLength, float);
00156 itkSetMacro (RelaxationFactor, float);
00157
00158
00159 void Update();
00160
00161 protected:
00162 mimxRegisterVersorRigidFilter();
00163 ~mimxRegisterVersorRigidFilter() {};
00164
00165
00166 private:
00167 mimxRegisterVersorRigidFilter(const Self&);
00168 void operator=(const Self&);
00169
00170
00171 FixedImagePointer m_FixedImage;
00172 MovingImagePointer m_MovingImage;
00173 TransformTypePointer m_Output;
00174
00175
00176
00177 float m_TranslationScale;
00178 float m_MaximumStepLength;
00179 float m_MinimumStepLength;
00180 float m_RelaxationFactor;
00181 int m_NumberOfSpatialSamples;
00182 int m_NumberOfIterations;
00183
00184 } ;
00185
00186 }
00187
00188
00189 #endif
00190
00191