DGtal 0.3.0

3dBorderExtractionImg.cpp


#include <iostream>
#include "DGtal/base/Common.h"
#include <QtGui/qapplication.h>
#include "DGtal/base/Common.h"
#include "DGtal/io/readers/VolReader.h"
#include "DGtal/kernel/images/ImageSelector.h"
#include "DGtal/kernel/imagesSetsUtils/SetFromImage.h"

#include "DGtal/3dViewer/DGtalQGLViewer.h"
#include "DGtal/helpers/StdDefs.h"
#include "ConfigExamples.h"



using namespace std;
using namespace DGtal;


int main( int argc, char** argv )
{

  std::string inputFilename = examplesPath + "samples/Al.100.vol"; 
  QApplication application(argc,argv);
  DGtalQGLViewer viewer;
  viewer.show(); 
  
  typedef ImageSelector < Z3i::Domain, int>::Type Image;
  Image image = VolReader<Image>::VolReader<Image>::importVol(inputFilename);
  Z3i::DigitalSet set3d (image.domain());
  SetFromImage<Z3i::DigitalSet>::append<Image>(set3d, image, 0,255);
  Z3i::Object18_6 obj3d (Z3i::dt18_6, set3d);
  Z3i::Object18_6 border = obj3d.border();
  viewer << border;
  viewer << ClippingPlane(0,1,0, -40)<< DGtalQGLViewer::updateDisplay;
  //viewer << ClippingPlane(0,-1,0, 70)<< DGtalQGLViewer::updateDisplay;
  //viewer << ClippingPlane(1,0.1,0, -50)<< DGtalQGLViewer::updateDisplay;
  //viewer << ClippingPlane(1,0.1,0, -50)<< DGtalQGLViewer::updateDisplay;
  
  

  
  return application.exec();   
}
//                                                                           //
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines