[Rtk-users] RTK crashes silently when calling Update in Python

Simon Rit simon.rit at creatis.insa-lyon.fr
Thu Nov 21 16:35:02 EST 2019


Thanks. The problem is that the function SetFileNames expects a list of
file. When passing only one string, it converts it to a list of char and
tries to open file "C" first. Use

reader.SetFileNames(["C:/xxx/Proj_0001.xim"])

instead. I have also submitted a patch
<https://github.com/SimonRit/RTK/commit/701704760dea06ee97c57121fb504acaed06f42b>
to avoid the crash but you'll have to wait for the release of new
python packages to have the fix on your side.

Cheers,

Simon



On Thu, Nov 21, 2019 at 1:03 PM Christian Mørup <chrmorup at gmail.com> wrote:

> Hi Simon,
>
> I have tried with 3D images as well, however it gives the same result. I
> have attached one similar projection to this mail.
>
> Best regards,
> Christian
>
> Den tor. 21. nov. 2019 kl. 12.05 skrev Simon Rit <
> simon.rit at creatis.insa-lyon.fr>:
>
>> Hi,
>> Thanks for reporting, I guess you can open an issue on github. Can you
>> try to see if it works better with 3D images (CPUImageType =
>> rtk.Image[itk.F,3])? We mainly use the projections reader to load a stack
>> of projections. If not, can you share your projection?
>> Best regards,
>> Simon
>>
>>
>> On Thu, Nov 21, 2019 at 11:50 AM Christian Mørup <chrmorup at gmail.com>
>> wrote:
>>
>>> Hi,
>>>
>>> We are currently trying to convert files in .xim-format to .mha-format
>>> by using RTK in Python. Our code is as follows:
>>>
>>> import sysimport itkfrom itk import RTK as rtkimport inspect
>>>
>>> CPUImageType = rtk.Image[itk.F,2]
>>> reader = itk.ProjectionsReader[CPUImageType].New()
>>> reader.SetFileNames("C:/xxx/Proj_0001.xim")
>>> reader.SetDebug(True)
>>> print("Updating...")
>>> reader.Update()print("Update done")
>>> img = reader.GetOutput()
>>>
>>> For some reason Update() crashes without any stacktrace. Does anyone have any idea why this is happening?
>>>
>>> Best regards,
>>>
>>> Christian Mørup
>>>
>>> _______________________________________________
>>> 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/20191121/e90adcd7/attachment.html>


More information about the Rtk-users mailing list