scverse / scverse/squidpy

Query Regarding Logic of calculating radius in generate_spot_crops()

Open
#725 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

image :microscope: sdata compat :milky_way:
Dominant language
Python
Stars
598
Forks
121
Avg merge
3d 11h
Merged PRs (30d)
3

Description

Thank you for developing such a valuable tool!

I have a question regarding the logic behind this line of code (https://github.com/scverse/squidpy/blame/ecee104bd165921f7a48934c13ff95599405e3eb/src/squidpy/im/_container.py#L820). I noticed that it performs floor division, followed by rounding, and then converts the result to an integer. However, if the diameter is <= 1, this process returns a radius of 0. This could potentially cause the downstream calculate_image_features() function to generate invalid feature values.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at src/squidpy/im/_container.py around line 820 and trace how generate_spot_crops() passes its radius into calculate_image_features(). Check the behavior when the diameter is <= 1 and whether radius zero produces invalid feature values. Done means establishing the intended radius behavior and verifying the downstream feature calculation for this edge case.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
computer-vision
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.