1 #ifndef AIMSDATA_BORDER_BORDERFILLER_H 2 #define AIMSDATA_BORDER_BORDERFILLER_H 7 #include <aims/resampling/splineresampler.h> 27 bool unreadOnly =
false );
37 bool unreadOnly =
false );
61 for( i = brd.
begin(); i != brd.
end(); ++i )
77 size[0] = ( bs[0] >= bs[1] ? bs[0] : bs[1] );
79 size[1] = ( bs[2] >= bs[3] ? bs[2] : bs[3] );
81 size[2] = ( bs[4] >= bs[5] ? bs[4] : bs[5] );
83 size[3] = ( bs[6] >= bs[7] ? bs[6] : bs[7] );
89 for( i = brdout.begin(); i != brdout.end(); ++i )
106 for( i = brd.
begin(); i != brd.
end(); ++i )
111 else if( current[0] >= vol.
getSizeX() )
115 else if( current[1] >= vol.
getSizeX() )
119 else if( current[2] >= vol.
getSizeX() )
123 else if( current[3] >= vol.
getSizeX() )
125 *i = vol( current[0], current[1], current[2], current[3] );
130 template <
typename T>
143 for( i = brd.
begin(); i != brd.
end(); ++i )
146 current[0] = mirrorCoeff( current[0], vol.
getSizeX() );
147 current[1] = mirrorCoeff( current[1], vol.
getSizeY() );
148 current[2] = mirrorCoeff( current[2], vol.
getSizeZ() );
149 current[3] = mirrorCoeff( current[3], vol.
getSizeT() );
150 *i = vol( current[0], current[1], current[2], current[3] );
169 Position size1 = parent1.
getSize();
170 Position size2 = parent2.
getSize();
172 size_t dims = pos.size();
174 for(
size_t d=0; d<dims; ++d) {
175 pos[d] =std::max(pos1[d], 0) - pos1[d];
176 size[d] = std::min(size1[d], size2[d] - pos1[d]) - pos[d];
189 #endif // AIMSDATA_BORDER_BORDERFILLER_H
static void fillNearest(carto::VolumeRef< T > in, bool unreadOnly=false)
Each voxel of the border is assigned with the nearest inside voxel.
This class contains static methods to fill the border of a VolumeRef with chosen values.
The class for EcatSino data write operation.
static carto::VolumeRef< T > buildUnfilledBorderView(const carto::VolumeRef< T > &vol)
Build a view that exposes data filled at reading time.
static void fillMirror(carto::VolumeRef< T > in, bool unreadOnly=false)
The border is filled by mirroring the inside border of same size.
static void fillMedian(carto::VolumeRef< T > in, Point4dl size=Point4dl(-1,-1,-1,-1), bool unreadOnly=false)
Fills the border with a "median" value.
Point4dl coordinate() const
Returns the coordinates of the current point in the linked volume.
const Position4Di posInRefVolume() const
std::vector< int > getSize() const
Represents the border of a volume.
rc_ptr< Volume< T > > refVolume() const
static T median(Iterator b, Iterator e, T default_value=(T) 0)
const AllocatorContext & allocatorContext() const
std::vector< int > getBorders() const
std::vector< int > Position
static void fillConstant(carto::VolumeRef< T > in, const T &value=0, bool unreadOnly=false)
Fills the border with a constant value.