MaMiCo 1.2
Loading...
Searching...
No Matches
coupling::filtering::NLM< dim, scope > Class Template Reference

#include <NLM.h>

Inheritance diagram for coupling::filtering::NLM< dim, scope >:
Collaboration diagram for coupling::filtering::NLM< dim, scope >:

Public Types

using CellIndex_T
 
- Public Types inherited from coupling::filtering::FilterInterface< dim >
using CellIndex_T
 

Public Member Functions

 NLM (const std::vector< coupling::datastructures::CouplingCell< dim > * > inputCellVector_unfiltered, const std::vector< coupling::datastructures::CouplingCell< dim > * > inputCellVector_prefiltered, const std::vector< coupling::datastructures::CouplingCell< dim > * > outputCellVector, const std::array< bool, 7 > filteredValues, int tws, double sigsq, double sigsq_rel, double hsq, double hsq_rel, int M=2, int d=1)
 
void operator() ()
 
- Public Member Functions inherited from coupling::filtering::JunctorInterface< dim, 2, 1 >
 JunctorInterface (const std::array< std::vector< coupling::datastructures::CouplingCell< dim > * >, inputc > inputCellVectors, const std::array< std::vector< coupling::datastructures::CouplingCell< dim > * >, outputc > outputCellVectors, const std::array< bool, 7 > filteredValues, const char *type)
 
void updateCellData (std::vector< coupling::datastructures::CouplingCell< dim > * > new_inputCellVectors[inputc], std::vector< coupling::datastructures::CouplingCell< dim > * > new_outputCellVectors[outputc], std::vector< tarch::la::Vector< dim, unsigned int > > &new_cellIndices)
 
- Public Member Functions inherited from coupling::filtering::FilterInterface< dim >
 FilterInterface (const std::vector< coupling::datastructures::CouplingCell< dim > * > &inputCellVector, const std::vector< coupling::datastructures::CouplingCell< dim > * > &outputCellVector, const std::array< bool, 7 > filteredValues, const char *type)
 
 FilterInterface (const char *type)
 
void updateCellData (const std::vector< coupling::datastructures::CouplingCell< dim > * > &new_inputCells, const std::vector< coupling::datastructures::CouplingCell< dim > * > &new_outputCells)
 
const char * getType () const
 
std::vector< coupling::datastructures::CouplingCell< dim > * > getInputCells () const
 
std::vector< coupling::datastructures::CouplingCell< dim > * > getOutputCells () const
 
coupling::datastructures::CouplingCell< dim > * getInputCellOfIndex (const CellIndex_T &index)
 
coupling::datastructures::CouplingCell< dim > * getOutputCellOfIndex (const CellIndex_T &index)
 
void setInputCells (const std::vector< coupling::datastructures::CouplingCell< dim > * > &newInputCells)
 
int getSize () const
 

Private Member Functions

void save_data ()
 
void update_patchfield ()
 
void denoise ()
 
std::vector< tarch::la::Vector< dim, int > > compute_boundary_neighbors (const tarch::la::Vector< dim, unsigned int > &)
 
void increment_time ()
 
unsigned int posmod (int i, int n) const
 

Private Attributes

const unsigned int _timeWindowSize
 
const unsigned int _M
 
const unsigned int _d
 
double _sigsq
 
double _sigsq_rel
 
double _hsq
 
double _hsq_rel
 
unsigned int _cycleCounter
 
unsigned int _t
 
coupling::filtering::Flowfield< dim > _flowfield
 
coupling::filtering::Flowfield< dim > _flowfield_prefiltered
 
coupling::filtering::Patchfield< dim > _patchfield
 
std::vector< CellIndex_T_innerCellIndices
 

Additional Inherited Members

- Protected Attributes inherited from coupling::filtering::JunctorInterface< dim, 2, 1 >
std::array< std::vector< coupling::datastructures::CouplingCell< dim > * >, inputc > _inputCellVectors
 
std::array< std::vector< coupling::datastructures::CouplingCell< dim > * >, outputc > _outputCellVectors
 
- Protected Attributes inherited from coupling::filtering::FilterInterface< dim >
std::vector< coupling::datastructures::CouplingCell< dim > * > _inputCells
 
std::vector< coupling::datastructures::CouplingCell< dim > * > _outputCells
 
std::vector< ScalarAccessFunctionPair_scalarAccessFunctionPairs
 
std::vector< VectorAccessFunctionPair_vectorAccessFunctionPairs
 
const char * _type
 

Detailed Description

template<unsigned int dim, coupling::indexing::IndexTrait... scope>
class coupling::filtering::NLM< dim, scope >

Noise reduction algorithm using non-local means (NLM) method See 'Fast Non Local Means Denoising for 3D MR Images' by Coupé et al. 2006 and 'Non-Local Means Denoising' by Buades et al. 2011.

Author
Piet Jarmatz

Member Typedef Documentation

◆ CellIndex_T

template<unsigned int dim, coupling::indexing::IndexTrait... scope>
using coupling::filtering::NLM< dim, scope >::CellIndex_T
Initial value:
coupling::indexing::CellIndex<dim, coupling::indexing::IndexTrait::vector, scope..., coupling::indexing::IndexTrait::md2macro,
coupling::indexing::IndexTrait::noGhost>
Definition CellIndex.h:85

Member Function Documentation

◆ compute_boundary_neighbors()

template<unsigned int dim, coupling::indexing::IndexTrait... scope>
std::vector< tarch::la::Vector< dim, int > > coupling::filtering::NLM< dim, scope >::compute_boundary_neighbors ( const tarch::la::Vector< dim, unsigned int > & )
private

Compute which filtering results we need here.

Parameters
idx_innerIndex of this cell on the inner local MD 2 macro domain, i.e. the domain where the patchfield is defined
Returns
Relative offsets, of all neighboring boundary cells and this cell itself

◆ denoise()

template<unsigned int dim, coupling::indexing::IndexTrait... scope>
void coupling::filtering::NLM< dim, scope >::denoise ( )
private

Main loop of NLM algorithm, computes filtering output for one coupling cycle.

◆ increment_time()

template<unsigned int dim, coupling::indexing::IndexTrait... scope>
void coupling::filtering::NLM< dim, scope >::increment_time ( )
private

Must be called to indicate that one coupling cycle is finished and timestep counters should be incremented.

◆ operator()()

template<unsigned int dim, coupling::indexing::IndexTrait... scope>
void coupling::filtering::NLM< dim, scope >::operator() ( )
virtual

◆ save_data()

template<unsigned int dim, coupling::indexing::IndexTrait... scope>
void coupling::filtering::NLM< dim, scope >::save_data ( )
private

Stores new values from inputCellVectors into _flowfield and _flowfield_prefiltered for this timestep _t.

◆ update_patchfield()

template<unsigned int dim, coupling::indexing::IndexTrait... scope>
void coupling::filtering::NLM< dim, scope >::update_patchfield ( )
private

Reconstructs _patchfield(idx,_t) for all inner cell indices idx, so that new information from updated flowfield will be included.


The documentation for this class was generated from the following file: