Image-Py / sknw

build net work from skeleton image (2D-3D)
BSD 3-Clause "New" or "Revised" License
224 stars 48 forks source link

try to overpass int16 restriction on image size #19

Open AlexeyTrekin opened 2 years ago

AlexeyTrekin commented 2 years ago

The current implementation is restricted to padded image size 32767 due to use of int16 for indexing, so I changed it to int32.

Maybe there should be a condition to use int32 only for bigger images? Didn't find out how to determine the size restriction inside this function.

yxdragon commented 2 years ago

just using int32, that is for the edge pixels, not very large. and in build_graph "os.round().astype(np.uint16)" need change int32 too.

and if the image is so large, there would be another question: in build_sknw we pad the image as uint16, and in parse_struc mark the node 1,2,3,4... if the image is too large, It may contains more than 65535 nodes So maybe wo need pad image as uint32. (cost 2 times memory, and the pad image is very large)