You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thank you very much for developing this wonderful tool!
I would like to export the final segmentation mask to QuPath. I have managed to convert the HE and GEX .npz files into GeoJSON files, but now I would like to export the label_joint data.
Is it possible to generate an .npz or geojson file from this metadata?
I don't have hands-on experience with GeoJSON, but based on the Wikipedia example you can specify a polygon by its four vertices, and also provide properties which should hopefully be able to hold the object name? So in principle you'd be able to specify multiple polygons for the same label.
If that is the case, you can get the four vertices of the square bin i,j by computing the midpoint between its centroid (as reported in spatial coordinate space) and the centroids of bins i-1,j-1, i-1,j+1, i+1,j-1 and i+1,j+1.
Thank you very much for your quick reply!
I was wondering whether it would be possible to obtain an NPZ file similar to those generated after segmentation with StarDist (he.npz and gex.npz).
We could then convert it into GeoJSON.
The NPZ files contain a segmentation mask matching the size of the processed morphology image, as you know as you converted them. The easiest way to generate one would be to iteratively populate a blank mask via cv2.fillPoly(), providing the same vertices as what you'd export in the GeoJSON.
Activity
ktpolanski commentedon Dec 11, 2025
I don't have hands-on experience with GeoJSON, but based on the Wikipedia example you can specify a polygon by its four vertices, and also provide
propertieswhich should hopefully be able to hold the object name? So in principle you'd be able to specify multiple polygons for the same label.If that is the case, you can get the four vertices of the square bin
i,jby computing the midpoint between its centroid (as reported inspatialcoordinate space) and the centroids of binsi-1,j-1,i-1,j+1,i+1,j-1andi+1,j+1.ChristelleBrest commentedon Dec 11, 2025
Thank you very much for your quick reply!
I was wondering whether it would be possible to obtain an NPZ file similar to those generated after segmentation with StarDist (he.npz and gex.npz).
We could then convert it into GeoJSON.
ktpolanski commentedon Dec 11, 2025
The NPZ files contain a segmentation mask matching the size of the processed morphology image, as you know as you converted them. The easiest way to generate one would be to iteratively populate a blank mask via
cv2.fillPoly(), providing the same vertices as what you'd export in the GeoJSON.