ImageJ base code to get access to all the classes and their methods to test new Plugins. https://imagejdocu.tudor.lu/howto/plugins/the_imagej_eclipse_howto
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

37 lines
1.0 KiB

3 years ago
  1. // This macro displays, as a montage, all the LUTs in the
  2. // Image>Lookup Tables menu.
  3. saveSettings();
  4. list = getList("LUTs");
  5. setBatchMode(true);
  6. newImage("ramp", "8-bit Ramp", 256, 32, 1);
  7. newImage("luts", "RGB White", 256, 48, 1);
  8. count = 0;
  9. setForegroundColor(255, 255, 255);
  10. setBackgroundColor(255, 255, 255);
  11. setFont("SansSerif", 12,"antialiased");
  12. for (i=0; i<list.length; i++) {
  13. selectWindow("ramp");
  14. run(list[i]);
  15. run("Select All");
  16. run("Copy");
  17. selectWindow("luts");
  18. makeRectangle(0, 0, 256, 32);
  19. run("Paste");
  20. setJustification("center");
  21. setColor(0, 0, 0);
  22. drawString(list[i],128, 48);
  23. run("Add Slice");
  24. run("Select All");
  25. run("Clear", "slice");
  26. count++;
  27. }
  28. run("Delete Slice");
  29. rows = floor(count/4);
  30. if (rows<count/4) rows++;
  31. run("Canvas Size...", "width=258 height=50 position=Center");
  32. run("Make Montage...", "columns=4 rows="+rows
  33. +" scale=1 first=1 last="+count+" increment=1 border=0 use");
  34. rename("Lookup Tables");
  35. setBatchMode(false);
  36. restoreSettings();