DGtal  1.2.0
Functions
shortcuts-geometry.cpp File Reference
#include <iostream>
#include "ConfigExamples.h"
#include "DGtal/helpers/StdDefs.h"
#include "DGtal/helpers/Shortcuts.h"
#include "DGtal/helpers/ShortcutsGeometry.h"
#include "DGtal/base/Common.h"
Include dependency graph for shortcuts-geometry.cpp:

Go to the source code of this file.

Functions

int main (int, char **)
 

Detailed Description

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
Jacques-Olivier Lachaud (jacqu.nosp@m.es-o.nosp@m.livie.nosp@m.r.la.nosp@m.chaud.nosp@m.@uni.nosp@m.v-sav.nosp@m.oie..nosp@m.fr ) Laboratory of Mathematics (CNRS, UMR 5127), University of Savoie, France
Date
2018/06/26

An example file named shortcuts.

This file is part of the DGtal library.

Definition in file shortcuts-geometry.cpp.

Function Documentation

◆ main()

int main ( int  ,
char **   
)

[dgtal_shortcuts_ssec2_1_6s]

[dgtal_shortcuts_ssec2_1_6s]

[dgtal_shortcuts_ssec2_2_5s]

[dgtal_shortcuts_ssec2_2_5s]

[dgtal_shortcuts_ssec2_2_6s]

[dgtal_shortcuts_ssec2_2_6s]

[dgtal_shortcuts_ssec2_2_7s]

[dgtal_shortcuts_ssec2_2_7s]

[dgtal_shortcuts_ssec2_2_8s]

[dgtal_shortcuts_ssec2_2_8s]

[dgtal_shortcuts_ssec2_2_9s]

[dgtal_shortcuts_ssec2_2_9s]

[dgtal_shortcuts_ssec2_2_10s]

[dgtal_shortcuts_ssec2_2_10s]

[dgtal_shortcuts_ssec2_2_11s]

[dgtal_shortcuts_ssec2_2_11s]

[dgtal_shortcuts_ssec2_2_13s]

[dgtal_shortcuts_ssec2_2_13s]

[dgtal_shortcuts_ssec2_2_12s]

[dgtal_shortcuts_ssec2_2_12s]

Definition at line 44 of file shortcuts-geometry.cpp.

