Login  Register

importing across multiple folders

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options Options
Embed post
Permalink
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

importing across multiple folders

Jeff Spector
8 posts
Hi ,
  The camera I'm using saves every 1000 frames in it's own folder. I can
import one folder easily, but I was wondering if there is a way and/or a
plugin that will let me import a sequence across multiple folders ?

Thanks,
-jeff
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

Re: importing across multiple folders

Spencer Eugene Olson
4 posts
On Wednesday 07 February 2007 03:28, Jeff Spector wrote:
>   The camera I'm using saves every 1000 frames in it's own folder. I can
> import one folder easily, but I was wondering if there is a way and/or a
> plugin that will let me import a sequence across multiple folders ?

My brain-dead way of doing this is to use a bash shell script, or perhaps a
simple 'find' command (I use Linux, but I am sure that a DOS proficient
person knows how to do this also).  Let's say that the images are of FITS
type:

runimageJ `find -name *.fits`

where runimageJ is the command line that you use to load imageJ (e.g.
"java -cp $ImageJDIR/ij.jar ImageJ" ).

But, say you want to open them all up in order.  Assume that directories are
labeled 000 to 999 and that images are labeled "image000.fits" to
"image999.fits".  Assume that we run this script in the parent directory of
all image subdirectories:

-----begin bash script-----
#!/bin/bash

for DIR `seq -w 0 999`; do
    if [ -d "$DIR" ] ; then
        FILES=""
        for i in `seq -w 0 999`; do
            IMAGE="image${i}.fits"
            if [ -f "$IMAGE" ]; then
                FILES="$FILES $IMAGE"
            fi;
        done;
        # We open them up a directory at a time to speed up the process.
        if [ "$FILES" != "" ] ; then
            runimageJ "$FILES"
        fi;
    fi;
done;
-----end bash script-----

For some reason, on Linux, (perhaps also windows), I have to give absolute
paths to each file that I want to open (instead of paths relative to the
current directory).

Have fun,

Spencer


--
------------
Spencer E. Olson
[hidden email]
http://www.umich.edu/~olsonse/
PGP Fingerprint: A452 312C 73DC 41EF 47F3  EE73 A898 B528 BAD2 0D0F
(See www.pgp.net or pgp.mit.edu for public keys to encrypt messages for me)

user, n.:
        The word computer professionals use when they mean "idiot."
                        -- Dave Barry, "Claw Your Way to the Top"
                         
[I always thought "computer professional" was the phrase hackers used
when they meant "idiot."  Ed.]