All Projects → dave3d → dicom2stl

dave3d / dicom2stl

Licence: other
Python script to extract a STL surface from a DICOM image series.

Programming Languages

python
139335 projects - #7 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to dicom2stl

rocket viewer
This simple and generic viewer allows you to visualize different kinds of data such as medical and biological images, 3D surfaces, electric signals (ECGs) and documents.
Stars: ✭ 22 (-85.43%)
Mutual labels:  dicom, vtk
sight
Surgical Image Guidance and Healthcare Toolkit
Stars: ✭ 38 (-74.83%)
Mutual labels:  vtk, itk
Ami
AMI Medical Imaging (AMI) JS ToolKit
Stars: ✭ 569 (+276.82%)
Mutual labels:  stl, dicom
fw4spl
Main repository for fw4spl
Stars: ✭ 30 (-80.13%)
Mutual labels:  vtk, itk
Dicomtomesh
A command line tool to transform a DICOM volume into a 3d surface mesh (obj, stl or ply). Several mesh processing routines can be enabled, such as mesh reduction, smoothing or cleaning. Works on Linux, OSX and Windows.
Stars: ✭ 191 (+26.49%)
Mutual labels:  stl, dicom
Sketchup Stl
A SketchUp Ruby Extension that adds STL (STereoLithography) file format import and export.
Stars: ✭ 214 (+41.72%)
Mutual labels:  stl
avl array
High performance templated AVL tree using a fixed size array. Extensive test suite passing.
Stars: ✭ 33 (-78.15%)
Mutual labels:  stl
Competitive Programming Resources
This repository consists of data helpful for ACM ICPC programming contest, in general competitive programming.
Stars: ✭ 199 (+31.79%)
Mutual labels:  stl
Mayo
3D CAD viewer and converter based on Qt + OpenCascade
Stars: ✭ 192 (+27.15%)
Mutual labels:  stl
Safe stl
A safe version of STL
Stars: ✭ 17 (-88.74%)
Mutual labels:  stl
HxSTLParser
Basic STL loader for SceneKit
Stars: ✭ 23 (-84.77%)
Mutual labels:  stl
xcsg
XML based Constructive Solid Geometry based on carve
Stars: ✭ 24 (-84.11%)
Mutual labels:  stl
Sdfx
A simple CAD package using signed distance functions
Stars: ✭ 213 (+41.06%)
Mutual labels:  stl
USmallFlat
Ubpa small flat containers based on C++20
Stars: ✭ 20 (-86.75%)
Mutual labels:  stl
Arduinostl
An STL and iostream implementation based on uClibc++ that supports my CS-11M class.
Stars: ✭ 201 (+33.11%)
Mutual labels:  stl
wsi-to-dicom-converter
Conversion tool/library for converting whole slide images to DICOM
Stars: ✭ 52 (-65.56%)
Mutual labels:  dicom
ZHStatusVolume
[iOS] hide system volume hud, display upon status bar
Stars: ✭ 49 (-67.55%)
Mutual labels:  volume
vtkplotlib
Wrap up VTK (python 3D graphics library) into an easy to use 3D equivalent of matplotlib
Stars: ✭ 31 (-79.47%)
Mutual labels:  stl
ITKWikiExamples
Scraped, buildable version of the wiki examples
Stars: ✭ 21 (-86.09%)
Mutual labels:  itk
win-audio
Get, Set and Watch Speaker/Microphone Volume on Windows
Stars: ✭ 46 (-69.54%)
Mutual labels:  volume

dicom2stl

CircleCI Binder Python application

Tutorial: Binder

dicom2stl.py is a script that takes a Dicom series and generates a STL surface mesh.

Written by David T. Chen from the National Institute of Allergy & Infectious Diseases (NIAID), [email protected] It is covered by the Apache License, Version 2.0:

http://www.apache.org/licenses/LICENSE-2.0

Getting Started

The script is written in Python and uses 3 external packages, SimpleITK, VTK, and pydicom.

The dependencies can be installed using pip:

pip install SimpleITK vtk pydicom

The options for the main script, dicom2stl.py, can be seen by running it:

python dicom2stl.py --help

How dicom2stl.py works

The script starts by reading in a series of 2-d images or a simple 3-d image. It can read any format supported by ITK. If the input name is a zip file or a directory name, the script expects a single series of DCM images, all with the ".dcm" suffix.

Note: if this script is run with the individual Dicom slices provided on the command line, the slices might not be ordered in the correct order. It is better to provide a zip file or a directory, so ITK can determine the proper slice ordering. Dicom slices are not necessarily ordered the same alphabetically as they are physically. In the case of a zip file or directory, the script loads using the SimpleITK ImageSeriesReader class, which orders the slices by their physical layout, not their alphabetical names.

The primary image processing pipeline is as follows:

The script has built in double threshold values for the 4 different tissue types (bone, skin, muscle, soft). These values assume the input is DICOM with standard CT Hounsfield units. I determined these values experimentally on a few DICOM test sets, so the values might not work as well on other images.

The volume is shrunk to 256 cubed or less for speed and polygon count reasons.

After all the image processing is finished, the volume is converted to a VTK image using sitk2vtk.py.

Then the following VTK pipeline is executed:

The amount of smoothing and mesh reduction can be adjusted via command line options. By default 25 iterations of smoothing is applied and the number of vertices is reduced by 90%.

Examples

To extract the bone from a zip of dicom images:

python dicom2stl.py -t bone -o bone.stl dicom.zip

To extract the skin from a NRRD volume:

python dicom2stl.py -t skin -o skin.stl volume.nrrd

To extract a specific iso-value from a VTK volume:

python dicom2stl.py -i 128 -o iso.stl volume.vtk

To extract soft tissue from a dicom series in directory and apply a 180 degree Y axis rotation:

python dicom2stl.py --enable rotation -t soft_tissue -o soft.stl dicom_dir

The options for the script can be seen by running it:

python dicom2stl.py --help

You can try out an interactive Jupyter notebook via Binder: Binder

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].