Closed yuerua closed 5 months ago
Hello, thanks for raising this issue. If I understand correctly, this error is generated when there are more than 65,535 nuclei detected in an input image. A potential workaround is to add a couple of parameters under nuclei
, in the yaml file, for example:
nuclei:
diameter: # estimated diameter of nuclei for Cellpose - or None to automatically compute, default: None
max_height: 4000
max_width: 4000
In this example the input DAPI size to Cellpose is limited to a 4000x4000 patch. BIDCell will do patching and stitching of the nuclei internally. There should be fewer nuclei in smaller patches and hopefully should overcome this problem. Hope this helps
Hi team, thank you for making this great tool! I tested it on some in-house Xenium samples, and for a few images it threw the error below:
This is due to an internal error in this specific version of CellPos, which occurs to images with values over 65,535, as stated in this post
As a temporary solution, I changed line 727 in
site-packages/cellpose/transforms.py
to belowimgs = cv2.resize(img0.astype("float32"), (Lx, Ly), interpolation=interpolation).round().astype("uint32")
This change bypassed the CV2 error. However, it also caused the nuclei segmentation to generate an empty mask, leading to an error in
preannotate.py
Is there a better solution to this?