Location of IJ_Props.txt and IJ_Prefs.txt

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Location of IJ_Props.txt and IJ_Prefs.txt

Stein Rørvik
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
Reply | Threaded
Open this post in threaded view
|

Re: Location of IJ_Props.txt and IJ_Prefs.txt

Wayne Rasband-2
> On Apr 2, 2019, at 5:36 AM, Stein Rørvik <[hidden email]> wrote:
>
> 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.

Starting with the latest ImageJ daily build (1.52o19), IJ_Props.txt and/or IJ_Prefs.txt files in the ImageJ folder override the corresponding files in the default locations.

-wayne

> 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
Reply | Threaded
Open this post in threaded view
|

Re: Location of IJ_Props.txt and IJ_Prefs.txt

Stein Rørvik
Thanks,

I tested this and it works fine for IJ_Props.txt, but not for IJ_Prefs.txt.
The default location is still used both for reading and writing the preferences.

I am on Windows 7 and my default IJ_Prefs.txt location is
"C:\Users\steinr\.imagej\IJ_Prefs.txt"

My ImageJ location is at
"C:\Users\steinr\ImageJ\ "

Stein

-----Original Message-----
From: ImageJ Interest Group <[hidden email]> On Behalf Of Wayne Rasband
Sent: 05. april 2019 05:55
To: [hidden email]
Subject: Re: Location of IJ_Props.txt and IJ_Prefs.txt

> On Apr 2, 2019, at 5:36 AM, Stein Rørvik <[hidden email]> wrote:
>
> 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.

Starting with the latest ImageJ daily build (1.52o19), IJ_Props.txt and/or IJ_Prefs.txt files in the ImageJ folder override the corresponding files in the default locations.

-wayne

> 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

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