Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef mitkVolumeVisualizationImagePreprocessor_h_include
00019 #define mitkVolumeVisualizationImagePreprocessor_h_include
00020
00021
00022 #include "mitkCommon.h"
00023 #include "MitkExtExports.h"
00024
00025
00026 #include "mitkImageCast.h"
00027 #include "mitkITKImageImport.h"
00028 #include "mitkTransferFunctionProperty.h"
00029
00030 #include <itkMedianImageFilter.h>
00031 #include "mitkMaskImageFilter.h"
00032 #include "mitkAutoCropImageFilter.h"
00033 #include "mitkSurface.h"
00034
00035 #include <vtkContourFilter.h>
00036 #include <vtkImageChangeInformation.h>
00037 #include <vtkMatrix4x4.h>
00038 #include <vtkLinearTransform.h>
00039 #include <vtkDataObject.h>
00040
00041 #include <itkDiscreteGaussianImageFilter.h>
00042 #include <itkConnectedComponentImageFilter.h>
00043 #include <itkRelabelComponentImageFilter.h>
00044 #include <itkThresholdLabelerImageFilter.h>
00045 #include <itkBinaryDilateImageFilter.h>
00046 #include <itkBinaryErodeImageFilter.h>
00047 #include <itkBinaryBallStructuringElement.h>
00048
00049 #include <vtkSmoothPolyDataFilter.h>
00050
00051 #include <vtkDecimatePro.h>
00052 #include <vtkQuadricDecimation.h>
00053
00054 namespace mitk
00055 {
00056
00057 class MitkExt_EXPORT VolumeVisualizationImagePreprocessor : public itk::Object
00058 {
00059 public:
00060
00061 mitkClassMacro(VolumeVisualizationImagePreprocessor, itk::Object);
00062
00063 itkNewMacro(Self);
00064
00065
00066 mitk::Image::Pointer Process( mitk::Image::Pointer originalCT,
00067 mitk::Image::Pointer originalLiverMask );
00068
00069
00070 double GetEstimatedThreshold() const
00071 {
00072 return m_EstimatedThreshold;
00073 }
00074
00075 double GetMinThreshold() const
00076 {
00077 return m_MinThreshold;
00078 }
00079
00080 double GetMaxThreshold() const
00081 {
00082 return m_MaxThreshold;
00083 }
00084
00085 double GetLastUsedThreshold() const
00086 {
00087 return m_LastUsedTreshold;
00088 }
00089
00090 mitk::TransferFunction::Pointer GetInitialTransferFunction( );
00091 void UpdateTransferFunction( mitk::TransferFunction::Pointer tf , int treshold );
00092
00093
00094 protected:
00095
00096 typedef itk::Image<short, 3> CTImage;
00097 typedef itk::ImageRegionIterator< CTImage > CTIteratorType;
00098 typedef itk::ImageRegionIteratorWithIndex< CTImage > CTIteratorIndexType;
00099
00100 typedef itk::Image<unsigned char, 3 > BinImage;
00101 typedef itk::ImageRegionIterator< BinImage > BinIteratorType;
00102 typedef itk::ImageRegionIteratorWithIndex< BinImage > BinIteratorIndexType;
00103
00104 typedef itk::Image<unsigned short, 3 > LabelImage;
00105 typedef itk::ImageRegionIterator< LabelImage > LabelIteratorType;
00106
00107
00108 VolumeVisualizationImagePreprocessor();
00109
00110 ~VolumeVisualizationImagePreprocessor();
00111
00112
00113 CTImage::Pointer Composite( CTImage::Pointer work,
00114 BinImage::Pointer mask,
00115 BinImage::Pointer dilated,
00116 BinImage::Pointer eroded );
00117
00118
00119 void DetermineBoundingBox( BinImage::Pointer mask );
00120
00121 CTImage::Pointer Crop(CTImage::Pointer src );
00122 BinImage::Pointer Crop(BinImage::Pointer src );
00123
00124
00125
00126
00128 BinImage::Pointer Dilate(BinImage::Pointer src);
00129 BinImage::Pointer Erode(BinImage::Pointer src);
00130 CTImage::Pointer Gaussian(CTImage::Pointer src);
00131 LabelImage::Pointer ConnectComponents(BinImage::Pointer src);
00132 LabelImage::Pointer RelabelComponents(LabelImage::Pointer src);
00133 BinImage::Pointer Threshold(CTImage::Pointer src, int threshold);
00134
00135
00136
00137
00138
00139 double m_OutOfLiverValue;
00140
00141
00142 double m_surfaceValue;
00143
00144
00145 double m_realSurfaceValue;
00146
00147 double m_realInLiverValue;
00148
00149
00150 double m_EstimatedThreshold;
00151
00152 double m_GreatestStructureThreshold;
00153
00154
00155
00156 double m_MinThreshold;
00157
00158
00159 double m_MaxThreshold;
00160
00161 int m_MinX;
00162 int m_MinY;
00163 int m_MinZ;
00164
00165 int m_MaxX;
00166 int m_MaxY;
00167 int m_MaxZ;
00168
00169 int m_LastUsedTreshold;
00170
00171 int histogramm[65536];
00172 int total;
00173
00174
00175 int GetHistogrammValueFromTop( double part );
00176 int GetHistogrammValueFromBottom( double part );
00177
00178
00179 };
00180
00181
00182 }
00183
00184 #endif // #define mitkVolumeVisualizationImagePreprocessor_h_include