Skip to content

Commit edad766

Browse files
Merge pull request #1109 from thom-dani/critical-point-tracking
Critical point tracking
2 parents 582c777 + 7fa9780 commit edad766

File tree

8 files changed

+56
-20
lines changed

8 files changed

+56
-20
lines changed

core/base/assignmentSolver/AssignmentAuction.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,10 @@ namespace ttk {
6262
epsilon = eps;
6363
}
6464

65+
inline void setDeltaLim(double delta) {
66+
delta_lim = delta;
67+
}
68+
6569
inline void setEpsilonDiviserMultiplier(double div) {
6670
epsilonDiviserMultiplier = div;
6771
}

core/base/trackingFromCriticalPoints/TrackingFromCriticalPoints.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -427,6 +427,7 @@ void ttk::TrackingFromCriticalPoints::assignmentSolver(
427427
if(assignmentMethod_ == 0) {
428428
ttk::AssignmentAuction<double> solver;
429429
solver.setInput(costMatrix);
430+
solver.setDeltaLim(assignmentPrecision);
430431
solver.run(matching);
431432
solver.clearMatrix();
432433
} else if(assignmentMethod_ == 1) {

core/base/trackingFromCriticalPoints/TrackingFromCriticalPoints.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ namespace ttk {
2626
double meshDiameter_{1};
2727
double tolerance_{10e-3};
2828
int assignmentMethod_{0};
29+
double assignmentPrecision{0.01};
2930
double xWeight_{1};
3031
double yWeight_{1};
3132
double zWeight_{1};
@@ -48,6 +49,10 @@ namespace ttk {
4849
tolerance_ = t;
4950
}
5051

52+
void setAssignmentPrecision(double p) {
53+
assignmentPrecision = p;
54+
}
55+
5156
void setAssignmentMethod(int a) {
5257
if(a == 0 || a == 1) {
5358
assignmentMethod_ = a;

core/vtk/ttkTrackingFromFields/ttkTrackingFromFields.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ int ttkTrackingFromFields::trackWithCriticalPointMatching(
138138
tracker.setEpsilon(relativeDestructionCost);
139139
tracker.setAssignmentMethod(assignmentMethod);
140140
tracker.setWeights(PX, PY, PZ, PF);
141+
tracker.setAssignmentPrecision(AssignmentPrecision);
141142

142143
tracker.setThreadNumber(this->threadNumber_);
143144
tracker.setDebugLevel(this->debugLevel_);

core/vtk/ttkTrackingFromFields/ttkTrackingFromFields.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,10 @@ class TTKTRACKINGFROMFIELDS_EXPORT ttkTrackingFromFields
8383
vtkGetMacro(RelativeDestructionCost, double);
8484
/// @}
8585

86+
vtkSetMacro(AssignmentPrecision, double);
87+
vtkGetMacro(AssignmentPrecision, double);
88+
/// @}
89+
8690
/// @brief Importance weight for the X component of the extremum.
8791
/// @{
8892
vtkSetMacro(PX, double);
@@ -193,6 +197,7 @@ class TTKTRACKINGFROMFIELDS_EXPORT ttkTrackingFromFields
193197
double PF{0};
194198

195199
double RelativeDestructionCost{0.1};
200+
double AssignmentPrecision{0.01};
196201
int AssignmentMethod{0};
197202

198203
// Bottleneck config.

doc/img/splash.png

198 Bytes
Loading

doc/img/splash.svg

Lines changed: 7 additions & 7 deletions
Loading

paraview/xmls/TrackingFromFields.xml

Lines changed: 33 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -153,25 +153,19 @@ by a list of scalar fields) and which computes a tracking mesh."
153153
default_values="0.1"
154154
panel_visibility="advanced">
155155
<Hints>
156-
<PropertyWidgetDecorator type="CompositeDecorator">
157-
<Expression type="and">
158-
<PropertyWidgetDecorator type="GenericDecorator"
159-
mode="visibility"
160-
property="Backend"
161-
value="2" />
162-
<PropertyWidgetDecorator type="GenericDecorator"
163-
mode="visibility"
164-
property="adaptDeathBirthCost"
165-
value="0" />
166-
</Expression>
167-
</PropertyWidgetDecorator>
156+
<PropertyWidgetDecorator type="GenericDecorator"
157+
mode="visibility"
158+
property="Backend"
159+
value="2" />
168160
</Hints>
169161
<Documentation>
170-
Relative cost (with regard to the data span, between 0 and 1) associated with the destruction of a critical point. Set this parameter to larger values to allow for larger displcements for a critical point from one time step to another. Set this parameter to smaller values to prevent a critical point from jumping too far from one time step to another.
162+
Relative cost (with regard to the data span, between 0 and 1) associated with the destruction of a critical point. Set this parameter to larger values to allow for larger displacements for a critical point from one time step to another. Set this parameter to smaller values to prevent a critical point from jumping too far from one time step to another.
171163
</Documentation>
172164
<DoubleRangeDomain name="range" min="0" max="1" />
173165
</DoubleVectorProperty>
174166

167+
168+
175169
<DoubleVectorProperty
176170
name="spe"
177171
label="Extremum weight"
@@ -275,6 +269,32 @@ the critical point.</Documentation>
275269
<Documentation>Importance weight for the function value of the critical point.</Documentation>
276270
</DoubleVectorProperty>
277271

272+
<DoubleVectorProperty
273+
name="deltalim"
274+
label="Assignment Precision"
275+
command="SetAssignmentPrecision"
276+
number_of_elements="1"
277+
default_values="0.01"
278+
panel_visibility="advanced">
279+
<Hints>
280+
<PropertyWidgetDecorator type="CompositeDecorator">
281+
<Expression type="and">
282+
<PropertyWidgetDecorator type="GenericDecorator"
283+
mode="visibility"
284+
property="Backend"
285+
value="2" />
286+
<PropertyWidgetDecorator type="GenericDecorator"
287+
mode="visibility"
288+
property="AssignmentMethod"
289+
value="0" />
290+
</Expression>
291+
</PropertyWidgetDecorator>
292+
</Hints>
293+
<Documentation>
294+
Set the relative precision for the optimal assignment approximation solver (auction algorithm).
295+
</Documentation>
296+
<DoubleRangeDomain name="range" min="0.000001" max="1" />
297+
</DoubleVectorProperty>
278298

279299
<IntVectorProperty
280300
name="Use spacing"

0 commit comments

Comments
 (0)