Returns the LUT 'name' as an IndexColorModel, where 'name' can be any entry in the Image/Lookup Tables menu. @see ij.IJ#getLuts See: Help>Examples>JavaScript/Show all LUTs
(String name)
| 27 | * See: Help>Examples>JavaScript/Show all LUTs |
| 28 | */ |
| 29 | public static IndexColorModel getLut(String name) { |
| 30 | if (name==null) return null; |
| 31 | LutLoader ll = new LutLoader(); |
| 32 | FileInfo fi = ll.getBuiltInLut(name.toLowerCase()); |
| 33 | if (fi.fileName!=null) |
| 34 | return new IndexColorModel(8, 256, fi.reds, fi.greens, fi.blues); |
| 35 | String path = IJ.getDir("luts")+name+".lut"; |
| 36 | IndexColorModel lut = LutLoader.openLut("noerror:"+path); |
| 37 | if (lut==null) { |
| 38 | path = IJ.getDir("luts")+name.replaceAll(" ","_")+".lut"; |
| 39 | lut = LutLoader.openLut("noerror:"+path); |
| 40 | } |
| 41 | return lut; |
| 42 | } |
| 43 | |
| 44 | /** If 'arg'="", displays a file open dialog and opens the specified |
| 45 | LUT. If 'arg' is a path, opens the LUT specified by the path. If |
no test coverage detected