Go to the documentation of this file.
18 #include <MGXViewer/qglviewer.h>
34 friend class SetupProcess;
96 void setMain(
Store* m);
115 void setWork(
Store* w);
148 return multiply(_step, scale());
155 return size_t(_size.x()) * _size.y() * _size.z();
168 return (_showScale ? _scale :
Point3f(1.0, 1.0, 1.0));
175 return multiply(scale(), _origin);
188 void setOrigin(
const Point3f& s);
195 void setSize(
const Point3u& s);
199 void setStep(
const Point3f& s);
259 Matrix4f worldToImageVector()
const;
262 Matrix4f imageToWorldVector()
const;
267 return multiply(
Point3f(img) +
Point3f(.5f, .5f, .5f), step()) + origin();
279 return multiply(
Point3f(img), step());
301 return worldToImage<float>(a);
304 return worldToImage<int>(a);
307 return worldToImage<uint>(a);
311 return worldToImage<float>(a);
314 return worldToImage<int>(a);
317 return worldToImage<uint>(a);
321 return worldToImageVector<float>(a);
324 return worldToImageVector<int>(a);
327 return worldToImageVector<uint>(a);
337 return divide(p, scale()) * _texScale;
344 return imageToWorldVector(_size);
350 if(x < 0 or y < 0 or z < 0 or x >=
int(_size.x()) or y >=
int(_size.y()) or z >=
int(_size.z()))
358 return (
size_t(z) * _size.y() + y) * _size.x() + x;
365 return (
size_t(ipos.
z()) * _size.y() + ipos.
y()) * _size.x() + ipos.
x();
417 return (_showTrans ? _trans : _frame);
427 return (_showTrans ? _trans : _frame);
449 if(_CurrLabel > ((1 << 16) - 1))
465 _current = (store == _main or store == _work) ? store : 0;
474 void resetModified();
477 Store* _main, *_work, *_current;
486 bool changed_frame, changed_trans;
489 bool _showScale, _showTrans, _showBBox, _tieScales;
CU_HOST_DEVICE Point3i worldToImage(const Point3f &wrld, const Point3f &step, const Point3f &shift)
Point3i worldToImagei(const Point3f &a) const
const qglviewer::ManipulatedFrame & getFrame() const
Returns the active frame (i.e.
Point3u size() const
Returns the size, in voxels, of the stores.
Point3u worldToImageVectoru(const Point3f &a) const
qglviewer::ManipulatedFrame & trans()
Returns the transformation frame.
bool empty() const
True if the stack is empty (i.e.
void setShowScale(bool s)
Set if the stack should be scaled.
const Store * work() const
Access the work store.
CU_HOST_DEVICE void z(const T &v)
Short access to the third element.
void setTieScales(bool s)
Set if the scales should be tied.
const Store * currentStore() const
Returns the current store.
void setLabel(int l)
Change the label to be used.
Point3f imageToWorldVector(const Vector< 3, T > &img) const
Go from image coordinates to world coordinates (for a vector)
BoundingBox3u worldToImageu(const BoundingBox3f &a) const
int viewLabel() const
Return the label to be used.
const Store * main() const
Access the main store.
void setId(int i)
Change the id of the stack.
size_t offset(Point3i ipos) const
Returns the position, in the image, of the point of image coordinate ipos.
bool showScale() const
True if the stack is scaled.
Point3i worldToImageVectori(const Point3f &a) const
BoundingBox3i worldToImagei(const BoundingBox3f &a) const
BoundingBox3f imageToWorld(const BoundingBox< 3, T > &img) const
Go from image coordinates to world coordinates (for a point)
Distributed matrix library.
CU_HOST_DEVICE Point pmin()
bool showTrans() const
True if the stack is shown transformed.
size_t storeSize() const
Returns the size, in number of elements, of the stores.
bool showBBox() const
True if the Bounding Box of the stack is shown.
CU_HOST_DEVICE Point3f imageToWorld(const Point3i &img, const Point3f &step, const Point3f &shift)
BoundingBox< 3, int > BoundingBox3i
BoundingBox< 3, float > BoundingBox3f
BoundingBox3i boundingBox() const
Returns the bounding box, in voxels, of the stores.
Vector< 3, float > Point3f
Point3f worldSize() const
Size of the image, in world coordinate.
Point3u position(size_t offset) const
Compute the position from the offset.
void setShowTrans(bool s)
Set if the stack should be transformed.
Store * work()
Access the work store.
CU_HOST_DEVICE void y(const T &v)
Short access to the second element.
Point3f abstractToWorld(const Point3f &p) const
Go from abstract unit to world unit.
Store * main()
Access the main store.
BoundingBox< 3, T > worldToImage(const BoundingBox3f &wrld) const
Go from world coordinates to image coordinates (for a point)
Point3f imageToWorld(const Vector< 3, T > &img) const
Go from image coordinates to world coordinates (for a point)
Point3f origin() const
Position of the point (0,0,0) of the image, in world coordinate.
const qglviewer::ManipulatedFrame & frame() const
Returns the manipulated frame.
bool tieScales() const
True if the 3 scaling axis are tied together.
size_t offset(uint x, uint y, uint z) const
Compute offset for image data.
bool boundsOK(int x, int y, int z) const
Check if (x,y,z) is in the image.
Point3u worldToImageu(const Point3f &a) const
const qglviewer::ManipulatedFrame & trans() const
Returns the transformation frame.
Point3f worldToImagef(const Point3f &a) const
Vector< 3, uint > Point3u
CU_HOST_DEVICE Point pmax()
Point3f worldToImageVectorf(const Point3f &a) const
int id() const
Id of a stack.
qglviewer::ManipulatedFrame & frame()
Returns the manipulated frame.
BoundingBox3f worldToImagef(const BoundingBox3f &a) const
Point3f step() const
Returns the size, in micro-meters, of a voxel.
void setScale(Point3f s)
Set the scaling factor of the stack.
CU_HOST_DEVICE void x(const T &v)
Short access to the first element.
int userId() const
Id as seen by the user.
CU_HOST_DEVICE size_t offset(uint x, uint y, uint z, uint xsz, uint ysz)
int nextLabel()
Return the next label to be used and change it so successive calls return successive labels.
void setCurrentStore(Store *store)
Vector< 3, T > worldToImageVector(Point3f wrld) const
Go from world coordinates to image coordinates (for a vector)
qglviewer::ManipulatedFrame & getFrame()
Returns the active frame (i.e.
Vector< 3, T > worldToImage(Point3f wrld) const
Go from world coordinates to image coordinates (for a point)
Store * currentStore()
Returns the current store.
Point3f scale() const
Scaling factor to apply, if scaled.
void setShowBBox(bool s)
Set if the bounding box of the stack should be visible.