<div dir="ltr"><div><div>I've just tried the vtkImageCast and put the output type to short and now everything works just fine, <br><br></div>Thanks,<br><br></div>Iyas<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Nov 14, 2014 at 2:24 PM, Iyas Hamdan <span dir="ltr"><<a href="mailto:iyas.hamdan@gmail.com" target="_blank">iyas.hamdan@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div><div><div>Hi,<br><br></div>Thank you Bill for your answer, <br></div>And yes the type of my image is in fact float. <br><br></div>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 ? <br></div>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. <br><br></div><div>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 ? <br><br></div><div>thanks in advance, <br><br></div><div>Iyas<br></div><div><br></div><br></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Nov 13, 2014 at 2:14 PM, Bill Lorensen <span dir="ltr"><<a href="mailto:bill.lorensen@gmail.com" target="_blank">bill.lorensen@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">It is telling you that the VTK image is float. Try printing the vtk image<br>
ImageVTK->Print(std::cout);<br>
<div><div><br>
<br>
On Thu, Nov 13, 2014 at 6:30 AM, Iyas Hamdan <<a href="mailto:iyas.hamdan@gmail.com" target="_blank">iyas.hamdan@gmail.com</a>> wrote:<br>
> Hi everyone!<br>
> I'm trying to read two DICOM series with VTK, and then register those two<br>
> volumes using ITK, so in this contexte I would have to convert the<br>
> vtkImageData into itk::Image.<br>
><br>
> What i'm doing is the following:<br>
><br>
> typedef itk::Image< signed short, 3> ImageType;<br>
> typedef itk::VTKImageToImageFilter< ImageType >  VTKImageToImageFilterType;<br>
> VTKImageToImageFilterType::Pointer connector =<br>
> VTKImageToImageFilterType::New();<br>
> connector->SetInput(ImageVTK);<br>
> connector->Update();<br>
><br>
> Where ImageVTK is my 3D volume and I visualized it so its reading the Dicom<br>
> series correctly.<br>
><br>
> But I'm always getting this error when I reach the update():<br>
> VTKImageToImageFilter: Input scalar type is float but should be short.<br>
><br>
> So what am I doing wrong here ?<br>
><br>
> thanks in advance,<br>
><br>
> Iyas<br>
><br>
</div></div>> _____________________________________<br>
> Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
><br>
> Visit other Kitware open-source projects at<br>
> <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
><br>
> Kitware offers ITK Training Courses, for more information visit:<br>
> <a href="http://www.kitware.com/products/protraining.php" target="_blank">http://www.kitware.com/products/protraining.php</a><br>
><br>
> Please keep messages on-topic and check the ITK FAQ at:<br>
> <a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
><br>
> Follow this link to subscribe/unsubscribe:<br>
> <a href="http://public.kitware.com/mailman/listinfo/insight-users" target="_blank">http://public.kitware.com/mailman/listinfo/insight-users</a><br>
><br>
<span><font color="#888888"><br>
<br>
<br>
--<br>
Unpaid intern in BillsBasement at noware dot com<br>
</font></span></blockquote></div><br></div>
</div></div></blockquote></div><br></div>