-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Persist color channels in rasterize()
#544
Persist color channels in rasterize()
#544
Conversation
Otherwise named channels will get lost during rasterize, which interferes with referencing them by name when plotting.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks @clwgg , looks good! would you mind adding a release note here? https://github.com/scverse/spatialdata/blob/main/CHANGELOG.md thanks!
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #544 +/- ##
=======================================
Coverage 92.55% 92.55%
=======================================
Files 42 42
Lines 6000 6001 +1
=======================================
+ Hits 5553 5554 +1
Misses 447 447
|
…wgg/spatialdata into rasterize_channel_persistence
Thanks @clwgg! I went for "using if schema in (Image2DModel, Image3DModel): logic instead of the current try: except:"; merging now 😊 |
Fixes scverse/spatialdata-plot#249
Please see the above
spatialdata-plot
issue for a problem description.This is just a draft of how this issue could be addressed. I could see several different routes this could be tackled, including:
if schema in (Image2DModel, Image3DModel):
logic instead of the currenttry: except:
get_channels()
instead ofxdata.coords["c"].values
, although this is a bit awkward sincexdata
is not the correct type forget_channels()
, so one would have to either modifyget_channels()
or call it ondata
instead ofxdata
which feels a little less cleanLet me know what you think!