Re: Format printing

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

Re: Format printing

pang
Dear ImageJ colleagues,

If I have an input of  0-30 as numbers. I need to print them into  000, 001, ... 010, ... 030. Is there any way I can do it with ImgeJ macro language. If not, what else I could do?

Thanks!

PS: I am very impressed by the successful story told by John Oreopoulos.

Zhengyu
Zhengyu Pang, Ph.D.
Biochemistry and Bioanalytics Laboratory
Diagnostic and Biomedical Technologies
GE Global Research, K1-5B37A
One Research Circle
Niskayuna, NY 12309
T: 518-387-4015
F: 518-387-7765

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

Re: Format printing

Rasband, Wayne (NIH/NIMH) [E]
On Mar 1, 2013, at 11:49 AM, Pang, Zhengyu (GE Global Research) wrote:

> Dear ImageJ colleagues,
>
> If I have an input of  0-30 as numbers. I need to print them into  000, 001, ... 010, ... 030. Is there any way I can do it with ImgeJ macro language. If not, what else I could do?

You can use the IJ.pad() macro function. As an example, this macro

   for (i=0; i<=30; i++)
       print(IJ.pad(i,3));

outputs

  000
  001
  .
  .
  010
  011
  .
  .
  030

-wayne

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

Re: Format printing

Kota Miura
In reply to this post by pang
Hi Zhengyu,

use IJ.pad(n, length)

http://rsbweb.nih.gov/ij/macros/examples/StackOverlay.txt

cheers,
Kota

On Fri, Mar 1, 2013 at 5:49 PM, Pang, Zhengyu (GE Global Research) <
[hidden email]> wrote:

> Dear ImageJ colleagues,
>
> If I have an input of  0-30 as numbers. I need to print them into  000,
> 001, ... 010, ... 030. Is there any way I can do it with ImgeJ macro
> language. If not, what else I could do?
>
> Thanks!
>
> PS: I am very impressed by the successful story told by John Oreopoulos.
>
> Zhengyu
> Zhengyu Pang, Ph.D.
> Biochemistry and Bioanalytics Laboratory
> Diagnostic and Biomedical Technologies
> GE Global Research, K1-5B37A
> One Research Circle
> Niskayuna, NY 12309
> T: 518-387-4015
> F: 518-387-7765
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>



--

-------------------------------------------------------------*Dr. Kota Miura*

Scientist & IT Engineer
Centre for Molecular and Cellular Imaging,
European Molecular Biology Laboratory
Meyerhofstr. 1
69117 Heidelberg
GERMANY

Tel +49 6221 387 404

Mobile +49 160 95001177

Fax +49 6221 387 512

http://cmci.embl.de
-------------------------------------------------------------

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