<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">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_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><p style="margin-bottom:0.0001pt"><span lang="EN-US" style="color:rgb(31,73,125)"><span lang="EN-US" style="font-size:11pt;line-height:16.8667px;font-family:Calibri,sans-serif">__________________________________</span></span></p><p style="margin-bottom:0.0001pt"><span lang="EN-US" style="color:rgb(31,73,125)"><span lang="EN-US" style="font-size:11pt;line-height:16.8667px;font-family:Calibri,sans-serif">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 lang="DA" style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)">Nørrebrogade 44,</span></p><p style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:"Times New Roman",serif;color:black"><span lang="DA" style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)">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 lang="DA" style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)">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">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>