13 #ifndef mitkImageStatisticsContainer_h
14 #define mitkImageStatisticsContainer_h
18 #include <itkHistogram.h>
22 #include <boost/variant.hpp>
38 itkFactorylessNewMacro(Self);
101 template <
typename TType>
104 auto value = GetValueNonConverted(name);
105 return boost::get<TType>(value);
116 HistogramType::ConstPointer m_Histogram=
nullptr;
119 using StatisticsMapType = std::map < std::string, StatisticsVariantType, std::less<>>;
121 StatisticsMapType m_Statistics;
168 void PrintSelf(std::ostream &os, itk::Indent indent)
const override;
171 itk::LightObject::Pointer InternalClone()
const override;
173 using TimeStepMapType = std::map<TimeStepType, ImageStatisticsObject>;
174 using LabelMapType = std::map<LabelValueType, TimeStepMapType>;
176 LabelMapType m_LabelTimeStep2StatisticsMap;
#define MITKIMAGESTATISTICS_EXPORT
Base of all data objects.
Container class for storing the computed image statistics.
StatisticNameVector GetExistingStatisticNames() const
bool HasStatistic(const std::string_view name) const
StatisticNameVector GetAllStatisticNames() const
Returns the names of all statistics (default and custom defined) Additional custom keys are added at ...
boost::variant< RealType, VoxelCountType, IndexType > StatisticsVariantType
static const StatisticNameVector & GetDefaultStatisticNames()
Returns the names of the default statistics.
unsigned long VoxelCountType
TType GetValueConverted(const std::string_view name) const
Converts the requested value to the defined type.
std::vector< std::string > StatisticNameVector
vnl_vector< int > IndexType
void AddStatistic(const std::string_view key, StatisticsVariantType value)
Adds a statistic to the statistics object.
StatisticsVariantType GetValueNonConverted(const std::string_view name) const
Returns the requested value.
const StatisticNameVector & GetCustomStatisticNames() const
Returns the names of all custom statistics (defined at runtime and no default names).
Container class for storing a StatisticsObject for each time step.
const ImageStatisticsObject & GetStatistics(LabelValueType labelValue, TimeStepType timeStep) const
ImageStatisticsObject::RealType RealType
bool StatisticsExist(LabelValueType labelValue, TimeStepType timeStep) const
Checks if the Time step exists.
mitkClassMacro(ImageStatisticsContainer, mitk::BaseData)
const HistogramType * GetHistogram(LabelValueType labelValue, TimeStepType timeStep) const
bool IgnoresZeroVoxel() const
ImageStatisticsObject::VoxelCountType VoxelCountType
void Reset()
Deletes all stored values.
ImageStatisticsObject::IndexType IndexType
LabelValueVectorType GetExistingLabelValues() const
TimeStepVectorType GetExistingTimeSteps(LabelValueType labelValue) const
void PrintSelf(std::ostream &os, itk::Indent indent) const override
ImageStatisticsObject::StatisticsVariantType StatisticsVariantType
void SetRequestedRegion(const itk::DataObject *) override
Set the requested region from this data object to match the requested region of the data object passe...
bool VerifyRequestedRegion() override
Verify that the RequestedRegion is within the LargestPossibleRegion.
MultiLabelSegmentation::LabelValueVectorType LabelValueVectorType
itk::Statistics::Histogram< double > HistogramType
MultiLabelSegmentation::LabelValueType LabelValueType
void SetStatistics(LabelValueType labelValue, TimeStepType timeStep, const ImageStatisticsObject &statistics)
Sets the statisticObject for the given Timestep.
bool RequestedRegionIsOutsideOfTheBufferedRegion() override
Determine whether the RequestedRegion is outside of the BufferedRegion.
ImageStatisticsContainer()
std::vector< TimeStepType > TimeStepVectorType
void SetRequestedRegionToLargestPossibleRegion() override
Set the RequestedRegion to the LargestPossibleRegion.
static constexpr PixelType UNLABELED_VALUE
std::vector< LabelValueType > LabelValueVectorType
mitk::Label::PixelType LabelValueType
Find image slices visible on a given plane.
MITKIMAGESTATISTICS_EXPORT ImageStatisticsContainer::ImageStatisticsObject::StatisticNameVector GetAllStatisticNames(const ImageStatisticsContainer *container)