Repository navigation
Expand file tree
/
Copy pathitkMABMISSimulateData.h
More file actions
109 lines (84 loc) · 3.89 KB
/
Copy pathitkMABMISSimulateData.h
File metadata and controls
109 lines (84 loc) · 3.89 KB
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
#ifndef __itkMABMISSimulateData_h
#define __itkMABMISSimulateData_h
#include <itkImage.h>
#include <itkImageToImageFilter.h>
#include "itkImageFileReader.h"
#include "itkImageFileWriter.h"
#include "itkImageRegionIterator.h"
#include "itkImage.h"
#include "itkMABMISDeformationFieldFilter.h"
#include "itkMABMISImageOperationFilter.h"
#include "itkMABMISBasicOperationFilter.h"
#define ImageDimension 3
namespace itk
{
namespace Statistics
{
template <class TInputImage, class TOutputImage>
class MABMISSimulateData : public ImageToImageFilter<TInputImage, TOutputImage>
{
public:
typedef MABMISSimulateData Self;
typedef ImageToImageFilter<TInputImage, TOutputImage> Superclass;
typedef SmartPointer<Self> Pointer;
typedef SmartPointer<const Self> ConstPointer;
typedef TInputImage ImageType;
typedef typename ImageType::Pointer ImagePointerType;
/** Method for creation through the object factory. */
itkNewMacro(Self);
/** Run-time type information (and related methods). */
itkTypeMacro(MABMISSimulateData, ImageToImageFilter);
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;
DeformationFieldType::SpacingType df_spacing;
DeformationFieldType::DirectionType df_direction;
DeformationFieldType::PointType df_origin;
typedef itk::Statistics::MABMISDeformationFieldFilter<ImageType, ImageType> DeformationFieldOperationType;
typedef itk::Statistics::MABMISImageOperationFilter<ImageType, ImageType> ImageOperationType;
typedef itk::Statistics::MABMISBasicOperationFilter<ImageType, ImageType> BasicOperationType;
typename DeformationFieldOperationType::Pointer dfoperator;
typename ImageOperationType::Pointer imgoperator;
typename BasicOperationType::Pointer basicoperator;
int DoPCATraining(std::vector<std::string> deformationFieldFileNames, int numFiles,
std::vector<std::string> allImgFileName, int root);
void LoadIntoArray(std::string resampledDeformationFieldFileName, float* df_vector);
void SaveFromArray(std::string deformationFieldFileName, float* df_vector, int sx, int sy, int sz);
itkSetMacro(Root, int);
itkSetMacro(Imx, int);
itkSetMacro(Imy, int);
itkSetMacro(Imz, int);
itkSetMacro(AtlasSize, int);
itkSetMacro(SimulateSize, int);
private:
MABMISSimulateData(const Self &); // purposely not implemented
void operator=(const Self &); // purposely not implemented
int m_Root;
int m_Imx;
int m_Imy;
int m_Imz;
int m_AtlasSize;
int m_SimulateSize;
protected:
MABMISSimulateData();
~MABMISSimulateData();
void PrintSelf(std::ostream& os, Indent indent) const;
};
} // namespace itk
} // namespace Statistics
#include "itkMABMISSimulateData.hxx"
#endif