00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #ifndef __mitkVolumeRenderer_h
00012 #define __mitkVolumeRenderer_h
00013
00014 #include "mitkRenderer.h"
00015
00016
00017 #define MITK_CROP_SUBVOLUME 0x0002000
00018 #define MITK_CROP_FENCE 0x2ebfeba
00019 #define MITK_CROP_INVERTED_FENCE 0x5140145
00020 #define MITK_CROP_CROSS 0x0417410
00021 #define MITK_CROP_INVERTED_CROSS 0x7be8bef
00022
00023
00024 #define MITK_PRE_CLASSIFICATION 0
00025 #define MITK_POST_CLASSIFICATION 1
00026 #define MITK_PRE_INTEGRATION 2
00027
00028 class mitkScene;
00029 class mitkVolumeModel;
00030
00036 class MITK_VISUALIZATION_API mitkVolumeRenderer : public mitkRenderer
00037 {
00038 public:
00039 MITK_TYPE(mitkVolumeRenderer,mitkRenderer)
00040
00041 virtual void PrintSelf(ostream& os);
00042
00043
00049 void SetCropping(bool isCropping) { m_EnableCropping = isCropping; }
00050
00054 void CroppingOn() { this->SetCropping(true); }
00055
00059 void CroppingOff() { this->SetCropping(false); }
00060
00066 int GetCropping() { return m_EnableCropping; }
00067
00068
00078 void SetCroppingRegionPlanes(float region[6])
00079 {
00080 m_CroppingRegionPlanes[0] = region[0];
00081 m_CroppingRegionPlanes[1] = region[1];
00082 m_CroppingRegionPlanes[2] = region[2];
00083 m_CroppingRegionPlanes[3] = region[3];
00084 m_CroppingRegionPlanes[4] = region[4];
00085 m_CroppingRegionPlanes[5] = region[5];
00086 }
00087
00097 void SetCroppingRegionPlanes(float xmin, float xmax, float ymin, float ymax, float zmin, float zmax)
00098 {
00099 m_CroppingRegionPlanes[0] = xmin;
00100 m_CroppingRegionPlanes[1] = xmax;
00101 m_CroppingRegionPlanes[2] = ymin;
00102 m_CroppingRegionPlanes[3] = ymax;
00103 m_CroppingRegionPlanes[4] = zmin;
00104 m_CroppingRegionPlanes[5] = zmax;
00105 }
00106
00112 float* GetCroppingRegionPlanes() {return m_CroppingRegionPlanes;}
00113
00123 void GetCroppingRegionPlanes(float &xmin, float &xmax, float &ymin, float &ymax, float &zmin, float &zmax)
00124 {
00125 xmin = m_CroppingRegionPlanes[0];
00126 xmax = m_CroppingRegionPlanes[1];
00127 ymin = m_CroppingRegionPlanes[2];
00128 ymax = m_CroppingRegionPlanes[3];
00129 zmin = m_CroppingRegionPlanes[4];
00130 zmax = m_CroppingRegionPlanes[5];
00131 }
00132
00137 void SetCroppingRegionFlags(int flags) {m_CroppingRegionFlags = flags;}
00138
00143 int GetCroppingRegionFlags() {return m_CroppingRegionFlags;}
00144
00148 void SetCroppingRegionFlagsToSubVolume()
00149 {this->SetCroppingRegionFlags(MITK_CROP_SUBVOLUME);}
00150
00154 void SetCroppingRegionFlagsToFence()
00155 {this->SetCroppingRegionFlags(MITK_CROP_FENCE);}
00156
00160 void SetCroppingRegionFlagsToInvertedFence()
00161 {this->SetCroppingRegionFlags(MITK_CROP_INVERTED_FENCE);}
00162
00166 void SetCroppingRegionFlagsToCross()
00167 {this->SetCroppingRegionFlags(MITK_CROP_CROSS);}
00168
00172 void SetCroppingRegionFlagsToInvertedCross()
00173 {this->SetCroppingRegionFlags(MITK_CROP_INVERTED_CROSS);}
00174
00175
00176 virtual float GetGradientMagnitudeScale() {return 1.0f;};
00177 virtual float GetGradientMagnitudeBias() {return 0.0f;};
00178
00189 void SetClassifyMethod(int classifyMethod)
00190 {
00191 m_ClassifyMethod = classifyMethod;
00192 }
00193
00203 int GetClassifyMethod() {return m_ClassifyMethod;}
00204
00208 void SetClassifyMethodToPreClassification()
00209 {
00210 m_ClassifyMethod = MITK_PRE_CLASSIFICATION;
00211 }
00212
00216 void SetClassifyMethodToPostClassification()
00217 {
00218 m_ClassifyMethod = MITK_POST_CLASSIFICATION;
00219 }
00220
00224 void SetClassifyMethodToPreIntegration()
00225 {
00226 m_ClassifyMethod = MITK_PRE_INTEGRATION;
00227 }
00228
00232 virtual int Render(mitkScene *scene, mitkVolumeModel *vol) = 0;
00233
00234 void SetAdjustClippingPlane(bool enable=true) { m_NeedAdjustClippingPlane = enable; }
00235
00236 protected:
00237 mitkVolumeRenderer();
00238 virtual ~mitkVolumeRenderer();
00239
00240 float m_CroppingRegionPlanes[6];
00241 int m_CroppingRegionFlags;
00242 int m_ClassifyMethod;
00243 bool m_EnableCropping;
00244 bool m_NeedAdjustClippingPlane;
00245
00246 private:
00247 mitkVolumeRenderer(const mitkVolumeRenderer&);
00248 void operator=(const mitkVolumeRenderer&);
00249 };
00250
00251
00252
00253
00254
00255
00256 #endif
00257
00258
00259
00260
00261
00262
00263
00264
00265
00266
00267
00268
00269
00270
00271
00272
00273
00274
00275
00276
00277
00278
00279
00280
00281
00282
00283
00284
00285
00286
00287
00288
00289
00290
00291
00292
00293
00294
00295
00296
00297
00298
00299