Internal:PODM 3D: Difference between revisions

From crtc.cs.odu.edu
Jump to navigation Jump to search
Spyridon97 (talk | contribs)
Spyridon97 (talk | contribs)
 
(150 intermediate revisions by the same user not shown)
Line 2: Line 2:


=Documentation=
=Documentation=
# Read [https://cepm.cs.odu.edu/pub/papers/journal_56.pdf PODM3D] paper✔
==Fall 2019==
# Read [https://cepm.cs.odu.edu/pub/papers/journal_58.pdf Guaranteed Quality Tetrahedral Delaunay Meshing for Medical Images] paper (Sect. 9) (TODO)
# Read [https://crtc.cs.odu.edu/pub/papers/journal_56.pdf PODM3D] paper✔
# Read [https://crtc.cs.odu.edu/pub/papers/journal_58.pdf Guaranteed Quality Tetrahedral Delaunay Meshing for Medical Images] paper (Sect. 9) (TODO)
# Write a proper README.md file✔
# Write a proper README.md file✔
# Add the [https://crtc.cs.odu.edu/CNF_Example_Meshes CNF Example Meshes] into the Appendix of the November Report✔
# Add the [https://crtc.cs.odu.edu/CNF_Example_Meshes CNF Example Meshes] into the Appendix of the November Report✔
# Create a [https://crtc.cs.odu.edu/I2M_Suite User Manual] for PODM 3D and Tessellate2D within the fields of Medical Image Computing and Computational Nuclear Femptography ✔
# Create [https://crtc.cs.odu.edu/Internal:CNF_Adaptivity CNF Adaptivity] Report
 
==Spring 2020==
# Create a [https://crtc.cs.odu.edu/CRTC_I2M User Manual] for PODM 3D and Tessellate2D within the fields of Medical Image Computing and Computational Nuclear Femptography ✔


=Execution Examples=
=Execution Examples=
==Fall 2019==
# Create meshes for the Computational Nuclear Femtography part of CRTC_I2M_Suite Documentation. [https://crtc.cs.odu.edu/CNF_Example_Meshes CNF Example Meshes] ✔
# Create meshes for the Computational Nuclear Femtography part of CRTC_I2M_Suite Documentation. [https://crtc.cs.odu.edu/CNF_Example_Meshes CNF Example Meshes] ✔
# Create meshes for the Medical Image Computing part of CRTC_I2M_Suite Documentation. [https://crtc.cs.odu.edu/Medical_Imaging_Example_Meshes Medical Imaging Example Meshes]  ✔


=Code Changes=
==Spring 2020==
# Create meshes for the Medical Image Computing part of CRTC_I2M_Suite Documentation. [https://crtc.cs.odu.edu/Medical_Imaging_Example_Meshes Medical Imaging Example Meshes] ✔
 
==Summer 2020==
# Create meshes for the Bioinformatics part of CRTC_I2M_Suite Documentation. [https://crtc.cs.odu.edu/Bioinformatics_Example_Meshes Bioinformatics Example Meshes] ✔
 
