Medical Imaging Interaction Toolkit  2018.4.99-4c24e3cb
Medical Imaging Interaction Toolkit
mitkLabeledImageVolumeCalculator.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 (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
13 #ifndef _MITK_LABELEDIMAGEVOLUMECALCULATOR_H
14 #define _MITK_LABELEDIMAGEVOLUMECALCULATOR_H
15 
17 #include <itkObject.h>
18 
19 #include "mitkImage.h"
20 #include "mitkImageTimeSelector.h"
21 
22 #include <itkImage.h>
23 
24 namespace mitk
25 {
35  {
36  public:
37  typedef std::vector<double> VolumeVector;
38  typedef std::vector<Point3D> PointVector;
39 
41  itkFactorylessNewMacro(Self) itkCloneMacro(Self)
42 
43  itkSetConstObjectMacro(Image, mitk::Image);
44 
45  virtual void Calculate();
46 
47  double GetVolume(unsigned int label) const;
48 
49  const Point3D &GetCentroid(unsigned int label) const;
50 
51  const VolumeVector &GetVolumes() const;
52 
53  const PointVector &GetCentroids() const;
54 
55  protected:
57 
58  ~LabeledImageVolumeCalculator() override;
59 
60  template <typename TPixel, unsigned int VImageDimension>
61  void _InternalCalculateVolumes(itk::Image<TPixel, VImageDimension> *image,
62  LabeledImageVolumeCalculator *volumeCalculator,
63  BaseGeometry *geometry);
64 
66 
68 
69  VolumeVector m_VolumeVector;
70  PointVector m_CentroidVector;
71 
73  };
74 }
75 
76 #endif // #define _MITK_LABELEDIMAGEVOLUMECALCULATOR_H
#define MITKDATATYPESEXT_EXPORT
DataCollection - Class to facilitate loading/accessing structured data.
#define mitkClassMacroItkParent(className, SuperClassName)
Definition: mitkCommon.h:49
Image class for storing images.
Definition: mitkImage.h:72
mitk::Image::Pointer image
Class for calculating the volume (or area) for each label in a labeled image.
BaseGeometry Describes the geometry of a data object.