file.rename example

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

file.rename example

Cohen, Ethan D

I am trying to save an image stack with the XXX.tiff suffix.

Note I do not use the suffix .tif  (single f), which I use for other files.

If I use saveAs("Tiff"), I get a .tif file.

Is this possible with file.rename?   So far no dice.

Ethan.


Ethan Cohen, Ph.D.
Div of Biomedical Physics, WO62 Rm 1204
Office of Science and Engineering Labs,
FDA Center for Devices and Radiological Health
White Oak Federal Res Ctr.
10903 New Hampshire Ave.
Silver Spring, MD 20993
Web: http://go.usa.gov/cegV3
Office: 301-796-2485
Lab:301-796-2762
Fax: 301-796-9927
Cell: 301-538-7544

[cid:image001.png@01D1C57E.DFA022A0]<http://www.fda.gov/>Excellent customer service is important to us. Please take a moment to provide feedback regarding the customer service you have received: https://www.research.net/s/cdrhcustomerservice?O=700&D=740&B=740&E=&S=E
"THIS MESSAGE FROM ETHAN COHEN IS INTENDED ONLY FOR THE USE OF THE PARTY TO WHOM IT IS ADDRESSED AND MAY CONTAIN INFORMATION THAT IS PRIVILEGED, CONFIDENTIAL, AND PROTECTED FROM DISCLOSURE UNDER LAW. If you are not the addressee, or a person authorized to deliver the document to the addressee, you are hereby notified that any review, disclosure, dissemination, copying, or other action based on the content of this communication is not authorized. If you have received this document in error, please immediately notify the sender immediately by e-mail or phone."
________________________________


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

image001.gif (1K) Download Attachment
image002.png (11K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: file.rename example

Herbie
Good day Ethan,

the following little demo macro shows that what you want is indeed possible:

newImage("myMiniStack", "8-bit ramp", 256, 256, 3);
path=getDirectory("home")+getTitle()+".tiff";
save(path);
exit();

It saves the demo-stack to your home directory.

Regards

Herbie

::::::::::::::::::::::::::::::::::::::::::::_
Am 22.11.18 um 22:38 schrieb Cohen, Ethan D:

>
> I am trying to save an image stack with the XXX.tiff suffix.
>
> Note I do not use the suffix .tif  (single f), which I use for other files.
>
> If I use saveAs("Tiff"), I get a .tif file.
>
> Is this possible with file.rename?   So far no dice.
>
> Ethan.
>
>
> Ethan Cohen, Ph.D.
> Div of Biomedical Physics, WO62 Rm 1204
> Office of Science and Engineering Labs,
> FDA Center for Devices and Radiological Health
> White Oak Federal Res Ctr.
> 10903 New Hampshire Ave.
> Silver Spring, MD 20993
> Web: http://go.usa.gov/cegV3
> Office: 301-796-2485
> Lab:301-796-2762
> Fax: 301-796-9927
> Cell: 301-538-7544

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

Re: file.rename example

Cohen, Ethan D
In reply to this post by Cohen, Ethan D
Thanks Herbie:
That worked...but it pointed me a the C:\usr directory

So I pointed it at my working directory

Now I understand the PATH statement much better.


                dir = getDirectory("Choose a Directory ");

               //Code manipulation

        path=dir+getTitle()+".tiff";// Saves stack .tiff file in processed directory
        save(path);
        exit();

Ethan

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