[Insight-users] vtk polydata import / export

Luis Ibanez luis . ibanez at kitware . com
Fri, 11 Jul 2003 09:42:50 -0400


Hi Imho,

You may want to use the VTK filter:

            vtkImplicitModeller

http://www . vtk . org/doc/nightly/html/classvtkImplicitModeller . html

This filter accepts as input a vtkPolyData,
and produces a vtkImageData as output.

The output vtkImageData is computed as a (non-signed)
distance to the surface represented by the itkPolyData.

Once you get this image you can go different paths:

A) you could use these signed distance images as
    direct input for the Demon's registration algorithm

or

B) you could threshold both of them a bit over zero and
    then obtain the inside/outside regions using a
    connectivity filter (VTK or ITK), for example
http://www . itk . org/Insight/Doxygen/html/classitk_1_1ConnectedComponentImageFilter . html
    This will give you binary masks inside the polydata surface.


----


The Demons registration algorithm is designed to work on
images, the itkMesh will not be an appropriate input, so
the conversion described above will certainly be necesary.




   Regards,


      Luis


---------------------
imho wrote:
> Hi Luis,
> I try to do what you said, my pipeline is ready and also the demon
> registration class, and all is compiling, but I don't know how to
> convert my vtkPolyData to a  vtkImageData. I do a simple CopyStructure
> but I think it works badly, because I have an execution error.
> Can I use the demonFilter with an itkMesh ?
> 
> thanks
> 
> Imho
> 
> Luis Ibanez wrote:
> 
>>
>> Hi Imho,
>>
>> The import/export connections currently available
>> between ITK and VTK only manage image-to-image
>> conversions.
>>
>> You may want to convert your vtkPolyData to a vtkImageData
>> and then use the itkVTKImageToImageFilter available in
>>
>>    InsightApplications/Auxiliary/vtk
>>
>> In any case, a vtkPolyData may not be the best support
>> for representing an image...
>>
>>
>> Please let us know if you have futher questions,
>>
>>
>> Thanks
>>
>>
>>    Luis
>>
>>
>>
>> ------------------
>> imho wrote:
>>
>>> Hi all,
>>> is it possible to import and export a vtkPolyData or can I use images 
>>> only?
>>> How can I do?
>>> I have two vtkPolyData volumes, and I'd like to use itk filters like 
>>> this :
>>>
>>> vtk reader -> vtk filters -> itk filters -> vtk viewer
>>> I've tried this :
>>>
>>> VTK                            ->              ITK                    
>>> ->              VTK
>>>
>>> ITKImageExporter4            VTKImageImporter4            
>>> ITKImageImporter4        == first POLY
>>>
>>> ITKImageExporter5            VTKImageImporter5 
>>>                                                  == second POLY (no 
>>> output)
>>>
>>> but I don't know how to convert my vtkPolyData or how to typedef the 
>>> VTKimporter to make it work :
>>>     typedef unsigned short PixelType;
>>>     typedef itk::Image<PixelType, Dimension> ImageType;
>>>     typedef itk::VTKImageImport<ImageType> ImageImportType;
>>> is ok but not with a polyData, and
>>>
>>>     typedef itk::VTKImageImport<vtkPolyData*> ImageImportType;
>>>  isn't ok
>>>
>>> Thanks a lot
>>>
>>> imho
>>
>>
>>
>>
>>
>>
>>
> 
> 
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk . org
> http://www . itk . org/mailman/listinfo/insight-users
>