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 -------------------------------------------------------------------
16
#include <
aims/signalfilter/filteringfunction_element_rgb.h
>
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
25
namespace
aims
{
26
35
template
<
typename
VoxelType>
36
inline
VoxelType
multichannelfiltervalues_nonlin
(
37
const
ElementFilteringFunction<typename VoxelType::ChannelType>
& f,
38
const
carto::VolumeRef<VoxelType>
&volume
39
)
40
{
41
ChannelSelector< carto::VolumeRef<VoxelType>,
42
carto::VolumeRef<typename VoxelType::ChannelType>
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>
67
inline
VoxelType
multichannelfiltervalues_nonlin
(
68
const
ElementFilteringFunction<typename VoxelType::ChannelType>
& f,
69
const
carto::VolumeRef<VoxelType>
&volume,
70
const
carto::rc_ptr<StructuringElement>
& se
71
)
72
{
73
ChannelSelector< carto::VolumeRef<VoxelType>,
74
carto::VolumeRef<typename VoxelType::ChannelType>
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
DataTypeInfo::samples
static uint8_t samples()
aims::ElementFilteringFunction
Base class for filtering functions applied in a structuring element.
Definition
filteringfunction_element.h:66
aims::ElementFilteringFunction::execute
virtual T execute(const carto::VolumeRef< T > &in, const carto::rc_ptr< StructuringElement > &se) const =0
carto::VolumeRef
carto::rc_ptr
filteringfunction_element.h
filteringfunction_element_rgb.h
aims
aims::multichannelfiltervalues_nonlin
VoxelType multichannelfiltervalues_nonlin(const ElementFilteringFunction< typename VoxelType::ChannelType > &f, const carto::VolumeRef< VoxelType > &volume)
Templated function to process filter on multichannel data (AimsRGB, AimsRGBA, ...)
Definition
filteringfunction_element_rgb_d.h:36
aims
signalfilter
filteringfunction_element_rgb_d.h
Generated by
1.13.2