macro to save images as tif

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

macro to save images as tif

Finn Peters
Hei,

I would like to save a number of images as tif. If I record a macro in
which I save a sample image as tif-file then Image J gives every image
processed with that macro exactly the same name. But I want to save
every image with its original file name.

I tried to use the gettitle() function. But if I put that function into
the saveAs function (see at the bottom) it is not executed but used as a
string to name the file.

This is how the macro looks like right now:

while (nImages>0) {
title = getTitle();
print("title: " + title);
saveAs("Tiff", "C:\\Users\\Admins\\Desktop\\confocal tifs\\gettitle()");
close();
}

Can somebody give me a hint how to solve that problem?

cheers,

Finn
Reply | Threaded
Open this post in threaded view
|

Re: macro to save images as tif

Gabriel Landini
On Wednesday 27 Apr 2011, Finn Peters wrote:
> I tried to use the gettitle() function. But if I put that function into
> the saveAs function (see at the bottom) it is not executed but used as a
> string to name the file.
 
> while (nImages>0) {
> title = getTitle();
> print("title: " + title);
> saveAs("Tiff", "C:\\Users\\Admins\\Desktop\\confocal tifs\\gettitle()");
> close();
> }
 
Try to chage the line to this (did not test it, though):
 saveAs("Tiff", "C:\\Users\\Admins\\Desktop\\confocal tifs\\"+title);

Cheers
G.
Reply | Threaded
Open this post in threaded view
|

Re: macro to save images as tif

mmettlen
How can I incorporate the string 'name' from line 4 in the title of the duplicated image (line 5)?

1 n = roiManager("count");
2 for (i=0; i<n; i++) {
3 roiManager("select", i);
4 name = "ROI_"+i;
5 run("Duplicate...", "title="name.tif duplicate);}
Reply | Threaded
Open this post in threaded view
|

Re: macro to save images as tif

Krs5
Change 5 into
run("Duplicate...", "title="+name+".tif duplicate"

-----Original Message-----
From: ImageJ Interest Group [mailto:[hidden email]] On Behalf Of mmettlen
Sent: 31 January 2014 14:05
To: [hidden email]
Subject: Re: macro to save images as tif

How can I incorporate the string 'name' from line 4 in the title of the duplicated image (line 5)?

1 n = roiManager("count");
2 for (i=0; i<n; i++) {
3 roiManager("select", i);
4 name = "ROI_"+i;
5 run("Duplicate...", "title="name.tif duplicate);}



--
View this message in context: http://imagej.1557.x6.nabble.com/macro-to-save-images-as-tif-tp3684836p5006353.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