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