Posted by
Kenneth Sloan-2 on
Nov 17, 2013; 6:47pm
URL: http://imagej.273.s1.nabble.com/Save-As-dialog-tp5005581p5005583.html
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