Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
mitkCalculateSegmentationVolume.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 mitkCalculateSegmentationVolume_h
14 #define mitkCalculateSegmentationVolume_h
15 
16 #include <mitkImageCast.h>
17 #include <mitkSegmentationSink.h>
19 
20 namespace mitk
21 {
32  {
33  public:
36 
37  protected:
38  CalculateSegmentationVolume(); // use smart pointers
40 
41  bool ReadyToRun() override;
42 
43  bool ThreadedUpdateFunction() override; // will be called from a thread after calling StartAlgorithm
44 
45  template <typename TPixel, unsigned int VImageDimension>
46  void ItkImageProcessing(itk::Image<TPixel, VImageDimension> *itkImage, TPixel *dummy = nullptr);
47 
48  private:
49  unsigned int m_Volume;
50 
51  Vector3D m_CenterOfMass;
52  Vector3D m_MinIndexOfBoundingBox;
53  Vector3D m_MaxIndexOfBoundingBox;
54  };
55 
56 } // namespace
57 
58 #endif
#define MITKSEGMENTATION_EXPORT
Non-blocking algorithm that calculates volume, center of mass, and bounding box of a binary segmentat...
mitkClassMacro(CalculateSegmentationVolume, SegmentationSink)
mitkAlgorithmNewMacro(CalculateSegmentationVolume)
bool ThreadedUpdateFunction() override
void ItkImageProcessing(itk::Image< TPixel, VImageDimension > *itkImage, TPixel *dummy=nullptr)
A NonBlockingAlgorithm that places segmentation results into the DataStorage.
Find image slices visible on a given plane.