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
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
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
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
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
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
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
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
Hope this helps.
best regards,
-Cartik
Mike