Open degrainger opened 1 week ago
Yep, you've got the gist of it down. Set the mpp
to whatever you set it to when you made the rescaled H&E image, make sure you're pointing at the correct set of spatial coordinates (the H&E image function crops out the part around the actual captured tissue bit and saves it to the object as .obsm["spatial_cropped"]
by default as shown in the demo) and you're good to go. As for the .npz
contents, it's just a scipy sparse matrix matching the shape of the rescaled H&E image with 0 as the background and integers as the identified objects. You can load one made/saved by bin2cell via scipy.sparse.load_npz()
and take a look around if you want to see.
I just to make sure, I think you got it like kp said, but i would emphasize that i would use the rescaled image from b2c to run your manual segmentation to make sure there isn't some weird precision issues of how images are rescaled.
So pipeline is: read object with b2c -> rescale the he to whatever resolution you want -> take the rescaled image and do your thing -> generate the masks -> convert it to .npz -> read back with insert labels.
In other words I would be careful if you plan to take your original image, scale it externally to the same mpp and then feed it back to b2c
Hello,
Thanks very much for developing and sharing this package, I think it is a great step forward in analysing Visium HD data.
I was wondering if you could advise us on how to import cell segmentation performed outside of bin2cell? If, for example, I wanted to manually curate the cell segmentation and then import it for segmenting Visium HD 2um bins.
I would obiously need to perform this on the rescaled H&E image, save the file, import it, convert it to
.npz
format. Could I then just plug it in tob2c.insert_labels()
?If I've understood
mpp
correctly I would just set it to the pixel size of my input image?Thanks for your support, any tips would be appreciated. Best wishes, Dave