ITK5 - Bug in itkPolygonSpatialObject (SpatialObjectToImage3.cxx)

(John Addams) #1

The example SpatialObjectToImage3.cxx does not create a binary image from a polygon using the new ITKv5, it only generates black images. The problem is probably in itkPolygonSpatialObject. Other spatial objects (i.e. itkEllipseSpatialObject, itkTubeSpatialObject, itkGaussianSpatialObject) work correctly. Do you know any way to fix it up?

(Dženan Zukić) #2

Welcome to the community John!

@Stephen_Aylward should be able to offer some advice.

(Matt McCormick) #3

@johnaddams there have been a number of recent changes related to Spatial Objects – what version of ITK are you using?

(John Addams) #4

I am using ITK version 5.0.0 (master branch). Although the example SpatialObjectToImage3.cxx follows the ITK5 migration rules, it does not work as expected.

(Stephen Aylward) #5

There was a bug in the implementation of IsInsideObjectSpace(pnt) for the PolygonSpatialObject, this is now fixed in pull request #747.

Thanks for the report!

(John Addams) #6

Thanks @Stephen_Aylward! But unfortunately, it seems that the bug is not completely fixed. The example SpatialObjectToImage3.cxx still doesn’t work using your latest ITKv5 commit. Could you please check this example out?

forum

(Francois Budin) #7

Hello @johnaddams,

When you say that @Stephen_Aylward’s PR doesn’t completely solve your issue, do you mean that you downloaded his PR (as opposed to master)?

(John Addams) #8

Thank you @fbudin for pointing out my mistake. Using @Stephen_Aylward’s PR works perfectly fine. My apologies, I was using before the master.

@Stephen_Aylward, thank you again for solving the bug so fast.

(Francois Budin) #9

@johnaddams: Thanks for testing! I merged #752 which is the same as #747 with one style comment addressed. Hopefully you should be able to use ITK on master now.

(Francois Budin) #10

The patch has now been merged.

1 Like