-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathitkMABMISImageRegistrationFilter.h
121 lines (93 loc) · 5.65 KB
/
itkMABMISImageRegistrationFilter.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
#ifndef __itkMABMISImageRegistrationFilter_h
#define __itkMABMISImageRegistrationFilter_h
#include <itkImage.h>
#include <itkImageToImageFilter.h>
#include "itkImageFileReader.h"
#include "itkImageFileWriter.h"
#include "itkImageRegionIterator.h"
#include "itkHistogramMatchingImageFilter.h"
#include "itkImage.h"
#include "itkMABMISDeformationFieldFilter.h"
#include "itkMABMISImageOperationFilter.h"
#define ImageDimension 3
namespace itk
{
namespace Statistics
{
template <class TInputImage, class TOutputImage>
class MABMISImageRegistrationFilter : public ImageToImageFilter<TInputImage, TOutputImage>
{
public:
typedef MABMISImageRegistrationFilter Self;
typedef ImageToImageFilter<TInputImage, TOutputImage> Superclass;
typedef SmartPointer<Self> Pointer;
typedef SmartPointer<const Self> ConstPointer;
typedef TInputImage ImageType;
typedef typename ImageType::Pointer ImagePointerType;
typedef itk::ImageFileReader<ImageType> ImageReaderType;
typedef itk::ImageRegionIterator<ImageType> ImageIteratorType;
// basic data type
typedef unsigned char CharPixelType; // for image IO usage
typedef float FloatPixelType; // for
typedef int IntPixelType;
typedef short ShortPixelType;
typedef float InternalPixelType; // for internal processing usage
typedef itk::Vector<InternalPixelType, ImageDimension> VectorPixelType;
// basic image type
typedef itk::Image<CharPixelType, ImageDimension> CharImageType;
typedef itk::Image<IntPixelType, ImageDimension> IntImageType;
typedef itk::Image<ShortPixelType, ImageDimension> ShortImageType;
typedef itk::Image<FloatPixelType, ImageDimension> FloatImageType;
typedef itk::Image<InternalPixelType, ImageDimension> InternalImageType;
typedef itk::Image<VectorPixelType, ImageDimension> DeformationFieldType;
// basic iterator type
typedef itk::ImageRegionIterator<DeformationFieldType> DeformationFieldIteratorType;
typedef itk::ImageRegionIterator<InternalImageType> InternalImageIteratorType;
typedef itk::ImageRegionIterator<CharImageType> CharImageIteratorType;
// basic image reader/writer related type
typedef itk::ImageFileReader<CharImageType> CharImageReaderType;
typedef itk::ImageFileReader<InternalImageType> InternalImageReaderType;
typedef itk::ImageFileWriter<InternalImageType> InternalImageWriterType;
typedef itk::CastImageFilter<InternalImageType, CharImageType> Internal2CharCastFilterType;
typedef itk::CastImageFilter<InternalImageType, FloatImageType> Internal2FloatCastFilterType;
typedef itk::CastImageFilter<InternalImageType, IntImageType> Internal2IntCastFilterType;
typedef itk::CastImageFilter<InternalImageType, ShortImageType> Internal2ShortCastFilterType;
typedef itk::WarpImageFilter<InternalImageType, InternalImageType, DeformationFieldType> InternalWarpFilterType;
typedef itk::ImageFileWriter<CharImageType> CharImageWriterType;
typedef itk::ImageFileWriter<IntImageType> IntImageWriterType;
typedef itk::ImageFileWriter<FloatImageType> FloatImageWriterType;
typedef itk::ImageFileWriter<ShortImageType> ShortImageWriterType;
typedef itk::ImageFileReader<DeformationFieldType> DeformationFieldReaderType;
typedef itk::ImageFileWriter<DeformationFieldType> DeformationFieldWriterType;
typedef itk::HistogramMatchingImageFilter<InternalImageType, InternalImageType> InternalHistMatchFilterType;
/** Method for creation through the object factory. */
itkNewMacro(Self);
/** Run-time type information (and related methods). */
itkTypeMacro(MABMISImageRegistrationFilter, ImageToImageFilter);
typedef itk::Statistics::MABMISDeformationFieldFilter<ImageType, ImageType> DeformationFieldOperationType;
typedef itk::Statistics::MABMISImageOperationFilter<ImageType, ImageType> ImageOperationType;
typename DeformationFieldOperationType::Pointer dfoperator;
typename ImageOperationType::Pointer imgoperator;
void DoIt();
int DiffeoDemonsRegistrationWithParameters(std::string fixedImageFileName, std::string movingImageFileName,
std::string deformedImageFileName, std::string deformationFieldFileName,
double sigmaDef, bool doHistMatch, std::vector<int> iterInResolutions);
int DiffeoDemonsRegistrationWithInitialWithParameters(std::string fixedImageFileName, std::string movingImageFileName,
std::string initDeformationFieldFileName,
std::string deformedImageFileName, std::string deformationFieldFileName,
double sigmaDef, bool doHistMatch,
std::vector<int> iterInResolutions);
itkSetMacro(Root, int);
private:
MABMISImageRegistrationFilter(const Self &); // purposely not implemented
void operator=(const Self &); // purposely not implemented
int m_Root;
protected:
MABMISImageRegistrationFilter();
~MABMISImageRegistrationFilter();
void PrintSelf(std::ostream& os, Indent indent) const;
};
} // namespace itk
} // namespace Statistics
#include "itkMABMISImageRegistrationFilter.hxx"
#endif