Posted by
Emanuele Martini on
Nov 19, 2014; 5:12pm
URL: http://imagej.273.s1.nabble.com/saveas-TIFF-without-get-filelist-tp5010548.html
Hi to all,
I have a problem with saving as tiff an opened image in a macro/function.
I write a macro that open an image from a path and process it and then want to save to a saving folder:
1) open image_path=path/image1.tif
2) doing something
3) save to save_path=save_dir/PR_image1.tif
I try with this code saveAs("TIFF", save_dir + "PR_" image_name);
where save_dir is a string path like = "path/ema/exp1"
and i retrieve the image name after opening the image using getTitle().
someone has some ideas to figure out from this, I think, simple problem?
Thanks,
Emanuele Martini
P.S.: the name of the image and the save_dir sometimes have spaces...so maybe it could be a problem
P.S.: i used sometimes, in other macros and plugin, the solution with
image_path=getDirectory("Choose image folder");
save_dir=getDirectory("Choose saving folder");
list = getFileList(image_path);
and then iterate in a for
saveAs("TIFF", save_dir+"PR_"+list[i]);
and that works fine...
but in this case I would have a function that operate on a single file like that:
extract(image_path,save_dir)
Image Analyst @Ifom-IEO research campus -MI-