[Rtk-users] CUDA projections are blank

Simon Rit simon.rit at creatis.insa-lyon.fr
Wed May 4 03:16:33 EDT 2016


Dear Solomon,
Thanks for the report. It looks like a bug to me. I checked and
itk::ChangeInformationImageFilter calls GetPixelContainer and, indeed, in
the itkGPUImage and the itkCudaImage, this function does not check
consistency between CPU and GPU data. I'll work on a minimal example to
check this but can you test that your problem is solved if you add
m_DataManager->UpdateCPUBuffer();
before
m_DataManager->SetGPUBufferDirty();
in itkCudaImage.h line 121?
Thanks,
Simon

On Mon, May 2, 2016 at 10:42 PM, Solomon Tang <solomoncztang at gmail.com>
wrote:

> 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/20160504/0ba20d4f/attachment-0010.html>


More information about the Rtk-users mailing list