Skip to content
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

Closed
Twinklebear opened this issue Apr 21, 2017 · 4 comments
Closed

Using simplification on ContourForests results in crash #9

Twinklebear opened this issue Apr 21, 2017 · 4 comments

Comments

@Twinklebear
Copy link
Contributor

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, where mergingArcId is set to the overflowed negative id.

I'm using ttk through the vtk wrappers, here's the code to reproduce:

// 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 and here have no fallback if withParallelSimplify is not set.

@julien-tierny
Copy link
Collaborator

julien-tierny commented Apr 21, 2017 via email

@Twinklebear
Copy link
Contributor Author

Thanks Julien, the code you suggested works great 👍

@Twinklebear
Copy link
Contributor Author

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

@julien-tierny
Copy link
Collaborator

julien-tierny commented Apr 25, 2017 via email

julien-tierny pushed a commit that referenced this issue Jul 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants