Login  Register

Location of IJ_Props.txt and IJ_Prefs.txt

Posted by Stein Rørvik on Apr 02, 2019; 9:36am
URL: http://imagej.273.s1.nabble.com/Location-of-IJ-Props-txt-and-IJ-Prefs-txt-tp5021963.html

The default loading locations of IJ_Props.txt and IJ_Prefs.txt is inside the ij.jar file and user home directory, respectively.
That is convenient, since the same files then will then "always" be present, also after moving or updating ImageJ.

The issue I have is that for a project I need to have a separate ImageJ folder with a different set of settings (in IJ_Prefs.txt) that conflicts with my default ImageJ installation. Currently, I see no easy way to override the IJ_Prefs.txt file to be used, apart from writing a custom ImageJ launch script that temporarily renames the default file which then must be renamed back afterwards.

Looking at the source, it seems that if IJ_Props.txt and/or IJ_Prefs.txt is missing from the default location, the respective file is attempted loaded from the ImageJ directory instead.

Would it be possible to make the latter case have precedence, so that if IJ_Props.txt and/or IJ_Prefs.txt is present as a file in the ImageJ directory, it will be used instead of the file from the default location?  If not present, the default location should be used.

That will enable many more possibilities for creating customized ImageJ installations, with macros and custom demo images "hardcoded" in the menus if desired. Today this can be done by editing IJ_Props.txt inside the jar, but that change is lost every time ij.jar is updated. It would also ensure that an ImageJ folder with a given set of plugins and macros will always work in the future, since a local IJ_Prefs.txt file would make all settings persistent for that installation.

Also, such a change should not break any existing behaviour, because if a user currently already has a workflow involving deleting the IJ_Props.txt and/or IJ_Prefs.txt file from the default location to make it load from the ImageJ folder instead, the same file would be loaded if the ImageJ folder location got precedence.

Stein


--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html