-
Notifications
You must be signed in to change notification settings - Fork 119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using simplification on ContourForests results in crash #9
Comments
Hi Will,
thanks for your email.
I'm trying to use the ContourForests code and would like to simplify the
tree after computing it via the simplification threshold stuff.
This feature is no longer supported (we're going to remove it from the API
soon). Topological simplification in TTK should be used as described in the
companion technical report:
https://topology-tool-kit.github.io/stuff/ttk.pdf
In short, you should select the extrema you want to maintain (with any
heuristic of your choice), call the topological simplification and then compute
the abstraction you're interested in (for instance: critical points,
persistence diagrams, merge trees, contour trees or Morse-Smale complexes)
Please check the following videos to see how to do this in ParaView:
https://youtu.be/YVk9vRKIEX8
https://youtu.be/xjKh6YTq5RA
To replicate this in Python or VTK/C++, you just need to replicate the
ParaView pipeline shown in the above videos.
Such a transcription is showcased in Figure 1 of the TTK technical report (the
corresponding code is attached to this email, just change the Morse-Smale
complex for the contour forest plugin).
Thanks for letting us know if you run into any other issue!
By the way, you may consider registering to the user mailing list (by sending
an empty email to ttk-users+subscribe@googlegroups.com) to participate to
similar usage discussions in the future.
Cheers,
--
Dr Julien Tierny
CNRS Researcher
Sorbonne Universites UPMC - LIP6
http://lip6.fr/Julien.Tierny
…On Thursday 20 April 2017 8:02:34 PM Will Usher wrote:
I'm trying to use the ContourForests code and would like to simplify the
tree after computing it via the simplification threshold stuff. However,
when trying to simplify the tree `getSeedsPos` eventually returns
`size_t(-1)` as the first tuple element, which the merge tree code then
tries to retrieve the super arc on this overflowed id. At this point the
code crashes with `[Merge Tree] get superArc on bad id
:18446744073709551615 / 129` (I'm running on the fuel from
https://github.com/pavolzetor/open_scivis_datasets).
Breaking in the debugger it looks like this occurs
[here](https://github.com/topology-tool-kit/ttk/blob/master/core/baseCode/c
ontourForestsTree/MergeTreeTemplate.h#L277), where mergingArcId is set to
the overflowed negative id.
I'm using ttk through the vtk wrappers, here's the code to reproduce:
```cpp
// includes....
int main(int argc, char **argv) {
// Read the volume data using vtk
vtkSmartPointer<vtkXMLImageDataReader> reader
= vtkSmartPointer<vtkXMLImageDataReader>::New();
reader->SetFileName(args[1].c_str());
reader->Update();
vtkImageData *vol = reader->GetOutput();
assert(vol);
std::cout << "loaded img '" << args[1] << "'\n";
vtkSmartPointer<vtkContourForests> contourForest
= vtkSmartPointer<vtkContourForests>::New();
contourForest->SetInputData(reader->GetOutput());
contourForest->SetTreeType(ttk::TreeType::Split);
contourForest->SetArcResolution(20);
contourForest->SetSkeletonSmoothing(50);
contourForest->SetUseAllCores(true);
contourForest->SetThreadNumber(12);
contourForest->SetSimplificationType(ttk::SimplifMethod::Persist);
contourForest->SetSimplificationThreshold(0.5);
contourForest->SetLessPartition(true);
contourForest->SetDebugLevel(2);
contourForest->Update();
return 0;
}
```
The defines `withParallelSimplify` and `withOpenMP` also seem to need to be
set. Maybe for another bug report, but without these no simplification is
run. From a glance it looks like `#defines` in
`ContourForests::parallelBuild`
[here](https://github.com/topology-tool-kit/ttk/blob/master/core/baseCode/c
ontourForests/ContourForestsTemplate.h#L341) and
[here](https://github.com/topology-tool-kit/ttk/blob/master/core/baseCode/c
ontourForests/ContourForestsTemplate.h#L366) have no fallback if
`withParallelSimplify` is not set.
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
#9
|
Thanks Julien, the code you suggested works great 👍 |
Hey @julien-tierny I ran into one small issue with the contour forests using this, in the example code you pasted it looks like vtk requires that you explicitly set the offset scalar field name to use, otherwise the simplification doesn't seem right? It seemed to do some sort of simplification but it wouldn't match what I'd get in paraview with the same settings, setting the scalar field name explicitly has got it to match paraview, which looks to set the name automatically |
hi Will,
thanks for your message.
Hey @julien-tierny I ran into one small issue with the contour forests using
this, in the example code you pasted it looks like vtk requires that you
explicitly set the offset scalar field name to use,
That's my bad. The default values for these fields were correctly set only for
the Morse-Smale complex (which I precisely tuned for the purpose of the code
demo shown in Figure 1 of TTK's tech report).
I've just pushed some edits regarding the default values of these fields (in
the VTK wrappers and ParaView plugins) for all scalar data modules.
The contour forests can now be used exactly like the Morse-Smale complex of
the demo code I sent you (in principle).
Thanks for letting us know if you run into any other issue!
Cheers,
--
Dr Julien Tierny
CNRS Researcher
Sorbonne Universites UPMC - LIP6
http://lip6.fr/Julien.Tierny
…On Monday 24 April 2017 4:21:13 PM Will Usher wrote:
Hey @julien-tierny I ran into one small issue with the contour forests using
this, in the example code you pasted it looks like vtk requires that you
explicitly set the offset scalar field name to use, otherwise the
simplification doesn't seem right? It seemed to do some sort of
simplification but it wouldn't match what I'd get in paraview with the same
settings, setting the scalar field name explicitly has got it to match
paraview, which looks to set the name automatically
--
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub:
#9 (comment)
|
I'm trying to use the ContourForests code and would like to simplify the tree after computing it via the simplification threshold stuff. However, when trying to simplify the tree
getSeedsPos
eventually returnssize_t(-1)
as the first tuple element, which the merge tree code then tries to retrieve the super arc on this overflowed id. At this point the code crashes with[Merge Tree] get superArc on bad id :18446744073709551615 / 129
(I'm running on the fuel from https://github.com/pavolzetor/open_scivis_datasets).Breaking in the debugger it looks like this occurs here, where mergingArcId is set to the overflowed negative id.
I'm using ttk through the vtk wrappers, here's the code to reproduce:
The defines
withParallelSimplify
andwithOpenMP
also seem to need to be set. Maybe for another bug report, but without these no simplification is run. From a glance it looks like#defines
inContourForests::parallelBuild
here and here have no fallback ifwithParallelSimplify
is not set.The text was updated successfully, but these errors were encountered: