Awesome
ct2print voxels to mesh
A basic example of converting a voxel-based image to a simplified mesh. This interactive drag-and-drop web page allows you to create meshes that can be used with a 3D printer.
Usage
- Open the live demo.
- Option 1 Use the
Volume
pull-down menu to select an image. - Option 2 If your image is in NIfTI format, drag and drop the file onto the web page.
- Option 3 If your image is in DICOM format, use the
Select DICOM
button to import your image. - Note when you click on the image, the voxel intensity is shown in the status bar at the bottom-left of the web page. You can decide a nice intensity threshold to segment your image (e.g. for a CT scan, bone will be brighter than soft tissue).
- Press the
Create Mesh
button and select your preferred settings:
- The Isosurface is the voxel intensity used to discriminate the mesh surface. See the previous step for detials. By default, this value is set to the Otsu threshold.
- Closing removes small crevices and cavities in your mesh which can plague printing.
- Fill bubbles will remove any cavities, this includes large cavities for example the ventricles for a brain scan.
- The
Largest cluster only
will only extract a single mesh. For example, with theIguana
demo this extracts only the skull without the scleral rings. - You can choose
Smoothing
to make the surfaces less jagged (note this can create self intersecting triangles that can confound some printers). - You can choose to
Simplify
reduce the number of triangles to create smaller files (note this can create self intersecting triangles that can confound some printers).
- Once you have set your preferences, press
Apply
. - You will see the mesh appear and can interactively view it. If you are unhappy with the result, repeat step 6 with different settings. If you want to print the results, press the
Save Mesh
button.
For Developers
You can serve a hot-reloadable web page that allows you to interactively modify the source code.
git clone https://github.com/niivue/ct2print
cd ct2print
npm install
npm run dev
Links
- Will Usher ported Marching Cubes to JavaScript.
- This project includes a pure JavaScript port of Sven Forstmann's Fast Quadric Mesh Simplification
- Tim Knip provides a ThreeJS project that provides both WASM and native JavaScript mesh decimation. Try the live demo.