STIR
6.2.0
|
Implements median filtering on 3D arrays. More...
#include "stir/MedianArrayFilter3D.h"
Public Member Functions | |
MedianArrayFilter3D (const Coordinate3D< int > &mask_radius) | |
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 |
Implements median filtering on 3D arrays.
The median for a 1D array of 2n+1 elements is defined as the nth element of the sorted array. For 2n elements, we use (sorted[n-1]+sorted[n])/2 (starting indices from 0).
For 3D images, the current filter works by extracting all neigbours (given by the mask) to a 1D array, and getting the median of that array.
This implementation of the median filter handles edges by taking a median of all available pixels. For instance, when a 3x3 mask is used, and the pixel-to-be-filtered is at the left edge, there will be only 6 pixels in the mask (instead of 9).
Currently, the mask is determined in terms of the mask radius (in pixels), where size = 2*radius+1. This could easily be relaxed.
generalise to n-dimensions
|
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 >.