Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members

mitkVolumeRenderer.h

00001 /*=========================================================================
00002 
00003   Program:   3DMed
00004   Date:      $Date: 2014-02-25 18:30:00 +0800 $
00005   Version:   $Version: 4.6.0 $
00006   Copyright: MIPG, Institute of Automation, Chinese Academy of Sciences
00007 
00008 =========================================================================*/
00009 
00010 
00011 #ifndef __mitkVolumeRenderer_h
00012 #define __mitkVolumeRenderer_h
00013 
00014 #include "mitkRenderer.h"
00015 
00016 //Crop flag
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 //Classification flag
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 //#define DEFINED_mitkVolumeRenderer
00253  
00254 
00255 
00256 #endif
00257 
00258 /*=========================================================================
00259 
00260   Program:   Visualization Toolkit
00261   Module:    $RCSfile$
00262   Language:  C++
00263   Date:      $Date: 2006-10-10 11:07:26 +0800 (ÐÇÆÚ¶þ, 10 ʮԠ2006) $
00264   Version:   $Revision: 72 $
00265 
00266 
00267 Copyright (c) 1993-2002 Ken Martin, Will Schroeder, Bill Lorensen 
00268 All rights reserved.
00269 
00270 Redistribution and use in source and binary forms, with or without
00271 modification, are permitted provided that the following conditions are met:
00272 
00273  * Redistributions of source code must retain the above copyright notice,
00274    this list of conditions and the following disclaimer.
00275 
00276  * Redistributions in binary form must reproduce the above copyright notice,
00277    this list of conditions and the following disclaimer in the documentation
00278    and/or other materials provided with the distribution.
00279 
00280  * Neither name of Ken Martin, Will Schroeder, or Bill Lorensen nor the names
00281    of any contributors may be used to endorse or promote products derived
00282    from this software without specific prior written permission.
00283 
00284  * Modified source versions must be plainly marked as such, and must not be
00285    misrepresented as being the original software.
00286 
00287 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
00288 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00289 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
00290 ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR
00291 ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00292 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
00293 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00294 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
00295 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00296 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00297 
00298 =========================================================================*/
00299 

Generated on Tue Feb 25 15:00:37 2014 for MITK (Medical Imaging ToolKit) by  doxygen 1.4.3