diff --git a/Modules/AlgorithmsExt/include/mitkImageToUnstructuredGridFilter.h b/Modules/AlgorithmsExt/include/mitkImageToUnstructuredGridFilter.h index fc022e01c2..a383ab7a4b 100644 --- a/Modules/AlgorithmsExt/include/mitkImageToUnstructuredGridFilter.h +++ b/Modules/AlgorithmsExt/include/mitkImageToUnstructuredGridFilter.h @@ -1,102 +1,103 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef _MITKIMAGETOUNSTRUCTUREDGRIDFILTER_h__ #define _MITKIMAGETOUNSTRUCTUREDGRIDFILTER_h__ #include #include #include #include #include namespace mitk { /** * @brief Converts an Image into an UnstructuredGrid represented by Points. * The filter uses a Threshold to extract every pixel, with value higher than * the threshold, as point. * If no threshold is set, every pixel is extracted as a point. */ class MITKALGORITHMSEXT_EXPORT ImageToUnstructuredGridFilter : public UnstructuredGridSource { public: mitkClassMacro(ImageToUnstructuredGridFilter, UnstructuredGridSource) itkFactorylessNewMacro(Self) itkCloneMacro(Self) /** This method is called by Update(). */ void GenerateData() override; /** Initializes the output information */ void GenerateOutputInformation() override; /** Returns a const reference to the input image */ const mitk::Image *GetInput(void) const; mitk::Image *GetInput(void); /** Set the source image. As input every mitk 3D image can be used. */ using itk::ProcessObject::SetInput; virtual void SetInput(const mitk::Image *image); /** * Set the threshold for extracting points. Every pixel, which value * is higher than this value, will be a point. */ void SetThreshold(double threshold); /** Returns the threshold */ double GetThreshold(); + /** Returns the number of extracted points after edge detection */ itkGetMacro(NumberOfExtractedPoints, int) protected : /** Constructor */ ImageToUnstructuredGridFilter(); /** Destructor */ ~ImageToUnstructuredGridFilter() override; /** * Access method for extracting the points from the input image */ template void ExtractPoints(const itk::Image *image); private: /** * Geometry of the input image, needed to tranform the image points * into world points */ mitk::BaseGeometry *m_Geometry; /** The number of points extracted by the filter */ int m_NumberOfExtractedPoints; /** Threshold for extracting the points */ double m_Threshold; /** The output of the filter, which contains the extracted points */ mitk::UnstructuredGrid::Pointer m_UnstructGrid; }; } // namespace mitk #endif //_MITKIMAGETOUNSTRUCTUREDGRIDFILTER_h__ diff --git a/Modules/SurfaceInterpolation/mitkImageToPointCloudFilter.h b/Modules/SurfaceInterpolation/mitkImageToPointCloudFilter.h index f68b8b695d..992b9c30f4 100644 --- a/Modules/SurfaceInterpolation/mitkImageToPointCloudFilter.h +++ b/Modules/SurfaceInterpolation/mitkImageToPointCloudFilter.h @@ -1,94 +1,91 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef mitkImageToPointCloudFilter_h_Included #define mitkImageToPointCloudFilter_h_Included #include #include #include namespace mitk { /** * @brief The filter extracts the edge pixels of an image as points and stores * them in an UnstructuredGrid. Every pixel which grey value is between the * mean +- standard deviation * (2 or 3), will be extracted as point. The * DetectionMethod can be set to choose if the doubled or tripled standard * deviation is used. */ class MITKSURFACEINTERPOLATION_EXPORT ImageToPointCloudFilter : public ImageToUnstructuredGridFilter { public: /** * @brief The method which calculates and extracts the edge pixels/points. * For the edge detection the laplacian filter is used and for extraction * the standard deviation multiplied with 2, 3 or 4 (depending on selected * method) is used. */ enum DetectionMethod { LAPLACIAN_STD_DEV2 = 0, LAPLACIAN_STD_DEV3 = 1, LAPLACIAN_STD_DEV4 = 2 }; mitkClassMacro(ImageToPointCloudFilter, ImageToUnstructuredGridFilter) itkFactorylessNewMacro(Self) typedef itk::Image FloatImageType; - /** Returns the selected DetectionMethod */ - itkGetMacro(Method, DetectionMethod) - - /** Returns the number of extracted points after edge detection */ - itkGetMacro(NumberOfExtractedPoints, int) + /** Returns the selected DetectionMethod */ + itkGetMacro(Method, DetectionMethod) /** Sets the DetectionMethod for edge detection and extraction */ itkSetMacro(Method, DetectionMethod) protected : /** This method is called by Update(). */ void GenerateData() override; /** Initializes the output information */ void GenerateOutputInformation() override; /** Constructor */ ImageToPointCloudFilter(); /** Destructor */ ~ImageToPointCloudFilter() override; private: /** Uses the laplace filter to create an image and extracts a pixel as point * if the grey value is between the mean +- standard deviation * (2 or 3) */ template void StdDeviations(itk::Image *image, int amount); /** The geometry of the input image for transforming the pixel coordinates to * world coordinates */ mitk::BaseGeometry *m_Geometry; /** The number of extracted points */ int m_NumberOfExtractedPoints; /** The selected detection method */ DetectionMethod m_Method; }; } #endif