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

TTK Crashes when ttk::AtomicUF::mergeStates() is called and one of the states is empty #488

Open
josiahblaisdell opened this issue Sep 11, 2020 · 3 comments

Comments

@josiahblaisdell
Copy link

josiahblaisdell commented Sep 11, 2020

Describe the bug
This bug occurred when trying to create the persistence diagram for a tumor from an MRI stored in a "Structured Grid". I used a threshold to remove voxels with enhancement of 0 and I used tetrahedralize in order to create a persistence diagram.

I modified the CurrentState struct's "merge" function to check if the "other" state's propagation is empty. This seemed to fix the bug on my end. I am not sure why the propogation was empty in the first place though, and this may be indicative of a larger issue. I am using the dev branch here: #487

The error I get says: /usr/include/boost/heap/fibonacci_heap.hpp:352: const value_type& boost::heap::fibonacci_heap<T, A0, A1, A2, A3, A4>::top() const [with T = int; A0 = boost::heap::compare<std::function<bool(int, int)> >; A1 = boost::parameter::void_; A2 = boost::parameter::void_; A3 = boost::parameter::void_; A4 = boost::parameter::void_; boost::heap::fibonacci_heap<T, A0, A1, A2, A3, A4>::value_type = int]: Assertion `!empty()' failed.

To Reproduce
I'm not sure how to reproduce this without my data... I attached a screenshot of the data. If you need to reproduce this with my data let me know and I can email it to you.

Expected behavior
The persistence diagram is computed.

Screenshots
If applicable, add screenshots to help explain your problem.
image
image

Potential Fix
I have gotten the (currently) latest code included in this pull: #487 , here are the changes I made:

In FTMStructures.h:

      void merge(CurrentState &other) {
        if(!other.propagation.empty()){

          propagation.merge(other.propagation);
          vertex = propagation.top();
        }
      }

In FTMAtomicUF.h:

          if(! (*data_.states[i]).empty()){
            s->merge(*data_.states[i]);
          }

System (please complete the following information):

  • OS: Ubuntu 20.04
  • Compiler gcc 9.3 g++ 9.3
  • Boost version 1.71.0
  • Installed TTK's optional dependencies:
-- GraphViz found
-- Found SQLITE3: /usr/lib/x86_64-linux-gnu/libsqlite3.so
-- Python version: 3.8
-- Numpy headers: /usr/include
-- ttk options -----------------------------------------------------------------
-- TTK_ENABLE_64BIT_IDS: OFF
-- TTK_ENABLE_CPU_OPTIMIZATION: ON
-- TTK_ENABLE_DOUBLE_TEMPLATING: OFF
-- TTK_ENABLE_EIGEN: ON
-- TTK_ENABLE_GRAPHVIZ: ON
-- TTK_ENABLE_KAMIKAZE: OFF
-- TTK_ENABLE_MPI: OFF
-- TTK_ENABLE_OPENMP: ON
-- TTK_ENABLE_SCIKIT_LEARN: ON
-- TTK_ENABLE_SPECTRA: ON
-- TTK_ENABLE_SQLITE3: ON
-- TTK_ENABLE_ZFP: ON
-- TTK_ENABLE_ZLIB: ON
-- ttk build -------------------------------------------------------------------
-- CMAKE_BUILD_TYPE: Release
-- TTK_BUILD_DOCUMENTATION: OFF
-- TTK_BUILD_PARAVIEW_PLUGINS: ON
--   ParaView_DIR: /usr/local/PARAVIEW58/lib/cmake/paraview-5.8
-- TTK_BUILD_STANDALONE_APPS: ON
-- TTK_BUILD_VTK_WRAPPERS: ON
--   VTK_DIR: /usr/local/PARAVIEW58/lib/cmake/paraview-5.8/vtk
--   TTK_BUILD_VTK_PYTHON_MODULE: ON
-- ttk install -----------------------------------------------------------------
-- CMAKE_INSTALL_PREFIX: /usr/local
-- TTK_PYTHON_MODULE_DIR: lib/python3.8/site-packages
-- TTK_INSTALL_PLUGIN_DIR: /usr/local/PARAVIEW58/lib/cmake/paraview-5.8/../../../bin/plugins
-- -----------------------------------------------------------------------------

Additional context
I have written my own vtk+c++ program to compute the distance between MRI data. This is occurring in my program, but I can reproduce in Paraview.

@julien-tierny
Copy link
Collaborator

hi josiah,

thanks for the issue.
@CharlesGueunet can you please have a quick look into this?
(if the fix looks reasonable to you, joshiah could PR it).

cheers,

@CharlesGueunet
Copy link
Contributor

Hello,

I am not sure how we can have an empty state here,the propagation should at least contains one vertex. Is your data set clean ? Can it have disconnected points ? Eventually without cells associated ?

If we keep them, we may want to put these checks only when Kamikaze is off as they impact methods called really often during the computation of the tree. The performance of FTM / FTR really depends on these.

Charles

@julien-tierny
Copy link
Collaborator

julien-tierny commented Sep 14, 2020 via email

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

3 participants