"Save As" dialog

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

"Save As" dialog

Kenneth Sloan
I routinely use ImageJ to convert files from (for example) .tif to .png.  This is quite easy - with one nasty speed bump.  The "Save As" dialog defaults to the last used directory, and the same filename as the .tif file (minus, of course, the .tif extension).

It would be much easier for me if the DIRECTORY also defaulted to the original directory from which the .tif file came?  

Am I missing an easy way to do this?  As it is - I  lose a lot of time re-setting the directory (and sometimes forget, which wastes even more time…

--
Kenneth Sloan
[hidden email]

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: "Save As" dialog

Jerome Mutterer-3
Hi Kenneth,

you can get the original directory from which the .tif file came using:
  path =  getInfo("image.directory");
and then set the default SaveAs directory using:
  call("ij.io.OpenDialog.setDefaultDirectory", path);
which you can then wrap into a simple customSaveAs macro

macro "customSaveAs [s]" {
  path =  getInfo("image.directory");
  call("ij.io.OpenDialog.setDefaultDirectory", path);
  run ("PNG...");
}

Now pressing the 's' key will pop up a save as png dialog which defaults to
the current image directory. You could also add this macro to the
StartupMacros.txt file in the macros folder to have it installed at startup.

If you prefer avoiding save as dialogs completely, you could also use the
Process>Batch>Convert... command ;-)


Jerome.





On 17 November 2013 05:57, Kenneth Sloan <[hidden email]> wrote:

> I routinely use ImageJ to convert files from (for example) .tif to .png.
>  This is quite easy - with one nasty speed bump.  The "Save As" dialog
> defaults to the last used directory, and the same filename as the .tif file
> (minus, of course, the .tif extension).
>
> It would be much easier for me if the DIRECTORY also defaulted to the
> original directory from which the .tif file came?
>
> Am I missing an easy way to do this?  As it is - I  lose a lot of time
> re-setting the directory (and sometimes forget, which wastes even more time…
>
> --
> Kenneth Sloan
> [hidden email]
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: "Save As" dialog

Kenneth Sloan-2
Thanks.

Our lab is most comfortable with full Java plugins - so we wrote "Save_As_PNG" and created a shortcut.

I don't want to use Batch, because I actually want to inspect the images as they go by.  So, I now
double-click on a group of .tif files (creating a nice pile of images) and then "accept" each one (saving as a .png) with a single keystroke.  No dialog box!  The plugin saves as .png and removes the image from the top of the pile, revealing the next. 'n' clicks later and all the images have been inspected, converted, saved, and removed from sight.

The point of my inquiry was - isn't it more natural for the normal "Save As PNG" to default to the image directory (when there is one)?  It already defaults to the image name.  I wonder if there is some
benefit to defaulting to "last used directory" that I don't appreciate?  If there is - never mind.  If not (i.e., it was an arbitrary choice), then I think using the image's directory (where known) would be an improvement.

--
Kenneth Sloan
[hidden email]


On Nov 17, 2013, at 03:37 , Jerome Mutterer <[hidden email]> wrote:

> Hi Kenneth,
>
> you can get the original directory from which the .tif file came using:
>  path =  getInfo("image.directory");
> and then set the default SaveAs directory using:
>  call("ij.io.OpenDialog.setDefaultDirectory", path);
> which you can then wrap into a simple customSaveAs macro
>
> macro "customSaveAs [s]" {
>  path =  getInfo("image.directory");
>  call("ij.io.OpenDialog.setDefaultDirectory", path);
>  run ("PNG...");
> }
>
> Now pressing the 's' key will pop up a save as png dialog which defaults to
> the current image directory. You could also add this macro to the
> StartupMacros.txt file in the macros folder to have it installed at startup.
>
> If you prefer avoiding save as dialogs completely, you could also use the
> Process>Batch>Convert... command ;-)
>
>
> Jerome.
>
>
>
>
>
> On 17 November 2013 05:57, Kenneth Sloan <[hidden email]> wrote:
>
>> I routinely use ImageJ to convert files from (for example) .tif to .png.
>> This is quite easy - with one nasty speed bump.  The "Save As" dialog
>> defaults to the last used directory, and the same filename as the .tif file
>> (minus, of course, the .tif extension).
>>
>> It would be much easier for me if the DIRECTORY also defaulted to the
>> original directory from which the .tif file came?
>>
>> Am I missing an easy way to do this?  As it is - I  lose a lot of time
>> re-setting the directory (and sometimes forget, which wastes even more time…
>>
>> --
>> Kenneth Sloan
>> [hidden email]
>>
>> --
>> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>>
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: "Save As" dialog

Michael Entrup
Hi Kenneth,

there will be different opinions on what is more natural for a "Save As
..." dialog. Some applications will select the folder of the current
file and some others will select the last used directory. On Win7 it
would be best to select the folder of the current file. The default
dialog contains a item to show the last used folders. Using Ubuntu there
is a very different dialog, that is missing such an item. I think you
will create a huge discussion without a clear result if you want to
change the default behavior of ImageJ.

Best regards
Michael

Am 17.11.2013 19:47, schrieb Kenneth Sloan:

> Thanks.
>
> ...
>
> The point of my inquiry was - isn't it more natural for the normal
> "Save As PNG" to default to the image directory (when there is one)?  
> It already defaults to the image name.  I wonder if there is some
> benefit to defaulting to "last used directory" that I don't
> appreciate?  If there is - never mind.  If not (i.e., it was an
> arbitrary choice), then I think using the image's directory (where
> known) would be an improvement.
>
> --
> Kenneth Sloan
> [hidden email]
>

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: "Save As" dialog

