ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
FastMarchingForPropagation.h
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 // - CloudViewer: www.cloudViewer.org -
3 // ----------------------------------------------------------------------------
4 // Copyright (c) 2018-2024 www.cloudViewer.org
5 // SPDX-License-Identifier: MIT
6 // ----------------------------------------------------------------------------
7 
8 #pragma once
9 
10 // local
11 #include "DgmOctree.h"
12 #include "FastMarching.h"
13 
14 namespace cloudViewer {
15 
16 class ReferenceCloud;
17 class GenericCloud;
18 
20 
23 public:
26 
28 
39  int init(GenericCloud* theCloud,
40  DgmOctree* theOctree,
41  unsigned char gridLevel,
42  bool constantAcceleration = false);
43 
46 
51 
53 
56 
58 
63  void setDetectionThreshold(float value) { m_detectionThreshold = value; }
64 
66 
72  void setJumpCoef(float value) { m_jumpCoef = value; }
73 
75 
79  void findPeaks();
80 
81  // inherited methods (see FastMarching)
82  int propagate() override;
83 
84 protected:
86  class PropagationCell : public Cell {
87  public:
89  PropagationCell() : Cell(), f(0), cellCode(0) {}
90 
92  ~PropagationCell() override = default;
93 
95  float f;
98  };
99 
100  // inherited methods (see FastMarching)
101  float computeTCoefApprox(Cell* currentCell,
102  Cell* neighbourCell) const override;
103  int step() override;
104  bool instantiateGrid(unsigned size) override {
105  return instantiateGridTpl<PropagationCell>(size);
106  }
107 
109  float m_jumpCoef;
112 };
113 
114 } // namespace cloudViewer
cloudViewer
Generic file read and write utility for python interface.
Definition: CloudViewerConfig.cpp:12
FastMarching.h
cloudViewer::FastMarchingForPropagation::PropagationCell::~PropagationCell
~PropagationCell() override=default
Destructor.
cloudViewer::GenericCloud
Definition: GenericCloud.h:20
cloudViewer::FastMarchingForPropagation::PropagationCell::cellCode
DgmOctree::CellCode cellCode
Equivalent cell code in the octree.
Definition: FastMarchingForPropagation.h:97
cloudViewer::FastMarchingForPropagation::computeTCoefApprox
float computeTCoefApprox(Cell *currentCell, Cell *neighbourCell) const override
Computes the front acceleration between two cells.
Definition: FastMarchingForPropagation.cpp:212
DgmOctree.h
cloudViewer::FastMarchingForPropagation::setPropagationTimingsAsDistances
bool setPropagationTimingsAsDistances()
Sets the propagation timings as distances for each point.
Definition: FastMarchingForPropagation.cpp:168
cloudViewer::FastMarchingForPropagation::m_detectionThreshold
float m_detectionThreshold
Threshold for propagation stop.
Definition: FastMarchingForPropagation.h:111
cloudViewer::FastMarching::Cell
A generic Fast Marching grid cell.
Definition: FastMarching.h:95
cloudViewer::FastMarchingForPropagation::PropagationCell
A Fast Marching grid cell for surfacical propagation.
Definition: FastMarchingForPropagation.h:86
size
int size
Definition: FileIOFactory.cpp:130
cloudViewer::FastMarchingForPropagation::FastMarchingForPropagation
FastMarchingForPropagation()
Default constructor.
Definition: FastMarchingForPropagation.cpp:17
cloudViewer::FastMarchingForPropagation::extractPropagatedPoints
bool extractPropagatedPoints(ReferenceCloud *Zk)
Definition: FastMarchingForPropagation.cpp:141
cloudViewer::FastMarchingForPropagation::init
int init(GenericCloud *theCloud, DgmOctree *theOctree, unsigned char gridLevel, bool constantAcceleration=false)
Initializes the grid with a point cloud (and ist corresponding octree)
Definition: FastMarchingForPropagation.cpp:27
cloudViewer::FastMarching
Fast Marching algorithm (front propagation)
Definition: FastMarching.h:41
cloudViewer::DgmOctree
The octree structure used throughout the library.
Definition: DgmOctree.h:39
cloudViewer::FastMarchingForPropagation::PropagationCell::PropagationCell
PropagationCell()
Default constructor.
Definition: FastMarchingForPropagation.h:89
cloudViewer::FastMarchingForPropagation::instantiateGrid
bool instantiateGrid(unsigned size) override
Instantiates grid in memory.
Definition: FastMarchingForPropagation.h:104
cloudViewer::FastMarchingForPropagation::findPeaks
void findPeaks()
Find peaks of local acceleration values.
Definition: FastMarchingForPropagation.cpp:219
cloudViewer::ReferenceCloud
A very simple point cloud (no point duplication)
Definition: ReferenceCloud.h:29
cloudViewer::FastMarchingForPropagation::setDetectionThreshold
void setDetectionThreshold(float value)
Sets the threshold for propagation stop.
Definition: FastMarchingForPropagation.h:63
cloudViewer::DgmOctree::CellCode
unsigned CellCode
Type of the code of an octree cell.
Definition: DgmOctree.h:78
cloudViewer::FastMarchingForPropagation::PropagationCell::f
float f
Local front acceleration.
Definition: FastMarchingForPropagation.h:95
cloudViewer::FastMarchingForPropagation::step
int step() override
Propagates the front (one step)
Definition: FastMarchingForPropagation.cpp:73
cloudViewer::FastMarchingForPropagation::propagate
int propagate() override
Propagates the front.
Definition: FastMarchingForPropagation.cpp:130
cloudViewer::FastMarchingForPropagation
Fast Marching algorithm for surface front propagation.
Definition: FastMarchingForPropagation.h:22
cloudViewer::FastMarchingForPropagation::setJumpCoef
void setJumpCoef(float value)
Sets the accceleration exageration factor.
Definition: FastMarchingForPropagation.h:72
cloudViewer::FastMarchingForPropagation::m_jumpCoef
float m_jumpCoef
Accceleration exageration factor.
Definition: FastMarchingForPropagation.h:109