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
I'm thinking there's a problem with the way I'm registering adata.uns['spatial'], another option I've tried is: spatial_key = "spatial" library_id = "CHANGE" adata.uns[spatial_key] = {library_id: {}} adata.uns[spatial_key][library_id]["images"] = {} adata.uns[spatial_key][library_id]["images"] = {"hires": np.transpose(mpif, (1,2,0))} adata.uns[spatial_key][library_id]["scalefactors"] = { "tissue_hires_scalef": 1, "spot_diameter_fullres": 0.5, }
Which is closer to the documentation but still I am unable to get the feature extraction to work. It seems that it cannot find the segmentation mask. Is there a way around this? Thanks!
The text was updated successfully, but these errors were encountered:
Hello, thanks for an awesome package! I am currently trying to extract image features within a segmentation mask and here is my set up so far:
mpif = tiff.imread('mpif_cropped.ome.tiff')
mask = tiff.imread('cellpose_mask_cropVFS-25489.ome.tif')
hae = tiff.imread('hae_cropped.ome.tiff')
image = sq.im.ImageContainer(mpif, layer='mpif')
image.add_img(mask, layer='mask')
image.add_img(hae, layer='hae')
adata = ad.AnnData(obs=pd.DataFrame(index=range(len(centroids))), obsm={"spatial": centroids})
adata.uns['spatial'] = {'images' : image}
sq.im.calculate_image_features( adata, img=image, layer='mpif', features='segmentation', n_jobs=16, features_kwargs={ 'segmentation': { 'props': ['area', 'centroid'], 'label_layer': 'mask' } } )
I'm thinking there's a problem with the way I'm registering adata.uns['spatial'], another option I've tried is:
spatial_key = "spatial"
library_id = "CHANGE"
adata.uns[spatial_key] = {library_id: {}}
adata.uns[spatial_key][library_id]["images"] = {}
adata.uns[spatial_key][library_id]["images"] = {"hires": np.transpose(mpif, (1,2,0))}
adata.uns[spatial_key][library_id]["scalefactors"] = { "tissue_hires_scalef": 1, "spot_diameter_fullres": 0.5, }
Which is closer to the documentation but still I am unable to get the feature extraction to work. It seems that it cannot find the segmentation mask. Is there a way around this? Thanks!
The text was updated successfully, but these errors were encountered: