This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.
- Author
- Bertrand Kerautret (
kerau.nosp@m.tre@.nosp@m.loria.nosp@m..fr
) LORIA (CNRS, UMR 7503), University of Nancy, France
- Date
- 2011/05/22
An example file named ctopo-2-3d.
This file is part of the DGtal library.
Definition in file ctopo-2-3d.cpp.
int main |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
Definition at line 53 of file ctopo-2-3d.cpp.
57 QApplication application(argc,argv);
60 std::string inputFilename = examplesPath +
"samples/cat10.vol";
67 bool space_ok = ks.
init( image.domain().lowerBound(), image.domain().upperBound(),
true );
71 trace.
error() <<
"Error in the Khamisky space construction."<<std::endl;
75 std::vector<Z3i::SCell> vectBdrySCell;
76 std::vector<Z3i::SCell> vectBdrySCell2;
77 std::set<Z3i::SCell> vectBdrySCellALL;
84 trace.
info() <<
"Tracking Boundary.."<<std::endl;
87 ks,SAdj, set3d, aCell );
91 ks, *(ks.
sDirs( aCell )), SAdj,
96 ks, *(++(ks.
sDirs( aCell ))), SAdj,
105 trace.
info() <<
"Displaying the surfels.."<<std::endl;
106 viewer <<
SetMode3D((*(vectBdrySCellALL.begin())).className(),
"Transparent");
107 for( std::set<Z3i::SCell>::iterator it=vectBdrySCellALL.begin();
108 it!= vectBdrySCellALL.end(); it++){
114 cmap_grad.addColor(
Color( 50, 50, 255 ) );
115 cmap_grad.addColor(
Color( 255, 0, 0 ) );
116 cmap_grad.addColor(
Color( 255, 255, 10 ) );
119 viewer << Viewer3D<Z3i::Space,Z3i::KSpace>::shiftSurfelVisu;
120 viewer <<
SetMode3D((*(vectBdrySCell2.begin())).className(),
"");
121 viewer.setFillColor(
Color(180, 200, 25, 255));
124 for( std::vector<Z3i::SCell>::iterator it=vectBdrySCell2.begin();
125 it!= vectBdrySCell2.end(); it++){
126 Color col= cmap_grad(d);
133 cmap_grad2.addColor(
Color( 50, 50, 255 ) );
134 cmap_grad2.addColor(
Color( 255, 0, 0 ) );
135 cmap_grad2.addColor(
Color( 255, 255, 10 ) );
136 viewer << Viewer3D<>::shiftSurfelVisu;
139 for( std::vector<Z3i::SCell>::iterator it=vectBdrySCell.begin();
140 it!= vectBdrySCell.end(); it++){
141 Color col= cmap_grad2(d);
148 viewer << MyViewer::shiftSurfelVisu;
149 viewer.setFillColor(
Color(18, 200, 25, 255));
151 viewer << MyViewer::updateDisplay;
153 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: A wrapper class around a STL associative container for storing sets of digital points within som...
Aim: This class template may be used to (linearly) convert scalar values in a given range into a colo...
Aim: implements association bewteen points lying in a digital domain and values.
Aim: This class is a model of CCellularGridSpaceND. It represents the cubical grid as a cell complex,...
bool init(const Point &lower, const Point &upper, bool isClosed)
Specifies the upper and lower bounds for the maximal cells in this space.
DirIterator sDirs(const SCell &p) const
Given a signed cell [p], returns an iterator to iterate over each coordinate the cell spans.
Aim: A utility class for constructing surfaces (i.e. set of (n-1)-cells).
Aim: Represent adjacencies between surfel elements, telling if it follows an interior to exterior ord...
void beginBlock(const std::string &keyword="")
Aim: Define utilities to convert a digital set into an image.
Modifier class in a Display3D stream. Useful to choose your own mode for a given class....
Represents a signed cell in a cellular grid space by its Khalimsky coordinates and a boolean value.
Aim: implements methods to read a "Vol" file format.
ImageContainerBySTLVector< Domain, Value > Image
References DGtal::GradientColorMap< PValue, PDefaultPreset, PDefaultFirstColor, PDefaultLastColor >::addColor(), DGtal::Trace::beginBlock(), DGtal::Color::blue(), DGtal::Trace::error(), DGtal::Color::green(), DGtal::Trace::info(), DGtal::KhalimskySpaceND< dim, TInteger >::init(), DGtal::Color::red(), DGtal::KhalimskySpaceND< dim, TInteger >::sDirs(), DGtal::Display3D< Space, KSpace >::setFillColor(), DGtal::Viewer3D< TSpace, TKSpace >::show(), and DGtal::trace.