// macro to make line plots // will select different colours to plot // handles 8, 16 and 32 bit images as well as > 3 channels // Would be nice to give option for relative, absolute and/or maximum values // // version 4.1; Solved problem with x-coordinates in scaled images. // Kees Straatman, University of Leicester 13 May 2013 p = 0; //counter for presence of plot intensityBottom=0; color = "black"; getVoxelSize(vw, vh, vd, unit); //Check bit deth and ser intensity range for the plot if (bitDepth==8)intensityTop=255; if (bitDepth==16)intensityTop=4095; if (bitDepth==24){ intensityTop=255; run("Make Composite"); } if (bitDepth==32) intensityTop=65536; if ((Stack.isHyperstack)||(is("composite"))){ Stack.getDimensions(width, height, channels, slices, frames); } else channels = 1; channel = newArray(channels); // to allow single channel profile in color for (i=0; i 1){ Dialog.create("channels"); Dialog.addMessage("Which channels do you want to plot?"); for (i=0; i1) Stack.setChannel(i); if(channel[i-1]==true){ getLut(reds, greens, blues); if ((reds[i]==i)&&(greens[i]==0)&&(blues[i]==0)) color = "red"; if ((reds[i]==0)&&(greens[i]==i)&&(blues[i]==0)) color = "green"; if ((reds[i]==0)&&(greens[i]==0)&&(blues[i]==i)) color = "blue"; if ((reds[i]==0)&&(greens[i]==i)&&(blues[i]==i)) color = "cyan"; if ((reds[i]==i)&&(greens[i]==0)&&(blues[i]==i)) color = "magenta"; if ((reds[i]==i)&&(greens[i]==1)&&(blues[i]==0)) color = "yellow"; if ((reds[i]==i)&&(greens[i]==i)&&(blues[i]==i)) color = "black"; // plot different colours if (p==0){ profile=getProfile(); Plot.create("multi Channel Plot", "Distance("+unit+")", "Intensity"); Plot.setLimits(0, profile.length*vw-1,intensityBottom,intensityTop); p=1; } // Scale the profiles for correct x-coordinates run("Plot Profile"); Plot.getValues(x, y); close(); Plot.setColor(color); Plot.add("line",x,y); } }