=Code=
==Fall 2019==
# Restructure repository of PODM3D based on Software engineering standards✔
# Restructure repository of PODM3D based on Software engineering standards✔
# Decouple Args from PODM✔
# Decouple Args from PODM✔
Line 18: Line 29:
# Create setInputImage(ImageType::Pointer)✔
# Create setInputImage(ImageType::Pointer)✔
# Remove IOs from PODM✔
# Remove IOs from PODM✔
# Implement a sizing function that will work as an extra rule and it will use the point indices of the tetrahedron that is tested✔
# Implement a sizing function that will work as an extra rule and it will use the points of the tetrahedron that is tested✔
## Create UML diagrams to understand the code and the Meshing Procedure in general✔
## Create UML diagrams to understand the code and the Meshing Procedure in general✔
## Create a list of functions that need to be modified to implement the extra Rule ✔
## Create a list of functions that need to be modified to implement the extra Rule ✔
Line 37: Line 48:
## Create the infrastructure to support Sizing Function pointer✔
## Create the infrastructure to support Sizing Function pointer✔
## Incorporate Function Pointer to PODM by creating a setSizingFunction()✔
## Incorporate Function Pointer to PODM by creating a setSizingFunction()✔
## Replace the test sizing function with the Adaptivity function that was created by Christos (The algorithm is described [https://crtc.cs.odu.edu/Adaptivity here])✔
## Replace the test sizing function with the Adaptivity function that was created by Christos (The algorithm is described [https://crtc.cs.odu.edu/Internal:CNF_Adaptivity here])✔
## Understand that the current implementation supports negative weights✔
### Understand that the current implementation supports negative weights✔
## Change the current implementation to use the minimum-maximum edge length of the element instead of its volume✔
### Change the current implementation to use the minimum-maximum edge length of the element instead of its volume✔
## Identify an issue of checking sample points outside the image and solve it according to Christos's suggestions✔
### Identify an issue of checking sample points outside the image and solve it according to Christos's suggestions✔
# Separate the interface, the IOs and the filters from PODM✔
# Separate the interface, the IOs and the filters from PODM✔
==Spring 2020==
# Create a general PODM driver✔
# Create a general PODM driver✔
# Set a warning if delta > min-spacing * min-dimension-size / 5✔
# Set a warning if delta > min-spacing * min-dimension-size / 5✔
# Set a default delta:  
# Set a default delta: ✔
## if sizing-function is off then default delta = min-spacing * min-dimension-size / 100✔
## if sizing-function is off then default delta = min-spacing * min-dimension-size / 100 ✔
## if sizing-function is off then default delta = min-spacing * min-dimension-size / 20✔
## if sizing-function is on then default delta = min-spacing * min-dimension-size / 20 ✔
# Remove labels array of output mesh if tissues of interest < 2✔
# Remove labels array if there is only 1 label of interest ✔
# Print a warning if a tissue is not recovered✔
# Print a warning if a label is not recovered✔
# Add Numa flag in CmakeLists.txt ✔
# Add Numa flag in CmakeLists.txt ✔
# Add binary file support ✔
# Add binary file support ✔
# Improve Text output ✔
# Improve Text output ✔
# Create GetCleanMeshParallel function ✔
# Create label-filter for images ✔
# Identify places in the code where δ varies with regards to background values (TODO)
## Preserve a set of labels of an image ✔
# Test if multiple δ works using synthetically generated image data (TODO)
## Exclude a set of labels of an image ✔
# Remove redundant volume threshold checks that don't contribute anything to the meshing procedure ✔
 
==Summer 2020==
# Libraries:
## Update ITK to v5.1.0 ✔
## Update VTK to v9.0.1 ✔
## Remove Boost from PODM (preserve it only for CGAL) ✔
# Save the label of a cell after its creation and Remove the expensive label recalculation in GetCleanMesh/GetCleanMeshParallel✔
# Compute Mesh Results in Parallel (TODO)
## Implement Parallel version of GetCleanMesh function ✔
## Testing ✔
## Speed-Up [[File:mesh-results-speed-up.png|500px|File:mesh-results-speed-up.png]] ✔
## Assigned as default ✔
# Upgrade the define NO_IO_WRITING
## Rename it to IO_WRITING ✔
## Create functions for loading and writing of auxiliary files ✔
## Create a compile flag for it, which will also enable the creation of the auxiliary files folder ✔
## Fix truncation error when loading box ✔
# Compute Box, Resized image and surface in Parallel ✔
## Implement Parallel version of ComputeBoxAndSurface function ✔
## Testing ✔
## Speed-Up [[File:box-surface-speed-up.png|500px|File:box-surface-speed-up.png]]✔
## Assigned as default ✔
# Sizing function:
## Control min edge and max edge using a percentage of the diagonal ✔
## Find values of samples points using linear interpolation ✔


