questions about ImageJ javascript scripts language

Posted by Xiuxia Zhang on
URL: http://imagej.273.s1.nabble.com/questions-about-ImageJ-javascript-scripts-language-tp5013709.html

 I am a PhD. candidate of Institute of Computing Technology, Chinese
Academy of   Sciences.
My research interest is image processing.
I am a user of ImageJ.  Recently I am writing ImageJ scripts.  Mostly I
refer this page
http://imagej.nih.gov/ij/developer/macro/functions.html
I also use Plugins->Macros->Record to generate the scripts automaticly.
.

However I find some commands  that not written in the documents I listed
above.
I have a need to read lots of text Image automaticly and save as  Tiff
image.

I need the comands Such as "File-->import-->textImage".
The macros generated is not correct for javascript, beanshell or java.
It's only correct as Fiji's Macro language. I can not use Js, java or
beanshell language.
I am using ImageJ 1.49P.
I just wonder what should I do if I can not macros I needed of Javascript
in the documents.


Here is the code snips of each language.  I also imported necessary
packages before these codes.
Macro
IJ.run("Text Image... ",
"open=/home/xiuxia/home2/result/predict_14img.txt");
IJ.run("Conversions...", " ");
IJ.saveAs(imp, "Tiff", "/home/xiuxia/home2/result/predict_14img0000.tif");
imp.close();


javascript:
imp = IJ.getImage();
IJ.run("Text Image... ",
"open=/home/xiuxia/home2/result/predict_14img.txt");
IJ.run("Conversions...", " ");
IJ.saveAs(imp, "Tiff", "/home/xiuxia/home2/result/predict_14img0000.tif");
imp.close();

Beanshell
imp = IJ.getImage();
IJ.run("Text Image... ",
"open=/home/xiuxia/home2/result/predict_14img.txt");
IJ.run("Conversions...", " ");
IJ.saveAs(imp, "Tiff", "/home/xiuxia/home2/result/predict_14img0000.tif");
imp.close();

java
*import ij.*;*
*import ij.process.*;*
*import ij.gui.*;*
*import java.awt.*;*
*import ij.plugin.*;*
*import ij.plugin.frame.*;*

*public class My_Plugin implements PlugIn {*

* public void run(String arg) {*
* ImagePlus imp = IJ.getImage();*
* IJ.run("Text Image... ",
"open=/home/xiuxia/home2/result/predict_14img.txt");*
* IJ.run("Conversions...", " ");*
* IJ.saveAs(imp, "Tiff",
"/home/xiuxia/home2/result/predict_14img0000.tif");*
* imp.close();*
* }*

*}*


Thanks,
--
* Xiuxia **Zhang*
*Institute of Computing Technology  Chinese Academy of Sciences*

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