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.
No data is sent to a server. Everything happens in your browser window, on your machine.
- Open the live demo.
- Option 1 The web page automatically loads with a default T1 MRI scan. If you want to use this scan, go to step 5.
- Option 2 If your T1 MRI scan is in NIfTI format, drag and drop the file onto the web page.
- Option 3 If your image is in DICOM format, it may load if you drag and drop the files. If this fails, convert your images with dcm2niix and save the result as a NIfTI format file that brain2print can open.
- 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 Threshold 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.
- The Hollow pull-down menu allows you to create a solid object, or a hollow one that uses less materials (but requires an escape hole).
- You can choose
Smoothing
to make the surfaces less jagged at the expense of computation time. - You can choose to
Simplify
to reduce the number of triangles and create smaller files.
- 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.
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
ct2print makes a mesh from the brightest voxels in the image. This works well for extracting the brightest tissues - for example bone from computerized axial tomography. However, if your iamge is a T1-weighted MRI scan of the head, you may prefer brain2print which uses AI methods to segment brain tissue.
This web page combines three packages developed by our team:
- niimath for creating hollow objects. Citation.
- niivue reading images and visualization.
- ITK-Wasm for voxel-to-mesh and mesh processing. [Citation](https://proceedings.scipy.org/articles/TCFJ5130.