=Adaptivity Results=
==Fall 2020==
# Podm Result of Gagic Data image with volume grading on and δ=6, minimum Volume Size = 0.5, limit = 0.1✔
# Fix shift of origin if delta not multiple of the spacing ✔
## 2D (Triangle): [[File:NT_X_min_0.5_limit_2e-3_interpolated.png|500px|Nt2DAdaptivity]] (Done by Christos)
# Handle CNF images with spacing different than 1, and origin different than {0, 0, 0} ✔
## 3D (PODM): [[File:NtAdaptivity.png|500px|Nt3DAdaptivity]] (Done with Christos)
## Upgrade Image Segmentation ✔
# Produce an Animated Adaptive Procedure video http://www.cs.odu.edu/crtc/videos/PODM3D.html ✔
## Upgrade Sizing function ✔
## [[File:InputImage.png|250px|InputImage]] -> Input Image:
## Upgrade Linear Interpolation ✔
## [[File:ImageSegmentation.png|250px|ImageSegmentation]] -> Image Segmentation
# Change ImageSegmentation to create an image inside the requested grid domain ✔
## [[File:AdaptiveMeshing.gif|250px|AdaptiveMeshing]] -> Meshing Procedure. This is a gif which is visible here: https://crtc.cs.odu.edu/images/8/89/AdaptiveMeshing.gif
## [[File:AdaptedMesh.png|250px|AdaptedMesh]] -> Adapted mesh
## [[File:LinearInterpolation.png|250px|LinearInterpolation]] -> Linear Interpolation


=Future Work=
==Spring 2021==
# Assembly of mesh: Performance of PODM3D can be still improved within the aspect of the time that it takes to assemble the mesh after finishing the meshing procedure. Currently, the assembly of the mesh is a solely sequential step. We propose to utilize the parallel nature of the PODM 3D algorithm and the vtkAppendFIlter of the VTK library, which merges individual meshes into one mesh, to speed up the process.
# [Christos] Addition of Extra points at the beginning of meshing ✔
# [Polykarpos] Loading and saving the state of PODM mesher ✔
# Load Dynamically Sizing Functions and their initialization as a shared Library using function pointers ✔
# Detect special cases of Christos and Polykarpos additions ✔
# Accept double instead of float type precision images ✔
# Add a vector of weights for each vertex ✔
# Add a vector of sizing functions for each thread ✔
==Summer 2021==
# Integrate PODM3D of APBNRR with the latest PODM3D (TODO)
# Fix add points issue (TODO)
# Fix PODM not working on Wahab (TODO)
# Remeshing by using a mesh instead of an image as input and background mesh (TODO)
# Replace CGAL Predicates with: (TODO)
## Predicates Construction Kit:
### [https://hal.inria.fr/hal-01225202 Paper]
### [https://gforge.inria.fr/frs/?group_id=5833 Code]
### Benchmark: [https://crtc.cs.odu.edu/Internal:4D_Predicates_Benchmark PCK vs CGAL Predicates Benchmark]
### Note: see Geogram branch
## Adaptive Precision Floating-Point Arithmetic and Fast Robust Predicates for Computational Geometry:
### [https://www.cs.cmu.edu/afs/cs/project/quake/public/papers/robust-predicates.ps Paper]
### [https://www.cs.cmu.edu/afs/cs/project/quake/public/code/predicates.c Code]
# Smoothing (TODO)
## [https://hal.inria.fr/inria-00413248/document Feature preserving Delaunay mesh generation from 3D multi-material images]
## CGAL Sources:
### https://doc.cgal.org/latest/Mesh_3/index.html
### https://doc.cgal.org/latest/Mesh_3/index.html#fig__mesh3protectionimage3D
### https://doc.cgal.org/latest/Mesh_3/index.html#fig__mesh3HybridDomainExample
## PODM3D citations:
### [https://www-sciencedirect-com.proxy.lib.odu.edu/science/article/pii/S0021999101968160 Volume conserving smoothing for piecewise linear curves, surfaces, and triple lines]
### [https://www-sciencedirect-com.proxy.lib.odu.edu/science/article/pii/S0021999108004981 An anisotropic scale-invariant unstructured mesh generator suitable for volumetric imaging data]
### [https://pubmed.ncbi.nlm.nih.gov/20161102/ Variational generation of prismatic boundary-layer meshes for biomedical computing, International Journal for Numerical Methods]
## Prof, Andrey Suggestions:
### [https://people.eecs.berkeley.edu/~jrs/papers/stuffing.pdf Isosurface Stuffing: Fast Tetrahedral Meshes with Good Dihedral Angles]
### [https://imr.sandia.gov/_assets/documents/2019_IMR_Papers/3B.2-Chernikov.pdf CERTIFIED FUNCTIONS FOR MESH GENERATION]
### [https://crtc.cs.odu.edu/pub/papers/journal_49.pdf GENERALIZED INSERTION REGION GUIDES FOR DELAUNAY MESH REFINEMENT]
# Μultiple δ (TODO)
## Implement multiple δ (TODO)
## Use different δ values (possibly uniform based) according to the surface of each label of a segmented image (TODO)
# Produce the Voronoi Mesh out of the Delaunay (TODO)
## Check what TetGen does (TODO)
## Research conversion methods (TODO)

