Hi Julia,
I would have used
volume = py.GetImageFromArray(result)
instead of your last line. Does this work? If it does, then you have
to be sure that you set correctly the origin, spacing and direction
(the ITK meta information). One way to do this if you already have an
image with the correct meta information would be to use
py.volume.CopyInformation(volume)
Simon

On Thu, Mar 23, 2017 at 11:14 AM, Julia Semyakishkina
<prekrasnaya1...@gmail.com> wrote:
> Hello.
> In matlab example from http://wiki.openrtk.org/index.php/SimpleRTK volume
> which is projected generates in SheppLoganPhantomFilter(). But i have my own
> volume, that is stored in matlab regular matrix for example.
>
> What i want to do:
> forward = py.JosephForwardProjectionImageFilter();
> forward.SetGeometry(g);
> projs = forward.Execute(projs, volume);
>
> The problem is to initialize the volume parameter.
> By this code
> data_size = size(matimg);
> transpose = matimg';
> result=py.numpy.reshape(transpose(:)', int32(data_size));
> volume = py.Image.fromarray(result);
>
> i store volume in type of py.Image, but in Execute() method i have to pass
> py.SimpleRTK.SimpleRTK.Image type. So, is there way to do such convertation
> ? Or is there some another way to init py.SimpleRTK.SimpleRTK.Image with my
> own matlab data ?
>
>
>
> _______________________________________________
> Rtk-users mailing list
> Rtk-users@public.kitware.com
> http://public.kitware.com/mailman/listinfo/rtk-users
>
_______________________________________________
Rtk-users mailing list
Rtk-users@public.kitware.com
http://public.kitware.com/mailman/listinfo/rtk-users

Reply via email to