CTL  0.6.1
Computed Tomography Library
Classes | Typedefs | Enumerations | Functions
filter.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  CTL::Chunk2D< T >
 The Chunk2D class provides a simple container for storage of 2D image data. More...
 
class  CTL::VoxelVolume< T >
 The VoxelVolume class provides a simple container for storage of voxelized 3D volume data. More...
 

Typedefs

typedef unsigned int uint
 Alias for unsigned int.
 

Enumerations

enum  CTL::imgproc::FiltMethod {
  CTL::imgproc::None, CTL::imgproc::Gauss3, CTL::imgproc::Gauss5, CTL::imgproc::Gauss7,
  CTL::imgproc::Average3, CTL::imgproc::Median3, CTL::imgproc::MedianAbs3, CTL::imgproc::MaxAbs3,
  RamLak
}
 

Functions

template<uint dim>
void CTL::imgproc::filter (Chunk2D< float > &image, FiltMethod m)
 
template<uint dim>
void CTL::imgproc::filter (Chunk2D< double > &image, FiltMethod m)
 
template<uint dim>
void CTL::imgproc::filter (VoxelVolume< float > &volume, FiltMethod m)
 
template<uint dim>
void CTL::imgproc::filter (VoxelVolume< double > &volume, FiltMethod m)
 
void CTL::imgproc::median3 (VoxelVolume< float > &volume)
 
void CTL::imgproc::median3NN (VoxelVolume< float > &volume)
 
template void CTL::imgproc::filter< 0u > (VoxelVolume< float > &volume, FiltMethod m)
 
template void CTL::imgproc::filter< 1u > (VoxelVolume< float > &volume, FiltMethod m)
 
template void CTL::imgproc::filter< 2u > (VoxelVolume< float > &volume, FiltMethod m)
 
template void CTL::imgproc::filter< 0u > (VoxelVolume< double > &volume, FiltMethod m)
 
template void CTL::imgproc::filter< 1u > (VoxelVolume< double > &volume, FiltMethod m)
 
template void CTL::imgproc::filter< 2u > (VoxelVolume< double > &volume, FiltMethod m)
 
template void CTL::imgproc::filter< 0u > (Chunk2D< float > &image, FiltMethod m)
 
template void CTL::imgproc::filter< 1u > (Chunk2D< float > &image, FiltMethod m)
 
template void CTL::imgproc::filter< 0u > (Chunk2D< double > &image, FiltMethod m)
 
template void CTL::imgproc::filter< 1u > (Chunk2D< double > &image, FiltMethod m)
 

Enumeration Type Documentation

◆ FiltMethod

Enumeration for filter methods that can be used.

To incorporate a new filter method, add a value to this enumeration (in filter.h) and provide the corresponding implementation of the method (see filter.cpp file for more information).

In general, values on the borders will be computed by extrapolating with zeros outside, where no valid values are available for the filtering, i.e. within the half filter size.

Enumerator
None 

Does not perform any modification to the image.

Gauss3 

This computes a Gaussian smoothing based on bionomial coefficients. The filter size N is three. For this, the standard deviation is \( \sigma=\frac{\sqrt{N-1}}{2}=\frac{1}{\sqrt{2}}\approx0.7071 \) and the elements are \( \frac{1}{4}\left[\begin{array}{ccc} 1 & 2 & 1\end{array}\right]\;. \)

Gauss5 

This computes a Gaussian smoothing based on bionomial coefficients. The filter size N is five. For this, the standard deviation is \( \sigma=\frac{\sqrt{N-1}}{2}=1 \) and the elements are \( \frac{1}{16}\left[\begin{array}{ccccc} 1 & 4 & 6 & 4 & 1\end{array}\right]\;. \)

Gauss7 

This computes a Gaussian smoothing based on bionomial coefficients. The filter size N is seven. For this, the standard deviation is \( \sigma=\frac{\sqrt{N-1}}{2}=\frac{\sqrt{6}}{2}\approx1.225 \) and the elements are \( \frac{1}{64}\left[\begin{array}{ccccccc} 1 & 6 & 15 & 20 & 15 & 6 & 1\end{array}\right]\;. \)

Average3 

This computes the arithmetic mean over three adjacent image values, i.e. the filter elements are \( \frac{1}{3}\left[\begin{array}{ccc} 1 & 1 & 1\end{array}\right]\;. \)

Median3 

This computes the median of three adjacent image values.

MedianAbs3 

This computes the median element wrt. the absolute value of three adjacent image values and returns the orignial (signed) image value.

MaxAbs3 

This computes the maximum element wrt. the absolute value of three adjacent image values and returns the orignial (signed) image value.

Function Documentation

◆ filter() [1/4]

template<uint dim>
void CTL::imgproc::filter ( Chunk2D< float > &  image,
FiltMethod  m 
)

Filters the data in image along the dimension dim using the filter method m.

◆ filter() [2/4]

template<uint dim>
void CTL::imgproc::filter ( Chunk2D< double > &  image,
FiltMethod  m 
)

Filters the data in image along the dimension dim using the filter method m.

◆ filter() [3/4]

template<uint dim>
void CTL::imgproc::filter ( VoxelVolume< float > &  volume,
FiltMethod  m 
)

Filters the data in volume along the dimension dim using the filter method m.

◆ filter() [4/4]

template<uint dim>
void CTL::imgproc::filter ( VoxelVolume< double > &  volume,
FiltMethod  m 
)

Filters the data in volume along the dimension dim using the filter method m.

◆ median3()

void CTL::imgproc::median3 ( VoxelVolume< float > &  volume)

Performs median filtering of the data in volume within a 3x3x3 voxel neighborhood. At the borders, the volume is mirrored for filtering.

◆ median3NN()

void CTL::imgproc::median3NN ( VoxelVolume< float > &  volume)

Performs median filtering of the data in volume in its immediate voxel neighborhood (ie. 6 neighbors in total). At the borders, the volume is mirrored for filtering.