Skip to content

Instantly share code, notes, and snippets.

@tferr
Forked from mutterer/multichannel_profile_plot.ijm
Last active August 29, 2015 14:09
Show Gist options
  • Save tferr/863b630d7da2dbcdbed0 to your computer and use it in GitHub Desktop.
Save tferr/863b630d7da2dbcdbed0 to your computer and use it in GitHub Desktop.
// yet another multichannel profile plotter
// with smart(?) lookuptables
Stack.getDimensions(w, h, c, z, t);
p = getProfile();
getStatistics(null, null, min, max);
Plot.create("Multi-Channel Profile Plot", "Distance (pixels)", "Value");
Plot.setLimits(0,p.length,min,max);
for (i=1;i<=c;i++) {
Stack.setChannel(i);
p = getProfile();
Plot.setColor(getLutColorName());
Plot.add("line", p);
}
Plot.show();
function getLutColorName() {
colors = newArray("black","blue","green", "cyan", "red", "magenta", "yellow", "black");
getLut(reds, greens, blues);
col = round(reds[255]/200)<<2+round(greens[255]/200)<<1+round(blues[255]/200);
return colors[col];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment