25 #ifndef IMAGE_STATE_HALF_FREQUENCY_DOMAIN_HH
26 #define IMAGE_STATE_HALF_FREQUENCY_DOMAIN_HH
37 #define CONJPOINT(a) ((a)[2]==0 ?((a)[1]==0?(a)[0]>0:(a)[1]>0):(a)[2]>0) ? (a) : -(a)
39 namespace ost {
namespace img {
namespace image_state {
45 return (d&0x1) ? (d-1)/2 : d/2;
50 return (d&0x1) ? -((d-1)/2) : -(d/2-1);
107 logical_extent_(ExtractLogicalExtent(e)),
108 physical_extent_(ExtractPhysicalExtent(e)),
112 assert(dim_>=1 && dim_<=3);
128 template <
typename V>
130 if(logical_extent_.Contains(p)) {
136 template <
typename V>
138 if(logical_extent_.Contains(p)) {
141 data.
Value(Point2Index(cp))=Val2Val<Real,V>(r);
146 template <
typename V>
148 if(logical_extent_.Contains(p)) {
151 return Val2Val<V,Complex>(data.
Value(Point2Index(cp)));
153 return conj(Val2Val<V,Complex>(data.
Value(Point2Index(cp))));
159 template <
typename V>
161 if(logical_extent_.Contains(p)) {
164 data.
Value(Point2Index(cp))=Val2Val<Complex,V>(c);
170 const Size& size=physical_extent_.GetSize();
171 return Index(p[0]>=0?p[0]:size[0]+p[0],
172 p[1]>=0?p[1]:size[1]+p[1],
184 }
else if(e.
GetDim()==2) {
197 }
else if(e.
GetDim()==2) {
DataDomain GetDomain() const
Complex GetComplex(const Point &p, const ValueHolder< V > &data) const
void SetComplex(const Point &p, const Complex &c, ValueHolder< V > &data)
DataDomain
underlying data type
std::complex< Real > Complex
Index Point2Index(const Point &p) const
Extent GetLogicalExtent() const
Extent GetPhysicalExtent() const
Point GetSpatialOrigin() const
Extent ExtractPhysicalExtent(const Extent &e) const
int GetDim() const
Return dimension.
V & Value(const Index &i)
return direct r/w access to the value without boundary check
class encapsulating 1D to 3D size
Defines lower and upper valid indices.
HalfFrequencyDomain(const Extent &e)
void SetReal(const Point &p, const Real &r, ValueHolder< V > &data)
void SetSpatialOrigin(const Point &o)
Real GetReal(const Point &p, const ValueHolder< V > &data) const
class encapsulating 1D to 3D point
#define DLLEXPORT_OST_IMG_BASE
Extent ExtractLogicalExtent(const Extent &e) const