save from macro

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

save from macro

gayu.gop
hi all..
i am trying to write a macro to render an image sequence in 3d and save the resulting jpgs...
the following is the code...it works fine when the &opath in "save=&opath " is replaced by the actual path but when given the variable generates file not found exception...is there a limitation with save? how can i get over this problem?
*******************************
abc=getArgument;
args=split(abc,";");
print(args[0]);
print(args[1]);
print(args[2]);
print(args[3]);
ippath=args[0];
slices=args[1];
opname=args[2];
opath="C:\\Users\\Operator\\Desktop\\rot_slices\\";

run("Image Sequence...", "open=&ippath number=&slices starting=1 increment=1 scale=100 file=[] or=[] sort");
run("3D Project...", "projection=[Brightest Point] axis=Y-Axis slice=1 initial=0 total=360 rotation=10 lower=1 upper=255 opacity=0 surface=100 interior=50");
run("Image Sequence... ", "format=JPEG name=[&opname] start=0 digits=4 save=&opath ");

***********
pls help...
Reply | Threaded
Open this post in threaded view
|

Re: save from macro

Michael Schmid
Hi,

when using a path in a macro call, use square brackets (there might be
special characters in the path).
In case of problems with the '&' notation, java-like String concatenation
with '+' might be more safe:
  run("Image Sequence...", "open=["+ippath+"] number=&slices ...

  run("Image Sequence... ", "... save=["+opath+"]");

Michael
_________________________________________________________________________


On Wed, June 6, 2012 15:04, gayu.gop wrote:

> hi all..
> i am trying to write a macro to render an image sequence in 3d and save
> the
> resulting jpgs...
> the following is the code...it works fine when the &opath in "save=&opath
> "
> is replaced by the actual path but when given the variable generates file
> not found exception...is there a limitation with save? how can i get over
> this problem?
> *******************************
> abc=getArgument;
> args=split(abc,";");
> print(args[0]);
> print(args[1]);
> print(args[2]);
> print(args[3]);
> ippath=args[0];
> slices=args[1];
> opname=args[2];
> opath="C:\\Users\\Operator\\Desktop\\rot_slices\\";
>
> run("Image Sequence...", "open=&ippath number=&slices starting=1
> increment=1
> scale=100 file=[] or=[] sort");
> run("3D Project...", "projection=[Brightest Point] axis=Y-Axis slice=1
> initial=0 total=360 rotation=10 lower=1 upper=255 opacity=0 surface=100
> interior=50");
> run("Image Sequence... ", "format=JPEG name=[&opname] start=0 digits=4
> save=&opath ");
>
> ***********
> pls help...
>
> --
> View this message in context:
> http://imagej.1557.n6.nabble.com/save-from-macro-tp4998923.html
> Sent from the ImageJ mailing list archive at Nabble.com.
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>

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