aimsalgo  5.0.5
Neuroimaging image processing
filteringfunction_linear_rgb_d.h
Go to the documentation of this file.
1 /* Copyright (C) 2000-2013 CEA
2  *
3  * This software and supporting documentation were developed by
4  * bioPICSEL
5  * CEA/DSV/I²BM/MIRCen/LMN, Batiment 61,
6  * 18, route du Panorama
7  * 92265 Fontenay-aux-Roses
8  * France
9  */
10 
11 
12 #ifndef AIMS_SIGNALFILTER_FILTERINGFUNCTION_LINEAR_RGB_D_H
13 #define AIMS_SIGNALFILTER_FILTERINGFUNCTION_LINEAR_RGB_D_H
14 
15 //--- aims -------------------------------------------------------------------
17 #include <aims/signalfilter/filteringfunction_linear.h> // aims::LinFilterFunc
18 #include <aims/utility/channel.h> // ChannelSelector
19 #include <aims/connectivity/structuring_element.h> // aims::StructuringElement
20 //--- cartodata --------------------------------------------------------------
21 #include <cartodata/volume/volume.h> // carto::VolumeRef
22 //----------------------------------------------------------------------------
23 
24 
25 namespace aims {
26 
35  template <typename VoxelType>
36  inline VoxelType multichannelfiltervalues_lin(
38  const carto::VolumeRef<VoxelType> &volume
39  )
40  {
41  ChannelSelector< carto::VolumeRef<VoxelType>,
43  > selector;
44  VoxelType r;
45  int32_t samples = DataTypeInfo<VoxelType>::samples();
46 
47  // Split data and process filter on each channel
48  for( int32_t s = 0; s < samples; s++ )
49  {
50  carto::VolumeRef<typename VoxelType::ChannelType> c = selector.select( volume, s );
51  r[s] = f.execute( c );
52  }
53 
54  return r;
55  }
56 
57 } // namespace aims
58 
59 #endif
60 
virtual T execute(const carto::VolumeRef< T > &in) const =0
static uint8_t samples()
Base class for linear filtering functions.
VoxelType multichannelfiltervalues_lin(const LinearFilteringFunction< typename VoxelType::ChannelType > &f, const carto::VolumeRef< VoxelType > &volume)
Templated function to process filter on multichannel data (AimsRGB, AimsRGBA, ...) ...