|
Medical Imaging Interaction Toolkit
2026.06.00
Medical Imaging Interaction Toolkit
|
Calculates the volume of a mitk::Image. More...
#include <mitkVolumeCalculator.h>


Public Member Functions | |
| mitkClassMacroItkParent (VolumeCalculator, itk::Object) | |
| Pointer | Clone () const |
| virtual void | SetImage (Image *_arg) |
| virtual void | SetThreshold (int _arg) |
| Sets threshold; all voxels with a value equal to or greater than this are accepted. More... | |
| virtual float | GetVolume () |
| Return the calculated volume. More... | |
| virtual unsigned long int | GetVoxelCount () |
| Return the number of accepted voxels (those at or above the threshold). More... | |
| std::vector< float > | GetVolumes () |
| Return the volumes for 4D images. More... | |
| void | ComputeVolume () |
| Compute the volume by iterating over all voxels above the threshold. More... | |
| void | ComputeVolumeFromImageStatistics () |
| Compute the volume using image statistics (count of max-valued voxels). More... | |
Static Public Member Functions | |
| static Pointer | New () |
| static float | ComputeVolume (Vector3D spacing, unsigned int voxelCount) |
| Compute a volume from spacing and voxel count. More... | |
Protected Member Functions | |
| VolumeCalculator () | |
| ~VolumeCalculator () override | |
| template<typename TPixel , unsigned int VImageDimension> | |
| void | InternalCompute (const itk::Image< TPixel, VImageDimension > *itkImage) |
Protected Attributes | |
| Image::ConstPointer | m_Image |
| int | m_Threshold |
| float | m_Volume |
| unsigned long int | m_VoxelCount |
| std::vector< float > | m_Volumes |
| ImageTimeSelector::Pointer | m_TimeSelector |
Calculates the volume of a mitk::Image.
The volume is given in milliliters (cubic cm for 3D, square cm for 2D) or as a voxel count. Voxels are counted if their gray value is equal to or greater than a threshold (see SetThreshold). The default threshold is 0.
The filter works for 2D, 3D, and 3D+t images. In the 3D+t case, a vector of volumes is provided (see GetVolumes()).
Definition at line 36 of file mitkVolumeCalculator.h.
|
protected |
|
overrideprotected |
| Pointer mitk::VolumeCalculator::Clone | ( | ) | const |
| void mitk::VolumeCalculator::ComputeVolume | ( | ) |
Compute the volume by iterating over all voxels above the threshold.
For 4D images, the per-time-step volumes are stored and can be retrieved via GetVolumes().
|
static |
Compute a volume from spacing and voxel count.
| [in] | spacing | The voxel spacing in each dimension. |
| [in] | voxelCount | The number of voxels. |
| void mitk::VolumeCalculator::ComputeVolumeFromImageStatistics | ( | ) |
Compute the volume using image statistics (count of max-valued voxels).
This is a faster alternative to ComputeVolume() when only the maximum-valued voxels are of interest.
|
virtual |
Return the calculated volume.
For 2D images the result is in square cm, for 3D images in cubic cm. For 4D data, use GetVolumes() instead.
| std::vector<float> mitk::VolumeCalculator::GetVolumes | ( | ) |
Return the volumes for 4D images.
Each entry in the returned vector represents the volume for one time step in cubic cm.
|
virtual |
Return the number of accepted voxels (those at or above the threshold).
|
protected |
| mitk::VolumeCalculator::mitkClassMacroItkParent | ( | VolumeCalculator | , |
| itk::Object | |||
| ) |
|
static |
|
virtual |
|
virtual |
Sets threshold; all voxels with a value equal to or greater than this are accepted.
|
protected |
Definition at line 111 of file mitkVolumeCalculator.h.
|
protected |
Definition at line 112 of file mitkVolumeCalculator.h.
|
protected |
Definition at line 116 of file mitkVolumeCalculator.h.
|
protected |
Definition at line 113 of file mitkVolumeCalculator.h.
|
protected |
Definition at line 115 of file mitkVolumeCalculator.h.
|
protected |
Definition at line 114 of file mitkVolumeCalculator.h.