running scale frm command line

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

running scale frm command line

Ray, Siddharth
Hi,

I am new to imagej and was trying to run "Scale..." from command line. I used the following command:
java -jar ij.jar image.hdr -run "Scale..." "x=5 y=5 z=5".

This opens the image with scaling option but it does not scale it to 5. I tried to run from macro with command:
Run("Scale...", "x=5 y=5 z=5");

But it says unidentified identifier. Can anyone please help me with this.

Thanks,
-Siddharth

______________________________________________________________________
CONFIDENTIALITY NOTICE:
 The information in this e-mail may be confidential and/or
 privileged.  If you are not the intended recipient or an
 authorized representative of the intended recipient, you
 are hereby notified that any review, dissemination, or
 copying of this e-mail and its attachments, if any, or
 the information contained herein is prohibited.  If you
 have received this e-mail in error, please immediately
 notify the sender by return e-mail and delete this e-mail
 from your computer system.  Thank you.
______________________________________________________________________

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

Re: running scale frm command line

Pariksheet Nanda
Hi Siddharth,

On Wed, Aug 27, 2014 at 10:24 AM, Ray, Siddharth
<[hidden email]> wrote:
>
> I am new to imagej and was trying to run "Scale..." from command line. I used the following command:
> java -jar ij.jar image.hdr -run "Scale..." "x=5 y=5 z=5".
>
> This opens the image with scaling option but it does not scale it to 5. I tried to run from macro with command:
> Run("Scale...", "x=5 y=5 z=5");
>
> But it says unidentified identifier. Can anyone please help me with this.

The Scale plugin requires several more inputs in addition to x, y and
z, and it won't run unless you provide all of them which is why it
also opens the scaling window.  An easy way to see these additional
inputs is by first opening the macro recorder (Plugins > Macros >
Record...) and then running the Scale plugin.  So on my computer I
get:

   run("Scale...", "x=5 y=5 z=5 width=65 height=10 depth=265
interpolation=Bilinear average process create title=[my_data.tif]");

Of course, it's cumbersome to have to provide the additional details.
But we can substitute them from ImageJ's built-in macro functions,
getDimensions() and getTitle().

   getDimensions(width, height, channels, slices, frames);
   title = getTitle();
   run("Scale...", "x=2 y=2 z=5 \
        width=&width height=&height depth=&slices \
        interpolation=Bilinear \
        average process create \
        title=&title");

This is a bit long to do nicely from the command line, but you could
save it into a macro and then run a macro from the command line.

(I'm not sure if one has to multiple the width, height, slices, etc by
5 - you might need to compare your output running the Scale window vs.
the macro and see what you prefer)


> -Siddharth

Pariksheet

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