[vtkusers] How do i port an image from ITK to VTK

Omer Ishaq medicalimageanalysis at gmail.com
Wed Oct 11 05:23:46 EDT 2006


Hi

You need to use the following two classes from ITK and VTK.

1. itkVTKImageExport
2. vtkImageImport

Use itkVTKImageExport class at the end of your ITK pipeline and use the
vtkImageImport class at the start of your VTK pipeline. The connection
between these two classes will be created by calling the function
ConnectVTKToITK. The function is given below.

void ConnectVTKToITK(ExportType* in, ImportType* out)
{

out->SetUpdateInformationCallback(in->GetUpdateInformationCallback());
        out->SetPipelineModifiedCallback(in->GetPipelineModifiedCallback());
       out->SetWholeExtentCallback(in->GetWholeExtentCallback());
       out->SetSpacingCallback(in->GetSpacingCallback());
       out->SetOriginCallback(in->GetOriginCallback());
       out->SetScalarTypeCallback(in->GetScalarTypeCallback());

out->SetNumberOfComponentsCallback(in->GetNumberOfComponentsCallback());

out->SetPropagateUpdateExtentCallback(in->GetPropagateUpdateExtentCallback());
       out->SetUpdateDataCallback(in->GetUpdateDataCallback());
       out->SetDataExtentCallback(in->GetDataExtentCallback());
       out->SetBufferPointerCallback(in->GetBufferPointerCallback());
       out->SetCallbackUserData(in->GetCallbackUserData());
}

where ExportType is of type itkVTKImageExport and
ImportType is of type vtkvtkImageImport

regards
Omer

On 10/10/06, Prename Surname <bsd.diverse at gmail.com> wrote:
>
> Hello
> I am reading files from ANALYZE format in ITK. I do processing of the
> image, and then i want to visualize it in VTK.
> So  my question is how i get the data fra ITK to VTK, and is it then
> difficult to show a volumne view of the data in VTK?
> A codeexample would be very nice. Thank you very much
>
> Best of regards
>
> _______________________________________________
> This is the private VTK discussion list.
> Please keep messages on-topic. Check the FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20061011/d81adeec/attachment.htm>


More information about the vtkusers mailing list