Skip to content
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

When a channel is selected in one of the RGB menus, change plot without undoing changes from OpenCV #25

Closed
twongjirad opened this issue May 6, 2016 · 6 comments
Assignees

Comments

@twongjirad
Copy link
Member

This way, I can erase data from all channels.

Right now, I have to hit Replot to change the viewed channels. But this reloads the image from disk and undoes any modifications.

@twongjirad
Copy link
Member Author

Proposed solution is here: 33207d2

This requires a redesign of the data interface layer. Right now we have orig_mat and plot_mat. The latter is thresholded for viewing contrast only. orig_mat on the other hand represents a working copy of the images that can get modified by cv and then passed to the network.

However, orig_mat and plot_mat are only 3 channels. For more channels (like the 12 channel data), we want to be able to swap the channels stored in both orig_mat and plot_mat while retaining the changes in orig_mat.

So here I added (in ch12image.py) another copy of the images: work_mat. This has all 12 channels. When channels are swapped, the contents of orig_mat are put into work_mat, and then the values of the new channels to view from work_mat are put into orig_mat.

This is big change in structure. So I will initiated a pull request that @vgenty should review. Maybe he will have a better solution more inline with his vision.

@twongjirad
Copy link
Member Author

As promised: #26

@twongjirad twongjirad self-assigned this May 6, 2016
@vgenty
Copy link
Member

vgenty commented May 6, 2016

Thanks for this fix, I don't have an issue with this method thanks for implementing. I didn't anticipate 12 channel image at all and I'm kicking myself in the butt during this whole process. The intermediate swapping matrix is necessary since with OpenCv the current set up and only operate on 3 channels at a time, swapping in and out is a fantastic addition. One more thing -- I notice that plotData had "refresh" as an input and it didn't look like it was being used so I removed, I hope this is OK

@vgenty
Copy link
Member

vgenty commented May 6, 2016

I will go in and make sure the image types -- false color and defaultimage follow the same procedure. Although as Kazu probably already mentioned it's probably better to have a standard way to load the image eliminating the need for someone to subclass PlotImage. I thought it was a good idea at the time but maybe blew up in my face when caffe interface came along. Growing pains!

@vgenty
Copy link
Member

vgenty commented May 6, 2016

forgot the commit number for plotData refresh: 57a13d1

@twongjirad
Copy link
Member Author

Yes. Thanks for noticing the useless refresh variables! They were from a previous attempt. Then I decided to go with a new function (swap_...) entirely.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants