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

mitkOoCVolumeShearFunction.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 __mitkOoCVolumeShearFunction_h
00012 #define __mitkOoCVolumeShearFunction_h
00013 
00014 #include "mitkObject.h"
00015 #include "mitkVolumeDivider.h"
00016 
00017 #define SHEAR_FORWARD 0
00018 #define SHEAR_BACKWARD 1
00019 
00020 #define SHEAR_SLICEX 0
00021 #define SHEAR_SLICEY 1
00022 #define SHEAR_SLICEZ 2
00023 
00024 #define SHEAR_OPACITY 0.98
00025 #define SHEAR_ZERO 0.000001f
00026 
00027 // Macro for absolute x
00028 #define mitkAbsMacro(x)     (((x) > 0.0)?(x):(-(x)))
00029 #define mitkFloorMacro(x)   (((x) < 0.0)?((int)((x)-1.0)):((int)(x)))
00030 #define mitkCeilingMacro(x)   (((x) < 0.0)?((int)(x)):((int)((x)+1.0)))
00031 #define mitkRoundMacro(x)   (((x) < 0.0)?((int)((x)-0.5)):((int)((x)+0.5)))
00032 
00033 class mitkMatrix;
00034 class mitkScene;
00035 class mitkVolumeModel;
00036 class mitkVolume;
00037 struct mitkShear
00038 {
00039     //  float m_Color[4];
00040 
00041     //volume information
00042     int   m_ScalarDataType;
00043     int   m_DataIncrement[3];
00044     int   m_DataSize[3];
00045     float m_DataSpacing[3]; 
00046     int   m_BlockStart, m_BlockEnd; //in case of out-of-core data
00047     int   m_BufferSliceNum;
00048     int   m_Offset;
00049     union
00050     {
00051 //      void  *m_ScalarDataPointer;
00052         void const **m_ScalarDataSlices; //in case of out-of-core data
00053         mitkVolume *m_ScalarDataVol;
00054     };
00055     
00056     //Shading
00057     int            m_Shading;   
00058     float          *m_RedDiffuseShadingTable;
00059     float          *m_GreenDiffuseShadingTable;
00060     float          *m_BlueDiffuseShadingTable;
00061     float          *m_RedSpecularShadingTable;
00062     float          *m_GreenSpecularShadingTable;
00063     float          *m_BlueSpecularShadingTable; 
00064     union
00065     {
00066 //      unsigned short *m_EncodedNormals;
00067         unsigned short const **m_EncodedNormalSlices; //in case of out-of-core data
00068         mitkVolume *m_EncodedNormalVol;
00069     };
00070 
00071     union
00072     {
00073 //      unsigned char  *m_GradientMagnitudes;
00074         unsigned char const **m_GradientMagnitudeSlices; //in case of out-of-core data
00075         mitkVolume *m_GradientMagnitudeVol;
00076     };
00077 
00078     //Transfer Function
00079     int   m_TF_Dimension;
00080     int   m_TF_ScalarOpacityMaxX;
00081     int   m_TF_ScalarOpacityMaxY;   
00082     float *m_TF_ScalarOpacity;
00083     float *m_TF_GradientOpacity;
00084     float *m_TF_ScalarColorRed;
00085     float *m_TF_ScalarColorGreen;
00086     float *m_TF_ScalarColorBlue;
00087 
00088     float *m_TF_2DOpacity;
00089     float *m_TF_2DRed;
00090     float *m_TF_2DGreen;
00091     float *m_TF_2DBlue;
00092 
00093     //transformation matrix
00094     mitkMatrix *m_ShearMatrix;
00095     mitkMatrix *m_ShearOnlyMatrix;
00096     float m_Sx;
00097     float m_Sy;
00098     float m_Sz;
00099 
00100     // classification and interpolation information
00101     int   m_InterpolationType;      
00102     int   m_ClassificationMethod;
00103 
00104     //Integral, MIP and X-Ray option information
00105     int m_Mode;
00106     enum
00107     {
00108         INTEGRAL,
00109         MOP
00110     };
00111     
00112     // image related information
00113     int           *m_GridOrigin;
00114     int           *m_GridSize;
00115     int           *m_ImageSize;
00116     int           *m_ImageMemorySize;
00117     float         *m_CompositeBuffer;
00118 
00119 
00120     // shear order
00121     int m_SliceOrder;
00122     int m_XOrder;
00123     int m_YOrder;
00124     int m_ZOrder;
00125 
00126     //crop and clip information
00127     int   *m_CropBounds;
00128     float *m_ClipInformation;
00129     int   m_ClipCount;
00130     bool  m_NeedVoxelCull;
00131 
00132     //scene and model information
00133     mitkScene        *m_Scene;
00134     mitkVolumeModel *m_Vol;
00135 
00136     //Grid/Image sample distance
00137     float m_ImageSampleDistance;
00138 
00139 };
00140 
00141 
00148 class MITK_VISUALIZATION_API mitkOoCVolumeShearFunction : public mitkObject
00149 {
00150 public:
00151     MITK_TYPE(mitkOoCVolumeShearFunction, mitkObject)
00152 
00153     virtual void PrintSelf(ostream &os);
00154 
00158     mitkOoCVolumeShearFunction();
00159 
00168     virtual bool IsParallel(){ return true; }
00169 
00175     virtual void Shear(mitkShear *shearInform) = 0;
00176 
00177 protected:
00178     virtual ~mitkOoCVolumeShearFunction();
00179 
00180 private:
00181     mitkOoCVolumeShearFunction(const mitkOoCVolumeShearFunction&);
00182     void operator = (const mitkOoCVolumeShearFunction&);
00183 
00184 };
00185 
00186 
00187 //#define DEFINED_mitkOoCVolumeShearFunction
00188 
00189 
00190 
00191 #endif
00192 

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