DGtalTools  1.2.0
Viewer3DImage.h
1 
2 #if defined(Viewer3DImage_RECURSES)
3 #error Recursive header files inclusion detected in Viewer3DImage.h
4 #else // defined(Viewer3DImage_RECURSES)
6 #define Viewer3DImage_RECURSES
7 
8 
9 #if !defined Viewer3DImage_h
10 #define Viewer3DImage_h
15 #include "DGtal/helpers/StdDefs.h"
16 #include "DGtal/io/viewers/Viewer3D.h"
17 #include "DGtal/io/Display3D.h"
18 #include "DGtal/images/ImageSelector.h"
19 #include "DGtal/images/ImageContainerBySTLVector.h"
20 #include "DGtal/images/ConstImageAdapter.h"
21 
22 template < typename Space = DGtal::Z3i::Space, typename KSpace = DGtal::Z3i::KSpace>
23 class Viewer3DImage: public DGtal::Viewer3D <Space, KSpace>
24 {
25 
26  typedef DGtal::ImageContainerBySTLVector<DGtal::Z3i::Domain, unsigned char> Image3D;
27  typedef DGtal::ImageContainerBySTLVector<DGtal::Z2i::Domain, unsigned char> Image2D;
28 
29  typedef DGtal::ConstImageAdapter<Image3D, Image2D::Domain, DGtal::functors::Projector< DGtal::Z3i::Space>,
30  Image3D::Value, DGtal::functors::Identity > SliceImageAdapter;
31 
32  typedef DGtal::ConstImageAdapter<Image3D, DGtal::Z2i::Domain, DGtal::functors::SliceRotator2D< DGtal::Z3i::Domain >,
33  Image3D::Value, DGtal::functors::Identity > MyRotatorSliceImageAdapter;
34 
35 
36 
37 public:
39 
40  Viewer3DImage(ModeVisu aMode=BoundingBox) : DGtal::Viewer3D<Space, KSpace>(), myImageOrigin(DGtal::Z3i::Point(0,0,0)){
41  mySliceXPos=0;
42  mySliceYPos=0;
43  mySliceZPos=0;
47  myAngleRotation=0.0;
49  myMode=aMode;
50  myDisplayingInfo=true;
51  }
52 
53 
54  Viewer3DImage(Image3D * an3DImage){
55  my3dImage = an3DImage;
56  Viewer3DImage();
57  }
58 
59  void setVolImage(Image3D * an3DImage);
60 
61 
62 
63 
64 protected:
65  virtual QString helpString() const;
66  virtual void keyPressEvent ( QKeyEvent *e );
67  virtual void init();
69  float myScaleX;
70  float myScaleY;
71  float myScaleZ;
81  DGtal::Z3i::Point myImageOrigin;
83 };
84 
85 
86 #endif // undefined viewer3dimage
87 
88 #undef Viewer3DImage_RECURSES
89 #endif // else defined(Viewer3DImage_RECURSES)
90 
virtual void keyPressEvent(QKeyEvent *e)
Viewer3DImage(Image3D *an3DImage)
Definition: Viewer3DImage.h:54
DGtal::ConstImageAdapter< Image3D, DGtal::Z2i::Domain, DGtal::functors::SliceRotator2D< DGtal::Z3i::Domain >, Image3D::Value, DGtal::functors::Identity > MyRotatorSliceImageAdapter
Definition: Viewer3DImage.h:33
DGtal::ConstImageAdapter< Image3D, Image2D::Domain, DGtal::functors::Projector< DGtal::Z3i::Space >, Image3D::Value, DGtal::functors::Identity > SliceImageAdapter
Definition: Viewer3DImage.h:30
virtual void init()
ModeVisu myMode
Definition: Viewer3DImage.h:82
Image3D * my3dImage
Definition: Viewer3DImage.h:68
double myAngleRotation
Definition: Viewer3DImage.h:76
double myTotalAngleRotationY
Definition: Viewer3DImage.h:78
double myTotalAngleRotationZ
Definition: Viewer3DImage.h:79
DGtal::ImageContainerBySTLVector< DGtal::Z3i::Domain, unsigned char > Image3D
Definition: Viewer3DImage.h:26
virtual QString helpString() const
DGtal::ImageContainerBySTLVector< DGtal::Z2i::Domain, unsigned char > Image2D
Definition: Viewer3DImage.h:27
Viewer3DImage(ModeVisu aMode=BoundingBox)
Definition: Viewer3DImage.h:40
double myTotalAngleRotationX
Definition: Viewer3DImage.h:77
bool myDisplayingInfo
Definition: Viewer3DImage.h:80
void setVolImage(Image3D *an3DImage)
DGtal::Z3i::Point myImageOrigin
Definition: Viewer3DImage.h:81
Definition: ATu0v1.h:57