#include <iostream>
#include "DGtal/base/Common.h"
#include "DGtal/io/readers/VolReader.h"
#include "DGtal/images/ImageHelper.h"
#include "ConfigExamples.h"
#include "DGtal/io/viewers/Viewer3D.h"
#include "DGtal/io/DrawWithDisplay3DModifier.h"
#include "DGtal/io/viewers/DrawWithViewer3DModifier.h"
#include "DGtal/io/colormaps/HueShadeColorMap.h"
#include "DGtal/io/Color.h"
struct hueFct{
inline
unsigned int operator() (unsigned char aVal) const
{
Color col = hueShade((
unsigned char)aVal);
return (((
unsigned int) col.
red()) << 16)| (((
unsigned int) col.
green()) << 8)|((
unsigned int) col.
blue());
}
};
int main(
int argc,
char** argv )
{
QApplication application(argc,argv);
MyViewer viewer;
std::string inputFilename = examplesPath + "samples/lobster.vol";
transTo2DdomainFunctorZ(imageVol.domain().upperBound()));
MySliceImageAdapter aSliceImageZ(imageVol, domain2DZ, aSliceFunctorZ, identityFunctor );
transTo2DdomainFunctorY(imageVol.domain().upperBound()));
MySliceImageAdapter aSliceImageY(imageVol, domain2DY, aSliceFunctorY, identityFunctor );
viewer <<
SetMode3D(aSliceImageZ.className(),
"BoundingBox");
viewer << MyViewer::updateDisplay;
viewer << aSliceImageZ;
viewer << aSliceImageY;
viewer <<
SetMode3D(aSliceImageZ.className(),
"");
viewer << DGtal::UpdateImagePosition<Z3i::Space, Z3i::KSpace>(1, MyViewer::yDirection, 0.0, 50.0, 0.0);
viewer << DGtal::UpdateImageData<MySliceImageAdapter>(0, aSliceImageZ, 0, 0, 10);
viewer << MyViewer::updateDisplay;
viewer << DGtal::UpdateImagePosition<Z3i::Space, Z3i::KSpace>(3, MyViewer::yDirection, 500.0, 50.0, 0.0);
viewer << DGtal::UpdateImageData<MySliceImageAdapter, hueFct>(2, aSliceImageZ, 500, 0, 10, 0.0, MyViewer::zDirection, hueFct());
viewer << MyViewer::updateDisplay;
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...
Aim: This class template may be used to (linearly) convert scalar values in a given range into a colo...
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 initRemoveOneDim(const Dimension &dimRemoved)