Returns, as an array of strings, a list of the LUTs in the Image/Lookup Tables menu. @see LutLoader#getLut See also: Help>Examples>JavaScript/Show all LUTs and Image/Color/Display LUTs
()
| 2569 | * and Image/Color/Display LUTs |
| 2570 | */ |
| 2571 | public static String[] getLuts() { |
| 2572 | ArrayList list = new ArrayList(); |
| 2573 | Hashtable commands = Menus.getCommands(); |
| 2574 | Menu lutsMenu = Menus.getImageJMenu("Image>Lookup Tables"); |
| 2575 | if (commands==null || lutsMenu==null) |
| 2576 | return new String[0]; |
| 2577 | for (int i=0; i<lutsMenu.getItemCount(); i++) { |
| 2578 | MenuItem menuItem = lutsMenu.getItem(i); |
| 2579 | String label = menuItem.getLabel(); |
| 2580 | if (label.equals("-") || label.equals("Invert LUT") || label.equals("Apply LUT")) |
| 2581 | continue; |
| 2582 | String command = (String)commands.get(label); |
| 2583 | if (command==null || command.startsWith("ij.plugin.LutLoader")) |
| 2584 | list.add(label); |
| 2585 | } |
| 2586 | return (String[])list.toArray(new String[list.size()]); |
| 2587 | } |
| 2588 | |
| 2589 | static void abort() { |
| 2590 | if ((ij!=null || Interpreter.isBatchMode()) && macroInterpreter==null) |
no test coverage detected