MCPcopy Create free account
hub / github.com/AstroImageJ/astroimagej / openLut

Method openLut

ij/src/main/java/ij/plugin/LutLoader.java:303–330  ·  view source on GitHub ↗

Opens a LUT and returns it as a LUT object.

(String pathOrURL)

Source from the content-addressed store, hash-verified

301
302 /** Opens a LUT and returns it as a LUT object. */
303 public static LUT openLut(String pathOrURL) {
304 boolean noError = pathOrURL.startsWith("noerror:");
305 if (noError)
306 pathOrURL = pathOrURL.substring(8);
307 FileInfo fi = new FileInfo();
308 fi.reds = new byte[256];
309 fi.greens = new byte[256];
310 fi.blues = new byte[256];
311 fi.lutSize = 256;
312 int nColors = 0;
313 if (pathOrURL.contains("://")) {
314 fi.url = pathOrURL;
315 fi.fileName = "";
316 } else {
317 OpenDialog od = new OpenDialog("Open LUT...", pathOrURL);
318 fi.directory = od.getDirectory();
319 fi.fileName = od.getFileName();
320 if (fi.fileName==null)
321 return null;
322 }
323 LutLoader loader = new LutLoader();
324 loader.suppressErrors = noError;
325 boolean ok = loader.openLut(fi);
326 if (ok)
327 return new LUT(fi.reds, fi.greens, fi.blues);
328 else
329 return null;
330 }
331
332 /** Opens an NIH Image LUT, 768 byte binary LUT or text LUT from a file or URL. */
333 boolean openLut(FileInfo fi) {

Callers 5

getLutMethod · 0.95
runMethod · 0.95
getMaskColorMethod · 0.95
openLutMethod · 0.95
getGroupColorMethod · 0.95

Calls 12

getDirectoryMethod · 0.95
getFileNameMethod · 0.95
errorMethod · 0.95
openBinaryLutMethod · 0.95
openTextLutMethod · 0.95
errorMethod · 0.95
startsWithMethod · 0.80
substringMethod · 0.80
lengthMethod · 0.65
containsMethod · 0.45
equalsMethod · 0.45
getFilePathMethod · 0.45

Tested by

no test coverage detected