Closed xiuliren closed 3 years ago
Sorry I just saw this Jingpeng! It looks like the problem is that the array order is C. I call labels = fastremap.asfortranarray(labels)
but it looks like that didn't perform an in-place transpose. I'll have to investigate more.
As a note, it does work if you do seg = fill_voids.fill(seg, in_place=True)
but you shouldn't have to.
I think I figured it out. The fastremap.asfortranarray
does an in-place transposition but doesn't reset the C/F flags on the array. I'll need to fix that in fastremap. Since the array is now transposed, assert seg[4,3,2] == True
works...
On further consideration, the numpy documentation says that there's no way to set C/F on an existing array view. https://numpy.org/doc/stable/reference/generated/numpy.ndarray.setflags.html#numpy.ndarray.setflags it looks like you have to use the equal sign. :-/ More clumsy than I'd like. The alternative would be for me to write a fill_voids for C and F order arrays or to re-transpose C order arrays back to the way they were after going through fill_voids.
thanks for investigating this! I'll just use the equal sign for now.
is this code expected to pass?