-
Notifications
You must be signed in to change notification settings - Fork 0
/
mitkVolumeShearFunction.h
161 lines (130 loc) · 4.53 KB
/
mitkVolumeShearFunction.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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
/*=========================================================================
Program: Medical Imaging Toolkit
Date: $Date: 2008-09-01 20:13:46 +0800 $
Version: $Version: 2.00 $
Copyright: AI Lab, Institute of Automation, Chinese Academy of Sciences
Last Modified by Xiang Dehui ,2008-7-25
=========================================================================*/
#ifndef __mitkVolumeShearFunction_h
#define __mitkVolumeShearFunction_h
#include "mitkObject.h"
#include "mitkGlobalRegistration2Framework.h"
#define SHEAR_FORWARD 0
#define SHEAR_BACKWARD 1
#define SHEAR_SLICEX 0
#define SHEAR_SLICEY 1
#define SHEAR_SLICEZ 2
#define SHEAR_OPACITY 0.98
#define SHEAR_ZERO 0.000001f
// Macro for absolute x
#define mitkAbsMacro(x) (((x) > 0.0)?(x):(-(x)))
#define mitkFloorMacro(x) (((x) < 0.0)?((int)((x)-1.0)):((int)(x)))
#define mitkCeilingMacro(x) (((x) < 0.0)?((int)(x)):((int)((x)+1.0)))
#define mitkRoundMacro(x) (((x) < 0.0)?((int)((x)-0.5)):((int)((x)+0.5)))
class mitkMatrix;
class mitkView;
class mitkVolumeModel;
struct mitkShear
{
// float m_Color[4];
//volume information
int m_ScalarDataType;
void *m_ScalarDataPointer;
int m_DataIncrement[3];
int m_DataSize[3];
float m_DataSpacing[3];
//Shading
int m_Shading;
float *m_RedDiffuseShadingTable;
float *m_GreenDiffuseShadingTable;
float *m_BlueDiffuseShadingTable;
float *m_RedSpecularShadingTable;
float *m_GreenSpecularShadingTable;
float *m_BlueSpecularShadingTable;
unsigned short *m_EncodedNormals;
unsigned char *m_GradientMagnitudes;
//Transfer Function
int m_TF_Dimension;
int m_TF_ScalarOpacityMaxX;
int m_TF_ScalarOpacityMaxY;
float *m_TF_ScalarOpacity;
float *m_TF_GradientOpacity;
float *m_TF_ScalarColorRed;
float *m_TF_ScalarColorGreen;
float *m_TF_ScalarColorBlue;
float *m_TF_ScalarGradientMagnitudesOpacity;
//transformation matrix
mitkMatrix *m_ShearMatrix;
mitkMatrix *m_ShearOnlyMatrix;
float m_Sx;
float m_Sy;
float m_Sz;
// classification and interpolation information
int m_InterpolationType;
int m_ClassificationMethod;
//Integral, MIP and X-Ray option information
int m_Mode;
enum
{
INTEGRAL,
MOP
};
// image related information
int *m_GridOrigin;
int *m_GridSize;
int *m_ImageSize;
int *m_ImageMemorySize;
float *m_CompositeBuffer;
// shear order
int m_SliceOrder;
int m_XOrder;
int m_YOrder;
int m_ZOrder;
//crop and clip information
int *m_CropBounds;
float *m_ClipInformation;
int m_ClipCount;
bool m_NeedVoxelCull;
//view and model information
mitkView *m_View;
mitkVolumeModel *m_Vol;
//Grid/Image sample distance
float m_ImageSampleDistance;
};
/// mitkVolumeShearFunction - abstract class defines interface for volume shear
///////////////////////////////////////////////////////////////////////////
/// mitkVolumeShearFunction is an abstract class that defines interface for
/// both parallel and perspective shear. The mitkVolumeRendererShearWarp class
/// provides common information for shear, and then calls "Shear()" to implement
/// volume shear progress concretely.
class MITK_REGISTRATION2_API mitkVolumeShearFunction : public mitkObject
{
public:
MITK_TYPE(mitkVolumeShearFunction, mitkObject)
virtual void PrintSelf(ostream &os);
///////////////////////////////////////////////////////////////////////
/// The default constructor.
///////////////////////////////////////////////////////////////////////
mitkVolumeShearFunction();
//////////////////////////////////////////////////////////////////////////
/// Get the projection status of the class.
/// \return
/// Return true, means that this class is used for parallel splatting.
/// Return false, means that this class is used for perspective splatting.
/// \note All of its subclasses must implement this virtual to indicate
/// its status.
//////////////////////////////////////////////////////////////////////////
virtual bool IsParallel(){ return true; }
//////////////////////////////////////////////////////////////////////////
/// The real function to splat the volume.
/// \note All of its subclasses must implement this pure virtual to splat
/// the volume.
//////////////////////////////////////////////////////////////////////////
virtual void Shear(mitkShear *shearInform) = 0;
protected:
virtual ~mitkVolumeShearFunction();
private:
mitkVolumeShearFunction(const mitkVolumeShearFunction&);
void operator = (const mitkVolumeShearFunction&);
};
#endif