Login  Register

Relative location of files & LUT loading

Posted by Gabriel Landini on Dec 30, 2005; 4:41pm
URL: http://imagej.273.s1.nabble.com/Relative-location-of-files-LUT-loading-tp3704122.html

Hi I have 2 issues that I do not seem to be able to resolve.

1. I am writing a LUT plugin applier so one can see the LUTs available before
applying it.
I am having trouble to direct the LUT importer because under linux, the path
is expected to be described in full.

For example, it does not find:
IJ.run("LUT... ", "path='\\ImageJ\\plugins\\Color\\LUTs\\"+LUTffile.lut+"'");

but expects
IJ.run("LUT... ",
"path='\\home\\gabriel\\ImageJ\\plugins\\Color\\LUTs\\"+LUTffile.lut+"'");

This is less than ideal, because it will run only in those IJ users running
linux and called "gabriel" :-)

Is there a way to make the directory relative to the IJ directory (so it is
independent of user or platform? Or what is the path of IJ at run time
without having to use the Open Dialog?


2.  In my List_LUTs plugin I had to put some delay to allow an image to apply
an LUT before converting it to RGB.

IJ.run("LUT... ", "path='"+dir+list[i]+"'");
IJ.wait(200);
IJ.run("RGB Color");

It seems that the plugin sends the command to import the LUT, but the image
conversion to RGB can take place before the LUT has been applied (and thus
gives an error as the file is not 8bit grey anymore.
Is there a solution to this other than inserting the delay as above?

Many thanks.

Gabriel