-
Notifications
You must be signed in to change notification settings - Fork 8
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
feat: rgb, v2 #141
feat: rgb, v2 #141
Conversation
Note that histograms are broken :)
These are conventionally RGB(A) images in Python
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #141 +/- ##
==========================================
+ Coverage 80.64% 80.74% +0.10%
==========================================
Files 45 45
Lines 4195 4270 +75
==========================================
+ Hits 3383 3448 +65
- Misses 812 822 +10 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Otherwise the rgb image shows in grayscale :)
It's useful for testing higher-dim RGB data, as might come from a RGB camera MDA via Micro-Manager in the real world
I did not realize that both images and volumes use PyGFXImageHandle
@tlambert03 I'm generally happy with the functionality here and would appreciate your thoughts and high-level review. Couple points I'd like your opinions on:
|
@tlambert03 did you ever get a chance to take a look at this? |
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.
beyond the few small comments, i think everything in here looks good! nice job adding a new feature with minimal lines :)
remaining segfaults do seem to be specific to this PR. locally, I can run |
when running with lldb, I get this:
so there's something going on during the paint event |
wow... i think i might have fixed it with this change. What I think is happening is that running
I believe that warning was getting upcast in tests to an exception. For some reason, simply letting the application process events (where it would have called However, it raises a new point. @gselzer, it probably shouldn't show a warning to simply call |
one more thing, could we add a simple test (in addition to the example test) in |
Yeah, it's probably too much - I'm a fan of silently ignoring changes to the colormap.
Sure! I can give that a shot tomorrow! |
@tlambert03 I've added a RGB magic test, and have removed the warning for setting the cmap on an RGB image. I additionally noticed that the wx/jupyter RGB lut views had a misplaced label (likely from the This took a lot longer than I thought, as I was plagued by qt widget leaks. I'm fairly certain they're coming from the |
thanks, that's a great lead |
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.
LGTM!
@@ -563,7 +598,15 @@ def _get_values_at_world_point(self, x: int, y: int) -> dict[ChannelKey, float]: | |||
values: dict[ChannelKey, float] = {} | |||
for key, ctrl in self._lut_controllers.items(): | |||
if (value := ctrl.get_value_at_index((y, x))) is not None: | |||
values[key] = value | |||
# Handle RGB | |||
if key == "RGB" and isinstance(value, np.ndarray): |
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.
just nothing for the future. I don't love the addition of another special unique key here (I recognize that None
was already that, and I don't have an immediate alternate suggestion at the moment). absolutely fine for now, and maybe forever... just noticed it :)
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.
Yeah...I'm also not a fan, as I mentioned here, but I wrote that for lack of a better option...very open to improving it later!
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.
Ah yes sorry I forgot you pointed that out. Agreed though, it’s a fine workaround
This PR revives the work done in #41, but updated for the new viewer. I'm guessing that the design can be further refined, and there are more bugs to be ironed out.
Still lots of cleaning, testing, bugfixing to do. Notably, there were many comments on #41 that should be gone through and addressed here.