Skip to content

Commit

Permalink
Update according to recent changes on VoxelComplex
Browse files Browse the repository at this point in the history
  • Loading branch information
phcerdan committed Nov 29, 2018
1 parent f8fdad8 commit 0144ada
Showing 1 changed file with 9 additions and 14 deletions.
23 changes: 9 additions & 14 deletions volumetric/criticalKernelsThinning3D.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -206,25 +206,17 @@ int main(int argc, char* const argv[]){
using DigitalSet =
DGtal::DigitalSetByAssociativeContainer<Domain ,
std::unordered_set< typename Domain::Point> >;
using Object =
DGtal::Object<DigitalTopology, DigitalSet>;
using Complex =
DGtal::VoxelComplex<KSpace, Object>;
using Complex = DGtal::VoxelComplex<KSpace>;

auto & sk = sk_string;
KSpace ks;
KSpace::Point d1( KSpace::Point::diagonal( 1 ) );
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;
Expand Down Expand Up @@ -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<Image>;
Predicate aPredicate(image, 0);
using L3Metric = ExactPredicateLpSeparableMetric<Z3i::Space, 3>;
using DT = DistanceTransformation<Z3i::Space, Predicate, L3Metric>;
L3Metric l3;
DT dt(obj.domain(),obj.pointSet(), l3);
DT dt(image.domain(), aPredicate, l3);
trace.endBlock();

std::function< std::pair<typename Complex::Cell, typename Complex::Data>(const Complex::Clique&) > Select ;
Expand Down Expand Up @@ -285,8 +278,10 @@ int main(int argc, char* const argv[]){
auto elapsed = std::chrono::duration_cast<std::chrono::seconds> (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"))
{
Expand Down

0 comments on commit 0144ada

Please sign in to comment.