[ITK-users] problem using VTKImageToImageFilter

Iyas Hamdan iyas.hamdan at gmail.com
Fri Nov 14 08:50:31 EST 2014


I've just tried the vtkImageCast and put the output type to short and now
everything works just fine,

Thanks,

Iyas

On Fri, Nov 14, 2014 at 2:24 PM, Iyas Hamdan <iyas.hamdan at gmail.com> wrote:

> Hi,
>
> Thank you Bill for your answer,
> And yes the type of my image is in fact float.
>
> So is it that I cant convert a VTKimage of type float to a itkImage of
> type short using this filter ? would that be the problem here ?
> because other than that, I dont think there is a way of defining the input
> image type for VTKImageToImageFilter, it only takes one parameter which is
> the type of the output image.
>
> So my only option here would be to cast my input type to match the output
> type since its not implemented in the VTKImageToImageFilter right ?
>
> thanks in advance,
>
> Iyas
>
>
>
> On Thu, Nov 13, 2014 at 2:14 PM, Bill Lorensen <bill.lorensen at gmail.com>
> wrote:
>
>> It is telling you that the VTK image is float. Try printing the vtk image
>> ImageVTK->Print(std::cout);
>>
>>
>> On Thu, Nov 13, 2014 at 6:30 AM, Iyas Hamdan <iyas.hamdan at gmail.com>
>> wrote:
>> > Hi everyone!
>> > I'm trying to read two DICOM series with VTK, and then register those
>> two
>> > volumes using ITK, so in this contexte I would have to convert the
>> > vtkImageData into itk::Image.
>> >
>> > What i'm doing is the following:
>> >
>> > typedef itk::Image< signed short, 3> ImageType;
>> > typedef itk::VTKImageToImageFilter< ImageType >
>> VTKImageToImageFilterType;
>> > VTKImageToImageFilterType::Pointer connector =
>> > VTKImageToImageFilterType::New();
>> > connector->SetInput(ImageVTK);
>> > connector->Update();
>> >
>> > Where ImageVTK is my 3D volume and I visualized it so its reading the
>> Dicom
>> > series correctly.
>> >
>> > But I'm always getting this error when I reach the update():
>> > VTKImageToImageFilter: Input scalar type is float but should be short.
>> >
>> > So what am I doing wrong here ?
>> >
>> > thanks in advance,
>> >
>> > Iyas
>> >
>> > _____________________________________
>> > Powered by www.kitware.com
>> >
>> > Visit other Kitware open-source projects at
>> > http://www.kitware.com/opensource/opensource.html
>> >
>> > Kitware offers ITK Training Courses, for more information visit:
>> > http://www.kitware.com/products/protraining.php
>> >
>> > Please keep messages on-topic and check the ITK FAQ at:
>> > http://www.itk.org/Wiki/ITK_FAQ
>> >
>> > Follow this link to subscribe/unsubscribe:
>> > http://public.kitware.com/mailman/listinfo/insight-users
>> >
>>
>>
>>
>> --
>> Unpaid intern in BillsBasement at noware dot com
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/insight-users/attachments/20141114/ca853199/attachment.html>


More information about the Insight-users mailing list