New script time! I recommend clicking the Raw button on the right and then selecting all-> copy/paste into QuPath.
This script creates a set of buttons on the top of the QuPath GUI bar that allow a user to quickly flip between pre-selected Measurement Maps settings. Not only does this make it much quicker to select a measurement of interest in what may otherwise be quite a long list (8 channel IF images have 125 by default!), it allows/forces you to set multiple fixed thresholds for the color map. That last bit makes it much easier to compare measurement colors between images. Normally the color map automatically selects thresholds based on the highest and lowest value in current image’s list of detections… which is less useful if, for example, one entire image is your negative control.
To demonstrate, I went right back to the LuCa 7 color image from the multiplex classification script guide, generated some cells, and then went through the actual Measurement Maps to pick out some good min and max values for my measurements of interest. Next, you need to manually enter the list of measurements, minimum and maximum values, and names for your buttons. I suggest keeping the button names to one or two characters so they fit in your window, though you can expand the buttons if you want longer names. All variables can be entered at the top of the script.
Mine ended up looking like:
//Keep these labels fairly short, or increase the button size. Be careful about having enough room! int buttonSize = 40 String buttonLabels = ["1C","2C", "3N", "4C", "5C", "6C"] as String String names = ["Cytoplasm: Channel 1 mean", "Cytoplasm: Channel 2 mean", "Nucleus: Channel 3 mean", "Cytoplasm: Channel 4 mean", "Cytoplasm: Channel 5 mean", "Cytoplasm: Channel 6 mean"] as String double minValue= [0,0,0,0,0,0] double maxValue= [18, 1,6,1,20,10]
The only checks for whether everything is typed correctly is a quick test to make sure all lists are the same length, so make sure you type everything correctly.
Once you run the script, you should get a string of buttons including a “Clear” button to the right of the other buttons in your normal GUI. Mine looked like the following:
The only way to remove the buttons currently is to close that instance of QuPath, and the buttons do not persist when closing and reopening the program.
Clicking on any of the buttons sets the measurement map to the selected measurement, and Clear returns you to the default view. Note this is ONLY an overlay coloring, it does not affect or interfere with cell classification coloring. Even if you want it to That could be another script, potentially.
Enjoy! And as usual let me know if you have any questions, comments, concerns or more importantly, find any bugs! So far it seems to be compatible with both 0.2.0m2 and earlier versions.