32 #include "DGtal/base/Common.h"
33 #include "DGtal/io/readers/VolReader.h"
34 #include "DGtal/images/ImageHelper.h"
35 #include "ConfigExamples.h"
36 #include "DGtal/io/viewers/Viewer3D.h"
39 #include "DGtal/io/DrawWithDisplay3DModifier.h"
40 #include "DGtal/io/viewers/DrawWithViewer3DModifier.h"
41 #include "DGtal/io/colormaps/HueShadeColorMap.h"
42 #include "DGtal/io/Color.h"
48 using namespace DGtal;
53 unsigned int operator() (
unsigned char aVal)
const
56 Color col = hueShade((
unsigned char)aVal);
57 return (((
unsigned int) col.
red()) << 16)| (((
unsigned int) col.
green()) << 8)|((
unsigned int) col.
blue());
63 int main(
int argc,
char** argv )
67 QApplication application(argc,argv);
71 std::string inputFilename = examplesPath +
"samples/lobster.vol";
84 transTo2DdomainFunctorZ(imageVol.domain().upperBound()));
91 MySliceImageAdapter aSliceImageZ(imageVol, domain2DZ, aSliceFunctorZ, identityFunctor );
97 transTo2DdomainFunctorY(imageVol.domain().upperBound()));
103 MySliceImageAdapter aSliceImageY(imageVol, domain2DY, aSliceFunctorY, identityFunctor );
107 viewer <<
SetMode3D(aSliceImageZ.className(),
"BoundingBox");
112 viewer << aSliceImageZ;
113 viewer << aSliceImageY;
116 viewer <<
SetMode3D(aSliceImageZ.className(),
"");
124 viewer << DGtal::UpdateImagePosition<Z3i::Space, Z3i::KSpace>(1,
MyViewer::yDirection, 0.0, 50.0, 0.0);
125 viewer << DGtal::UpdateImageData<MySliceImageAdapter>(0, aSliceImageZ, 0, 0, 10);
131 viewer << DGtal::UpdateImagePosition<Z3i::Space, Z3i::KSpace>(3,
MyViewer::yDirection, 500.0, 50.0, 0.0);
132 viewer << DGtal::UpdateImageData<MySliceImageAdapter, hueFct>(2, aSliceImageZ, 500, 0, 10, 0.0,
MyViewer::zDirection, hueFct());
136 return application.exec();
virtual void show()
Overload QWidget method in order to add a call to updateList() method (to ensure that the lists are w...
void initRemoveOneDim(const Dimension &dimRemoved)
Aim: Functor that maps a point P of dimension i to a point Q of dimension j. The member myDims is an ...
Aim: Define a simple default functor that just returns its argument.
Aim: implements methods to read a "Vol" file format.
DGtal is the top-level namespace which contains all DGtal functions and types.
Structure representing an RGB triple with alpha component.
void green(const unsigned char aGreenValue)
Aim: implements a const image adapter with a given domain (i.e. a subdomain) and 2 functors : g for d...
void red(const unsigned char aRedValue)
Modifier class in a Display3D stream. Useful to choose your own mode for a given class. Realizes the concept CDrawableWithDisplay3D.
void blue(const unsigned char aBlueValue)