[Rtk-users] CUDA projections are blank

Solomon Tang solomoncztang at gmail.com
Mon May 2 16:42:44 EDT 2016


Thanks for the tip Simon,

I think I may have figured it out. I initially read as a CUDA Image, and
then passed the CUDA image through ChangeInformationImageFilter to change
the offset of the image.

template <class T, int IM_DIM>
typename itk::CudaImage<T, IM_DIM>::Pointer ShiftOffset(
const typename itk::CudaImage<T, IM_DIM>::Pointer image,
const typename itk::Image<T,IM_DIM>::PointType origin)
{
typedef itk::ChangeInformationImageFilter< itk::CudaImage<T,IM_DIM> >
FilterType;
FilterType::Pointer filter = FilterType::New();
filter -> SetInput(image);
filter -> SetOutputOrigin(origin);
filter -> ChangeOriginOn();
filter -> UpdateOutputInformation();
filter -> Update();
return filter->GetOutput();
}

If I pass the offset image pointer to ForwardProjection, it outputs a blank
image.

However, when I write the offset image and then read it again as a CUDA
image, then the ForwardProjection works as intended. Perhaps using the CUDA
version of ITK would fix this.


On Sat, Apr 30, 2016 at 12:08 AM, Simon Rit <simon.rit at creatis.insa-lyon.fr>
wrote:

> Hi Solomon,
> Hard to say without the full code. Maybe the cudaness of your output image
> is lost further in the code. Try accessing the CPU buffer at the end, after
> the update, to be sure that the GPU image is transferred to CPU, e.g.
> std::cout << forwardProjection->GetOutput()->GetPointer() <<std::endl;
> Simon
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/rtk-users/attachments/20160502/a599c0ef/attachment-0009.html>


More information about the Rtk-users mailing list