29 #ifndef IMG_IMAGE_HANDLE_H
30 #define IMG_IMAGE_HANDLE_H
32 #include <boost/shared_ptr.hpp>
47 namespace test_image {
51 namespace ost {
namespace img {
53 using image_state::ImageStateBase;
55 using image_state::ImageStateNonModVisitorBase;
56 using image_state::ImageStateModIPVisitorBase;
57 using image_state::ImageStateConstModIPVisitorBase;
58 using image_state::ImageStateModOPVisitorBase;
59 using image_state::ImageStateConstModOPVisitorBase;
60 using image_state::ImageStateMorphVisitorBase;
66 class NonModAlgorithm;
68 class ConstModIPAlgorithm;
70 class ConstModOPAlgorithm;
80 class ConstImageHandle;
121 typedef boost::shared_ptr<DataObservable> ObsPtr;
123 typedef boost::shared_ptr<ImageStateBasePtr> StatePtrPtr;
169 void Paste(
const Data& d);
196 bool IsValid()
const;
199 long MemSize()
const;
216 virtual Extent GetExtent()
const;
224 virtual Point GetSpatialOrigin()
const;
231 void SetSpatialOrigin(
const Point& p);
241 void CenterSpatialOrigin();
249 Vec3 GetAbsoluteOrigin()
const;
256 void SetAbsoluteOrigin(
const Vec3& c) ;
264 Vec3 IndexToCoord(
const Point &p)
const;
273 Vec3 CoordToIndex(
const Vec3& c)
const;
282 Vec3 FractionalIndexToCoord(
const Vec3 &p)
const;
290 virtual Real GetReal(
const Point& p)
const;
305 virtual Real GetIntpolReal(
const Vec3 &v)
const;
306 virtual Real GetIntpolReal(
const Vec2 &v)
const;
307 virtual Real GetIntpolReal(
const Real &d)
const;
310 virtual Complex GetIntpolComplex(
const Vec3 &v)
const;
311 virtual Complex GetIntpolComplex(
const Vec2 &v)
const;
312 virtual Complex GetIntpolComplex(
const Real &d)
const;
327 virtual void Notify()
const;
328 virtual void Notify(
const Extent& e)
const;
329 virtual void Notify(
const Point& p)
const;
409 void StateApply(ImageStateNonModVisitorBase& v)
const;
413 void StateApplyIP(ImageStateModIPVisitorBase& v);
415 ImageHandle StateApply(ImageStateModIPVisitorBase& v)
const;
417 void StateApplyIP(
const ImageStateConstModIPVisitorBase& v);
419 ImageHandle StateApply(
const ImageStateConstModIPVisitorBase& v)
const;
421 void StateApplyIP(ImageStateModOPVisitorBase& v);
423 ImageHandle StateApply(ImageStateModOPVisitorBase& v)
const;
425 void StateApplyIP(
const ImageStateConstModOPVisitorBase& v);
427 ImageHandle StateApply(
const ImageStateConstModOPVisitorBase& v)
const;
429 void StateApplyIP(ImageStateMorphVisitorBase& v);
431 ImageHandle StateApply(ImageStateMorphVisitorBase& v)
const;
520 operator const Data& ()
const {
return handle_;}
559 bool IsValid()
const;
562 long MemSize()
const;
578 Point GetSpatialOrigin()
const;
582 Vec3 GetAbsoluteOrigin()
const;
585 Vec3 IndexToCoord(
const Point &p)
const;
588 Vec3 CoordToIndex(
const Vec3& c)
const;
591 Vec3 FractionalIndexToCoord(
const Vec3 &p)
const;
604 virtual Real GetIntpolReal(
const Vec3 &v)
const;
605 virtual Real GetIntpolReal(
const Vec2 &v)
const;
606 virtual Real GetIntpolReal(
const Real &d)
const;
609 virtual Complex GetIntpolComplex(
const Vec3 &v)
const;
610 virtual Complex GetIntpolComplex(
const Vec2 &v)
const;
611 virtual Complex GetIntpolComplex(
const Real &d)
const;
624 void Notify(
const Extent& e)
const;
625 void Notify(
const Point& p)
const;
654 void StateApply(ImageStateNonModVisitorBase& v)
const;
658 ImageHandle StateApply(ImageStateModIPVisitorBase& v)
const;
661 ImageHandle StateApply(
const ImageStateConstModIPVisitorBase& v)
const;
664 ImageHandle StateApply(ImageStateModOPVisitorBase& v)
const;
667 ImageHandle StateApply(
const ImageStateConstModOPVisitorBase& v)
const;
670 ImageHandle StateApply(ImageStateMorphVisitorBase& v)
const;
out-of-place modification const algorithm
Non-modifying Algorithm, abstract base class.
templated observable class
DataDomain
underlying data type
std::complex< Real > Complex
DLLEXPORT_OST_IMG_BASE ImageHandle operator/(const ConstImageHandle &h, Real v)
DLLEXPORT_OST_IMG_BASE ImageHandle operator+(const ConstImageHandle &h, Real v)
Abstract base class for data.
DLLEXPORT_OST_IMG_BASE bool operator!=(const ImageHandle &lhs, const ConstImageHandle &rhs)
Abstract base class for read-only data.
Helper class to handle pixel sampling.
Defines lower and upper valid indices.
In-place modification const algorithm.
Abstract base class of data observer.
In-place modification algorithm.
Exception thrown upon invalid image handle usage.
read-only ImageHandle implementation
DLLEXPORT_OST_IMG_BASE bool operator==(const ImageHandle &lhs, const ConstImageHandle &rhs)
out-of-place modification algorithm
Manage shared instances of images.
boost::shared_ptr< ImageStateBase > ImageStateBasePtr
class encapsulating 1D to 3D point
#define DLLEXPORT_OST_IMG_BASE
DLLEXPORT_OST_IMG_BASE ImageHandle operator*(const ConstImageHandle &h, Real v)
DLLEXPORT_OST_IMG_BASE ImageHandle operator-(const ConstImageHandle &h, Real v)