diff --git a/Modules/ImageStatistics/files.cmake b/Modules/ImageStatistics/files.cmake index 74cde7da0d..343ee8d404 100644 --- a/Modules/ImageStatistics/files.cmake +++ b/Modules/ImageStatistics/files.cmake @@ -1,11 +1,12 @@ SET(CPP_FILES mitkImageStatisticsCalculator.cpp + mitkPointSetStatisticsCalculator.cpp ) IF ( ${VTK_MAJOR_VERSION}.${VTK_MINOR_VERSION} VERSION_LESS 5.8 ) MESSAGE(STATUS "Using VTK 5.8 classes from MITK respository") SET(CPP_FILES ${CPP_FILES} vtkImageStencilRaster.cxx vtkLassoStencilSource.cxx ) -ENDIF ( ${VTK_MAJOR_VERSION}.${VTK_MINOR_VERSION} VERSION_LESS 5.8 ) +ENDIF ( ${VTK_MAJOR_VERSION}.${VTK_MINOR_VERSION} VERSION_LESS 5.8 ) \ No newline at end of file diff --git a/Modules/ImageStatistics/mitkPointSetStatisticsCalculator.cpp b/Modules/ImageStatistics/mitkPointSetStatisticsCalculator.cpp new file mode 100644 index 0000000000..4695c93783 --- /dev/null +++ b/Modules/ImageStatistics/mitkPointSetStatisticsCalculator.cpp @@ -0,0 +1,28 @@ +/*========================================================================= + +Program: Medical Imaging & Interaction Toolkit +Language: C++ +Date: $Date: 2009-05-12 19:56:03 +0200 (Di, 12 Mai 2009) $ +Version: $Revision: 17179 $ + +Copyright (c) German Cancer Research Center, Division of Medical and +Biological Informatics. All rights reserved. +See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. + +This software is distributed WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. See the above copyright notices for more information. + +=========================================================================*/ + + +#include "mitkPointSetStatisticsCalculator.h" + +mitk::PointSetStatisticsCalculator::PointSetStatisticsCalculator() +{ +} + + +mitk::PointSetStatisticsCalculator::~PointSetStatisticsCalculator() +{ +} \ No newline at end of file diff --git a/Modules/ImageStatistics/mitkPointSetStatisticsCalculator.h b/Modules/ImageStatistics/mitkPointSetStatisticsCalculator.h new file mode 100644 index 0000000000..fa1f0c36fe --- /dev/null +++ b/Modules/ImageStatistics/mitkPointSetStatisticsCalculator.h @@ -0,0 +1,74 @@ +/*========================================================================= + +Program: Medical Imaging & Interaction Toolkit +Language: C++ +Date: $Date: 2009-05-12 19:56:03 +0200 (Di, 12 Mai 2009) $ +Version: $Revision: 17179 $ + +Copyright (c) German Cancer Research Center, Division of Medical and +Biological Informatics. All rights reserved. +See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. + +This software is distributed WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. See the above copyright notices for more information. + +=========================================================================*/ + + +#ifndef _MITK_PointSetSTATISTICSCALCULATOR_H +#define _MITK_PointSetSTATISTICSCALCULATOR_H + +#include +#include "ImageStatisticsExports.h" +#include + +namespace mitk +{ + +/** + * \brief Class for calculating statistics (like standard derivation, RMS, mean, etc.) for a PointSet. + */ +class ImageStatistics_EXPORT PointSetStatisticsCalculator : public itk::Object +{ +public: + + //TODO: move this to an abstract class? + struct Statistics + { + unsigned int N; + double Min; + double Max; + double Mean; + double Median; + double StandardDerivation; + double SampleStandardDerivation; + double RMS; + + void Reset() + { + N = 0; + Min = 0.0; + Max = 0.0; + Mean = 0.0; + Median = 0.0; + StandardDerivation = 0.0; + SampleStandardDerivation = 0.0; + RMS = 0.0; + } + }; + + + mitkClassMacro( PointSetStatisticsCalculator, itk::Object ); + itkNewMacro( PointSetStatisticsCalculator ); + + +protected: + + PointSetStatisticsCalculator(); + virtual ~PointSetStatisticsCalculator(); +}; + +} + +#endif // #define _MITK_PointSetSTATISTICSCALCULATOR_H \ No newline at end of file