[Rtk-users] cast itk:::Image to itk::CudaImage

Andreas Andersen andreasga22 at gmail.com
Wed Jan 16 17:06:30 EST 2019


Hi Tao,

I think you want the CastImageFilter
<https://itk.org/Doxygen/html/classitk_1_1CastImageFilter.html> from ITK.

Something like this:
using castToImageType = itk::CastImageFilter<itk:::Image<float,3>,
itk::CudaImage<float,3>>;
typename castToImageType::Pointer castfilter = castToImageType::New();
castfilter->SetInput(projectionReader->GetOutput());
castfilter->Update();
auto cuda_image = castfilter->GetOutput();

Best regards Andreas

__________________________________

Andreas Gravgaard Andersen

Department of Oncology,

Aarhus University Hospital

Nørrebrogade 44,

8000, Aarhus C

Mail:     agravgaard at protonmail.com

Cell:      +45 3165 8140


On Wed, 16 Jan 2019 at 22:59, tao sun <colddiesun at gmail.com> wrote:

> Hi,
>
> I have read in some image using  itk::ImportImageFilter.
>  ImportFilterType::Pointer projectionReader = ImportFilterType::New();
> ...
>  projectionReader->Update();
>
> 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>?
> In rtkforwardprojections.cxx the imageReaderType is defined as
> CudaImageType so there is no such problem.
>
> Thanks,
> Tao
> _______________________________________________
> Rtk-users mailing list
> Rtk-users at public.kitware.com
> https://public.kitware.com/mailman/listinfo/rtk-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://public.kitware.com/pipermail/rtk-users/attachments/20190116/f08486b6/attachment.html>


More information about the Rtk-users mailing list