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

Customizable Heatmap Colors #93

Closed
birm opened this issue Feb 24, 2020 · 13 comments
Closed

Customizable Heatmap Colors #93

birm opened this issue Feb 24, 2020 · 13 comments
Assignees
Labels

Comments

@birm
Copy link
Member

birm commented Feb 24, 2020

Is your feature request related to a problem? Please describe.
The current color scheme for the heatmaps are often useful, but may not be conveyant or visible in all contexts

Describe the solution you'd like
Addition of a mechanism to let a user define a heatmap color function (takes in the value(s) for a patch, outputs a color)

Describe alternatives you've considered
Different possible options include just adding presets, use of a single color gradient, etc.
Could also include taking in multiple fields to make a color (at simplest, imagine variables a,b,c -> r,g,b)

@saphal1998
Copy link

I'd like to work on this issue @birm

Can you assign it to me?

@birm
Copy link
Member Author

birm commented Feb 27, 2020

Hello, and thanks for your interest. Looking at https://github.com/camicroscope/caMicroscope/blob/0971f1368894d000464c481c713a3392e0f6ea80/core/extension/osd-heatmap-overlay.js#L803 may be useful, as it's where colors are set. also, this code was written by @nanli-emory who may have additional pointers/advice.

@saphal1998
Copy link

@birm I would like some more information about how to setup the project and in general, how to recreate the problem at hand. Could you please maybe list down some steps on how to recreate the current setting?

I've run the docker-compose up and have all the deps installed. I think I would just like help in visualising what this feature request is exactly.

@cz2h
Copy link

cz2h commented Mar 2, 2020

@birm Hi, can I try to address this problem as well?

@birm
Copy link
Member Author

birm commented Mar 2, 2020

Hello; you may find it useful to add a test heatmap to a slide; see

heatmap_data = []
for the data we use for smoke testing. Run something like this (with the slide id replaced with one to add the heatmap to) against mongo (docker exec -it ca-mongo mongo then use camic) That should show the current color scheme.

@birm
Copy link
Member Author

birm commented Mar 2, 2020

@zengchu2 Sure! It's entirely possible the two of you end up with solutions that work well together too!

@birm birm assigned cz2h Mar 6, 2020
@saphal1998
Copy link

Sir, after some trial and error, I have been able to get the fake heatmaps using the mongo shell, It seems to coat the entire image with a purple-ish hue. I have some follow up questions if I am to solve this issue.
Screenshot 2020-03-15 at 11 39 04 PM

  1. How exactly are we setting the heatmap and what does this snippet mean?
    heatmap_data = []; for (var i = 0; i < 1; i += 0.007243258749282846) { for (var j = 0; j < 1; j += 0.010489147367327867) { heatmap_data.push([i, j, Math.random(), Math.floor(Math.random() * 10)]); } }
    More specifically, what do the variables i & j here stand for?

  2. I have not been able to locate the files to make these changes in the Distro repo, I think I need a better understanding of the flow or where exactly to put the code to make sure that it appears in the application, I believe the changes should be made in the core repo, but I am not sure.

  3. I wanted to know what is the role of the following as well in the heatmaps we insert in the DB
    fields: [ { name: "necrosis", range: [0, 1] }, { name: "tumor", range: [0, 10] } ],

@birm
Copy link
Member Author

birm commented Mar 18, 2020

this document should be reasonably useful -- https://github.com/camicroscope/Distro/blob/develop/data_types.md

Please let me know if it's missing details you find important.

@birm
Copy link
Member Author

birm commented Mar 18, 2020

To see heatmap colors as mentioned, change the mode to gradient under the gear menu.

@nanli-emory
Copy link
Member

This is a pretty useful doc to explain heatmap data model [Camic Heatmap Data Model and Rendering]
https://docs.google.com/document/d/1ckiwENsYIq1t7585Y6fxixXukVxAvoEwi0B6qp4QT88/edit#heading=h.b22n6ceohm0y

@rahuldeepattri
Copy link

rahuldeepattri commented Mar 25, 2020

Hi from what i was able to find that we have two modes for drawing the heatmap, binal and gradient.
In the heatmap generated in test seed, we have a default blue color for heatmap in binal mode.

The requirement is to implement a feature where user can give an input and color of heatmap is changed for both binal and gradient modes? The code here tries to get colors. But the at line https://github.com/camicroscope/caMicroscope/blob/39d2d683dc73619190b3f8b57d8f69272dbfcb63/core/extension/osd-heatmap-overlay.js#L808 we have fixed set of colors.

This is a pretty useful doc to explain heatmap data model [Camic Heatmap Data Model and Rendering]
https://docs.google.com/document/d/1ckiwENsYIq1t7585Y6fxixXukVxAvoEwi0B6qp4QT88/edit#heading=h.b22n6ceohm0y

The test seed uses the Heatmap Data Model as mentioned in above document, what is the use of Heatmap Edited Data Model described in the document?

Also other than test seed how the heatmap data is generated, What is the ideal flow in production?

@birm
Copy link
Member Author

birm commented Mar 25, 2020

Yes, the task is about letting people add different colors (either more presets or letting users choose directly, or something of that sort).
Heatmaps are currently generated by pipelines which are a little outside of scope of caMicroscope itself, at least for now.

@birm
Copy link
Member Author

birm commented Apr 2, 2020

Thanks @rahuldeepattri!

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

No branches or pull requests

5 participants