34 #ifndef AIMSALGO_ALGORITHM_IMAGEALGORITHM_H
35 #define AIMSALGO_ALGORITHM_IMAGEALGORITHM_H
55 template <
typename T>
class ImageAlgorithmInterface;
56 template <
typename T>
class ImageAlgorithm;
57 template <
typename T,
bool M>
class ImageAlgorithmSwitch;
124 const long & dt = 1 )
const
131 const float & vy = 1.0,
132 const float & vz = 1.0,
133 const float & vt = 1.0 )
const
142 std::vector<float> voxelsize(4, 1.);
145 Point4df voxel( voxelsize[0], voxelsize[1], voxelsize[2], voxelsize[3] );
148 voxelsize[0] = voxel[0];
149 voxelsize[1] = voxel[1];
150 voxelsize[2] = voxel[2];
151 voxelsize[3] = voxel[3];
199 template <
typename T>
220 return _algo->getOutputImageDimensions( dims );
224 return _algo->getOutputImageVoxelSize( voxelsize );
240 _algo->setVerbose( level );
264 ASSERT(
typeid(other) ==
typeid(*
this) );
265 if( &other !=
this ) {
292 template <
typename T,
bool M>
310 template <
typename T>
325 return algo.execute( in, out );
340 template <
typename T>
356 ChannelSelector< carto::VolumeRef<T>,
360 for( uint8_t channel = 0;
361 channel < DataTypeInfo<T>::samples();
365 std::cout <<
"Processing channel :"
372 selector.set( out, channel, outChannel );
aims::ImageAlgorithmInterface is the interface for an image processing algorithm.
virtual carto::VolumeRef< T > execute(const carto::VolumeRef< T > &in) const
virtual Point4df getOutputImageVoxelSize(const Point4df &voxelsize) const
Returns the output voxel size of the processed image.
virtual void setVerbose(int level)
virtual Point4dl getOutputImageDimensions(const long &dx=1, const long &dy=1, const long &dz=1, const long &dt=1) const
virtual void updateOptions(const carto::Object &)
ImageAlgorithmInterface()
virtual Point4df getOutputImageVoxelSize(const float &vx=1.0, const float &vy=1.0, const float &vz=1.0, const float &vt=1.0) const
virtual ImageAlgorithmInterface * clone() const =0
ImageAlgorithmInterface<T> Pure virtual method.
ImageAlgorithmInterface(const ImageAlgorithmInterface &other)
ImageAlgorithmInterface & operator=(const ImageAlgorithmInterface &other)
virtual Point4dl getOutputImageDimensions(const Point4dl &dims) const
Returns the output dimensions of the processed image.
virtual void execute(const carto::VolumeRef< T > &in, carto::VolumeRef< T > &out) const =0
ImageAlgorithmInterface<T> Pure virtual method.
virtual ~ImageAlgorithmInterface()
virtual void setOptions(const carto::Object &)
static void execute(ImageAlgorithmInterface< T > &algo, const carto::VolumeRef< T > &in, carto::VolumeRef< T > &out, int verbose=carto::verbose)
Execute ImageAlgorithmInterface<T> on VolumeRef<T>.
T::ChannelType ChannelType
static void execute(ImageAlgorithmInterface< ChannelType > &algo, const carto::VolumeRef< T > &in, carto::VolumeRef< T > &out, int verbose)
Execute ImageAlgorithmInterface<T> on VolumeRef<T>.
aims::ImageAlgorithmSwitch switches between multichannel and monochannel ImageAlgorithmInterface
aims::ImageAlgorithm class used to implement image algorithms
ImageAlgorithm(ImageAlgorithmInterface< ChannelType > *algo, bool deepcopy=true)
ImageAlgorithm(const ImageAlgorithm &other)
ImageAlgorithm(const ImageAlgorithmInterface< ChannelType > &algo)
ImageAlgorithm & operator=(const ImageAlgorithm &other)
virtual Point4dl getOutputImageDimensions(const Point4dl &dims) const
Returns the output dimensions of the processed image.
virtual void execute(const carto::VolumeRef< T > &in, carto::VolumeRef< T > &out) const
ImageAlgorithmInterface<T> Pure virtual method.
virtual ~ImageAlgorithm()
virtual ImageAlgorithm< T > * clone() const
ImageAlgorithmInterface<T> Pure virtual method.
carto::rc_ptr< ImageAlgorithmInterface< ChannelType > > _algo
virtual Point4df getOutputImageVoxelSize(const Point4df &voxelsize) const
Returns the output voxel size of the processed image.
virtual void setVerbose(int level)
carto::DataTypeTraits< T >::ChannelType ChannelType
void setProperty(const std::string &, const T &)
bool getProperty(const std::string &, T &) const
virtual void copyHeaderFrom(const PropertySet &other)
const PropertySet & header() const
std::string toString(const T &object)
Volume< T > deepcopy(const Volume< T > &src, const std::vector< int > &size=std::vector< int >())