please I still get some errors
RuntimeError: Exception thrown in SimpleITK ImageRegistrationMethod_Execute: C:\d\VS14-Win64-pkg\SimpleITK\Wrapping\Python\sitkPyCommand.cxx:135:
sitk::ERROR: There was an error executing the Python Callable.
You will need to add try-except inside you Python callable used in the events to get the error encountered. It may even be a syntax error the callables can be skittle tricky to debug and get right.
yeah that is the problem. The test image has width, height and color values, but my image just have width and height. Is there a way I can make it work without the color values?
@henrisco82 ,
The original script dealt with 3D scalar images, no color values. The blended slices are combined and converted to color by repeating the scalar value in all channels (see the line saying "convert grayscale image to color (r,g,b)). As you are working in 2D you will have to modify the code to deal with it (e.g. you don’t need all of the slice extraction, see references to central_index in the script).
The need for using color is because we wanted the similarity metric graph to be in color, so the alpha blended grayscale extracted slices were also converted to color.