[Rtk-users] how to transform itk.CudaImage[itk.F, 3] to itk.Image[itk.F, 3] in python?

Simon Rit simon.rit at creatis.insa-lyon.fr
Mon Nov 27 07:55:16 CET 2023


Please stick to the mailing list.
It should, what is the error message?

On Mon, Nov 27, 2023 at 7:53 AM Fuquan Deng <dfq_2022 at 163.com> wrote:

> Thanks for your answer. i convert itk.CudaImage to numpy.array after
> reconstruction by fdk. But it showed error when i use
> itk.GetArrayFromImage. Does itk not support to convert itk.CudaImage to
> numpy.array?
>
>
>
>
> At 2023-11-27 14:00:23, "Simon Rit" <simon.rit at creatis.insa-lyon.fr>
> wrote:
>
> Hi,
> You can find here
> <https://github.com/RTKConsortium/RTK/blob/master/examples/FirstReconstruction/FirstCudaReconstruction.py#L70-L76>
> how to convert an itk.Image to an itk.CudaImage. An itk.CudaImage is an
> itk.Image (by inheritance) so you should not need to convert it, just use
> it as if it were an itk.Image, as illustrated in the same example here
> <https://github.com/RTKConsortium/RTK/blob/master/examples/FirstReconstruction/FirstCudaReconstruction.py#L91>.
> Or have I missed something?
> Simon
>
>
> On Sun, Nov 26, 2023 at 4:06 PM Fuquan Deng <dfq_2022 at 163.com> wrote:
>
>> Dear simon,
>>
>> althought do not the theory of  transforming numpy.array to cuda image, I
>> succeed.
>> but now i have other question.
>> how to transform cudaimage to itk.Image, and then use GetArrayFromImage
>> to transform to numpy.array?
>>
>> i have read the itk and rtk documents and can not find the answer. Use
>> GPT and get wrong answer. So i come to here and send email to ask you about
>> this. Does rtk-python support this?
>> Thanks and look forward to your reply.
>>
>> Fuquan Deng
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.creatis.insa-lyon.fr/pipermail/rtk-users/attachments/20231127/83b9734a/attachment.htm>


More information about the Rtk-users mailing list