1/9
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai | Chat |
|---|
No analytics yet
Send a link to your students to track their progress
What function converts a Labels element into exact polygon/multipolygon Shapes?
to_polygons()
What function converts a Labels element into approximate circle Shapes?
to_circles()
What's a known limitation of to_circles()?
For a label with multiple disconnected components (e.g. a multipolygon), the resulting circle's centroid can end up outside the actual shape.
What does target_unit_to_pixels control in rasterize()?
The output image resolution → e.g. 0.1 produces roughly ⅒ the pixels.
What does default rasterization do when shapes overlap?
Counts overlaps → pixel values are 0, 1, 2... depending on how many shapes cover that pixel.
What does instance_key_as_default_value_key=True do, and what's its limitation?
Gives each shape a distinct pixel value instead of a count but where shapes overlap, only the first shape is kept.
What does return_single_channel=False do, and when is it recommended?
Produces one channel per shape (no overlap information lost) → recommended only for a small number of large shapes, since memory cost scales with shape count.
What is rasterize_bins() specifically designed for?
Grid-like "binned" data (like Visium HD) with millions of geometries arranged in a regular but possibly rotated grid.
Why should you never call .compute() on the full output of rasterize_bins()?
It's a lazy object that could represent ~180 GB of data for a real Visium HD dataset → access it channel-wise instead (.sel(c=...)).
What extra information does rasterize_bins() compute and store?
The affine transformation needed to align the rasterized (possibly rotated) grid with the original high-resolution image.