<div dir="ltr"><div>Hi,</div><div>That's one solution. Two other:</div><div>- graft the output to a Cuda image</div><div>itk::CudaImage<float, 3>::Pointer cuImg = itk::CudaImage<float, 3>::New();</div><div>cuImg->Graft(projectionReader->GetOutput())</div><div>- use the rtk::ImportImageFilter which is templated over image type to allow precisely this (I used it in Gate <a href="https://github.com/OpenGATE/Gate/blob/develop/source/digits_hits/src/GateFixedForcedDetectionActor.cc#L1583">here</a>).</div><div>Best regards,</div><div>Simon<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Jan 16, 2019 at 11:06 PM Andreas Andersen <<a href="mailto:andreasga22@gmail.com">andreasga22@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">Hi Tao,<br><br>I think you want the <a href="https://itk.org/Doxygen/html/classitk_1_1CastImageFilter.html" target="_blank">CastImageFilter</a> from ITK.<br><br></div><div dir="ltr">Something like this:<br><div dir="ltr">using castToImageType = itk::CastImageFilter<<span style="color:rgb(0,0,0)">itk:::Image<float,3></span>, <span style="color:rgb(0,0,0)">itk::CudaImage<float,3></span>>;</div><div dir="ltr">typename castToImageType::Pointer castfilter = castToImageType::New();</div><div dir="ltr">castfilter->SetInput(projectionReader->GetOutput());</div><div dir="ltr">castfilter->Update();</div><div dir="ltr">auto cuda_image = castfilter->GetOutput();</div><div><br></div><div>Best regards Andreas</div><div><div dir="ltr" class="gmail-m_8518759442569938gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><p style="margin-bottom:0.0001pt"><span style="color:rgb(31,73,125)" lang="EN-US"><span style="font-size:11pt;line-height:16.8667px;font-family:Calibri,sans-serif" lang="EN-US">__________________________________</span></span></p><p style="margin-bottom:0.0001pt"><span style="color:rgb(31,73,125)" lang="EN-US"><span style="font-size:11pt;line-height:16.8667px;font-family:Calibri,sans-serif" lang="EN-US">Andreas Gravgaard Andersen</span></span></p><div><p style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:"Times New Roman",serif;color:black"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)">Department of Oncology, </span></p><p style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:"Times New Roman",serif;color:black"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)">Aarhus University Hospital<u></u><u></u></span></p><p style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:"Times New Roman",serif;color:black"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)" lang="DA">Nørrebrogade 44,</span></p><p style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:"Times New Roman",serif;color:black"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)" lang="DA">8000, Aarhus C<u></u></span></p><p style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:"Times New Roman",serif;color:black"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)" lang="DA">Mail:     <a href="mailto:agravgaard@protonmail.com" target="_blank">agravgaard@protonmail.com</a></span></p><p style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:"Times New Roman",serif;color:black"><span style="color:rgb(31,73,125);font-family:Calibri,sans-serif;font-size:11pt">Cell:     </span><span style="color:rgb(31,73,125);font-family:Calibri,sans-serif;font-size:11pt"> </span><a value="+4523382411" style="font-family:Calibri,sans-serif;font-size:11pt;color:rgb(17,85,204)">+45 3165 8140</a></p></div></div></div></div></div></div></div></div><br></div></div></div></div></div><br><div class="gmail_quote"><div dir="ltr">On Wed, 16 Jan 2019 at 22:59, tao sun <<a href="mailto:colddiesun@gmail.com" target="_blank">colddiesun@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr"><span style="color:rgb(0,0,0)">Hi,</span><div style="color:rgb(0,0,0)"><br></div><div style="color:rgb(0,0,0)">I have read in some image using  itk::ImportImageFilter. </div><div style="color:rgb(0,0,0)"> ImportFilterType::Pointer projectionReader = ImportFilterType::New();<br></div><div style="color:rgb(0,0,0)">...</div><div style="color:rgb(0,0,0)"> projectionReader->Update();<br></div><div style="color:rgb(0,0,0)"><br></div><div style="color:rgb(0,0,0)">The type of the image is itk:::Image<float,3>. I wonder if there is any way I can cast it to itk::CudaImage<float,3>? </div><div style="color:rgb(0,0,0)">In rtkforwardprojections.cxx the imageReaderType is defined as CudaImageType so there is no such problem.</div><div style="color:rgb(0,0,0)"><br></div><div style="color:rgb(0,0,0)">Thanks,</div><div style="color:rgb(0,0,0)">Tao</div></div></div>
_______________________________________________<br>
Rtk-users mailing list<br>
<a href="mailto:Rtk-users@public.kitware.com" target="_blank">Rtk-users@public.kitware.com</a><br>
<a href="https://public.kitware.com/mailman/listinfo/rtk-users" rel="noreferrer" target="_blank">https://public.kitware.com/mailman/listinfo/rtk-users</a><br>
</blockquote></div>
_______________________________________________<br>
Rtk-users mailing list<br>
<a href="mailto:Rtk-users@public.kitware.com" target="_blank">Rtk-users@public.kitware.com</a><br>
<a href="https://public.kitware.com/mailman/listinfo/rtk-users" rel="noreferrer" target="_blank">https://public.kitware.com/mailman/listinfo/rtk-users</a><br>
</blockquote></div>