[Insight-users] Mesh to Grayscale Image

Andreas Hahn zweikaesehoch at gmx.de
Sat Sep 26 11:19:16 EDT 2009


Hi,

I try to get a grayscale image from a triangular mesh. The final  
result shall be a dicom series which contains the surface consisting  
of values from the mesh point data.

The approach with a TriangularMesh SpatialObject which is passed to  
the SpatialObjectToImageFilter is very slow. If i just tell the filter  
the spacing, it resutls in an empty volume with some 1.0 on the top.  
Setting origin slows it down by more then ten times but draws the mesh  
on the right place. And the resulting values are either 1.0 or 0.0  
(input data between [0.5, 5.0]).

Why is this filter so slow?
Is it better in itk 3.16 (i'm still using 3.14)?

I know the TriangularMeshToBinaryImageFilter works much faster but  
it's just binary and I need a surface.
Is there a good workaround?

Greets,
Andreas

Basic values:
mesh contains 2356 points
Number of Cells = 4704
bounds = [-41.0628, 64.2066, -51.1757, 1.3605, -16.4932, 67.6209]

Resulting Image:
Image (0x117456400)
   RTTI typeinfo:   itkEX::Image<float, 3u>
   Reference Count: 3
   Modified Time: 39880
   Debug: Off
   Observers:
     none
   Source: (0x117456260)
   Source output index: 0
   Release Data: Off
   Data Released: False
   Global Release Data: Off
   PipelineMTime: 39710
   UpdateMTime: 39881
   LargestPossibleRegion:
     Dimension: 3
     Index: [0, 0, 0]
     Size: [21, 10, 16]
   BufferedRegion:
     Dimension: 3
     Index: [0, 0, 0]
     Size: [21, 10, 16]
   RequestedRegion:
     Dimension: 3
     Index: [0, 0, 0]
     Size: [21, 10, 16]
   Spacing: [5, 5, 5]
   Origin: [-41.0628, -51.1757, -16.4932]
   Direction:
1 0 0
0 1 0
0 0 1

   IndexToPointMatrix:
   5 0 0
0 5 0
0 0 5

   PointToIndexMatrix:
   0.2 0 0
0 0.2 0
0 0 0.2

   PixelContainer:
     ImportImageContainer (0x103ed54e0)
       RTTI typeinfo:   itkEX::ImportImageContainer<unsigned long,  
float>
       Reference Count: 1
       Modified Time: 39719
       Debug: Off
       Observers:
         none
       Pointer: 0x102134a00
       Container manages memory: true
       Size: 3360
       Capacity: 3360


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20090926/3af69db3/attachment-0001.htm>


More information about the Insight-users mailing list