45 {
46  unsigned int nb = 0, nbok = 0;
47  // 3d tests
50 
51  trace.beginBlock ( "Load vol file -> build digital surface -> estimate mean curvature -> save OBJ." );
52  {
55  params( "colormap", "Tics" );
56  auto bimage = SH3::makeBinaryImage( examplesPath + "samples/Al.100.vol", params );
57  auto K = SH3::getKSpace( bimage, params );
58  auto surface = SH3::makeDigitalSurface( bimage, K, params );
59  auto surfels = SH3::getSurfelRange( surface, params );
60  auto curv = SHG3::getIIMeanCurvatures( bimage, surfels, params );
61  // To get Gauss curvatures, write instead:
62  // auto curv = SHG3::getIIGaussianCurvatures( bimage, surfels, params );
63  auto cmap = SH3::getColorMap( -0.5, 0.5, params );
64  auto colors = SH3::Colors( surfels.size() );
65  std::transform( curv.cbegin(), curv.cend(), colors.begin(), cmap );
66  bool ok = SH3::saveOBJ( surface, SH3::RealVectors(), colors,
67  "al-H-II.obj" );
69  ++nb; nbok += ok ? 1 : 0;
70  }
71  trace.endBlock();
72 
73  trace.beginBlock ( "Load vol file -> build digital surface -> estimate Gauss curvature -> save OBJ." );
74  {
76  params( "colormap", "Tics" );
77  auto bimage = SH3::makeBinaryImage( examplesPath + "samples/Al.100.vol", params );
78  auto K = SH3::getKSpace( bimage, params );
79  auto surface = SH3::makeDigitalSurface( bimage, K, params );
80  auto surfels = SH3::getSurfelRange( surface, params );
81  auto curv = SHG3::getIIGaussianCurvatures( bimage, surfels, params );
82  auto cmap = SH3::getColorMap( -0.25, 0.25, params );
83  auto colors = SH3::Colors( surfels.size() );
84  std::transform( curv.cbegin(), curv.cend(), colors.begin(), cmap );
85  bool ok = SH3::saveOBJ( surface, SH3::RealVectors(), colors,
86  "al-G-II.obj" );
87  ++nb; nbok += ok ? 1 : 0;
88  }
89  trace.endBlock();
90 
91  trace.beginBlock ( "Build polynomial shape -> digitize -> extract ground-truth geometry." );
92  {
95  params( "polynomial", "3*x^2+2*y^2+z^2-90" )( "gridstep", 0.25 );
96  auto implicit_shape = SH3::makeImplicitShape3D ( params );
97  auto digitized_shape = SH3::makeDigitizedImplicitShape3D( implicit_shape, params );
98  auto binary_image = SH3::makeBinaryImage ( digitized_shape, params );
99  auto K = SH3::getKSpace( params );
100  auto surface = SH3::makeLightDigitalSurface( binary_image, K, params );
101  auto surfels = SH3::getSurfelRange( surface, params );
102  auto positions = SHG3::getPositions( implicit_shape, K, surfels, params );
103  auto normals = SHG3::getNormalVectors( implicit_shape, K, surfels, params );
104  auto mean_curvs = SHG3::getMeanCurvatures( implicit_shape, K, surfels, params );
105  auto gauss_curvs = SHG3::getGaussianCurvatures( implicit_shape, K, surfels, params );
107  auto stat_mean = SHG3::getStatistic( mean_curvs );
108  auto stat_gauss = SHG3::getStatistic( gauss_curvs );
109  trace.info() << " min(H)=" << stat_mean.min()
110  << " avg(H)=" << stat_mean.mean()
111  << " max(H)=" << stat_mean.max() << std::endl;
112  trace.info() << " min(G)=" << stat_gauss.min()
113  << " avg(G)=" << stat_gauss.mean()
114  << " max(G)=" << stat_gauss.max() << std::endl;
115  ++nb; nbok += positions.size() == surfels.size() ? 1 : 0;
116  ++nb; nbok += normals.size() == surfels.size() ? 1 : 0;
117  ++nb; nbok += mean_curvs.size() == surfels.size() ? 1 : 0;
118  ++nb; nbok += gauss_curvs.size() == surfels.size() ? 1 : 0;
119  ++nb; nbok += stat_mean.min() > 0.08 ? 1 : 0;
120  ++nb; nbok += stat_gauss.min() > 0.0064 ? 1 : 0;
121  }
122  trace.endBlock();
123 
124  trace.beginBlock ( "Build polynomial shape -> digitize -> get pointels -> save projected quadrangulated surface." );
125  {
128  const double h = 0.25;
129  params( "polynomial", "goursat" )( "gridstep", h );
130  auto implicit_shape = SH3::makeImplicitShape3D ( params );
131  auto digitized_shape = SH3::makeDigitizedImplicitShape3D( implicit_shape, params );
132  auto binary_image = SH3::makeBinaryImage ( digitized_shape, params );
133  auto K = SH3::getKSpace( params );
134  auto embedder = SH3::getCellEmbedder( K );
135  auto surface = SH3::makeLightDigitalSurface( binary_image, K, params );
136  SH3::Cell2Index c2i;
137  auto pointels = SH3::getPointelRange( c2i, surface );
138  SH3::RealPoints pos( pointels.size() );
139  std::transform( pointels.cbegin(), pointels.cend(), pos.begin(),
140  [&] (const SH3::Cell& c) { return h * embedder( c ); } );
141  auto ppos = SHG3::getPositions( implicit_shape, pos, params );
142  bool ok = SH3::saveOBJ( surface,
143  [&] (const SH3::Cell& c){ return ppos[ c2i[ c ] ];},
145  "goursat-quad-proj.obj" );
147  ++nb; nbok += ok ? 1 : 0;
148  }
149  trace.endBlock();
150 
151  trace.beginBlock ( "Build polynomial shape -> digitize -> extract mean curvature -> save as OBJ with colors." );
152  {
155  params( "polynomial", "goursat" )( "gridstep", 0.25 )( "colormap", "Tics" );
156  auto implicit_shape = SH3::makeImplicitShape3D ( params );
157  auto digitized_shape = SH3::makeDigitizedImplicitShape3D( implicit_shape, params );
158  auto binary_image = SH3::makeBinaryImage ( digitized_shape, params );
159  auto K = SH3::getKSpace( params );
160  auto surface = SH3::makeLightDigitalSurface( binary_image, K, params );
161  auto surfels = SH3::getSurfelRange( surface, params );
162  auto mean_curv = SHG3::getMeanCurvatures( implicit_shape, K, surfels, params );
163  auto cmap = SH3::getColorMap( -0.3, 0.3, params );
164  auto colors = SH3::Colors( surfels.size() );
165  std::transform( mean_curv.cbegin(), mean_curv.cend(), colors.begin(), cmap );
166  bool ok = SH3::saveOBJ( surface, SH3::RealVectors(), colors,
167  "goursat-H.obj" );
169  ++nb; nbok += ok ? 1 : 0;
170  }
171  trace.endBlock();
172 
173  trace.beginBlock ( "Build polynomial shape -> digitize -> extract ground-truth and estimated mean curvature -> display errors in OBJ with colors." );
174  {
177  params( "polynomial", "goursat" )( "gridstep", 0.25 )( "colormap", "Tics" )
178  ( "R-radius", 5.0 );
179  auto implicit_shape = SH3::makeImplicitShape3D ( params );
180  auto digitized_shape = SH3::makeDigitizedImplicitShape3D( implicit_shape, params );
181  auto bimage = SH3::makeBinaryImage ( digitized_shape, params );
182  auto K = SH3::getKSpace( params );
183  auto surface = SH3::makeLightDigitalSurface( bimage, K, params );
184  auto surfels = SH3::getSurfelRange( surface, params );
185  auto t_curv = SHG3::getMeanCurvatures( implicit_shape, K, surfels, params );
186  auto ii_curv = SHG3::getIIMeanCurvatures( bimage, surfels, params );
187  auto cmap = SH3::getColorMap( -0.5, 0.5, params );
188  auto colors = SH3::Colors( surfels.size() );
189  std::transform( t_curv.cbegin(), t_curv.cend(), colors.begin(), cmap );
190  bool ok_t = SH3::saveOBJ( surface, SH3::RealVectors(), colors, "goursat-H.obj" );
191  std::transform( ii_curv.cbegin(), ii_curv.cend(), colors.begin(), cmap );
192  bool ok_ii = SH3::saveOBJ( surface, SH3::RealVectors(), colors, "goursat-H-ii.obj" );
193  auto errors = SHG3::getScalarsAbsoluteDifference( t_curv, ii_curv );
194  auto stat_errors = SHG3::getStatistic( errors );
195  auto cmap_errors = SH3::getColorMap( 0.0, stat_errors.max(), params );
196  std::transform( errors.cbegin(), errors.cend(), colors.begin(), cmap_errors );
197  bool ok_err = SH3::saveOBJ( surface, SH3::RealVectors(), colors, "goursat-H-ii-err.obj" );
198  trace.info() << "Error Loo=" << SHG3::getScalarsNormLoo( t_curv, ii_curv )
199  << " L1=" << SHG3::getScalarsNormL1 ( t_curv, ii_curv )
200  << " L2=" << SHG3::getScalarsNormL2 ( t_curv, ii_curv )
201  << std::endl;
203  ++nb; nbok += ( ok_t && ok_ii && ok_err ) ? 1 : 0;
204  }
205  trace.endBlock();
206 
207  trace.beginBlock ( "Build polynomial shape -> digitize -> build digital surface -> save primal surface with VCM normals as obj." );
208  {
211  params( "polynomial", "goursat" )( "gridstep", 0.25 )
212  ( "surfaceTraversal", "Default" );
213  auto implicit_shape = SH3::makeImplicitShape3D ( params );
214  auto digitized_shape = SH3::makeDigitizedImplicitShape3D( implicit_shape, params );
215  auto K = SH3::getKSpace( params );
216  auto binary_image = SH3::makeBinaryImage( digitized_shape, params );
217  auto surface = SH3::makeDigitalSurface( binary_image, K, params );
218  auto surfels = SH3::getSurfelRange( surface, params );
219  auto vcm_normals = SHG3::getVCMNormalVectors( surface, surfels, params );
220  bool ok = SH3::saveOBJ( surface, vcm_normals, SH3::Colors(),
221  "goursat-primal-vcm.obj" );
223  ++nb; nbok += ok ? 1 : 0;
224  }
225  trace.endBlock();
226 
227  trace.beginBlock ( "Build polynomial shape -> digitize implicitly -> estimate II normals and curvature." );
228  {
231  params( "polynomial", "goursat" )( "gridstep", .25 );
232  auto implicit_shape = SH3::makeImplicitShape3D ( params );
233  auto dig_shape = SH3::makeDigitizedImplicitShape3D( implicit_shape, params );
234  auto K = SH3::getKSpace ( params );
235  auto surface = SH3::makeDigitalSurface ( dig_shape, K, params );
236  auto surfels = SH3::getSurfelRange ( surface, params( "surfaceTraversal", "DepthFirst" ) );
237  auto def_surfels = SH3::getSurfelRange ( surface, params( "surfaceTraversal", "Default" ) );
238  auto ii_normals = SHG3::getIINormalVectors ( dig_shape, surfels, params );
239  trace.beginBlock( "II with default traversal (slower)" );
240  auto ii_mean_curv = SHG3::getIIMeanCurvatures ( dig_shape, def_surfels, params );
241  trace.endBlock();
242  trace.beginBlock( "II with depth-first traversal (faster)" );
243  auto ii_mean_curv2 = SHG3::getIIMeanCurvatures ( dig_shape, surfels, params );
244  trace.endBlock();
245  auto cmap = SH3::getColorMap ( -0.5, 0.5, params );
246  auto colors = SH3::Colors ( def_surfels.size() );
247  auto match = SH3::getRangeMatch ( def_surfels, surfels );
248  auto normals = SH3::getMatchedRange ( ii_normals, match );
249  for ( SH3::Idx i = 0; i < colors.size(); i++ )
250  colors[ i ] = cmap( ii_mean_curv[ match[ i ] ] );
251  bool ok_H = SH3::saveOBJ( surface, SH3::RealVectors(), colors, "goursat-imp-H-ii.obj" );
253  ++nb; nbok += ( ok_H && ii_mean_curv.size() == ii_mean_curv2.size() ) ? 1 : 0;
254  }
255  trace.endBlock();
256 
257  trace.beginBlock ( "Build polynomial shape -> save several projected quadrangulated surface and digitized boundaries." );
258  {
260  std::vector<double> gridsteps {0.5, 0.25, 0.125};
261  for ( auto h : gridsteps ) {
262  params( "polynomial", "goursat" )( "gridstep", h );
263  auto implicit_shape = SH3::makeImplicitShape3D ( params );
264  auto digitized_shape = SH3::makeDigitizedImplicitShape3D( implicit_shape, params );
265  auto binary_image = SH3::makeBinaryImage ( digitized_shape, params );
266  auto K = SH3::getKSpace( params );
267  auto embedder = SH3::getCellEmbedder( K );
268  auto surface = SH3::makeLightDigitalSurface( binary_image, K, params );
269  SH3::Cell2Index c2i;
270  auto pointels = SH3::getPointelRange( c2i, surface );
271  SH3::RealPoints pos( pointels.size() );
272  std::transform( pointels.cbegin(), pointels.cend(), pos.begin(),
273  [&] (const SH3::Cell& c) { return h * embedder( c ); } );
274  auto ppos = SHG3::getPositions( implicit_shape, pos, params );
275  auto fname = std::string( "goursat-quad-" ) + std::to_string( h ) + std::string( ".obj" );
276  bool ok = SH3::saveOBJ( surface,
277  [&] (const SH3::Cell& c){ return pos[ c2i[ c ] ];},
279  fname );
280  auto proj_fname = std::string( "goursat-quad-proj-" ) + std::to_string( h ) + std::string( ".obj" );
281  bool proj_ok = SH3::saveOBJ( surface,
282  [&] (const SH3::Cell& c){ return ppos[ c2i[ c ] ];},
284  proj_fname );
285  ++nb; nbok += ok ? 1 : 0;
286  ++nb; nbok += proj_ok ? 1 : 0;
287  }
288  }
289  trace.endBlock();
290 
291  trace.beginBlock ( "Build polynomial shape -> digitize -> digital surface -> save primal surface and VCM normal field as obj." );
292  {
295  params( "polynomial", "goursat" )( "gridstep", 0.5 )
296  ( "surfaceTraversal", "Default" );
297  auto implicit_shape = SH3::makeImplicitShape3D ( params );
298  auto digitized_shape = SH3::makeDigitizedImplicitShape3D( implicit_shape, params );
299  auto K = SH3::getKSpace( params );
300  auto binary_image = SH3::makeBinaryImage( digitized_shape, params );
301  auto surface = SH3::makeDigitalSurface( binary_image, K, params );
302  auto surfels = SH3::getSurfelRange( surface, params );
303  auto vcm_normals = SHG3::getVCMNormalVectors( surface, surfels, params );
304  auto embedder = SH3::getSCellEmbedder( K );
305  SH3::RealPoints positions( surfels.size() );
306  std::transform( surfels.cbegin(), surfels.cend(), positions.begin(),
307  [&] (const SH3::SCell& c) { return embedder( c ); } );
308  bool ok = SH3::saveOBJ( surface, vcm_normals, SH3::Colors(),
309  "goursat-primal-vcm.obj" );
310  bool ok2 = SH3::saveVectorFieldOBJ( positions, vcm_normals, 0.05, SH3::Colors(),
311  "goursat-primal-vcm-normals.obj",
312  SH3::Color( 0, 0, 0 ), SH3::Color::Red );
314  ++nb, nbok += ok ? 1 : 0;
315  ++nb, nbok += ok2 ? 1 : 0;
316  }
317  trace.endBlock();
318 
319  trace.beginBlock ( "Build polynomial shape -> digitize -> extract ground-truth curvatures -> display in OBJ." );
320  {
323  params( "polynomial", "goursat" )( "gridstep", 0.25 )( "colormap", "Tics" );
324  auto implicit_shape = SH3::makeImplicitShape3D ( params );
325  auto digitized_shape = SH3::makeDigitizedImplicitShape3D( implicit_shape, params );
326  auto bimage = SH3::makeBinaryImage ( digitized_shape, params );
327  auto K = SH3::getKSpace( params );
328  auto surface = SH3::makeLightDigitalSurface( bimage, K, params );
329  auto surfels = SH3::getSurfelRange( surface, params );
330  auto k1 = SHG3::getFirstPrincipalCurvatures( implicit_shape, K, surfels, params );
331  auto k2 = SHG3::getSecondPrincipalCurvatures( implicit_shape, K, surfels, params );
332  auto d1 = SHG3::getFirstPrincipalDirections( implicit_shape, K, surfels, params );
333  auto d2 = SHG3::getSecondPrincipalDirections( implicit_shape, K, surfels, params );
334  auto embedder = SH3::getSCellEmbedder( K );
335  SH3::RealPoints positions( surfels.size() );
336  std::transform( surfels.cbegin(), surfels.cend(), positions.begin(),
337  [&] (const SH3::SCell& c) { return embedder( c ); } );
338  bool ok = SH3::saveOBJ( surface, SH3::RealVectors(), SH3::Colors(),
339  "goursat-primal.obj" );
340  // output principal curvatures and directions
341  auto cmap = SH3::getColorMap( -0.5, 0.5, params );
342  auto colors= SH3::Colors( surfels.size() );
343  std::transform( k1.cbegin(), k1.cend(), colors.begin(), cmap );
344  bool ok_k1 = SH3::saveOBJ( surface, SH3::RealVectors(), colors, "goursat-primal-k1.obj" );
345  bool ok_d1 = SH3::saveVectorFieldOBJ( positions, d1, 0.05, colors,
346  "goursat-primal-d1.obj", SH3::Color::Black );
347  std::transform( k2.cbegin(), k2.cend(), colors.begin(), cmap );
348  bool ok_k2 = SH3::saveOBJ( surface, SH3::RealVectors(), colors, "goursat-primal-k2.obj" );
349  bool ok_d2 = SH3::saveVectorFieldOBJ( positions, d2, 0.05, colors,
350  "goursat-primal-d2.obj", SH3::Color::Black );
352  }
353  trace.endBlock();
354 
355 
356 #if defined(WITH_EIGEN)
357 
358  trace.beginBlock ( "Load vol file -> build main digital surface -> II normals -> AT regularization -> save OBJ with colored normals." );
359  {
362  auto al_capone = SH3::makeBinaryImage( examplesPath + "samples/Al.100.vol", params );
363  auto K = SH3::getKSpace( al_capone );
364  auto surface = SH3::makeLightDigitalSurface( al_capone, K, params );
365  auto surfels = SH3::getSurfelRange( surface, params );
366  auto ii_normals = SHG3::getIINormalVectors( al_capone, surfels, params );
367  auto linels = SH3::getCellRange( surface, 1 );
368  auto uembedder = SH3::getCellEmbedder( K );
369  SH3::Scalars features( linels.size() );
370  auto at_normals = SHG3::getATVectorFieldApproximation( features, linels.cbegin(), linels.cend(),
371  surface, surfels,
372  ii_normals, params );
373  // Output normals as colors depending on directions
374  SH3::Colors colors( surfels.size() );
375  for ( size_t i = 0; i < surfels.size(); i++ )
376  colors[ i ] = SH3::Color( (unsigned char) 255.0*fabs( at_normals[ i ][ 0 ] ),
377  (unsigned char) 255.0*fabs( at_normals[ i ][ 1 ] ),
378  (unsigned char) 255.0*fabs( at_normals[ i ][ 2 ] ) );
379  bool ok1 = SH3::saveOBJ( surface, SH3::RealVectors(), SH3::Colors(), "al-surface.obj" );
380  bool ok2 = SH3::saveOBJ( surface, at_normals, colors, "al-colored-at-normals.obj" );
381  // Output discontinuities as sticks on linels.
382  SH3::RealPoints f0;
383  SH3::RealVectors f1;
384  for ( size_t i = 0; i < linels.size(); i++ )
385  {
386  if ( features[ i ] < 0.5 )
387  {
388  const SH3::Cell linel = linels[ i ];
389  const Dimension d = * K.uDirs( linel );
390  const SH3::Cell p0 = K.uIncident( linel, d, false );
391  const SH3::Cell p1 = K.uIncident( linel, d, true );
392  f0.push_back( uembedder( p0 ) );
393  f1.push_back( uembedder( p1 ) - uembedder( p0 ) );
394  }
395  }
396  bool ok3 = SH3::saveVectorFieldOBJ( f0, f1, 0.1, SH3::Colors(),
397  "al-features.obj",
398  SH3::Color( 0, 0, 0 ), SH3::Color::Red );
400  ++nb; nbok += ok1 ? 1 : 0;
401  ++nb; nbok += ok2 ? 1 : 0;
402  ++nb; nbok += ok3 ? 1 : 0;
403  }
404  trace.endBlock();
405 
406 #endif // defined(WITH_EIGEN)
407 
408  trace.info() << nbok << "/" << nb << " passed tests." << std::endl;
409  return 0;
410 }
Structure representing an RGB triple with alpha component.
Definition: Color.h:67
static const Color Red
Definition: Color.h:392
static const Color Black
Definition: Color.h:389
Cell uIncident(const Cell &c, Dimension k, bool up) const
Return the forward or backward unsigned cell incident to [c] along axis [k], depending on [up].
DirIterator uDirs(const Cell &p) const
Given an unsigned cell [p], returns an iterator to iterate over each coordinate the cell spans.
Aim: This class is used to simplify shape and surface creation. With it, you can create new shapes an...
static Scalars getIIGaussianCurvatures(CountedPtr< BinaryImage > bimage, const SurfelRange &surfels, const Parameters &params=parametersGeometryEstimation()|parametersKSpace())
static Scalar getScalarsNormL1(const Scalars &v1, const Scalars &v2)
static Scalars getMeanCurvatures(CountedPtr< ImplicitShape3D > shape, const KSpace &K, const SurfelRange &surfels, const Parameters &params=parametersShapeGeometry())
static RealPoints getPositions(CountedPtr< ImplicitShape3D > shape, const KSpace &K, const SurfelRange &surfels, const Parameters &params=parametersShapeGeometry())
static RealVectors getIINormalVectors(CountedPtr< BinaryImage > bimage, const SurfelRange &surfels, const Parameters &params=parametersGeometryEstimation()|parametersKSpace())
static Scalars getScalarsAbsoluteDifference(const Scalars &v1, const Scalars &v2)
static RealVectors getNormalVectors(CountedPtr< ImplicitShape3D > shape, const KSpace &K, const SurfelRange &surfels, const Parameters &params=parametersShapeGeometry())
static RealVectors getFirstPrincipalDirections(CountedPtr< ImplicitShape3D > shape, const KSpace &K, const SurfelRange &surfels, const Parameters &params=parametersShapeGeometry())
static RealVectors getSecondPrincipalDirections(CountedPtr< ImplicitShape3D > shape, const KSpace &K, const SurfelRange &surfels, const Parameters &params=parametersShapeGeometry())
static Scalars getIIMeanCurvatures(CountedPtr< BinaryImage > bimage, const SurfelRange &surfels, const Parameters &params=parametersGeometryEstimation()|parametersKSpace())
static Parameters defaultParameters()
static Scalars getGaussianCurvatures(CountedPtr< ImplicitShape3D > shape, const KSpace &K, const SurfelRange &surfels, const Parameters &params=parametersShapeGeometry())
static Scalar getScalarsNormL2(const Scalars &v1, const Scalars &v2)
static Scalars getFirstPrincipalCurvatures(CountedPtr< ImplicitShape3D > shape, const KSpace &K, const SurfelRange &surfels, const Parameters &params=parametersShapeGeometry())
static Scalar getScalarsNormLoo(const Scalars &v1, const Scalars &v2)
static ScalarStatistic getStatistic(const Scalars &v)
static VectorFieldInput getATVectorFieldApproximation(CountedPtr< TAnyDigitalSurface > surface, const SurfelRange &surfels, const VectorFieldInput &input, const Parameters &params=parametersATApproximation()|parametersGeometryEstimation())
static Scalars getSecondPrincipalCurvatures(CountedPtr< ImplicitShape3D > shape, const KSpace &K, const SurfelRange &surfels, const Parameters &params=parametersShapeGeometry())
static RealVectors getVCMNormalVectors(CountedPtr< TAnyDigitalSurface > surface, const SurfelRange &surfels, const Parameters &params=parametersGeometryEstimation())
Aim: This class is used to simplify shape and surface creation. With it, you can create new shapes an...
Definition: Shortcuts.h:105
static CanonicSCellEmbedder< KSpace > getSCellEmbedder(const KSpace &K)
Definition: Shortcuts.h:445
static CountedPtr< ImplicitShape3D > makeImplicitShape3D(const Parameters &params=parametersImplicitShape3D())
Definition: Shortcuts.h:281
static CountedPtr< BinaryImage > makeBinaryImage(Domain shapeDomain)
Definition: Shortcuts.h:560
static KSpace getKSpace(const Point &low, const Point &up, Parameters params=parametersKSpace())
Definition: Shortcuts.h:331
static CellRange getCellRange(Cell2Index &c2i, CountedPtr< ::DGtal::DigitalSurface< TDigitalSurfaceContainer > > surface, const Dimension k)
Definition: Shortcuts.h:1398
static CountedPtr< DigitizedImplicitShape3D > makeDigitizedImplicitShape3D(CountedPtr< ImplicitShape3D > shape, Parameters params=parametersDigitizedImplicitShape3D())
Definition: Shortcuts.h:522
std::map< Cell, IdxVertex > Cell2Index
Definition: Shortcuts.h:188
static PointelRange getPointelRange(Cell2Index &c2i, CountedPtr< ::DGtal::DigitalSurface< TDigitalSurfaceContainer > > surface)
Definition: Shortcuts.h:1468
std::vector< Color > Colors
Definition: Shortcuts.h:191
static SurfelRange getSurfelRange(CountedPtr< ::DGtal::DigitalSurface< TDigitalSurfaceContainer > > surface, const Parameters &params=parametersDigitalSurface())
Definition: Shortcuts.h:1546
static CountedPtr< DigitalSurface > makeDigitalSurface(CountedPtr< TPointPredicate > bimage, const KSpace &K, const Parameters &params=parametersDigitalSurface())
Definition: Shortcuts.h:1208
static IdxRange getRangeMatch(const std::vector< TValue > &s1, const std::vector< TValue > &s2, bool perfect=false)
Definition: Shortcuts.h:2569
std::vector< RealPoint > RealPoints
Definition: Shortcuts.h:180
std::vector< RealVector > RealVectors
Definition: Shortcuts.h:179
std::vector< Scalar > Scalars
Definition: Shortcuts.h:178
static bool saveVectorFieldOBJ(const RealPoints &positions, const RealVectors &vf, double thickness, const Colors &diffuse_colors, std::string objfile, const Color &ambient_color=Color(32, 32, 32), const Color &diffuse_color=Color(200, 200, 255), const Color &specular_color=Color::White)
Definition: Shortcuts.h:1938
IdxVertex Idx
Definition: Shortcuts.h:181
static Parameters defaultParameters()
Definition: Shortcuts.h:202
static CountedPtr< LightDigitalSurface > makeLightDigitalSurface(CountedPtr< BinaryImage > bimage, const KSpace &K, const Parameters &params=parametersDigitalSurface())
Definition: Shortcuts.h:1061
static ColorMap getColorMap(Scalar min, Scalar max, const Parameters &params=parametersUtilities())
Definition: Shortcuts.h:2619
static CanonicCellEmbedder< KSpace > getCellEmbedder(const KSpace &K)
Definition: Shortcuts.h:437
static std::vector< TValue > getMatchedRange(const std::vector< TValue > &range, const IdxRange &match)
Definition: Shortcuts.h:2604
LightDigitalSurface::SCell SCell
Definition: Shortcuts.h:163
static bool saveOBJ(CountedPtr< ::DGtal::DigitalSurface< TDigitalSurfaceContainer > > digsurf, const TCellEmbedder &embedder, const RealVectors &normals, const Colors &diffuse_colors, std::string objfile, const Color &ambient_color=Color(32, 32, 32), const Color &diffuse_color=Color(200, 200, 255), const Color &specular_color=Color::White)
Definition: Shortcuts.h:1738
LightDigitalSurface::Cell Cell
Definition: Shortcuts.h:162
void beginBlock(const std::string &keyword="")
std::ostream & info()
double endBlock()
DGtal::uint32_t Dimension
Definition: Common.h:137
Trace trace
Definition: Common.h:154
Shortcuts< KSpace > SH3
KSpace K
ShortcutsGeometry< Z3i::KSpace > SHG3

