37 #ifndef AIMS_UTILITY_FLIP_H 
   38 #define AIMS_UTILITY_FLIP_H 
   97 template <
class T> 
inline 
  107   std::vector<int> pos;
 
  109   for( ; !it.
ended(); ++it )
 
  113     pos[0] = thing->getSizeX() -  1;
 
  115       *p = thing->at( pos );
 
  122 template <
class T> 
inline 
  126                            thing->getSizeZ(), thing->getSizeT(),
 
  127                            thing->getBorders() );
 
  133   std::vector<int> pos;
 
  135   for( ; !it.
ended(); ++it )
 
  139     pos[1] = thing->getSizeY() - pos[1] - 1;
 
  141       *p = thing->at( pos );
 
  148 template <
class T> 
inline 
  152                            thing->getSizeZ(), thing->getSizeT(),
 
  153                            thing->getBorders() );
 
  159   std::vector<int> pos;
 
  161   for( ; !it.
ended(); ++it )
 
  165     pos[2] = thing->getSizeZ() - pos[2] - 1;
 
  167       *p = thing->at( pos );
 
  174 template <
class T> 
inline 
  178                            thing->getSizeZ(), thing->getSizeT(),
 
  179                            thing->getBorders() );
 
  185   std::vector<int> pos;
 
  187   for( ; !it.
ended(); ++it )
 
  191     pos[0] = thing->getSizeX() -  1;
 
  192     pos[2] = thing->getSizeZ() - pos[2] - 1;
 
  194       *p = thing->at( pos );
 
  200 template <
class T> 
inline 
  204                            thing->getSizeZ(), thing->getSizeT(),
 
  205                            thing->getBorders() );
 
  211   std::vector<int> pos;
 
  213   for( ; !it.
ended(); ++it )
 
  217     pos[0] = thing->getSizeX() -  1;
 
  218     pos[1] = thing->getSizeY() - pos[1] - 1;
 
  220       *p = thing->at( pos );
 
  227 template <
class T> 
inline 
  231                            thing->getSizeZ(), thing->getSizeT(),
 
  232                            thing->getBorders() );
 
  238   std::vector<int> pos;
 
  240   for( ; !it.
ended(); ++it )
 
  244     pos[1] = thing->getSizeY() - pos[1] - 1;
 
  245     pos[2] = thing->getSizeZ() - pos[2] - 1;
 
  247       *p = thing->at( pos );
 
  254 template <
class T> 
inline 
  258                            thing->getSizeZ(), thing->getSizeT(),
 
  259                            thing->getBorders() );
 
  261   std::vector<float> vs = thing->getVoxelSize();
 
  270   std::vector<int> pos;
 
  272   for( ; !it.
ended(); ++it )
 
  276     pos[0] = res->
getSizeY() - pos[1] - 1;
 
  279       *p = thing->at( pos );
 
  286 template <
class T> 
inline 
  291                            thing->getSizeX(), thing->getSizeT(),
 
  292                            thing->getBorders() );
 
  294   std::vector<float> vs = thing->getVoxelSize();
 
  303   std::vector<int> pos;
 
  305   for( ; !it.
ended(); ++it )
 
  309     pos[0] = res->
getSizeZ() - pos[2] - 1;
 
  312       *p = thing->at( pos );
 
  319 template <
class T> 
inline 
  324                            thing->getSizeY(), thing->getSizeT(),
 
  325                            thing->getBorders() );
 
  327   std::vector<float> vs = thing->getVoxelSize();
 
  336   std::vector<int> pos;
 
  339   for( ; !it.
ended(); ++it )
 
  344     pos[1] = res->
getSizeZ() - pos[2] - 1;
 
  347       *p = thing->at( pos );
 
  354 template <
class T> 
inline 
  364   std::vector<int> pos;
 
  366   for( ; !it.
ended(); ++it )
 
  370     pos[0] = thing->getSizeX() - 1;
 
  371     pos[1] = thing->getSizeY() - pos[1] - 1;
 
  372     pos[2] = thing->getSizeZ() - pos[2] - 1;
 
  374       *p = thing->at( pos );
 
The template object function for flipping.
carto::VolumeRef< T > doZZ(const carto::rc_ptr< carto::Volume< T > > &thing)
function which returns the ZZ flipped data
carto::VolumeRef< T > doYY(const carto::rc_ptr< carto::Volume< T > > &thing)
function which returns the YY flipped data
AimsFlip()
Constructor does nothing.
carto::VolumeRef< T > doXX(const carto::rc_ptr< carto::Volume< T > > &thing)
function which returns the XX flipped data
carto::VolumeRef< T > doXZ(const carto::rc_ptr< carto::Volume< T > > &thing)
function which returns the XZ flipped data
carto::VolumeRef< T > doXXYYZZ(const carto::rc_ptr< carto::Volume< T > > &thing)
function which returns the XXYYZZ flipped data
carto::VolumeRef< T > doXY(const carto::rc_ptr< carto::Volume< T > > &thing)
function which returns the XY flipped data
carto::VolumeRef< T > doXXZZ(const carto::rc_ptr< carto::Volume< T > > &thing)
function which returns the XXZZ flipped data
virtual ~AimsFlip()
Destructor does nothing.
carto::VolumeRef< T > doYZ(const carto::rc_ptr< carto::Volume< T > > &thing)
function which returns the YZ flipped data
carto::VolumeRef< T > doYYZZ(const carto::rc_ptr< carto::Volume< T > > &thing)
function which returns the YYZZ flipped data
carto::VolumeRef< T > doXXYY(const carto::rc_ptr< carto::Volume< T > > &thing)
function which returns the XXYY flipped data
const std::vector< int > & position() const
void setVoxelSize(float vx, float vy=1., float vz=1., float vt=1.)
virtual void copyHeaderFrom(const PropertySet &other)
std::vector< int > getSize() const
const T & at(long x, long y=0, long z=0, long t=0) const
std::vector< size_t > getStrides() const
void inc_line_ptr(T *&p) const