Latest revision as of 13:35, 3 June 2021

Documentation

Fall 2019

  1. Read PODM3D paper✔
  2. Read Guaranteed Quality Tetrahedral Delaunay Meshing for Medical Images paper (Sect. 9) (TODO)
  3. Write a proper README.md file✔
  4. Add the CNF Example Meshes into the Appendix of the November Report✔
  5. Create CNF Adaptivity Report

Spring 2020

  1. Create a User Manual for PODM 3D and Tessellate2D within the fields of Medical Image Computing and Computational Nuclear Femptography ✔

Execution Examples

Fall 2019

  1. Create meshes for the Computational Nuclear Femtography part of CRTC_I2M_Suite Documentation. CNF Example Meshes ✔

Spring 2020

  1. Create meshes for the Medical Image Computing part of CRTC_I2M_Suite Documentation. Medical Imaging Example Meshes ✔

Summer 2020

  1. Create meshes for the Bioinformatics part of CRTC_I2M_Suite Documentation. Bioinformatics Example Meshes ✔

Code

Fall 2019

  1. Restructure repository of PODM3D based on Software engineering standards✔
  2. Decouple Args from PODM✔
  3. Create setArguments function✔
  4. Create setInputImage(ImageType::Pointer)✔
  5. Remove IOs from PODM✔
  6. Implement a sizing function that will work as an extra rule and it will use the points of the tetrahedron that is tested✔
    1. Create UML diagrams to understand the code and the Meshing Procedure in general✔
    2. Create a list of functions that need to be modified to implement the extra Rule ✔
    3. Modify the created list (Extra Rule sizing Function list) of functions✔
    4. Create the following test sizing function to understand if modifications have been done correctly✔
      bool checkSizingFunction(double coordinatesOfTetrahedron**)
      {
          double volume = volume(coordinatesOfTetrahedron);
          double* baryCenter = baryCenter(coordinatesOfTetrahedron)
          
          // if x axis <= 55 and volume of tetrahedron > 10
          if (baryCenter[0] <= 55 && volume > 10)
             return true;
          else
             return false
      }
      
    5. Create the infrastructure to support Sizing Function pointer✔
    6. Incorporate Function Pointer to PODM by creating a setSizingFunction()✔
    7. Replace the test sizing function with the Adaptivity function that was created by Christos (The algorithm is described here)✔
      1. Understand that the current implementation supports negative weights✔
      2. Change the current implementation to use the minimum-maximum edge length of the element instead of its volume✔
      3. Identify an issue of checking sample points outside the image and solve it according to Christos's suggestions✔
  7. Separate the interface, the IOs and the filters from PODM✔

Spring 2020

  1. Create a general PODM driver✔
  2. Set a warning if delta > min-spacing * min-dimension-size / 5✔
  3. Set a default delta: ✔
    1. if sizing-function is off then default delta = min-spacing * min-dimension-size / 100 ✔
    2. if sizing-function is on then default delta = min-spacing * min-dimension-size / 20 ✔
  4. Remove labels array if there is only 1 label of interest ✔
  5. Print a warning if a label is not recovered✔
  6. Add Numa flag in CmakeLists.txt ✔
  7. Add binary file support ✔
  8. Improve Text output ✔
  9. Create label-filter for images ✔
    1. Preserve a set of labels of an image ✔
    2. Exclude a set of labels of an image ✔
  10. Remove redundant volume threshold checks that don't contribute anything to the meshing procedure ✔

