When called during macro composite image will only display first channel



Sorry if this has already been discussed - I searched but couldn’t find anything.

I have a macro that runs on 3 or 4 channel images. It thresholds the nucelus based on the DAPI channel and then invites the user to draw ROIs using the paintbrush tool. At this step ImageJ often only (but not consistently) shows the first channel despite the image being a composite (sometimes a horizontal line of the composite appears on the image too). I’ve used both the selectWindow and selectImage commands to no different result. It can usually be overcome by clicking on the window of the image but it’s quite irritating because this macro is used by quite a few people and at the moment I have to have a dialogue box to tell individuals to click on the image window to get it to display correctly because without it they can’t choose their ROI.

I was just wondering if maybe there were people who had experienced this and found a way round it?


Hi @lmurphy,

Did you try to re-set the display mode to composite with Stack.setDisplayMode("composite") already? Additionally, you could try to explicitly trigger an update (and redrawing) of an image with updateDisplay() (your observation that activating the image fixes the problem points in that direction…).



Hi @stelfrich,

Sorry for late reply, I managed to find updateDisplay() through some more intensive searching and it worked. Thanks a lot for the reply.