37 #ifndef AIMS_UTILITY_CONVERTER_VOLUME_H 38 #define AIMS_UTILITY_CONVERTER_VOLUME_H 47 template<
typename _Tp>
54 template<
typename _Tp>
61 template<
typename _Tp>
72 template <
typename INP,
typename OUTP>
80 template <
typename INP,
typename OUTP>
90 template<
typename INP,
typename OUTP>
104 template<
typename INP,
typename OUTP>
120 template <
typename INP>
124 RawConverter(
bool shallowcopy =
false ) : _shallowcopy( shallowcopy ) {}
132 template <
typename INP>
136 RawConverter(
bool shallowcopy =
false ) : _shallowcopy( shallowcopy ) {}
144 template <
typename INP>
146 :
public Converter<AimsData<INP>, AimsData<INP> >
156 template <
typename INP>
158 :
public Converter<carto::VolumeRef<INP>, carto::VolumeRef<INP> >
168 template <
class INP,
class OUTP>
176 template <
class INP,
class OUTP>
203 template <
class INP,
class OUTP>
inline 212 template <
class INP>
inline 221 template<
class INP,
class OUTP>
inline 233 int x, y, z, t, dx = out.
dimX(), dy = out.
dimY(), dz = out.
dimZ(),
234 dt = out.
dimT(), ox = dx, oy = dy, oz = dz, ot = dt;
246 for( t=0; t<dt; ++t )
248 for( z=0; z<dz; ++z )
250 for( y=0; y<dy; ++y )
252 for( x=0; x<dx; ++x )
253 itemconv.
convert( in( x, y, z, t ), out( x, y, z, t ) );
255 out( x, y, z, t ) = OUTP(0);
258 for( x=0; x<ox; ++x )
259 out( x, y, z, t ) = OUTP(0);
262 for( y=0; y<oy; ++y )
263 for( x=0; x<ox; ++x )
264 out( x, y, z, t ) = OUTP(0);
268 for( z=0; z<oz; ++z )
269 for( y=0; y<oy; ++y )
270 for( x=0; x<ox; ++x )
271 out( x, y, z, t ) = OUTP(0);
285 template<
class INP,
class OUTP>
inline 291 if( out.
dimX() == 0 )
304 if( std::isnan( info.
vmin ) ) {
310 if( std::isnan( info.
vmax ) ) {
318 int x, y, z, t, dx = out.
dimX(), dy = out.
dimY(), dz = out.
dimZ(),
319 dt = out.
dimT(), ox = dx, oy = dy, oz = dz, ot = dt;
329 for( t=0; t<dt; ++t )
331 for( z=0; z<dz; ++z )
333 for( y=0; y<dy; ++y )
335 for( x=0; x<dx; ++x )
339 out( x, y, z, t ) = OUTP(0);
342 for( x=0; x<ox; ++x )
343 out( x, y, z, t ) = OUTP(0);
346 for( y=0; y<oy; ++y )
347 for( x=0; x<ox; ++x )
348 out( x, y, z, t ) = OUTP(0);
352 for( z=0; z<oz; ++z )
353 for( y=0; y<oy; ++y )
354 for( x=0; x<ox; ++x )
355 out( x, y, z, t ) = OUTP(0);
371 template<
class INP>
inline 380 if( this->_shallowcopy )
396 int x, y, z, t, dx = out.
dimX(), dy = out.
dimY(), dz = out.
dimZ(),
397 dt = out.
dimT(), ox = dx, oy = dy, oz = dz, ot = dt;
407 for( t=0; t<dt; ++t )
409 for( z=0; z<dz; ++z )
411 for( y=0; y<dy; ++y )
413 for( x=0; x<dx; ++x )
414 out( x, y, z, t ) = in( x, y, z, t );
416 out( x, y, z, t ) = INP(0);
419 for( x=0; x<ox; ++x )
420 out( x, y, z, t ) = INP(0);
423 for( y=0; y<oy; ++y )
424 for( x=0; x<ox; ++x )
425 out( x, y, z, t ) = INP(0);
429 for( z=0; z<oz; ++z )
430 for( y=0; y<oy; ++y )
431 for( x=0; x<ox; ++x )
432 out( x, y, z, t ) = INP(0);
436 template<
typename INP,
typename OUTP>
442 template<
typename INP,
typename OUTP>
449 template<
typename INP>
461 template<
typename INP>
463 :
public RawConverter<carto::VolumeRef<INP>,carto::VolumeRef<INP> >
473 template<
typename INP>
475 :
public Rescaler<AimsData<INP>,AimsData<INP> >
485 template<
typename INP>
487 :
public Rescaler<carto::VolumeRef<INP>,carto::VolumeRef<INP> >
497 template<
typename INP>
500 std::numeric_limits<INP>::is_specialized
501 && std::numeric_limits<INP>::is_bounded >
506 std::numeric_limits<INP>::is_specialized
507 &&
std::numeric_limits<INP>::is_bounded >( shallowcopy ) {}
510 std::numeric_limits<INP>::is_specialized
511 &&
std::numeric_limits<INP>::is_bounded >( info, shallowcopy ) {}
515 template<
typename INP>
518 std::numeric_limits<INP>::is_specialized
519 && std::numeric_limits<INP>::is_bounded >
524 std::numeric_limits<INP>::is_specialized
525 &&
std::numeric_limits<INP>::is_bounded >( shallowcopy ) {}
528 std::numeric_limits<INP>::is_specialized
529 &&
std::numeric_limits<INP>::is_bounded >( info, shallowcopy ) {}
541 sc.convert( in, out );
561 sc( this->_info,
true );
562 sc.convert( in, out );
572 template <
typename INP,
typename OUTP>
583 template<
typename INP,
typename OUTP>
590 template<
typename INP,
typename OUTP>
598 template<
typename INP,
typename OUTP>
608 template <
class INP,
class OUTP>
618 template <
class INP>
inline 627 template<
class INP>
inline 633 RawConverter<AimsData<INP>,
AimsData<INP> > conv( _shallowcopy );
634 conv.
convert( datain, dataout );
void setSizeT(float sizet)
SmartConverter(bool shallowcopy=false)
void convert(const INP &in, OUTP &out) const
virtual bool getProperty(const std::string &, Object &) const
ShallowConverter(bool rescale=false)
ShallowConverter(bool rescale, const RescalerInfo &info)
SmartConverter(bool shallowcopy=false)
void setSizeX(float sizex)
RawConverter(bool shallowcopy=false)
virtual bool removeProperty(const std::string &)
void setSizeY(float sizey)
OUTP getScaledValue(INP value) const
void setHeader(aims::Header *hdr)
ConverterSwitch(bool=false)
ConverterSwitch(const RescalerInfo &info, bool)
SmartConverter(const RescalerInfo &info, bool shallowcopy=false)
ShallowConverter(bool rescale=false)
ConverterSwitch(const RescalerInfo &info, bool)
AimsData< T > clone() const
ShallowConverter(bool rescale, const RescalerInfo &info)
ConverterSwitch(const RescalerInfo &, bool shallowcopy=false)
const aims::Header * header() const
ConverterSwitch(const RescalerInfo &, bool shallowcopy=false)
carto::rc_ptr< carto::Volume< T > > volume()
ConverterSwitch(bool shallowcopy=false)
ConverterSwitch(bool shallowcopy=false)
virtual void setProperty(const std::string &, Object)
void setSizeXYZT(float sizex=1.0f, float sizey=1.0f, float sizez=1.0f, float sizet=1.0f)
virtual bool hasProperty(const std::string &) const
void setSizeZ(float sizez)
void convert(const INP &in, OUTP &out) const
ConverterSwitch(bool=false)
RawConverter(bool shallowcopy=false)
SmartConverter(const RescalerInfo &info, bool shallowcopy=false)
int borderWidth() const
Usefull offsets for A.I.M.S.