References DGtal::Trace::beginBlock(), DGtal::Color::Black, DGtal::Shortcuts< TKSpace >::defaultParameters(), DGtal::ShortcutsGeometry< TKSpace >::defaultParameters(), DGtal::Trace::endBlock(), DGtal::ShortcutsGeometry< TKSpace >::getATVectorFieldApproximation(), DGtal::Shortcuts< TKSpace >::getCellEmbedder(), DGtal::Shortcuts< TKSpace >::getCellRange(), DGtal::Shortcuts< TKSpace >::getColorMap(), DGtal::ShortcutsGeometry< TKSpace >::getFirstPrincipalCurvatures(), DGtal::ShortcutsGeometry< TKSpace >::getFirstPrincipalDirections(), DGtal::ShortcutsGeometry< TKSpace >::getGaussianCurvatures(), DGtal::ShortcutsGeometry< TKSpace >::getIIGaussianCurvatures(), DGtal::ShortcutsGeometry< TKSpace >::getIIMeanCurvatures(), DGtal::ShortcutsGeometry< TKSpace >::getIINormalVectors(), DGtal::Shortcuts< TKSpace >::getKSpace(), DGtal::Shortcuts< TKSpace >::getMatchedRange(), DGtal::ShortcutsGeometry< TKSpace >::getMeanCurvatures(), DGtal::ShortcutsGeometry< TKSpace >::getNormalVectors(), DGtal::Shortcuts< TKSpace >::getPointelRange(), DGtal::ShortcutsGeometry< TKSpace >::getPositions(), DGtal::Shortcuts< TKSpace >::getRangeMatch(), DGtal::ShortcutsGeometry< TKSpace >::getScalarsAbsoluteDifference(), DGtal::ShortcutsGeometry< TKSpace >::getScalarsNormL1(), DGtal::ShortcutsGeometry< TKSpace >::getScalarsNormL2(), DGtal::ShortcutsGeometry< TKSpace >::getScalarsNormLoo(), DGtal::Shortcuts< TKSpace >::getSCellEmbedder(), DGtal::ShortcutsGeometry< TKSpace >::getSecondPrincipalCurvatures(), DGtal::ShortcutsGeometry< TKSpace >::getSecondPrincipalDirections(), DGtal::ShortcutsGeometry< TKSpace >::getStatistic(), DGtal::Shortcuts< TKSpace >::getSurfelRange(), DGtal::ShortcutsGeometry< TKSpace >::getVCMNormalVectors(), DGtal::Trace::info(), K, DGtal::Shortcuts< TKSpace >::makeBinaryImage(), DGtal::Shortcuts< TKSpace >::makeDigitalSurface(), DGtal::Shortcuts< TKSpace >::makeDigitizedImplicitShape3D(), DGtal::Shortcuts< TKSpace >::makeImplicitShape3D(), DGtal::Shortcuts< TKSpace >::makeLightDigitalSurface(), DGtal::Color::Red, DGtal::Shortcuts< TKSpace >::saveOBJ(), DGtal::Shortcuts< TKSpace >::saveVectorFieldOBJ(), DGtal::trace, DGtal::KhalimskySpaceND< dim, TInteger >::uDirs(), and DGtal::KhalimskySpaceND< dim, TInteger >::uIncident().