clEsperanto / pyclesperanto

GPU-accelerated Image Processing library using OpenCL
https://clesperanto.github.io/pyclesperanto
BSD 3-Clause "New" or "Revised" License
31 stars 6 forks source link

[Bug] the documentation fo bounding_box() is wrong #165

Closed thawn closed 8 months ago

thawn commented 8 months ago

Pre-requist tasks

Describe the bug The Docstring of bounding_box says:

Determines the bounding box of all nonzero pixels in a binary image. If called
from macro, the positions will be stored in a new row of ImageJs Results table
in the columns 'BoundingBoxX', 'BoundingBoxY', 'BoundingBoxZ',
'BoundingBoxWidth', 'BoundingBoxHeight' 'BoundingBoxDepth'.In case of 2D images
Z and depth will be zero.

However, the results are 'BoundingBoxXStart', 'BoundingBoxYStart', 'BoundingBoxZStart', 'BoundingBoxXEnd', 'BoundingBoxYEnd', 'BoundingBoxZEnd'

I think the algorithm is fine as it is, since it allows to use the results for slicing the image without further calculations. However, the documentation should be changed according to the algorithm

To Reproduce

cle.bounding_box()

Expected behavior

The Docstring should be (or similar):

Determines the bounding box of all nonzero pixels in a binary image. If called
from macro, the positions will be stored in a new row of ImageJs Results table
in the columns 'BoundingBoxXStart', 'BoundingBoxYStart', 'BoundingBoxZStart',
'BoundingBoxXEnd', 'BoundingBoxYEnd', 'BoundingBoxZEnd'. In case of 2D images
Z and depth will be zero.
thawn commented 8 months ago

Cool thanks, Stephane 🎉

StRigaud commented 8 months ago

Will be effective in the next release