# DicomToMesh **Repository Path**: guningbo__buaa/DicomToMesh ## Basic Information - **Project Name**: DicomToMesh - **Description**: No description available - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2021-03-24 - **Last Updated**: 2024-10-23 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README [](https://travis-ci.org/AOT-AG/DicomToMesh) # DicomToMesh DicomToMesh is a handy command line tool, which enables the user to automatically create a 3D mesh from a set of 2D DICOM images, a common image format used in medicine. The supported 3D mesh formats are STL, OBJ and PLY. DicomToMesh works on Linux, OSX and Windows.
-t X
, where X is an integer.
# Mesh Post-Processing Options
**Mesh reduction:** The mesh of a medical DICOM image can easily exceed 1 GB of data. Reducing the number of polygons, therefore, is a crucial feature. Reduction can be enabled by the option -r X
where X is a floating-point value between 0.0 and 1.0.
-s
.
-e X
where X is a floating-point value between 0.0 and 1.0. X
is a size threshold relative to the connected object with the most vertices. It is easy understandable with an example: The biggest connected object of the mesh has 1000 vertices. Then -e 0.25
removes all connected objects with less than 250 vertices.
-v
the resulting mesh is visualised in a 3D environment. By double clicking the mesh's surface, the corresponding 3D coordinate is printed to the shell.
-vo
shows the input DICOM data in a volume renderer (vtkFixedPointVolumeRayCastMapper). The color map can be set with multiple parameters like (Red,Green,Blue,Alpha,Iso-Value)
. As an example, the parameters -vo (255,0,0,0,0) (255,0,0,60,700) (200,200,200,90,2000)
color voxels with values from 0-700 reddish and 700-2000 whitish.
c
and then g
.
Now you are back in terminal and ready to build.
```
> make
```
In order to extend the supported DICOM formats, the library vtk-dicom USE_VTK_DICOM
can be optionally enabled (see https://github.com/dgobbi/vtk-dicom).
Building on Windows:
Building on Windows is essentially the same as building under Linux and OSX. The project settings can be done with the cmake GUI. The versions we are using are VTK 7.0.0 together with Visual Studio 2015. The optional GUI we are building with QT 5.9.4.
Additional build notes:
- Building on OSX with vtk-dicom (Moritz Moeller)
# How to use Dicom2Mesh
Command line arguments can be combined and passed in arbitrary order.
**Input and output:** The path to the DICOM directory is passed by the argument -i dicomPath
. The file name of the resulting 3D mesh is specified by the parameter -o meshPath
. This simple example transforms a DICOM data set into a 3D mesh file called mesh.stl, by using an iso-value of 557 -t 557
.
> dicom2mesh -i pathToDicomDirectory -t 557 -o mesh.stl
Alternatively, one can use an existing 3d mesh as input. This is useful if you want to apply only mesh post-processing routines and bypass the time consuming mesh creation step. This example imports the former mesh.stl, centers it and exports it in the OBJ mesh format.
> dicom2mesh -i mesh.stl -c -o newMesh.obj
**Mesh post-processing:** The following example shows different mesh post-processing methods applied to resulting surface mesh out of the marching cubes algorithm. In particular, a mesh is reduced by 90% of its original number faces -r 0.9
. In addition, the mesh is smoothed -s
and centred at the coordinate system's origin -c
. Another helpful function is the removal of small objects - here the removal of every object smaller than 5% of the biggest object -e 0.05
.
> dicom2mesh -i pathToDicomDirectory -r 0.9 -s -c -e 0.05 -o mesh.stl
# GUI
Dicom2Mesh can be built with a small GUI on top.
This showed up to be helpful for users without command line experience.
However, the control possibilities are limited compared to the command line version.
BUILD_GUI=ON
when configuring the project.
The GUI requires QT.
The icons in the gui were made by Smashicons from www.flaticon.com. The license is CC 3.0 BY
# Contributors
DicomToMesh is a small in-house product of AOT AG (http://www.aot.swiss). Since it is based on several open-source examples, we decided to make our code public as well. We hope somebody can use parts of it. Participants are most welcome.
Have fun :)