headless mode

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

headless mode

H A S M
If I run
  /path/to/fiji/ImageJ-linux64 /tmp/Macro.ijm
everything works fine, but if I do:
  /path/to/fiji/ImageJ-linux64 --headless /tmp/Macro.ijm
I get a java exception and a long traceback
  java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    ... (lots of lines deleted)
    at imagej.ClassLauncher.main(ClassLauncher.java:72)
  Caused by: java.lang.NullPointerException
    at fiji.util.gui.GenericDialogPlus.addStringField(GenericDialogPlus.java:88)
    at fiji.util.gui.GenericDialogPlus.addDirectoryField(GenericDialogPlus.java:123)
    at plugin.Stitching_Grid.run(Stitching_Grid.java:137)
    at ij.IJ.runUserPlugIn(IJ.java:184)
    at ij.IJ.runPlugIn(IJ.java:151)
    ... 27 more

Macro.ijm contains (lines broken up for mailing)

run("Grid/Collection stitching", "type=[Grid: row-by-row]
  order=[Right & Down                ]
  grid_size_x=3
  grid_size_y=11
  tile_overlap=10
  first_file_index_i=1
  directory=/tmp/tiles file_names=tile_{ii}.jpg
  output_textfile_name=TileConfiguration.txt
  fusion_method=[Linear Blending]
  regression_threshold=0.30
  max/avg_displacement_threshold=10
  absolute_displacement_threshold=20
  compute_overlap
  subpixel_accuracy
  computation_parameters=[Save memory (but  be slower)]
  image_output=[Write to disk]
output_directory=/tmp/tiles");
open("/tmp/tiles/img_t1_z1_c1");
open("/tmp/tiles/img_t1_z1_c2");
open("/tmp/tiles/img_t1_z1_c3");
run("Merge Channels...", "c1=img_t1_z1_c1 c2=img_t1_z1_c2
c3=img_t1_z1_c3 create");
run("Flip Horizontally");
run("Flip Vertically");
saveAs("Jpeg", "/tmp/tiles/tiles.jpg");
close();
run ("Quit");

Is this hopeless, i.e.  do I have to run with a display?

-- HASM

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