From 0144adaaf4f4fe522ecac4e4727977562b64aaf1 Mon Sep 17 00:00:00 2001 From: Pablo Hernandez-Cerdan Date: Thu, 29 Nov 2018 17:25:50 -0500 Subject: [PATCH] Update according to recent changes on VoxelComplex See https://github.com/DGtal-team/DGtal/pull/1369 --- volumetric/criticalKernelsThinning3D.cpp | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/volumetric/criticalKernelsThinning3D.cpp b/volumetric/criticalKernelsThinning3D.cpp index 4bb0343c..2bb004c4 100644 --- a/volumetric/criticalKernelsThinning3D.cpp +++ b/volumetric/criticalKernelsThinning3D.cpp @@ -206,10 +206,7 @@ int main(int argc, char* const argv[]){ using DigitalSet = DGtal::DigitalSetByAssociativeContainer >; - using Object = - DGtal::Object; - using Complex = - DGtal::VoxelComplex; + using Complex = DGtal::VoxelComplex; auto & sk = sk_string; KSpace ks; @@ -217,14 +214,9 @@ int main(int argc, char* const argv[]){ ks.init(image.domain().lowerBound() - d1 , image.domain().upperBound() + d1 , true); - DigitalTopology::ForegroundAdjacency adjF; - DigitalTopology::BackgroundAdjacency adjB; - DigitalTopology topo(adjF, adjB, DGtal::DigitalTopologyProperties::JORDAN_DT); - Object obj(topo,image_set); - trace.beginBlock("construct with table"); Complex vc(ks); - vc.construct(obj.pointSet(), functions::loadTable(simplicity::tableSimple26_6 )); + vc.construct(image_set, functions::loadTable(simplicity::tableSimple26_6 )); trace.endBlock(); trace.beginBlock("load isthmus table"); boost::dynamic_bitset<> isthmus_table; @@ -253,11 +245,12 @@ int main(int argc, char* const argv[]){ * Calculate distance map even if not requested: */ trace.beginBlock("Create Distance Map"); - using Predicate = Z3i::DigitalSet; + using Predicate = DGtal::functors::SimpleThresholdForegroundPredicate; + Predicate aPredicate(image, 0); using L3Metric = ExactPredicateLpSeparableMetric; using DT = DistanceTransformation; L3Metric l3; - DT dt(obj.domain(),obj.pointSet(), l3); + DT dt(image.domain(), aPredicate, l3); trace.endBlock(); std::function< std::pair(const Complex::Clique&) > Select ; @@ -285,8 +278,10 @@ int main(int argc, char* const argv[]){ auto elapsed = std::chrono::duration_cast (end - start) ; if (profile) std::cout <<"Time elapsed: " << elapsed.count() << std::endl; - const auto & thin_set = vc_new.objectSet(); - const auto & all_set = obj.pointSet(); + + DigitalSet thin_set(image.domain()); + vc_new.dumpVoxels(thin_set); + const auto & all_set = image_set; if (vm.count("exportSDP")) {