Path Corruption by Install Macro Command

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

Path Corruption by Install Macro Command

Dan McDonald
I seem to have a problem with interference between the 'install macro'
command and the 'run Import raw' command.

When I run the code below I get the expected results and the user selected
raw file is opened properly.

.

  path = File.openDialog("Select a 100% Q Size Rice Raw Image")

 //verify (path); // verify the file

   dir = File.getParent(path);

   name = File.getName(path);

 //Open the raw image file

   run("Raw...", "open=[path] image=[16-bit Unsigned] width=7364
height=17744 offset=0 number=1 gap=0 little-endian");

.

 

If I precede the above code with a command to install a macro:

   run("Install...", "install=[C:\\Program
Files\\ImageJ\\plugins\\Cut_Count_Measure_CNRRI.txt]");

the macro is installed properly but I get the following errors when the code
reaches run("Raw.  in my code to open the raw file.

 

            java.io.FileNotFoundException: path (The system cannot find the
file specified)

            at java.io.FileInputStream.open(Native Method)

            at java.io.FileInputStream.<init>(Unknown Source)

            at ij.io.FileOpener.createInputStream(FileOpener.java:464)

            at ij.io.FileOpener.readPixels(FileOpener.java:521)

            at ij.io.FileOpener.open(FileOpener.java:77)

            at ij.io.ImportDialog.openImage(ImportDialog.java:160)

            at ij.plugin.Raw.run(Raw.java:20)

            at ij.IJ.runPlugIn(IJ.java:157)

            at ij.Executer.runCommand(Executer.java:124)

            at ij.Executer.run(Executer.java:61)

            at ij.IJ.run(IJ.java:250)

            at ij.macro.Functions.doRun(Functions.java:553)

            at ij.macro.Functions.doFunction(Functions.java:74)

            at ij.macro.Interpreter.doStatement(Interpreter.java:200)

            at ij.macro.Interpreter.doStatements(Interpreter.java:188)

            at ij.macro.Interpreter.run(Interpreter.java:99)

            at ij.macro.Interpreter.run(Interpreter.java:71)

            at ij.macro.MacroRunner.run(MacroRunner.java:124)

            at java.lang.Thread.run(Unknown Source)

 

Can anyone suggest a solution?

 

Dan

 

Daniel W. McDonald, President

Phenotype Screening Corporation

4028 Papermill Rd, Suite 10

Knoxville, TN 37909

(865) 385-8641

 

Our product, RootViz FS, was a 2007 R&D100 Award Winner. Rated as one of the
100 most technologically significant products introduced into the
marketplace in the prior year.