DGtal 2.2.0
Loading...
Searching...
No Matches
parallelIIShortcuts-viewer.cpp File Reference
#include <iostream>
#include "ConfigExamples.h"
#include "DGtal/base/Common.h"
#include "DGtal/helpers/StdDefs.h"
#include "DGtal/helpers/Shortcuts.h"
#include "DGtal/helpers/ShortcutsGeometry.h"
#include "DGtal/io/viewers/PolyscopeViewer.h"
#include "DGtal/io/colormaps/GradientColorMap.h"
Include dependency graph for parallelIIShortcuts-viewer.cpp:

Go to the source code of this file.

Typedefs

typedef Shortcuts< Z3i::KSpace > SH3
typedef ShortcutsGeometry< Z3i::KSpace > SHG3

Functions

int main ()

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
David Coeurjolly (david.nosp@m..coe.nosp@m.urjol.nosp@m.ly@c.nosp@m.nrs.f.nosp@m.r) Laboratoire d'InfoRmatique en Image et Systèmes d'information - LIRIS (CNRS, UMR 5205), INSA-Lyon, France
Date
2026/06/08

This file is part of the DGtal library.

Definition in file parallelIIShortcuts-viewer.cpp.

Typedef Documentation

◆ SH3

typedef Shortcuts<Z3i::KSpace> SH3

Definition at line 49 of file parallelIIShortcuts-viewer.cpp.

◆ SHG3

Definition at line 50 of file parallelIIShortcuts-viewer.cpp.

Function Documentation

◆ main()

int main ( void )

[Parallel-instantiation]

[Parallel-instantiation]

Definition at line 53 of file parallelIIShortcuts-viewer.cpp.

54{
55
58 std::string filename = examplesPath + std::string("/samples/bunny-128.vol");
59 auto binary_image = SH3::makeBinaryImage(filename, params );
60 auto K = SH3::getKSpace( binary_image, params );
62 auto surfels = SH3::getSurfelRange( surface, params );
64
65 //Parallel
66 const auto axis = 2;
67 const auto nbThreads = 4;
68 trace.beginBlock(std::to_string(nbThreads) + "threads on axis "+std::to_string(axis));
69 auto curv = SHG3::getIIMeanCurvatures( binary_image, surfels,
70 params( "ii-thread-number", nbThreads )
71 ( "ii-split-axis", axis )
72 ( "r-radius", 8 ));
74
75 PolyscopeViewer viewer;
76 std::string objectName = "Surfels";
77 viewer.draw(surfels, objectName); // Draws the object independently
78 viewer.addQuantity(objectName, "Mean curvature", curv);
79
82 HueShadeColorMap<unsigned int> cmap(0,(unsigned int)splits.size());
83 for(auto i=0; i< splits.size(); ++i)
84 {
85 viewer << cmap(i);
86 viewer << splits[i].domain;
87 }
88 viewer.show();
89
90 return 0;
91}
std::string draw(const Point &p, const std::string &uname="Point_{i}")
void addQuantity(const std::string &oName, const std::string &qName, const Type &value, QuantityScale scale=QuantityScale::UNKNOWN)
Aim: This class template may be used to (linearly) convert scalar values in a given range into a colo...
void show() override
Starts the event loop and display of elements.
static Scalars getIIMeanCurvatures(CountedPtr< BinaryImage > bimage, const SurfelRange &surfels, const Parameters &params=parametersGeometryEstimation()|parametersKSpace())
static KSpace getKSpace(const Point &low, const Point &up, Parameters params=parametersKSpace())
Definition Shortcuts.h:329
static SurfelRange getSurfelRange(CountedPtr< ::DGtal::DigitalSurface< TDigitalSurfaceContainer > > surface, const Parameters &params=parametersDigitalSurface())
Definition Shortcuts.h:1808
static CountedPtr< DigitalSurface > makeDigitalSurface(CountedPtr< TPointPredicate > bimage, const KSpace &K, const Parameters &params=parametersDigitalSurface())
Definition Shortcuts.h:1470
static Parameters defaultParameters()
Definition Shortcuts.h:200
static CountedPtr< BinaryImage > makeBinaryImage(Domain shapeDomain)
Definition Shortcuts.h:558
void beginBlock(const std::string &keyword="")
double endBlock()
CountedPtr< SH3::DigitalSurface > surface
CountedPtr< SH3::BinaryImage > binary_image
Trace trace
Splits a domain along one of the domain grid axis.
std::vector< SplitInfo< Domain > > SplitDomainsInfo
KSpace K
AxisDomainSplitter< Domain > splitter

References DGtal::Display3D< Space, KSpace >::addQuantity(), DGtal::Trace::beginBlock(), binary_image, DGtal::Shortcuts< Z3i::KSpace >::defaultParameters(), DGtal::ShortcutsGeometry< Z3i::KSpace >::defaultParameters(), DGtal::Display3D< Space, KSpace >::draw(), DGtal::Trace::endBlock(), DGtal::ShortcutsGeometry< Z3i::KSpace >::getIIMeanCurvatures(), DGtal::Shortcuts< Z3i::KSpace >::getKSpace(), DGtal::Shortcuts< Z3i::KSpace >::getSurfelRange(), K, main(), DGtal::Shortcuts< Z3i::KSpace >::makeBinaryImage(), DGtal::Shortcuts< Z3i::KSpace >::makeDigitalSurface(), DGtal::PolyscopeViewer< Space, KSpace >::show(), splitter, surface, and DGtal::trace.