25 #ifndef WMANISOTROPICFILTERING_H
26 #define WMANISOTROPICFILTERING_H
32 #include "core/dataHandler/WDataSetSingle.h"
33 #include "core/dataHandler/WValueSet.h"
34 #include "core/kernel/WModule.h"
35 #include "core/kernel/WModuleInputData.h"
36 #include "core/kernel/WModuleOutputData.h"
60 virtual const std::string
getName()
const;
74 virtual std::shared_ptr< WModule >
factory()
const;
122 std::size_t
coordsToIndex( std::shared_ptr< WGridRegular3D >
const& grid,
123 std::size_t x, std::size_t y, std::size_t z );
131 void copyData( std::shared_ptr< std::vector< double > >& smoothed,
132 std::shared_ptr< WGridRegular3D >
const& grid );
144 void calcDeriv( std::vector< double >& deriv, std::shared_ptr< std::vector< double > >
const& smoothed,
145 std::shared_ptr< WGridRegular3D >
const& grid, std::size_t image, std::size_t numImages );
154 void calcCoeff( std::vector< double >& coeff, std::vector< double >
const& deriv,
155 std::shared_ptr< WGridRegular3D >
const& grid );
167 void diffusion( std::vector< double >
const& deriv, std::vector< double >
const& coeff,
168 std::shared_ptr< std::vector< double > >& smoothed,
169 std::shared_ptr< WGridRegular3D >
const& grid, std::size_t image, std::size_t numImages );
174 std::shared_ptr< WModuleInputData< WDataSetSingle > >
m_input;
179 std::shared_ptr< WModuleOutputData< WDataSetSingle > >
m_output;
This module smoothes images of a dataset while preserving edges.
std::shared_ptr< WDataSetSingle > m_dataSet
This is a pointer to the dataset the module is currently working on.
virtual void moduleMain()
Entry point after loading the module.
std::shared_ptr< WCondition > m_propCondition
A condition used to notify about changes in several properties.
double m_d
The size of the time steps.
WPropDouble m_Kcoeff
A property for the edge preservation parameter.
void calcDeriv(std::vector< double > &deriv, std::shared_ptr< std::vector< double > > const &smoothed, std::shared_ptr< WGridRegular3D > const &grid, std::size_t image, std::size_t numImages)
Calculates an array containing the derivatives in x, y and z directions of the image intensity (i....
virtual std::shared_ptr< WModule > factory() const
Due to the prototype design pattern used to build modules, this method returns a new instance of this...
virtual const std::string getName() const
Gives back the name of this module.
WPropDouble m_delta
A property for the time step size.
virtual const char ** getXPMIcon() const
Return an icon for this module.
void calcCoeff(std::vector< double > &coeff, std::vector< double > const &deriv, std::shared_ptr< WGridRegular3D > const &grid)
Calculates the diffusion coeff for every voxel.
virtual ~WMAnisotropicFiltering()
Destructor.
std::shared_ptr< WModuleOutputData< WDataSetSingle > > m_output
An output connector for the output dataset.
void copyData(std::shared_ptr< std::vector< double > > &smoothed, std::shared_ptr< WGridRegular3D > const &grid)
Copy the datasets image data to a temp array.
void diffusion(std::vector< double > const &deriv, std::vector< double > const &coeff, std::shared_ptr< std::vector< double > > &smoothed, std::shared_ptr< WGridRegular3D > const &grid, std::size_t image, std::size_t numImages)
Do the diffusion.
virtual const std::string getDescription() const
Gives back a description of this module.
virtual void properties()
Initialize the properties for this module.
std::shared_ptr< WModuleInputData< WDataSetSingle > > m_input
An input connector that accepts multi image datasets.
WMAnisotropicFiltering()
Standard constructor.
void calcSmoothedImages(int iterations)
Calculates the resulting smoothed image.
virtual void connectors()
Initialize the connectors this module is using.
std::size_t coordsToIndex(std::shared_ptr< WGridRegular3D > const &grid, std::size_t x, std::size_t y, std::size_t z)
Calculates grid indices from voxel coords.
double m_k
The edge preservation parameter used for diffusion coeff calculation.
WPropInt m_iterations
A property for the number of iterations.
virtual void activate()
Callback for m_active.
Class representing a single module of OpenWalnut.