OpenGATE / GateTools

Python tools and functions for Gate
GNU Lesser General Public License v3.0
30 stars 22 forks source link

Unit test for image_arithm #3

Closed tbaudier closed 5 years ago

tbaudier commented 5 years ago

Hi @djboersma

I debug your unit test for image arithm: https://github.com/OpenGATE/GateTools/blob/34fc70a4f4dbe247516e12e3ff04631d67770c65/gatetools/image_arithm.py#L161

First https://github.com/OpenGATE/GateTools/blob/34fc70a4f4dbe247516e12e3ff04631d67770c65/gatetools/image_arithm.py#L112 you need to add the Update line like this:

         op_instance.SetInput(i,img)
    op_instance.Update()
    return _image_output(op_instance.GetOutput(),output_file)

With itk, all filters need to be updated to create the output. This is why the unit test failed, the output did not exist and it created a segfault.

Next, I suggest you some modifications:

Thomas

djboersma commented 5 years ago

I think that this is all fixed now. Thanks! :+1: