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 VOLUME_CALCULATOR_H_HEADER_INCLUDED
00019 #define VOLUME_CALCULATOR_H_HEADER_INCLUDED
00020
00021 #include "itkObject.h"
00022 #include "itkObjectFactory.h"
00023 #include "itkImage.h"
00024
00025 #include "mitkCommon.h"
00026 #include "mitkImage.h"
00027 #include "mitkImageTimeSelector.h"
00028
00029 namespace mitk
00030 {
00038 class MITK_CORE_EXPORT VolumeCalculator : public itk::Object
00039 {
00040 public:
00041 mitkClassMacro(VolumeCalculator,itk::Object);
00042
00043 itkNewMacro(Self);
00044 itkSetObjectMacro(Image,Image);
00045 itkSetMacro(Threshold,int);
00046 itkGetMacro(Volume,float);
00047 itkGetMacro(VoxelCount,unsigned long int);
00048
00049 std::vector<float> GetVolumes();
00050 void ComputeVolume();
00051
00052 void ComputeVolumeFromImageStatistics();
00053 static float ComputeVolume(Vector3D spacing, unsigned int voxelCount);
00054
00055 protected:
00056
00057 VolumeCalculator();
00058 virtual ~VolumeCalculator();
00059
00060 template < typename TPixel, unsigned int VImageDimension >
00061 void InternalCompute(itk::Image< TPixel, VImageDimension >* itkImage);
00062
00063 Image::ConstPointer m_Image;
00064 int m_Threshold;
00065 float m_Volume;
00066 unsigned long int m_VoxelCount;
00067 std::vector<float> m_Volumes;
00068 ImageTimeSelector::Pointer m_TimeSelector;
00069 };
00070
00071 }
00072
00073 #endif
00074