Summer 2020

  1. Libraries:
    1. Update ITK to v5.1.0 ✔
    2. Update VTK to v9.0.1 ✔
    3. Remove Boost from PODM (preserve it only for CGAL) ✔
  2. Save the label of a cell after its creation and Remove the expensive label recalculation in GetCleanMesh/GetCleanMeshParallel✔
  3. Compute Mesh Results in Parallel (TODO)
    1. Implement Parallel version of GetCleanMesh function ✔
    2. Testing ✔
    3. Speed-Up File:mesh-results-speed-up.png ✔
    4. Assigned as default ✔
  4. Upgrade the define NO_IO_WRITING
    1. Rename it to IO_WRITING ✔
    2. Create functions for loading and writing of auxiliary files ✔
    3. Create a compile flag for it, which will also enable the creation of the auxiliary files folder ✔
    4. Fix truncation error when loading box ✔
  5. Compute Box, Resized image and surface in Parallel ✔
    1. Implement Parallel version of ComputeBoxAndSurface function ✔
    2. Testing ✔
    3. Speed-Up File:box-surface-speed-up.png✔
    4. Assigned as default ✔
  6. Sizing function:
    1. Control min edge and max edge using a percentage of the diagonal ✔
    2. Find values of samples points using linear interpolation ✔

Fall 2020

  1. Fix shift of origin if delta not multiple of the spacing ✔
  2. Handle CNF images with spacing different than 1, and origin different than {0, 0, 0} ✔
    1. Upgrade Image Segmentation ✔
    2. Upgrade Sizing function ✔
    3. Upgrade Linear Interpolation ✔
  3. Change ImageSegmentation to create an image inside the requested grid domain ✔

Spring 2021

  1. [Christos] Addition of Extra points at the beginning of meshing ✔
  2. [Polykarpos] Loading and saving the state of PODM mesher ✔
  3. Load Dynamically Sizing Functions and their initialization as a shared Library using function pointers ✔
  4. Detect special cases of Christos and Polykarpos additions ✔
  5. Accept double instead of float type precision images ✔
  6. Add a vector of weights for each vertex ✔
  7. Add a vector of sizing functions for each thread ✔

Summer 2021

  1. Integrate PODM3D of APBNRR with the latest PODM3D (TODO)
  2. Fix add points issue (TODO)
  3. Fix PODM not working on Wahab (TODO)
  4. Remeshing by using a mesh instead of an image as input and background mesh (TODO)
  5. Replace CGAL Predicates with: (TODO)
    1. Predicates Construction Kit:
      1. Paper
      2. Code
      3. Benchmark: PCK vs CGAL Predicates Benchmark
      4. Note: see Geogram branch
    2. Adaptive Precision Floating-Point Arithmetic and Fast Robust Predicates for Computational Geometry:
      1. Paper
      2. Code
  6. Smoothing (TODO)
    1. Feature preserving Delaunay mesh generation from 3D multi-material images
    2. CGAL Sources:
      1. https://doc.cgal.org/latest/Mesh_3/index.html
      2. https://doc.cgal.org/latest/Mesh_3/index.html#fig__mesh3protectionimage3D
      3. https://doc.cgal.org/latest/Mesh_3/index.html#fig__mesh3HybridDomainExample
    3. PODM3D citations:
      1. Volume conserving smoothing for piecewise linear curves, surfaces, and triple lines
      2. An anisotropic scale-invariant unstructured mesh generator suitable for volumetric imaging data
      3. Variational generation of prismatic boundary-layer meshes for biomedical computing, International Journal for Numerical Methods
    4. Prof, Andrey Suggestions:
      1. Isosurface Stuffing: Fast Tetrahedral Meshes with Good Dihedral Angles
      2. CERTIFIED FUNCTIONS FOR MESH GENERATION
      3. GENERALIZED INSERTION REGION GUIDES FOR DELAUNAY MESH REFINEMENT
  7. Μultiple δ (TODO)
    1. Implement multiple δ (TODO)
    2. Use different δ values (possibly uniform based) according to the surface of each label of a segmented image (TODO)
  8. Produce the Voronoi Mesh out of the Delaunay (TODO)
    1. Check what TetGen does (TODO)
    2. Research conversion methods (TODO)