open batch

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

open batch

Johannes Breu
Hello,

I am looking for a macro to open all images within a file. I found some
macros dealing with batches but I just want: Open all images in the file I
selected.

Thanks
Johannes
Reply | Threaded
Open this post in threaded view
|

Re: open batch

Sudipta Mukhopadhyay
Hi

Are you looking for opening all the images in a DIRECTORY? If so, you can use :
Import>Image sequence
command. Hopethis helps,

With warm regards

Sudipta
Johannes Breu <[hidden email]> wrote :

> Hello,
>
> I am looking for a macro to open all images within a file. I found some
> macros dealing with batches but I just want: Open all images in the file I
> selected.
>
> Thanks
> Johannes

___________________________________
IIT Kharagpur, http://www.iitkgp.ac.in
Reply | Threaded
Open this post in threaded view
|

Re: open batch

lechristophe
In reply to this post by Johannes Breu
Dear Johannes,

I guess you mean open all images inside a "folder" rather than a file ? If
so, just use the File>Open...>Open File Sequence command if all your images
have the same format. If not, you coud use a simple macro using getDirectory
and getFileList and a loop on all files found (optionnally testing for an
image extension such as .tif).

Christophe


On Sun, Jul 27, 2008 at 23:21, Johannes Breu <[hidden email]> wrote:

> Hello,
>
> I am looking for a macro to open all images within a file. I found some
> macros dealing with batches but I just want: Open all images in the file I
> selected.
>
> Thanks
> Johannes
>
Reply | Threaded
Open this post in threaded view
|

Re: open batch

Johannes Breu
Yes, I mean "all images inside a folder". Sorry for that. But I cannot
comprehend your solution.

There is just File>Open... and then I can open only one image.
I did not find >Open File Sequence.

Thanks
Johannes

2008/7/28 Christophe Leterrier <[hidden email]>

> Dear Johannes,
>
> I guess you mean open all images inside a "folder" rather than a file ? If
> so, just use the File>Open...>Open File Sequence command if all your images
> have the same format. If not, you coud use a simple macro using
> getDirectory
> and getFileList and a loop on all files found (optionnally testing for an
> image extension such as .tif).
>
> Christophe
>
>
> On Sun, Jul 27, 2008 at 23:21, Johannes Breu <[hidden email]>
> wrote:
>
> > Hello,
> >
> > I am looking for a macro to open all images within a file. I found some
> > macros dealing with batches but I just want: Open all images in the file
> I
> > selected.
> >
> > Thanks
> > Johannes
> >
>
Reply | Threaded
Open this post in threaded view
|

Re: open batch

lechristophe
In reply to this post by lechristophe
Dear Johannes,

Sorry for being inaccurate, the proper File command is
File>Import...>Image Sequence as explained in the ImageJ documentation
:
http://rsbweb.nih.gov/ij/docs/menus/file.html#import

As regards a macro for opening every file in a chosen folder, try this code :

macro "Open All Files" {
DIR=getDirectory("Choose Folder");
NAMES=getFileList(DIR);
for (i=0; i<NAMES.length; i++) {
open(DIR+NAMES[i]);
}
}

Beware, the macro will throw an error and exit if something in the
folder is not recongnized as an ImageJ compatible format, so you have
to make sure you only have images in the folder.

The code is very simple, it just asks a directory (getDirectory) with
its path stored as DIR, then store an array NAMES containing all file
names in the folder DIR (getFileList), then loop on from the first to
the last element of NAMES and opens the images, which path is created
by concatenating DIR and the element NAMES[i]. Just go to
http://rsbweb.nih.gov/ij/developer/macro/macros.html and
http://rsbweb.nih.gov/ij/developer/macro/functions.html to get started
with writing simple macros, it is not complicated and quite powerful.


Christophe


On Mon, Jul 28, 2008 at 12:21, Johannes Breu <[hidden email]> wrote:

>
> Thanks for answering. Yes, I mean folder not file but I am not experienced enough to implement your suggestions.
>
>>
>>
>> I guess you mean open all images inside a "folder" rather than a file ? If
>> so, just use the File>Open...>Open File Sequence command if all your images
>> have the same format.
>
> I did not find this possibility to open images (imageJ 1.40g).
>
>>
>> If not, you coud use a simple macro using getDirectory
>> and getFileList and a loop on all files found (optionnally testing for an
>> image extension such as .tif).
>
> I was not able to find these macros <http://rsb.info.nih.gov/ij/macros/> . Is there another suitable address for macros? Originally I was optimistic to detect anything useable because my purpose seemed quite trivial. But either it is hard find or I am to unexperienced to reshape the macros.
>
> Thanks
> Johannes
>>
>> Christophe
>>
>>
>> On Sun, Jul 27, 2008 at 23:21, Johannes Breu <[hidden email]> wrote:
>>
>> > Hello,
>> >
>> > I am looking for a macro to open all images within a file. I found some
>> > macros dealing with batches but I just want: Open all images in the file I
>> > selected.
>> >
>> > Thanks
>> > Johannes
>> >
>