34 #ifndef AIMSALGO_ALGORITHM_IMAGEALGORITHM_H 35 #define AIMSALGO_ALGORITHM_IMAGEALGORITHM_H 125 const long & dt = 1 )
const 132 const float & vy = 1.0,
133 const float & vz = 1.0,
134 const float & vt = 1.0 )
const 143 std::vector<float> voxelsize(4, 1.);
145 in.
header().getProperty(
"voxel_size", voxelsize );
146 Point4df voxel( voxelsize[0], voxelsize[1], voxelsize[2], voxelsize[3] );
149 voxelsize[0] = voxel[0];
150 voxelsize[1] = voxel[1];
151 voxelsize[2] = voxel[2];
152 voxelsize[3] = voxel[3];
156 out.
header().setProperty(
"voxel_size", voxelsize );
185 _verbose(other._verbose)
206 template <
typename T>
223 S::execute( *_algo, in, out, this->
_verbose );
227 return _algo->getOutputImageDimensions( dims );
231 return _algo->getOutputImageVoxelSize( voxelsize );
247 _algo->setVerbose( level );
279 _algo(other._algo->
clone())
283 ASSERT(
typeid(other) ==
typeid(*
this) );
284 if( &other !=
this ) {
286 _algo.reset( other.
_algo->clone() );
311 template <
typename T,
bool M>
329 template <
typename T>
344 return algo.
execute( in, out );
359 template <
typename T>
375 ChannelSelector< carto::VolumeRef<T>,
379 for( uint8_t channel = 0;
380 channel < DataTypeInfo<T>::samples();
384 std::cout <<
"Processing channel :" 391 selector.set( out, channel, outChannel );
virtual Point4df getOutputImageVoxelSize(const Point4df &voxelsize) const
Returns the output voxel size of the processed image.
virtual ImageAlgorithmInterface * clone() const =0
ImageAlgorithmInterface<T> Pure virtual method.
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 ~ImageAlgorithm()
ImageAlgorithmInterface(const ImageAlgorithmInterface &other)
aims::ImageAlgorithmSwitch switches between multichannel and monochannel ImageAlgorithmInterface ...
virtual void setVerbose(int level)
carto::DataTypeTraits< T >::ChannelType ChannelType
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>.
virtual Point4dl getOutputImageDimensions(const long &dx=1, const long &dy=1, const long &dz=1, const long &dt=1) const
static void execute(ImageAlgorithmInterface< ChannelType > &algo, const carto::VolumeRef< T > &in, carto::VolumeRef< T > &out, int verbose)
Execute ImageAlgorithmInterface<T> on VolumeRef<T>.
virtual void updateOptions(const carto::Object &)
T::ChannelType ChannelType
const PropertySet & header() const
ImageAlgorithm(const ImageAlgorithm &other)
virtual AimsData< T > execute(const AimsData< T > &in) const
virtual AimsData< T > doit(const AimsData< T > &in)
Convenience method that execute the algorithm on the input image.
virtual Point4df getOutputImageVoxelSize(const Point4df &voxelsize) const
Returns the output voxel size of the processed image.
ImageAlgorithmInterface()
aims::ImageAlgorithm class used to implement image algorithms
ImageAlgorithm(const ImageAlgorithmInterface< ChannelType > &algo)
Volume< T > deepcopy(const Volume< T > &src)
ImageAlgorithmInterface & operator=(const ImageAlgorithmInterface &other)
virtual void execute(const carto::VolumeRef< T > &in, carto::VolumeRef< T > &out) const =0
ImageAlgorithmInterface<T> Pure virtual method.
virtual void setVerbose(int level)
carto::rc_ptr< carto::Volume< T > > volume()
aims::ImageAlgorithmInterface is the interface for an image processing algorithm. ...
ImageAlgorithm(ImageAlgorithmInterface< ChannelType > *algo, bool deepcopy=true)
virtual carto::VolumeRef< T > execute(const carto::VolumeRef< T > &in) const
virtual ImageAlgorithm< T > * clone() const
ImageAlgorithmInterface<T> Pure virtual method.
virtual void copyHeaderFrom(const PropertySet &other)
virtual ~ImageAlgorithmInterface()
std::string toString(const T &object)
virtual Point4dl getOutputImageDimensions(const Point4dl &dims) const
Returns the output dimensions of the processed image.
virtual void setOptions(const carto::Object &)
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.
carto::rc_ptr< ImageAlgorithmInterface< ChannelType > > _algo