This is the discussion page of Specifications/GeometryGeneration. Please provide your input in regard to this specification
- by editing this page, or
by responding to relevant forum entry, or
by sending an e-mail to Ahmet Erdemir, <erdemira@ccf.org>.
Comments
-- aerdemir 2016-04-14 17:41:11 Information below was ported from the main specifications page. It illustrates various iterations for smoothing, etc.
-- arielschwartz 2018-03-02 17:55:01 some users may benefit from seeing the geometry generation page in reverse order. Beginning with the component specific procedures, with links to instructions for Laplacian Smoothing, Taubin smoothing, etc. This way they can follow along with the instructions applicable to the part they are working with. Alternatively, a paragraph at the beginning of the page explaining the layout of this page (with links) will give users an idea of what they are reading before they begin.
Following are examples (oks001) of distance maps (using MeshLab: Hausdorf distance) between various pairs of surfaces to assess:
- spatial error between corresponding surfaces with varying levels of smoothing/refinement
- distance between different model components (e.g. femur vs. femur cartilage, BACK SURFACE)
- thickness of model components (e.g. cartilage):
To map tissue thicknesses (e.g. cartilage), opposing surfaces (i.e. BACK SURFACE, FRONT SURFACE) from a manifold (i.e. watertight) STL mesh were split into two complementary, shell STL mesh sets using Blender.
NOTE: all units are displayed in mm.
Smoothing Errors
UNSMOOTHED vs. SMOOTHED:
- femur cartilage, BACK SURFACE (REF; unsmoothed) vs. femur cartilage, BACK SURFACE (VCG smoothed, 0.7; ISO 10)
- femur cartilage, FRONT SURFACE (REF; unsmoothed) vs. femur cartilage, FRONT SURFACE (VCG smoothed, 0.7; ISO 10)
Distance between Model Components
FEMUR vs. FEMUR CARTILAGE:
- femur (REF; VCG smoothed, 0.7; ISO, 10) vs. femur cartilage, BACK SURFACE (VCG smoothed, 0.7; ISO, 10)
FEMUR CARTILAGE vs. FEMUR:
- femur cartilage (REF; VCG smoothed, 0.7; ISO, 10) vs. femur (VCG smoothed, 0.7; ISO, 10) NOTE: this visualized distance on femur cartilage from the femur bone boundary can be used to find a cutoff value for generating a node set to tie nodes on the back surface of the femur cartilage to the rigid body femur.
Tissue Thickness
FEMUR CARTILAGE THICKNESS (UNSMOOTHED):
- femur cartilage, BACK SURFACE (REF; UNSMOOTHED) vs. femur cartilage, FRONT SURFACE (UNSMOOTHED)
- femur cartilage, FRONT SURFACE (REF; UNSMOOTHED) vs. femur cartilage, BACK SURFACE (UNSMOOTHED)
FEMUR CARTILAGE THICKNESS (VCG smoothed, 0.7):
- femur cartilage, BACK SURFACE (REF; VCG smoothed, 0.7) vs. femur cartilage, FRONT SURFACE (VCG smoothed, 0.7)
- femur cartilage, FRONT SURFACE (REF; VCG smoothed, 0.7) vs. femur cartilage, BACK SURFACE (VCG smoothed, 0.7)
FEMUR CARTILAGE THICKNESS (VCG smoothed, 0.7; ISO, 10):
- femur cartilage, BACK SURFACE (REF; VCG smoothed, 0.7; ISO, 10) vs. femur cartilage, FRONT SURFACE (VCG smoothed, 0.7; ISO, 10)
- femur cartilage, FRONT SURFACE (REF; VCG smoothed, 0.7; ISO, 10) vs. femur cartilage, BACK SURFACE (VCG smoothed, 0.7; ISO, 10)
FEMUR CARTILAGE THICKNESS (LVTIT):
- femur cartilage, BACK SURFACE (REF; LVTIT) vs. femur cartilage, FRONT SURFACE (LVTIT)
- femur cartilage, FRONT SURFACE (REF; LVTIT) vs. femur cartilage, BACK SURFACE (LVTIT)
NOTE: spurious distances (0.0 mm, which are known not to be correct) are present only in the FRONT SURFACE (REF) vs BACK SURFACE, despite similar relative normal directions between reference and measured surfaces!!!
Blender Procedures
Input/Output
IMPORT STL:
File -> Import -> 'Stl (.stl)'.
- Select desired STL file(s) (multiple contiguous by holding 'Shift', multiple non-contiguous by holding 'Ctrl').
- Click 'Import STL'.
EXPORT STL:
- Select the desired mesh to export from the hierarchical Outliner editor pane (default: upper right).
File -> Export -> 'Stl (.stl)'
- Specify a desired folder and filename (extension: .stl).
- Click 'Export STL'.
Useful Shortcuts
- 'n': show 3D Viewport Panel Options
- 'Tab': switch between 'Object Mode' (default) and 'Edit Mode'
'p' (-> : split selected surface mesh triangles into two complementary sets
- 'a': toggle, select all/none
- 'c': 'Circle Select'
- Left-click: select
- Middle mouse button, scroll wheel (click): deselect
- Middle mouse button, scroll wheel (scroll): change size of circular selection area
- 'Esc': cancel current active tool
3D Viewport Interaction
- Left mouse button:
- ['Object Mode']: position cursor
- ['Edit Mode']: select specified sub-geometry (node/edge/face)
- IF TOOL IS ACTIVE: apply active tool
- ('Ctrl'+_): lasso select
- ('Ctrl'+'Shift'+_): lasso deselect
- Middle mouse button, scroll wheel (click): rotate 3D view
- ('Ctrl'+_) zoom in/out (continuous)
- ('Shift'+_) pan
- Middle mouse button, scroll wheel (scroll): zoom in/out (discrete steps)
- Right mouse button:
- [Object Mode]: select object
- [Edit Mode]: activate/deactivate tool (default tool: translate selection)
Triangulated surface mesh (STL) splitting
In order to determine tissue thickness for thin structures (e.g. cartilage, ligament, tendon) using MeshLab, the manifold (water-tight) triangulated surface mesh must be split into to non-manifold, complementary shells. The procedure to do this is as follows:
- Import desired STL(s).
- Ensure you are in 'Object Mode' (shown in drop-down menu underneath the 3D Viewport).
- Selected the desired STL with one of the following options:
- In the 'Outliner' panel (default: upper right), showing the scene graph and datablocks hierarchy, left-click the desired STL.
- In the 3D View, right-click on the desired STL interactively.
- Hit 'Tab' to change to 'Edit Mode'.
- Make sure 'Face Select' mode is selected:
- in the 3D Viewport menu (underneath), left-click the icon showing a cube with one orange face (in a group of three icons, in the ).
- Press 'a' to deselect all faces (automatically selected by default when entering 'Edit Mode').
- SELECT DESIRED SET OF CONTIGUOUS TRIANGLES:
- Right-click a single triangular face on the desired side of the thin model component.
In 3D Viewport menu -> Select -> 'Linked Flat Faces':
- Adjust Sharpness (angle: degrees) until the desired set of contiguous triangular faces are obtained (determine the max. angle that includes the largest region of one side of the thin structure, without spilling over onto the opposite face of the structure).
- MODIFY SELECTION, IF NEEDED:
- Add/select 'holes' (unselected triangles) in contiguously selected region: use 'Circle Select' or 'Lasso Select'
- Tidy boundary of select contiguous triangles: use 'Circle Select'
- PARTITION STL MESH:
- Press 'p' ('Separate').
From Pop-up menu -> 'Selection P'
General Procedures
General Procedure: NO Smoothing (RAW)
Slicer:
- Load desired segmented label map/image volume.
- Generate triangulated surface (STL) from desired component using (Smooth = 0, Decimate = 0, 'Post Merge Simplification').
Save STL to file using naming convention (Specifications/DataManagement).
General Procedure: Smoothing (LVTIT)
Slicer:
- Load desired segmented label map/image volume.
- Generate triangulated surface (STL) from desired component using 'Laplacian Smoothing' [L] (Smooth = 20, Decimate = 0, 'Post Merge Simplification'), to provide maximum mesh volume prior to following processing steps, which tend to shrink the volume.
Save STL to file using naming convention (Specifications/DataManagement).
Meshlab:
- Load STL generated in prior step.
- Perform 'Surface Reconstruction: VCG' [V] ('Voxel Side'(world unit) = 0.35-0.7, for cartilage MRI, resolution = 0.35 x 0.35 x 0.7 mm), to smooth out step-i-ness of mesh.
- Perform 'Taubin Smoothing' [T] (Lambda = 0.5, mu = -0.53), to make discretized triangules more uniform in areas of high curvature or triangle node density.
- Perform 'Iso Parametrization' [I].
- Perform 'Iso Parametrization Remeshing' (Sampling rate = 3-20).
- Perform 'Taubin Smoothing' [T] (Lambda = 0.5, mu = -0.53), to untwist potentially collapsed triangles at focal points from iso parametrization.