aimsalgo 6.0.0
Neuroimaging image processing
filteringfunction_element_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_ELEMENT_RGB_D_H
13#define AIMS_SIGNALFILTER_FILTERINGFUNCTION_ELEMENT_RGB_D_H
14
15//--- aims -------------------------------------------------------------------
17#include <aims/signalfilter/filteringfunction_element.h> // aims::NonLinFilterFunc
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
25namespace aims {
26
35 template <typename VoxelType>
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
66 template <typename VoxelType>
69 const carto::VolumeRef<VoxelType> &volume,
71 )
72 {
73 ChannelSelector< carto::VolumeRef<VoxelType>,
75 > selector;
76 VoxelType r;
77 int32_t samples = DataTypeInfo<VoxelType>::samples();
78
79 // Split data and process filter on each channel
80 for( int32_t s = 0; s < samples; s++ )
81 {
82 carto::VolumeRef<typename VoxelType::ChannelType> c = selector.select( volume, s );
83 r[s] = f.execute( c, se );
84 }
85
86 return r;
87 }
88
89} // namespace aims
90
91#endif
92
static uint8_t samples()
Base class for filtering functions applied in a structuring element.
virtual T execute(const carto::VolumeRef< T > &in, const carto::rc_ptr< StructuringElement > &se) const =0
VoxelType multichannelfiltervalues_nonlin(const ElementFilteringFunction< typename VoxelType::ChannelType > &f, const carto::VolumeRef< VoxelType > &volume)
Templated function to process filter on multichannel data (AimsRGB, AimsRGBA, ...)