Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
mitkVolumeCalculator.h
Go to the documentation of this file.
1 /*===================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center,
6 Division of Medical and Biological Informatics.
7 All rights reserved.
8 
9 This software is distributed WITHOUT ANY WARRANTY; without
10 even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 A PARTICULAR PURPOSE.
12 
13 See LICENSE.txt or http://www.mitk.org for details.
14 
15 ===================================================================*/
16 
17 #ifndef VOLUME_CALCULATOR_H_HEADER_INCLUDED
18 #define VOLUME_CALCULATOR_H_HEADER_INCLUDED
19 
20 #include "itkImage.h"
21 #include "itkObject.h"
22 #include "itkObjectFactory.h"
23 
24 #include "mitkImage.h"
25 #include "mitkImageTimeSelector.h"
26 #include <MitkCoreExports.h>
27 
28 namespace mitk
29 {
37  class MITKCORE_EXPORT VolumeCalculator : public itk::Object
38  {
39  public:
41 
42  itkFactorylessNewMacro(Self) itkCloneMacro(Self) itkSetObjectMacro(Image, Image);
46  itkSetMacro(Threshold, int);
52  itkGetMacro(Volume, float);
56  itkGetMacro(VoxelCount, unsigned long int);
62  std::vector<float> GetVolumes();
63  void ComputeVolume();
64 
65  void ComputeVolumeFromImageStatistics();
66  static float ComputeVolume(Vector3D spacing, unsigned int voxelCount);
67 
68  protected:
70  virtual ~VolumeCalculator();
71 
72  template <typename TPixel, unsigned int VImageDimension>
73  void InternalCompute(const itk::Image<TPixel, VImageDimension> *itkImage);
74 
75  Image::ConstPointer m_Image;
76  int m_Threshold;
77  float m_Volume;
78  unsigned long int m_VoxelCount;
79  std::vector<float> m_Volumes;
80  ImageTimeSelector::Pointer m_TimeSelector;
81  };
82 
83 } // namespace mitk
84 
85 #endif /* VOLUME_CALCULATOR_H_HEADER_INCLUDED */
#define MITKCORE_EXPORT
STL namespace.
DataCollection - Class to facilitate loading/accessing structured data.
void InternalCompute(itk::Image< TPixel, VImageDimension > *itkImage, const mitk::HistogramGenerator *mitkHistoGenerator, mitk::HistogramGenerator::HistogramType::ConstPointer &histogram)
#define mitkClassMacroItkParent(className, SuperClassName)
Definition: mitkCommon.h:53
Image class for storing images.
Definition: mitkImage.h:76
Provides access to a volume at a specific time of the input image.
Calculates the volume of a mitk::Image. The given volume is in milliliters or as a voxel count...