sq.im.calculate_image_features() - scale factors for cropped image
@michalk8 is already working on this.
Since Apr 13, 2023.
- Dominant language
- Python
- Stars
- 598
- Forks
- 121
- Avg merge
- 3d 11h
- Merged PRs (30d)
- 3
Description
Description
Hi,
Thank you for the great package. I am having an issue with sq.im.calculate_image_features(), as previously mentioned in #399.
I provide the scale factor when initialising the ImageContainer, as mentioned in #399.
When using an uncropped tif image, I can successfully use sq.im.calculate_image_features(). However, with a cropped image I get the same error as mentioned previously (below).
I'd thought that I may need to re-provide scale factors for the cropped image. Do you have any suggestions about how I'd do this?
Many thanks.
scale = adata.uns['spatial'][f'{SAMPLE_NAME}']['scalefactors']['tissue_hires_scalef']
img = sq.im.ImageContainer('/path_to_tif/img.tif', scale = scale)
crop = img.crop_corner(5000, 3000, size=500)
sq.im.segment(img=crop,
layer="image",
layer_added="segmented_watershed",
method="watershed",
channel=0,
qeq=False)
sq.im.calculate_image_features(
adata,
crop,
layer='image',
features="segmentation",
key_added="segmentation_features",
mask_circle=True)
ValueError: Expected 'height' to be in interval '[0, 500]', found '-4390'.
Version
1.2.3
...
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.