[vtkusers] RE: mesh to volumetric image

Yan Pingkun engp1734 at nus.edu.sg
Fri Mar 19 06:05:52 EST 2004


Hi, Thomas and others,

Can you enlight me how to read the data from vtkImageStencilData? Or is
there any method to convert it to vtkImageData?

Thanks!

Regards,
Pingkun

-----Original Message-----
From: Thomas Boettger [mailto:t.boettger at dkfz-heidelberg.de] 
Sent: Wednesday, March 17, 2004 5:29 PM
To: Yan Pingkun
Subject: Re: [Insight-users] mesh to volumetric image


Hi Pingkun,

I am using vtkPolyDataToImageStencil to create a stencil which can be 
used to cut out parts of an image. For this I convert my itkMesh to 
vtkPolyData and run a vtkPolyDataNormalsFilter. Then I create the
stencil:

   vtkPolyData * segmentationTriangulated = 
MeshUtil<TriangleMeshType>::meshToPolyData(triangleFilter->GetOutput(),t
rue 
);

     vtkPolyDataNormals * normalsFilter = vtkPolyDataNormals::New();
     normalsFilter->SetInput( segmentationTriangulated );
     normalsFilter->SetFeatureAngle(50);
     normalsFilter->SetConsistency(1);
     normalsFilter->SetSplitting(1);
     normalsFilter->SetFlipNormals(0);
     normalsFilter->Update();

     vtkPolyDataToImageStencil * surfaceConverter = 
vtkPolyDataToImageStencil::New();
     surfaceConverter->SetInput( normalsFilter->GetOutput() );
     surfaceConverter->SetTolerance( 0.0 );
     surfaceConverter->Update();


At the end I use the vtkImageStencil, which gets the output from the 
vtkPolyDataToImageStencil and an vtkImage (converted from the itkImage):


     vtkImageStencil * stencil = vtkImageStencil::New();
     stencil->SetStencil( surfaceConverter->GetOutput() );
     stencil->SetBackgroundValue( 0 );
     stencil->ReverseStencilOff();
     stencil->SetInput( vtkImage );
     stencil->Update();

The output from the stencil filter will be  all voxels of the image 
which lie inside the mesh.

Is this what you need?


Regards,

Thomas



Yan Pingkun wrote:
> Celina & Luis,
> 
> Thanks for your reply! Now I am trying to do this work in vtk. Are you

> familiar with the vtkProbeFilter? I may use planes to probe the 
> polydata. Hope it works.
> 
> Cheers,
> Pingkun
> 
> -----Original Message-----
> From: ci42 at columbia.edu [mailto:ci42 at columbia.edu]
> Sent: Wednesday, March 17, 2004 12:37 AM
> To: Yan Pingkun
> Cc: Luis Ibanez; insight-users at itk.org
> Subject: RE: [Insight-users] mesh to volumetric image
> 
> 
> 
>  Pingkun,
> 
>   I agree that a deformable mesh could be "projected back" into the 
> volume... I know that Ting Chen implemented it but I don't think this 
> is part of the itk. The problem is that the moment you grow a 
> deformable mesh, you don't know its location with respect to a 
> corresponding volume. What could be done: 1. When a mesh is generated,

> keep track where its vertices are located with respect to the volume 
> (in way way, maintain dual mesh-digital representation of the 3D shape

> OR 2. Implement an algorithm that will intersect "mesh with volume", 
> that can be a generic useful tool with many applications...
> 
>  none of the features is available now under the itk,
> 
>  -Celina
> 
> 
> 
> On Tue, 16 Mar 2004, Yan Pingkun wrote:
> 
> 
>>Hi, Luis,
>>
>>Thank you for your quick reply!
>>
>>
>>>Hi Pingkun,
>>
>>>Your 3D objects,.... are they 3D Images ?
>>>or geometrical representation of objects ?
>>>(like surfaces...?)
>>
>>My objects are in geometrical representation. They can be represented
>>by itk::mesh or vtk::polydata.
>>
>>
>>>When you use the Mesh deformable model, you
>>>usually expect this deformed surface to be
>>>the final result of your process.
>>
>>That's true!
>>
>>
>>>If you want to get a deformation field that
>>>you can use for wrapping an image or a set
>>>of geometrical objects, you should rather
>>>look at methods such as:
>>
>>I choose deformable model because it is a requirement in this project.
> 
> 
>>The first step is to handle these 3D objects. An initial mesh should
>>snap to an object surface. We just need to load one object each time. 
>>In practice, this is useless as we already know the results. So, it is
> 
> 
>>just an experiment.
>>
>>After that, I'd like to apply the 3D deformable model on some real
>>volumetric medical images just like that in the new example.
>>
>>Regards,
>>Pingkun
>>
>>
>>>  1) FEM-Based deformable registration
>>
>>>  2) Demons deformable registration
>>
>>>  3) BSplines transform for deformable
>>>     registration
>>
>>>  4) KernelTransform based on landmarks
>>>     for warping space.
>>
>>
>>
>>Regards,
>>
>>
>>    Luis
>>
>>
>>
>>
>>--------------------
>>Yan Pingkun wrote:
>>
>>
>>>Dear all,
>>>
>>>I am doing an experiment on 3D deformable models. Now I have a set
>>>of 3D objects and I need to apply 3D deformable model filter on 
>>>them. The problem is how to convert the geometric data into 
>>>volumetric data. Any
>>
>>idea?
>>
>>>Thanks!
>>>
>>>Regards,
>>>Pingkun
>>
>>
>>
>>_______________________________________________
>>Insight-users mailing list
>>Insight-users at itk.org
>>http://www.itk.org/mailman/listinfo/insight-users
>>
> 
> 
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org 
> http://www.itk.org/mailman/listinfo/insight-users
> 


-- 
Dipl.-Inform. Thomas Boettger
Deutsches Krebsforschungszentrum         (German Cancer Research Center)
Div. Medical and Biological Informatics B010    Tel: (+49) 6221-42 2328
Im Neuenheimer Feld 280                          Fax: (+49) 6221-42 2345
D-69120 Heidelberg                            e-mail: t.boettger at dkfz.de
Germany                      http://www.dkfz.de/mbi/people/thomasb.shtml





More information about the vtkusers mailing list