Gabriel Landini
On Monday 18 Nov 2013 10:12:16 Michael Entrup wrote:
> The default dialog contains a item to show the last used folders.
> Using Ubuntu there is a very different dialog, that is missing such an item.

Is this because you have different settings in the I/O Options?
There is a check box for "Use JFileChooser to open/save"

Cheers
Gabriel

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: "Save As" dialog

Kenneth Sloan
In reply to this post by Michael Entrup
Well…the first question is: is the "last directory accessed" behavior of the JFileChooser, as invoked by ImageJ, documented anywhere?  If so - sorry I missed it, and perhaps it should just be left alone.
If not - then I propose that it is reasonable to consider changing the actual behavior to use:

a) directory associated with the image
b) last directory
c)  standard directory

in that order.  And then, of course, document it so that users will know the behavior
by reading the documentation, rather than "doing Science" on the implementation.

This is all theoretical - my immediate problem is solved (as always, by a custom Java plugin).

One more thing - why should this behavior be different under Win7 or Ubuntu?
This kind of behavior should be positively controlled by ImageJ - not left to individual OS defaults.
When one distributes an application to 5 different operating systems, it seems bad policy to have to write different user manuals for each OS.

--
Kenneth Sloan
[hidden email]


On Nov 18, 2013, at 04:12 , Michael Entrup <[hidden email]> wrote:

> Hi Kenneth,
>
> there will be different opinions on what is more natural for a "Save As ...." dialog. Some applications will select the folder of the current file and some others will select the last used directory. On Win7 it would be best to select the folder of the current file. The default dialog contains a item to show the last used folders. Using Ubuntu there is a very different dialog, that is missing such an item. I think you will create a huge discussion without a clear result if you want to change the default behavior of ImageJ.
>
> Best regards
> Michael
>
> Am 17.11.2013 19:47, schrieb Kenneth Sloan:
>> Thanks.
>>
>> ...
>>
>> The point of my inquiry was - isn't it more natural for the normal "Save As PNG" to default to the image directory (when there is one)?  It already defaults to the image name.  I wonder if there is some
>> benefit to defaulting to "last used directory" that I don't appreciate?  If there is - never mind.  If not (i.e., it was an arbitrary choice), then I think using the image's directory (where known) would be an improvement.
>>
>> --
>> Kenneth Sloan
>> [hidden email]
>>
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html

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