You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In this method the selection bounds return object is given as a new RealRect(xMin, yMin, xMax - xMin, yMax - yMin) (see constructor). xMin/xMax/yMin/yMax are found by calling realMin(dimension) or realMax(dimension) on the Data object of the input ImageDisplay's DataView or from the ImageDisplay's bounds itself. For example, an image image of size 256/256, xMin/yMin will be 0 and xMax/yMax will be 255. This causes image.width and image.height, according to the above, to be 255, which is wrong, since it causes plugins like this one to not calculate the last column/row (see the driving for-loop here).
The text was updated successfully, but these errors were encountered:
For an image of 256x256 pixels, the real width and height are actually 255.0 (max-min), since pixels are just sample points, not squares, right? Maybe the API should be changed to return a net.imglib2.roi.geom.real.ClosedWritableBox here instead of a RealRect? The closed boundary would make sure that all border pixels are included in the selection.
@imagejan yeah, I was thinking about that when I wrote the issue. I suppose it depends on how we are defining width/height here, as number of pixels or as a measure of distance (I was naively assuming the former). I just took a look at some of the other plugins relying on this method and some (like this one) assume width/height to be as you suggested, not like Sharpen/Smooth.
I am also hesitant to change the API of this method since it would break all of the plugins that might be calling it. Now that I am doing some more digging, maybe this is more of an issue with Neighborhood3x3Operation, since other plugins that call this method but do not use Neighborhood3x3Operation (like the one linked above) do not look like they have this issue. And, seeing as how some of these plugins using Neighborhood3x3Operation are being converted into Ops anyways (see imagej/imagej-ops#557 and imagej/imagej-ops#556), maybe we should just deprecate these faulty plugins, which would also keep reproducability
In this method the selection bounds return object is given as a
new RealRect(xMin, yMin, xMax - xMin, yMax - yMin)
(see constructor).xMin
/xMax
/yMin
/yMax
are found by callingrealMin(dimension)
orrealMax(dimension)
on theData
object of the inputImageDisplay
'sDataView
or from theImageDisplay
's bounds itself. For example, an imageimage
of size 256/256,xMin
/yMin
will be 0 andxMax
/yMax
will be 255. This causesimage.width
andimage.height
, according to the above, to be 255, which is wrong, since it causes plugins like this one to not calculate the last column/row (see the driving for-loop here).The text was updated successfully, but these errors were encountered: