<div dir="ltr"><div dir="ltr">No I am not using that. But the error was thrown before GRAFT() function was called. It happens when I initialized the backprojector:<div> bp = rtk::CudaRayCastBackProjectionImageFilter::New(). <br><div> </div></div><div>Tao</div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Simon Rit <<a href="mailto:simon.rit@creatis.insa-lyon.fr">simon.rit@creatis.insa-lyon.fr</a>> 於 2019年1月30日 週三 上午11:13寫道:<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">Are you using the HEAD version of the git ? Because I recently corrected a bug in the Graft function (commit b2d73642ce171ba9890af2c107a1a31f923454b5).</div><div>Simon<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Jan 30, 2019 at 5:05 PM 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">Hi Simon,<div><br></div><div>CUDA_HAVE_GPU is on. So is CUDA_FOUND. I can run examples like rtkfdk with gpu on without any problem though,</div><div>By the way I am using CUDA 9.2.88.</div><div><br></div><div>Tao</div><div><br></div><div><br></div><div><br></div><div><br></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Simon Rit <<a href="mailto:simon.rit@creatis.insa-lyon.fr" target="_blank">simon.rit@creatis.insa-lyon.fr</a>> 於 2019年1月30日 週三 上午1:25寫道:<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>Hi,</div><div>No, not really. In my experience, this occurs mainly when you don't have a GPU properly configured for CUDA. Can you check the value of CUDA_HAVE_GPU in cmake ? If it's OFF, then this is indeed the problem.<br></div><div>Simon<br></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Jan 30, 2019 at 1:23 AM 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"><div dir="ltr">Hi again,<div><br></div><div>Finally I got time to work on this. I was able to compile the program this time using the Graft() function. However, there's a runtime error when I run the program:</div><div><br></div><div><div>    /home/tsun/bin/RTK-1.4.0/utilities/ITKCudaCommon/src/itkCudaDataManager.cxx:38 @ unknown : Cuda Error #3</div><div>    terminate called after throwing an instance of 'itk::ExceptionObject'</div><div>    what():  /home/tsun/bin/RTK-1.4.0/utilities/ITKCudaCommon/src/itkCudaDataManager.cxx:38:</div><div>    Cuda Error # 3</div><div>    Aborted</div></div><div><br></div><div>It happens when a new gpu backprojector is created:</div><div>    bp = rtk::CudaRayCastBackProjectionImageFilter::New();<br></div><div><br></div><div>Any insights for this?</div><div><br></div><div>Thanks,</div><div>Tao</div></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">tao sun <<a href="mailto:colddiesun@gmail.com" target="_blank">colddiesun@gmail.com</a>> 於 2019年1月19日 週六 下午8:51寫道:<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">Thank you all! I will give a try using your solutions.<div>Tao</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Simon Rit <<a href="mailto:simon.rit@creatis.insa-lyon.fr" target="_blank">simon.rit@creatis.insa-lyon.fr</a>> 於 2019年1月17日 週四 上午12:26寫道:<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>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" target="_blank">here</a>).</div><div>Best regards,</div><div>Simon<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail-m_-6928066469225963281gmail-m_2083612832876678240gmail-m_1585271949393647574gmail-m_-485280682349819555gmail-m_6672558738276974937gmail-m_5619079691586473791gmail_attr">On Wed, Jan 16, 2019 at 11:06 PM Andreas Andersen <<a href="mailto:andreasga22@gmail.com" target="_blank">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_-6928066469225963281gmail-m_2083612832876678240gmail-m_1585271949393647574gmail-m_-485280682349819555gmail-m_6672558738276974937gmail-m_5619079691586473791gmail-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>
</blockquote></div>
</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>
</blockquote></div>
</blockquote></div>
</blockquote></div>