I loaded a series of DICOM images of CT scan and extracted the surface data by vtkMarchingCubes.
When I saved the 3d model into .stl file by vtkSTLWriter, it became a vary large file,so i thought the resolution of surface needs to be reduced.
Then I found the class vtkImageResample and had a brief look at the description, but i’m still not sure how to use it.
Is there any help or hint about this issue? How to save the surface data or volume data to .stl file in smaller size? Thanks.
This is expected. With a few exceptions, such as extracting bone or air surface, you cannot segment CT images with a simple isosurface extraction.
If you are interested in how to segment specific structures on CT images using VTK-based software then I would recommend to contact experts at the Slicer forum. Write there what exactly you would like to segment and for what clinical purpose.
Thank you for your kindly reply, I will look for more detail about segmentation for specific purpose.
But an additional question comes to my mind:
if the 3D scene of CT model cannot saved into smaller file, what is the best way to saving whole project of 3D study by vtk? Or I need to record all parameters and annotations in some file format(such as .xml) to remodel from DICOM and render it every time?
Nowadays storage space is not a problem on most systems. If you work in a constrained environment (web, embedded, etc.) so that you must reduce your data, even at the cost of losing information, then you have lots of options:
- preprocess the input image: reduce noise, reduce size by cropping and/or resampling, etc.
- improving segmentation quality by choosing the right segmentation algorithms: simple isosurface extraction will not work for most cases; but you need to use methods based on local intensity differences, contain built-in spatial smoothness constraints, or use machine learning, etc.
- post-process the segmentation result: on labelmap representation you can run morphological operators to fill holes and remove extrusions; on closed surface representation you can run mesh smoothing and decimation, extract largest connected component, etc.
There are many potential solutions, the best choice depends on what is the exact clinical goal.