Skip to content

Instantly share code, notes, and snippets.

@mutterer
Created February 18, 2021 08:12
Show Gist options
  • Save mutterer/c616769fe9c4f988eb102df90be737c8 to your computer and use it in GitHub Desktop.
Save mutterer/c616769fe9c4f988eb102df90be737c8 to your computer and use it in GitHub Desktop.
Applying LUTs when opening a file
// applying a defined LUTs sequence when opening a file.
// suggested by Debora Keller Olivier @olivier_debora
run("Action Bar","/plugins/ActionBar/open_with_lut.ijm");
exit();
<text><html><h2>Drop your image here</h2></html>
<line>
<button>
label=preferences...
arg=<macro>
s=call('ij.Prefs.get','openwithlut.luts',"Cyan,Magenta,Yellow,Grays");
s=getString("LUTs sequence",s);
call('ij.Prefs.set','openwithlut.luts',s);
</macro>
</line>
<DnDAction>
f=getArgument();
open(f);
s=call('ij.Prefs.get','openwithlut.luts',"Cyan,Magenta,Yellow,Grays");
luts=split(s,',');
Stack.getDimensions(width, height, channels, slices, frames);
for(i=1;i<=channels;i++) {
Stack.setChannel(i);
run(luts[i-1]);
}
</DnDAction>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment