GithubHelp home page GithubHelp logo

menelausezzw / vascular-tree-reconstruction Goto Github PK

View Code? Open in Web Editor NEW
27.0 4.0 6.0 621 KB

Source code for CVPR 19 (Divergence Prior) & 21 (Confluent Vessel Tree) papers.

CMake 4.41% C++ 83.52% TeX 1.40% Cuda 5.06% Python 4.94% C 0.11% Shell 0.57%

vascular-tree-reconstruction's Introduction

Vascular-Tree-Reconstruction

This repository holds the source code for the papers Divergence Prior and Vessel-tree Reconstruction and Confluent Vessel Trees with Accurate Bifurcations appeared in CVPR19 and CVPR21 respectively.

How to install

The following installation is tested using cmake-3.10.2 under Ubuntu 18.04.3 LTS.

  1. c/c++ compiler: gcc-4.8/g++-4.8
  2. CUDA: 8.0
  3. Dependencies: boost-1.65.0, hdf5-1.10.1, eigen-3.3.4, ITK-4.13.3, flann-1.8.4, cusp-0.5.1
  4. If these dependencies are installed in a custom folder, you may need to help cmake find them by explicitly setting some variables in CMakeLists.txt, CMake/FindEigen.cmake, CMake/FindFlann.cmake and CMake/FindITK.cmake.
  5. Create a new folder Build inside the folder where this repository is cloned.
mkdir Build
cd Build
  1. To build the project
cmake -DCMAKE_INSTALL_PREFIX=[path to install the project] ..
make -j 8
make install

How to use

The example script is contained in the Experiments. To obtain the synthetic vessel volume data, use fetchData.sh. After downloading the data, simply run ExprOutter.sh.

Five stages for vessel tree/centerline extraction:

  1. Do ObjectenessMasureImageFilter (Frangi filtering)

  2. Do NonmaximumSuppressionVolume

    Important

    --thresholdValue --- this is threshold for plots (ROC, angle error)
    
  3. Do GenerateNeighborhoodGraph

  4. Do LevenbergMarquardtMinimizer (use GPU)

    Important

    --lambda  --- curvature coefficient
    --beta  --- divergence coefficient
    --tau  --- the hyperparameter in the oriented curvature
    --voxelPhysicalSize  --- defines allowed error in ||l_p - p||_+
    
  5. Do GenerateTreeTopology

    Important

    --directedLabel   --- a flag used to decide whether to use minimum arborescence or MST
    --root   --- root index needs to be specified if using the minimum arborescence
    

    Code for the minimum arborescence: https://github.com/atofigh/edmonds-alg.git

vascular-tree-reconstruction's People

Contributors

dmitrii-marin avatar menelausezzw avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

vascular-tree-reconstruction's Issues

Code not released yet

Hello, I have read your paper. Are you planning to release the code anytime soon?

Is it possible for reconstructing the surface mesh or segmentation image?

Hi,

Thanks for the interesting work and making code available. If I understand correctly, your work is on generating the centerlines of vascular tree structure from raw 3D image, which is very amazing enough.

However, I am wondering if it is possible to generate a final surface structure or a segmentation of the whole vessels instead of just the centerlines, because that is really important for further simulation and flow analysis ect.

Thanks in advance!

Compilation error

Table 1. Access flags and modes
Access Flag Resulting Access Mode
H5F_ACC_EXCL If the file already exists, H5Fcreate fails. If the file does not exist, it is created and opened with read-write access. (Default)
H5F_ACC_TRUNC If the file already exists, the file is opened with read-write access, and new data will overwrite any existing data. If the file does not exist, it is created and opened with read-write access.
H5F_ACC_RDONLY An existing file is opened with read-only access. If the file does not exist, H5Fopen fails. (Default)
H5F_ACC_RDWR An existing file is opened with read-write access. If the file does not exist, H5Fopen fails.

Error running GenerateNeighborhoodGraph

Hi,

Thank you for the great work and sharing the code. I have been trying to run the example that you provide in the experiments folder. After some work, I have been able to successfully build and install the application. One comment here is that boost 1.65.0 does not work well with gcc-4.8, so I had to use gcc-5 to build successfully.

Now, I can run ObjectnessMeasureImageFilter and NonMaximumSuppressionFilter without any error but with GenerateNeighborhoodGraph I get the following output.

0.023     0     0
    0  0.23     0
    0     0  0.23
[2022-04-05 13:18:02.251920] [0x00007fd479f6b7c0] [info]    measurements.size = 21552
[2022-04-05 13:18:02.251935] [0x00007fd479f6b7c0] [info]    tangentLinesPoints1.size = 21552
[2022-04-05 13:18:02.251939] [0x00007fd479f6b7c0] [info]    tangentLinesPoints2.size = 21552
[2022-04-05 13:18:02.251941] [0x00007fd479f6b7c0] [info]    radiuses.size = 7184
[2022-04-05 13:18:02.251944] [0x00007fd479f6b7c0] [info]    objectnessMeasure.size = 7184
[2022-04-05 13:18:02.251947] [0x00007fd479f6b7c0] [info]    indices1.size = 109330
[2022-04-05 13:18:02.251950] [0x00007fd479f6b7c0] [info]    indices2.size = 109330
HDF5-DIAG: Error detected in HDF5 (1.10.1) thread 0:
  #000: /home/roman/PhD/confluent-stuff/CMake-hdf5-1.10.1/hdf5-1.10.1/src/H5Dio.c line 226 in H5Dwrite(): not a dataset
    major: Invalid arguments to routine
    minor: Inappropriate type
terminate called after throwing an instance of 'H5::DataSetIException'
test2.sh: line 12: 10616 Aborted                 (core dumped) /usr/local/Bin/GenerateNeighborhoodGraph --thresholdBelow 0.040 --aKnnGraph true --knnValue 4 --aspectRatio 10 --mutualLink false --distConstraint 2 --voxelSize 0.046 --inputFileName "/home/roman/PhD/confluent-stuff/Main/image001/0.040/NonMaximumSuppressionVolume.mhd" --outputFileName "/home/roman/PhD/confluent-stuff/Main/image001/0.040/NonMaximumSuppressionVolumeMalK4.h5"

I am not sure how to solve this error. I upgraded the HDF version to 1.10.2 but then I get another set of errors as following.

0.023     0     0
    0  0.23     0
    0     0  0.23
[2022-04-05 13:45:19.397953] [0x00007f8a41de67c0] [info]    measurements.size = 21552
[2022-04-05 13:45:19.397967] [0x00007f8a41de67c0] [info]    tangentLinesPoints1.size = 21552
[2022-04-05 13:45:19.397971] [0x00007f8a41de67c0] [info]    tangentLinesPoints2.size = 21552
[2022-04-05 13:45:19.397974] [0x00007f8a41de67c0] [info]    radiuses.size = 7184
[2022-04-05 13:45:19.397977] [0x00007f8a41de67c0] [info]    objectnessMeasure.size = 7184
[2022-04-05 13:45:19.397979] [0x00007f8a41de67c0] [info]    indices1.size = 109330
[2022-04-05 13:45:19.397982] [0x00007f8a41de67c0] [info]    indices2.size = 109330
HDF5-DIAG: Error detected in HDF5 (1.10.2) thread 0:
  #000: /home/roman/PhD/confluent-stuff/CMake-hdf5-1.10.2/hdf5-1.10.2/src/H5D.c line 145 in H5Dcreate2(): unable to create dataset
    major: Dataset
    minor: Unable to initialize object
  #001: /home/roman/PhD/confluent-stuff/CMake-hdf5-1.10.2/hdf5-1.10.2/src/H5Dint.c line 474 in H5D__create_named(): unable to create and link to dataset
    major: Dataset
    minor: Unable to initialize object
  #002: /home/roman/PhD/confluent-stuff/CMake-hdf5-1.10.2/hdf5-1.10.2/src/H5L.c line 1641 in H5L_link_object(): unable to create new link to object
    major: Links
    minor: Unable to initialize object
  #003: /home/roman/PhD/confluent-stuff/CMake-hdf5-1.10.2/hdf5-1.10.2/src/H5L.c line 1885 in H5L_create_real(): can't insert link
    major: Symbol table
    minor: Unable to insert object
  #004: /home/roman/PhD/confluent-stuff/CMake-hdf5-1.10.2/hdf5-1.10.2/src/H5Gtraverse.c line 867 in H5G_traverse(): internal path traversal failed
    major: Symbol table
    minor: Object not found
  #005: /home/roman/PhD/confluent-stuff/CMake-hdf5-1.10.2/hdf5-1.10.2/src/H5Gtraverse.c line 639 in H5G_traverse_real(): traversal operator failed
    major: Symbol table
    minor: Callback failed
  #006: /home/roman/PhD/confluent-stuff/CMake-hdf5-1.10.2/hdf5-1.10.2/src/H5L.c line 1688 in H5L_link_cb(): unable to create object
    major: Object header
    minor: Unable to initialize object
  #007: /home/roman/PhD/confluent-stuff/CMake-hdf5-1.10.2/hdf5-1.10.2/src/H5Oint.c line 2221 in H5O_obj_create(): unable to open object
    major: Object header
    minor: Can't open object
  #008: /home/roman/PhD/confluent-stuff/CMake-hdf5-1.10.2/hdf5-1.10.2/src/H5Doh.c line 291 in H5O__dset_create(): unable to create dataset
    major: Dataset
    minor: Unable to initialize object
  #009: /home/roman/PhD/confluent-stuff/CMake-hdf5-1.10.2/hdf5-1.10.2/src/H5Dint.c line 1087 in H5D__create(): not a datatype
    major: Invalid arguments to routine
    minor: Inappropriate type
terminate called after throwing an instance of 'H5::FileIException'
test2.sh: line 12: 15701 Aborted                 (core dumped) /usr/local/Bin/GenerateNeighborhoodGraph --thresholdBelow 0.040 --aKnnGraph true --knnValue 4 --aspectRatio 10 --mutualLink false --distConstraint 2 --voxelSize 0.046 --inputFileName "/home/roman/PhD/confluent-stuff/Main/image001/0.040/NonMaximumSuppressionVolume.mhd" --outputFileName "/home/roman/PhD/confluent-stuff/Main/image001/0.040/NonMaximumSuppressionVolumeMalK4.h5"

I am running these commands as root so permission should not be a problem.

The script is

/usr/local/Bin/GenerateNeighborhoodGraph \
--thresholdBelow 0.040 \
--aKnnGraph true \
--knnValue 4 \
--aspectRatio 10 \
--mutualLink false \
--distConstraint 2 \
--voxelSize 0.046 \
--inputFileName "/home/roman/PhD/confluent-stuff/Main/image001/0.040/NonMaximumSuppressionVolume.mhd" \
--outputFileName "/home/roman/PhD/confluent-stuff/Main/image001/0.040/NonMaximumSuppressionVolumeMalK4.h5"

I would really appreciate it if you could guide me here. Also, what is good thresholdBelow value, I am using 0.040 for now because I saw it in the paper. Thank you.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.