Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

DICOM to STL (Stereolithography) Conversion

10,866 views
Skip to first unread message

eey...@nottingham.ac.uk

unread,
Feb 13, 2007, 5:25:31 AM2/13/07
to
Hi,

I am working at the University of Nottingham on modeling and molding
realistic heart ventricles for testing in conjunction with cardiac
prostheses. This work will take patient data in the form of DICOM file
scans of the human heart and create artificial models of working
ventricles. In order to do this, however, I will need to create the
data to stereolithography (.stl) file format for the creation of a
mold for input into the University's rapid prototyping machines
through the Pro/Engineer program.

Unfortunately, however, I have been unable to find a workable
conversion method between these two file formats and was wondering if
anyone could please suggest any possible methods or offer any tips or
suggestions that may help me find a way of making this work?

Many thanks,

David Wood

Mathieu Malaterre

unread,
Feb 13, 2007, 10:17:14 AM2/13/07
to

Hi David,

I was once involved in such project. There is no direct
transformation in between DICOM (raster format) and STL (mesh). What I
would suggest is that you look into VTK. You would need to setup a
pipeline:
1. vtkDICOMImageReader (read DICOM image)
2. vtkContourFilter (extract isocontour to produce a mesh)
3. vtkSTLWriter (write mesh in STL file format)

Step 1 to 2 is the most difficult, unless you are dealing with a
very nice and clear injection product the iscontouring can be a
difficult task. In general this is part of the 'segmentation' process,
and solutions to this problem are brought by ITK.

Good luck !
Mathieu
Ref: http://www.vtk.org
and http://www.itk.org

Mike

unread,
Feb 13, 2007, 11:50:31 AM2/13/07
to
This sort of thing is relatively straight forward with 3D slicer
(www.slicer.org), which uses vtk. I do this often to create stl files
for ProE and other applications. Here's the sequence of events:

1 - load dicom series into slicer
2 - edit volume (thresholding may be sufficient) and create vtk model
3 - convert to stl using vtk

I can provide more detail once the snow stops and I can get back to
the lab...

Mike

Douglas

unread,
Feb 15, 2007, 2:52:35 PM2/15/07
to

<eey...@nottingham.ac.uk> wrote in message
news:1171362331.5...@a34g2000cwb.googlegroups.com...


Hi David,

I used the open source PACS workstation OsiriX (for the MacOS) to convert CT
data of a foetal heart model into STL for rapid prototyping. See:

http://homepage.mac.com/rossetantoine/osirix/

Douglas

Yves Martel

unread,
Feb 15, 2007, 6:06:29 PM2/15/07
to
Bonjour David,

As everybody pointed out, going from slices to a surface model require
some work. The most important is the segmentation. You need to
isolate on each slice the tissue that will be used to create the 3D
model.

On top of the free tools already suggested, there's a number of
commercial products that will do just that.

There's also a bunch of integrated solution that will enable you to
segment/reconstruct the images. Most of these are used to
create STL models.

Among those I know there are: (alphabetically)

