#include <iostream>
#include "DGtal/base/Common.h"
#include "DGtal/io/readers/GenericReader.h"
#include "DGtal/images/ImageHelper.h"
#include "DGtal/images/Image.h"
#include "ConfigExamples.h"
#include "DGtal/helpers/StdDefs.h"
#include "DGtal/io/viewers/Viewer3D.h"
#include "DGtal/io/DrawWithDisplay3DModifier.h"
#include "DGtal/io/colormaps/HueShadeColorMap.h"
#include "DGtal/io/Color.h"
using namespace std;
struct hueFct{
inline
unsigned int operator() (unsigned int aVal) const
{
HueShadeColorMap<unsigned int> hueShade(0,255);
Color col = hueShade((unsigned int)aVal);
return (((unsigned int) col.red()) << 16)| (((unsigned int) col.green()) << 8)|((unsigned int) col.blue());
}
};
int main(
int argc,
char** argv )
{
typedef ImageContainerBySTLVector<Z3i::Domain, unsigned char > Image3D;
QApplication application(argc,argv);
typedef Viewer3D<> MyViewer ;
MyViewer viewer;
viewer.show();
std::string inputFilename = examplesPath + "samples/lobster.vol";
Image3D imageVol = GenericReader<Image3D>::import(inputFilename);
Image3D imageCrop(subDomain);
Image3D imageCrop2(subDomain2);
if(imageVol(*it)>140)
viewer << *it;
if(pt[0]>=ptLow[0] && pt[1] >= ptLow[1] && pt[2] >= ptLow[2] &&
pt[0]<=ptUpp[0] && pt[1] <= ptUpp[1] && pt[2] <= ptUpp[2]){
imageCrop.setValue(*it, imageVol(*it));
}
if(pt[0]>=ptLow2[0] && pt[1] >= ptLow2[1] && pt[2] >= ptLow2[2] &&
pt[0]<=ptUpp2[0] && pt[1] <= ptUpp2[1] && pt[2] <= ptUpp2[2]){
imageCrop2.setValue(*it, imageVol(*it));
}
}
viewer << imageCrop;
viewer << SetMode3D(imageCrop.className(), "BoundingBox");
viewer << AddTextureImage3DWithFunctor<Image3D, hueFct, Z3i::Space, Z3i::KSpace> (imageCrop2, hueFct(), MyViewer::RGBMode);
viewer << MyViewer::updateDisplay;
return application.exec();
}
MyDigitalSurface::ConstIterator ConstIterator
DGtal is the top-level namespace which contains all DGtal functions and types.
int main(int argc, char **argv)
HyperRectDomain< Space > Domain