John-P / wsic

Whole Slide image (WSI) conversion for brightfield histology images
MIT License
33 stars 4 forks source link

:sparkles: Validation & Handle Negative Index Wrap #101

Open ajinkya-kulkarni opened 1 year ago

ajinkya-kulkarni commented 1 year ago
  1. The function now raises a ValueError if the downsample factor is not greater than 0 - downsample_shape
  2. wrap_index includes handling negative indices and indices that exceed the bounds of the array.
  3. view_as_blocks includes checking that the block shape is a divisor of the array shape to avoid errors, and removing the unnecessary numpy.ravel() call.
John-P commented 1 year ago

I am curious what your use case is for negative indexing with the wrap_index function, as it is only used when writing files which must be in increasing order.