/** Opens a lookup table (LUT) and returns it as a LUT object, or returns null if there is an error. * @see ij.ImagePlus#setLut */ public static LUT openLut(String filePathOrUrl) { return LutLoader.openLut(filePathOrUrl); }
/** Opens a lookup table (LUT) and returns it as a LUT object, or returns null if there is an error. * @see ij.ImagePlus#setLut */ public static LUT openLut(String filePathOrUrl) { return LutLoader.openLut(filePathOrUrl); }
private void initialize() { String path = IJ.getDirectory("luts"); List<File> files = IOUtils.listFilesInFolder(new File(path), false); luts = new HashMap<String, LUT>(); for (File f : files) { if (FilenameUtils.getExtension(f.getName()).toLowerCase().equals("lut")) { String lutName = FilenameUtils.removeExtension(f.getName()).replace('_', ' '); LUT lut = LutLoader.openLut(f.getAbsolutePath()); luts.put(lutName, lut); model.addElement(lutName); } } }
/** Opens a LUT and returns it as a LUT object. */ public static LUT openLut(String pathOrURL) { FileInfo fi = new FileInfo(); fi.reds = new byte[256]; fi.greens = new byte[256]; fi.blues = new byte[256]; fi.lutSize = 256; int nColors = 0; if (pathOrURL.contains("://")) { fi.url = pathOrURL; fi.fileName = ""; } else { OpenDialog od = new OpenDialog("Open LUT...", pathOrURL); fi.directory = od.getDirectory(); fi.fileName = od.getFileName(); if (fi.fileName==null) return null; } LutLoader loader = new LutLoader(); boolean ok = loader.openLut(fi); if (ok) return new LUT(fi.reds, fi.greens, fi.blues); else return null; }
/** Opens a LUT and returns it as a LUT object. */ public static LUT openLut(String pathOrURL) { FileInfo fi = new FileInfo(); fi.reds = new byte[256]; fi.greens = new byte[256]; fi.blues = new byte[256]; fi.lutSize = 256; int nColors = 0; if (pathOrURL.contains("://")) { fi.url = pathOrURL; fi.fileName = ""; } else { OpenDialog od = new OpenDialog("Open LUT...", pathOrURL); fi.directory = od.getDirectory(); fi.fileName = od.getFileName(); if (fi.fileName==null) return null; } LutLoader loader = new LutLoader(); boolean ok = loader.openLut(fi); if (ok) return new LUT(fi.reds, fi.greens, fi.blues); else return null; }
if (fi.fileName==null) return; if (openLut(fi)) showLut(fi, arg.equals("")); IJ.showStatus("");
if (fi.fileName==null) return; if (openLut(fi)) showLut(fi, arg.equals("")); IJ.showStatus("");