STIR  6.3.0
Public Member Functions | List of all members
stir::WienerArrayFilter2D< elemT > Class Template Reference

Applies a 2D Wiener filter on a 3D input array, slice by slice. More...

#include "stir/WienerArrayFilter2D.h"

Inheritance diagram for stir::WienerArrayFilter2D< elemT >:
Inheritance graph
[legend]

Public Member Functions

bool is_trivial () const override
 Should return true when the operations won't modify the object at all. More...
 
- Public Member Functions inherited from stir::ArrayFunctionObject_2ArgumentImplementation< 3, elemT >
void operator() (Array< num_dimensions, elemT > &array) const override
 in-place modification of array, implemented inline
 
void operator() (Array< num_dimensions, elemT > &out_array, const Array< num_dimensions, elemT > &in_array) const override
 result stored in another array More...
 
- Public Member Functions inherited from stir::ArrayFunctionObject< num_dimensions, elemT >
virtual Succeeded get_influencing_indices (IndexRange< num_dimensions > &influencing_indices, const IndexRange< num_dimensions > &output_indices) const
 sets the range of indices that influences the result in a set of coordinates output_indices More...
 
virtual Succeeded get_influenced_indices (IndexRange< num_dimensions > &influenced_indices, const IndexRange< num_dimensions > &input_indices) const
 sets the range of indices that gets influenced by a set of coordinate input_indices More...
 

Additional Inherited Members

- Protected Member Functions inherited from stir::ArrayFunctionObject_2ArgumentImplementation< 3, elemT >
virtual void do_it (Array< num_dimensions, elemT > &out_array, const Array< num_dimensions, elemT > &in_array) const=0
 

Detailed Description

template<typename elemT>
class stir::WienerArrayFilter2D< elemT >

Applies a 2D Wiener filter on a 3D input array, slice by slice.

This function applies a Wiener filter on each 2D slice of a 3D volume independently, using a fixed 3x3 window. For each pixel in the slice, the filter estimates the local mean and variance, and uses these values, along with the noise variance estimated from the entire slice, to reduce noise while preserving details. The filtered output is stored in the out_array.

The formula used for the Wiener filter is:

\[ \text{output}(i, j) = \left(\frac{\text{input}(i, j) - \text{localMean}(i, j)}{\max(\text{localVar}(i, j), \text{noise})}\right) \cdot \max(\text{localVar}(i, j) - \text{noise}, 0) + \text{localMean}(i, j) \]

Warning
The edges of each 2D slice are not processed, as the filter does not have sufficient neighboring pixels for the 3x3 window.

Wiener Filter Configuration

This filter is fully automated and does not require any parameters. To enable it in the reconstruction process, include the following in the parameter file:

post-filter type := Wiener
Wiener Filter Parameters :=
End Wiener Filter Parameters :=
Note
This filter operates on each axial slice independently, and does not take into account neighboring slices. It is effectively a 2D filter applied slice-by-slice on a 3D volume.

Member Function Documentation

◆ is_trivial()

template<typename elemT >
bool stir::WienerArrayFilter2D< elemT >::is_trivial ( ) const
overridevirtual

Should return true when the operations won't modify the object at all.

For the 2 argument version, elements in out_array will be set to corresponding elements in in_array. Elements in out_array that do not occur in in_array will be set to 0.

Implements stir::ArrayFunctionObject< num_dimensions, elemT >.


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