STIR  6.2.0
Public Member Functions | Static Public Attributes | List of all members
stir::SeparableConvolutionImageFilter< elemT > Class Template Reference

A class derived from DataProcessor for performing separable non-periodic convolutions. More...

#include "stir/SeparableConvolutionImageFilter.h"

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

Public Member Functions

 SeparableConvolutionImageFilter ()
 Default constructor.
 
 SeparableConvolutionImageFilter (const VectorWithOffset< VectorWithOffset< elemT >> &filter_coefficients)
 Constructor taking filter coefficients explicitly. More...
 
template<>
const char *const registered_name
 
VectorWithOffset< VectorWithOffset< elemT > > get_filter_coefficients ()
 Overloaded get and set methods the filter coefficients for axis or set of filter coefficients.
 
void set_filter_coefficients (const VectorWithOffset< VectorWithOffset< elemT >> &v)
 
VectorWithOffset< elemT > get_filter_coefficients (const int axis)
 
void set_filter_coefficients (const int axis, const VectorWithOffset< elemT > &v)
 
- Public Member Functions inherited from stir::RegisteredParsingObject< SeparableConvolutionImageFilter< elemT >, DataProcessor< DiscretisedDensity< 3, elemT > >, DataProcessor< DiscretisedDensity< 3, elemT > > >
std::string get_registered_name () const override
 Returns Derived::registered_name.
 
std::string parameter_info () override
 Returns a string with all parameters and their values, in a form suitable for parsing again.
 
- Public Member Functions inherited from stir::DataProcessor< DiscretisedDensity< 3, elemT > >
Succeeded set_up (const DiscretisedDensity< 3, elemT > &data)
 Initialises any internal data (if necessary) using data as a template for sizes, sampling distances etc. More...
 
virtual void reset ()
 Makes sure we will ignore any previous call to set-up() More...
 
Succeeded apply (DiscretisedDensity< 3, elemT > &data)
 Calls set_up() (if not already done before) and process data in-place. More...
 
Succeeded apply (DiscretisedDensity< 3, elemT > &out_data, const DiscretisedDensity< 3, elemT > &in_data)
 Calls set_up() (if not already done before) and process in_data, putting the result in out_data. More...
 
bool parse (std::istream &f)
 
bool parse (const char *const filename)
 
- Public Member Functions inherited from stir::ParsingObject
 ParsingObject (const ParsingObject &)
 
ParsingObjectoperator= (const ParsingObject &)
 
void ask_parameters ()
 
bool parse (std::istream &f)
 
bool parse (const char *const filename)
 
- Public Member Functions inherited from stir::TimedObject
void reset_timers ()
 reset all timers kept by this object
 
void stop_timers () const
 stop all timers kept by this object More...
 
void start_timers (bool do_reset=false) const
 start all timers kept by this object More...
 
double get_CPU_timer_value () const
 get current value of the CPU timer (since first use or last reset)
 
double get_wall_clock_timer_value () const
 get current value of the wall-clock timer (since first use or last reset)
 

Static Public Attributes

static const char *const registered_name
 Name for parsing registry.
 

Additional Inherited Members

- Static Public Member Functions inherited from stir::RegisteredParsingObject< SeparableConvolutionImageFilter< elemT >, DataProcessor< DiscretisedDensity< 3, elemT > >, DataProcessor< DiscretisedDensity< 3, elemT > > >
static DataProcessor< DiscretisedDensity< 3, elemT > > * read_from_stream (std::istream *)
 Construct a new object (of type Derived) by parsing the istream. More...
 
- Static Public Member Functions inherited from stir::RegisteredObject< Root >
static Root * read_registered_object (std::istream *in, const std::string &registered_name)
 Construct a new object (of a type derived from Root, its actual type determined by the registered_name parameter) by parsing the istream. More...
 
static Root * ask_type_and_parameters ()
 ask the user for the type, and then calls read_registered_object(0, type) More...
 
static void list_registered_names (std::ostream &stream)
 List all possible registered names to the stream. More...
 
- Protected Types inherited from stir::RegisteredObject< Root >
typedef Root *(* RootFactory) (std::istream *)
 The type of a root factory is a function, taking an istream* as argument, and returning a Root*.
 
typedef FactoryRegistry< std::string, RootFactory, interfile_lessRegistryType
 The type of the registry.
 
- Protected Member Functions inherited from stir::DataProcessor< DiscretisedDensity< 3, elemT > >
virtual Succeeded virtual_set_up (const DiscretisedDensity< 3, elemT > &)=0
 Will be called to build any internal parameters.
 
virtual void virtual_apply (DiscretisedDensity< 3, elemT > &data, const DiscretisedDensity< 3, elemT > &in_data) const=0
 Performs actual operation (virtual_set_up is called before this function)
 
virtual void virtual_apply (DiscretisedDensity< 3, elemT > &data) const=0
 Performs actual operation (in-place)
 
- Protected Member Functions inherited from stir::ParsingObject
virtual void set_key_values ()
 This will be called before parsing or parameter_info is called. More...
 
- Static Protected Member Functions inherited from stir::RegisteredObject< Root >
static RegistryTyperegistry ()
 Static function returning the registry. More...
 
- Protected Attributes inherited from stir::ParsingObject
KeyParser parser
 

Detailed Description

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

A class derived from DataProcessor for performing separable non-periodic convolutions.

This filter applies a 1D convolution in all directions (z,y,x) with potentially a different filter kernel for every direction.

When parsing, the filter coefficients are read as a list of numbers for each direction. The following conventions is used:

  1. A list of 0 length (which is the default) corresponds to no filtering.
  2. When the list contains an even number of data, a 0 is appended (at the end).
  3. After this, the central element of the list corresponds to the 0-th element in the kernel, see below.

Convolution is non-periodic. In each direction, the following is applied:

\[ out_i = \sum_j kernelforthisdirection_j in_{i-j} \]

Note that for most kernels, the above convention means that the zero- index of the kernel corresponds to the peak in the kernel.

Elements of the input array that are outside its index range are considered to be 0.

Warning
There is NO check if the kernel coefficients add up to 1. This is because not all filters need this (e.g. edge enhancing filters).
Example input for a low-pass filter in x,y, no filtering in z
  Separable Convolution Parameters :=
  x-dir filter coefficients := {0.25, .5, .25}
  y-dir filter coefficients := {0.25, .5, .25}
  ;z-dir filter coefficients :=
  END Separable Convolution Parameters :=

The filter is implemented using the class ArrayFilter1DUsingConvolution.

Constructor & Destructor Documentation

◆ SeparableConvolutionImageFilter()

template<typename elemT >
stir::SeparableConvolutionImageFilter< elemT >::SeparableConvolutionImageFilter ( const VectorWithOffset< VectorWithOffset< elemT >> &  filter_coefficients)

Constructor taking filter coefficients explicitly.

These filter coefficients are passed to the ArrayFilter1DUsingConvolution constructor.

filter_coefficients has to have length 3. (Start index is irrelevant). Its first element will be applied to the 'first dimension', i.e. the first index.


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