imglib / imglib2

A generic next-generation Java library for image processing
http://imglib2.net/
Other
293 stars 93 forks source link

Too strict assertion `RealRandomAccess.setPositionAndGet` #320

Closed bogovicj closed 1 year ago

bogovicj commented 1 year ago

@axtimwalde

The RealPositionable.setPosition(double[]) API says:

position - absolute position, length must be ≥ EuclideanSpace.numDimensions()

emphasis on greater than or equal to numDimensions.

But the default methods RealRandomAccess.setPositionAndGet assert for equality:

https://github.com/imglib/imglib2/blob/5c548b4701f8668e151bb931cba4e577c405fcd1/src/main/java/net/imglib2/RealRandomAccess.java#L160

I would expect the assertion to read

 assert position.numDimensions() >= numDimensions(); 
bogovicj commented 1 year ago

fixed by #321