42#include "DGtal/base/Common.h"
43#include "DGtal/io/readers/GenericReader.h"
44#include "DGtal/images/ImageHelper.h"
45#include "DGtal/images/Image.h"
46#include "ConfigExamples.h"
48#include "DGtal/helpers/StdDefs.h"
50#include "DGtal/io/viewers/Viewer3D.h"
51#include "DGtal/io/DrawWithDisplay3DModifier.h"
52#include "DGtal/io/colormaps/HueShadeColorMap.h"
53#include "DGtal/io/Color.h"
64 unsigned int operator() (
unsigned int aVal)
const
67 Color col = hueShade((
unsigned int)aVal);
68 return (((
unsigned int) col.
red()) << 16)| (((
unsigned int) col.
green()) << 8)|((
unsigned int) col.
blue());
75int main(
int argc,
char** argv )
79 QApplication application(argc,argv);
84 std::string inputFilename = examplesPath +
"samples/lobster.vol";
95 Image3D imageCrop(subDomain);
96 Image3D imageCrop2(subDomain2);
102 if(pt[0]>=ptLow[0] && pt[1] >= ptLow[1] && pt[2] >= ptLow[2] &&
103 pt[0]<=ptUpp[0] && pt[1] <= ptUpp[1] && pt[2] <= ptUpp[2]){
104 imageCrop.setValue(*it, imageVol(*it));
107 if(pt[0]>=ptLow2[0] && pt[1] >= ptLow2[1] && pt[2] >= ptLow2[2] &&
108 pt[0]<=ptUpp2[0] && pt[1] <= ptUpp2[1] && pt[2] <= ptUpp2[2]){
109 imageCrop2.setValue(*it, imageVol(*it));
113 viewer <<
SetMode3D(imageCrop.className(),
"BoundingBox");
115 viewer << AddTextureImage3DWithFunctor<Image3D, hueFct, Z3i::Space, Z3i::KSpace> (imageCrop2, hueFct(),
MyViewer::RGBMode);
119 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: This class template may be used to (linearly) convert scalar values in a given range into a colo...
Iterator for HyperRectDomain.
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.
static TContainer import(const std::string &filename, std::vector< unsigned int > dimSpace=std::vector< unsigned int >())
Modifier class in a Display3D stream. Useful to choose your own mode for a given class....