- 3D Doctor (http://www.ablesw.com/3d-doctor/)

- Amira http://amira.zib.de/

- Analyse by the Clinique Mayo (http://www.analyzedirect.com/)

- BioBuild by Anatomics (http://www.qmi.asn.au/anatomics/)

- Mimics by Materialise
(http://www.materialise.com/mt.asp?mp=mm_main)

- SliceOmatic by TomoVision
(http://www.tomovision.com/tomo_prod_sliceo.htm)

I am from TomoVision, so (of course) I think that sliceOmatic is the
best

Yves

cartik...@gmail.com

unread,
Mar 13, 2007, 2:46:51 AM3/13/07
to
Hi David,

Please try and use IDL's libraries for reading in DICOM
files(www.rsinc.com). With IDL's classes, you can instantiate a DICOM
object and transfer the DICOM property information over.

Then try and use the IDLffDxf library for writing information out to
DXF files. This will enable soft support for a 3D modeling package. I
gather DXF to STL conversion should be possible with any standard CAD
translator.

I suggest IDL since it is has a strong library support for 2D/3D model
conversion and you can look at intermittent results in the
conversion.

best regards,
Cartik

Mike

unread,
Mar 14, 2007, 10:08:17 AM3/14/07
to
On Mar 13, 2:46 am, "cartik.sha...@gmail.com"

Can you provide a short example code? At the present, my actual tool
chain is IDL -> slicer -> vtk to stl converter -> printer. Going from
volumetric data to surface models to dxf directly with IDL would be
great.

Mike

cartik...@gmail.com

unread,
Mar 20, 2007, 2:06:29 AM3/20/07
to michael...@gmail.com
Mike,

Here's some sample code from IDL's online documentation.

First read in the file using the IDLffDicom class.

; Create a DICOM object:
obj = OBJ_NEW( 'IDLffDICOM' )
obj = OBJ_NEW( 'IDLffDICOM', $
FILEPATH('mr_brain.dcm', SUBDIRECTORY=['examples', 'data']))

; Get all of the image data element(s), 7fe0,0010, from the file:
array = obj->GetValue('7fe0'x,'0010'x,/NO_COPY)

; Get the row & column size of the image(s):
rows = obj->GetValue('0028'x,'0010'x,/NO_COPY)
cols = obj->GetValue('0028'x,'0011'x,/NO_COPY)

Then transfer across the image information to the DXF object in IDL.
You could use the snipped of code from IDL online documentation.

However all we're doing here is specfying vertices and connectivity
for those
vertices.

oDXF = OBJ_NEW('IDLffDXF')
lines = {IDL_DXF_POLYLINE}
lines.dxf_type = 4
lines.layer='myLayer'
lines.thickness = 1.0

; Create clockwise square:
lines = REPLICATE(lines, 4)
lines[0].vertices = PTR_NEW([[0.0,0.0,0.0], $
[0.0,1.0,0.0]])
lines[0].connectivity = PTR_NEW([0,1])
lines[1].vertices = PTR_NEW([[0.0,1.0,0.0], $
[1.0,1.0,0.0]])
lines[1].connectivity = PTR_NEW([0,1])
lines[2].vertices = PTR_NEW([[1.0,1.0,0.0], $
[1.0,0.0,0.0]])
lines[2].connectivity = PTR_NEW([0,1])
lines[3].vertices = PTR_NEW([[1.0,0.0,0.0], $
[0.0,0.0,0.0]])
lines[3].connectivity = PTR_NEW([0,1])
oDXF->PutEntity, lines
IF (not oDXF->Write('mySquare.dxf')) THEN $
PRINT, 'Write Failed.'
; Clean up the memory in the structs:
OBJ_DESTROY, oDXF
FOR i=0,3 DO BEGIN
PTR_FREE, lines[i].vertices, lines[i].connectivity
ENDFOR

I think I've used Rhino translator in the past to convert from .dxf
to .stl but it would be helpful to check.

Hope this helps.

best regards,
-Cartik

cartik...@gmail.com

unread,
Mar 20, 2007, 2:07:49 AM3/20/07
to
Mike,

Hope this helps.

best regards,
-Cartik

Mike

unread,
Mar 20, 2007, 10:21:37 AM3/20/07
to
Thanks for the example - I'll give it a try. As for Rhino, I've used
that for editing stl files. It is very handy for removing cruft like
small islands leftover after segmentation. Since I print with a
powder-based printer, removing those keeps my waste powder cleaner.

Mike

razm...@gmail.com

unread,
Jun 5, 2013, 1:03:45 AM6/5/13
to
hi David,

Im currently doing a research that requires similar task.
I am wondering, if you had you succeed in converting the DICOM files into STL ?
If you do, can you share how to do it?

Regards,
Razmi


duef...@libero.it

unread,
Jun 19, 2013, 12:41:59 AM6/19/13
to
http://www.youtube.com/watch?v=_PtTpRz3aU8

This screencast shows how to extract an STL format mesh surface from DICOM CT data, using the open source DeVIDE software [1]. Although DeVIDE can visualise the surface, the saved STL file is

akrawczy...@gmail.com

unread,
Jan 8, 2014, 1:45:35 PM1/8/14
to

Hi,


I am writing to you in regard to this conversation topic

Currently, I am working in Veterinary Cardiology Clinic where we are using real-time 3D Echo system (iE33 xMATRIX manufactured by PHILIPS). Recently we've bought also a 3D printer and I have a problem with make it possible. I mean I can not find a way to print a models based on our 3D Echo studies.


I was wondering if anyone of you have come up with any idea about that.




Pleas let me know if you would be able to help me.




Thanks

crispin....@gmail.com

unread,
Feb 3, 2014, 12:22:14 PM2/3/14
to
We had a similar problem with Philips TEE data, since they use a proprietary format. Eventually we were able to contact someone at Philips who provided a MATLAB snippet to convert the data to DICOM in Cartesian Coordinates so we could do the segmentation in Mimics.

The conversion is not approved for clinical use so they were very cautious and restrictive about releasing it, but I imagine they would be willing to give it you for veterinary use. You probably should start by contacting your Philips rep.

Good luck,
Crispin Weinberg
Biomedical Modeling Inc.
www.biomodel.com
Message has been deleted

g.j...@simpleware.com

unread,
Apr 10, 2014, 6:01:29 AM4/10/14
to
If people are still looking to convert DICOM formats into STL, we'd be happy to discuss our software options with you - www.simpleware.com

We provide image data to 3D model visualisation, analysis and model generation capabilities - you can export STL files (guaranteed watertight triangulations) to CAD and 3D printing, as well as volume FE and CFD meshes to solvers for further analysis. We have extensive experience in medical image processing. Our software can also export NURBS-based models.

You can learn more on our website, where free 30-day trials are available - http://simpleware.com/software/trial/, or by contacting us at in...@simpleware.com with a specific query about your workflow.

All best,

Gareth

rushi....@gmail.com

unread,
Jun 3, 2014, 7:53:43 AM6/3/14
to
hi Mathieu Malaterre,
i have read series of dicom files via vtkDicomImageReader,can you tell me how to use vtkContourFilter library to convert series of Dicom files to STL or produce a mesh and how to write it in stl files?

sharma.ma...@gmail.com

unread,
Jun 23, 2014, 10:40:32 AM6/23/14
to
Hie,
Just now i was working on the similar problem of converting a series of dicom file to .stl file.
You can go for 3d doctor, it's freely available.
tutorial is also available on downloading link.

enjoy working
Thanks
Sharma
IIT madras.

drkom...@gmail.com

unread,
Apr 5, 2015, 12:32:16 PM4/5/15
to
Hello Sharma,
Will it be possible to get the STL file from the 3d doctor. I visited the website and did not realize that the software is free.
Thanks
Dr Komandur

mdrag...@gmail.com

unread,
Aug 14, 2015, 8:59:11 PM8/14/15
to
I am looking for somebody to do this conversions for me...I am ready to pay $ 1 for each conversion

himaj...@gmail.com

unread,
Aug 20, 2015, 6:32:26 AM8/20/15
to
Hi,

I am working on Slicer 4.4, downloaded Slicer code and followed build instructions.

Right now I am loading Dicom Directory using Command line through python script.
Uploading Entire directory is done but not able to read image series from Dicom Directory.

Python Script:
import vtk
import slicer
import vtk.util.numpy_support
import sys
import argparse
import os
import glob


i = ctk.ctkDICOMIndexer()
i.addDirectory(slicer.dicomDatabase, '/path/to/Dicmo/Directory/')
a=slicer.util.loadScene('/path/to/Dicmo/Directory/')

This script will Load Dicom Directory.

After this script I am adding below mentioned pyhton code:

vl = slicer.vtkSlicerVolumesLogic()
vl.SetAndObserveMRMLScene(mrml)

n = vl.vtkITKArchetypeImageSeriesReader('/path/to/Dicom/Directory/Single/image/file', 'CTC')

This script is not working for multiple images in Dicom Directory. This will read single image and showing the output as:
Pixels, Dimensions.


What changes I have to do in this script to make it read entire directory , load volume and create vtk file (or) stl ?

How to use Volume rendering? (For doing some settings(Threshold) for loaded mode from Command line using python script)

Is there any IDE available for Slicer 4.4 ?

What is the work flow?

What are intermeiate operations it is performing while doing volume rendering and saving into stl format?

How to Debug?


This Command I am using for Loading Dicom Data :
cd /home/Slicer-SuperBuild-Debug/
./Slicer --no-main-window --python-script /home/path/to/python/scrip (Please check the python script which I mentioned above.)


Many Thanks,
Himaja

Andrey Fedorov

unread,
Aug 21, 2015, 6:50:43 AM8/21/15
to
Kanampalli,

You should direct these questions to the slicer user or developer list. Please see http://wiki.slicer.org/slicerWiki/index.php/Documentation/Nightly to subscribe and post.

AF

ryans3d...@gmail.com

unread,
Sep 14, 2015, 2:33:33 PM9/14/15
to
I was wondering if anyone can help me get started on this subject matter. I recently purchased a 3d printer and I have 3d ultrasound files in DICOM format. How can I convert them into a printable 3d model?
Message has been deleted

james.r...@gmail.com

unread,
Jan 2, 2017, 12:00:17 PM1/2/17
to
Just starting this sort of process myself, with a local med school here in PA, USA any info or direction would be appreciated!
thanks

Andrey Fedorov

unread,
Jan 3, 2017, 3:54:09 PM1/3/17
to

I think this question is outside of the scope of this group, but perhaps those videos might be of use:

https://youtu.be/MKLWzD0PiIc
https://youtu.be/GGgP89uTOLo

Robert Horn

unread,
Jan 4, 2017, 8:34:56 AM1/4/17
to
Closely related to this, but not an immediate answer, is the rejuvenation of DICOM WG-17 (3D) at the most recent DSC meeting. It will be looking at what steps DICOM should be taking for better support of 3D manufacturing in the medical context.

That doesn't answer the more specific conversion questions and it's unlikely that DICOM will standardize a conversion method. But there are other related technologies that are suitable for standardization.

WG-17 is just getting organized right now, and will be figuring what to do first during the new few months.

kps.s...@gmail.com

unread,
Apr 11, 2019, 4:01:27 AM4/11/19
to
On Tuesday, February 13, 2007 at 8:47:14 PM UTC+5:30, Mathieu Malaterre wrote:
> On Feb 13, 5:25 am, eeyw...@nottingham.ac.uk wrote:
> > Hi,
> >
> > I am working at the University of Nottingham on modeling and molding
> > realistic heart ventricles for testing in conjunction with cardiac
> > prostheses. This work will take patient data in the form of DICOM file
> > scans of the human heart and create artificial models of working
> > ventricles. In order to do this, however, I will need to create the
> > data to stereolithography (.stl) file format for the creation of a
> > mold for input into the University's rapid prototyping machines
> > through the Pro/Engineer program.
> >
> > Unfortunately, however, I have been unable to find a workable
> > conversion method between these two file formats and was wondering if
> > anyone could please suggest any possible methods or offer any tips or
> > suggestions that may help me find a way of making this work?
>
> Hi David,
>
> I was once involved in such project. There is no direct
> transformation in between DICOM (raster format) and STL (mesh). What I
> would suggest is that you look into VTK. You would need to setup a
> pipeline:
> 1. vtkDICOMImageReader (read DICOM image)
> 2. vtkContourFilter (extract isocontour to produce a mesh)
> 3. vtkSTLWriter (write mesh in STL file format)
>
> Step 1 to 2 is the most difficult, unless you are dealing with a
> very nice and clear injection product the iscontouring can be a
> difficult task. In general this is part of the 'segmentation' process,
> and solutions to this problem are brought by ITK.
>
> Good luck !
> Mathieu
> Ref: http://www.vtk.org
> and http://www.itk.org

How to Write STL using Python?

* I have X Y Z co-odinates from 500 dicom slides
* I have generated Faces and triangulation from X Y Z
* But i cont do write 3D STL?

Can you share sample code for STL write from 500 dicom slides, each slides Gray image? i have extract edge x y z boundary but this STL look like 2D single dimension ? so ? can you clear doubts?
0 new messages