NOTICE! This is a static HTML version of a legacy Fiji BugZilla bug.

The Fiji project now uses GitHub Issues for issue tracking.

Please file all new issues there.

Bug 1171 - batch mode not working
batch mode not working
Status: RESOLVED FIXED
Product: Fiji
Classification: Unclassified
Component: Plugins
unspecified
Macintosh Mac OS
: P4 normal
Assigned To: ImageJ Bugs Mailing List
Depends on:
Blocks:
 
Reported: 2015-10-06 11:29 CDT by Ferdinando Pucci
Modified: 2015-10-07 20:55 CDT
2 users (show)

See Also:


Attachments
macro generating the issue with proof of it (145.65 KB, image/png)
2015-10-06 11:32 CDT, Ferdinando Pucci
runnable macro (971 bytes, text/plain)
2015-10-06 13:42 CDT, Ferdinando Pucci
offending image stack (2.95 MB, image/tiff)
2015-10-06 14:51 CDT, Ferdinando Pucci

Description Ferdinando Pucci 2015-10-06 11:29:20 CDT
following macro stops after a window asks to confirm action and another window asks to save file (see attached screenshot)

Information about your version of Java:

  os.arch => x86_64
  os.name => Mac OS X
  os.version => 10.10.4
  java.version => 1.6.0_65
  java.vendor => Apple Inc.
  java.runtime.name => Java(TM) SE Runtime Environment
  java.runtime.version => 1.6.0_65-b14-466.1-11M4716
  java.vm.name => Java HotSpot(TM) 64-Bit Server VM
  java.vm.version => 20.65-b04-466.1
  java.vm.vendor => Apple Inc.
  java.vm.info => mixed mode
  java.awt.graphicsenv => apple.awt.CGraphicsEnvironment
  java.specification.name => Java Platform API Specification
  java.specification.version => 1.6
  sun.cpu.endian => little
  sun.desktop => null
  file.separator => /

The up-to-date check says: CHECK_TURNED_OFF

Information relevant to JAVA_HOME related problems:

  JAVA_HOME is set to: /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/
  imagej.dir => /Applications/Fiji.app

Information about the version of each plugin:

Activated update sites:
ImageJ: http://update.imagej.net/ (last check:20150915094157)
Fiji: http://update.fiji.sc/ (last check:20150928090247)

Files not up-to-date:
  8096845f (MODIFIED) 20150527172026 Contents/Info.plist
  86f03f50 (MODIFIED) 20151006112320 jars/ij-1.50b.jar
  1ad3be0d (LOCAL_ONLY) 20140214180410 jars/jpedalSTD.jar
  d5a2ebdf (LOCAL_ONLY) 20150623161730 plugins/NDPITools_.jar
  617c3507 (LOCAL_ONLY) 20140513152031 plugins/QuickTime_Plugins.jar
Comment 1 Ferdinando Pucci 2015-10-06 11:32:36 CDT
Created attachment 264
macro generating the issue with proof of it
Comment 2 Wayne Rasband 2015-10-06 13:16:01 CDT
To fix this problem, we need to be able to reproduce it. To reproduce it, we need a runnable macro and a folder of test images, uploaded as a ZIP archive.
Comment 3 Ferdinando Pucci 2015-10-06 13:42:49 CDT
Created attachment 265
runnable macro
Comment 4 Ferdinando Pucci 2015-10-06 13:43:51 CDT
thanks Wayne. any image should work, cannot attach mine because they are too big
Comment 5 Wayne Rasband 2015-10-06 14:14:52 CDT
I tried RGB images and they do not work. Please upload a folder of test images that do work with the macro.
Comment 6 Ferdinando Pucci 2015-10-06 14:51:18 CDT
Created attachment 266
offending image stack

if you run the macro on the folder containing this image stack you can reproduce the issue
Comment 7 Wayne Rasband 2015-10-06 17:14:22 CDT
Here is a version of your macro that should work better. I marked the changes with "//**".

dir = getDirectory("Choose Sorce Directory"); //with slash at the end
dir2 = getDirectory("Choose Destination Directory");
acq = getFileList(dir);
setBatchMode(true); 
for (i=0; i<acq.length; i++) {
	if (endsWith(acq[i], "tif")) {
		open(dir+acq[i]);
		run("Make Composite");
		run("Split Channels");
		close("C3-"+acq[i]);
		imageCalculator("Subtract stack", "C2-"+acq[i], "C1-"+acq[i]);
		//Save Z-projection of 169
		selectWindow("C2-"+acq[i]);
		run("Despeckle", "stack");   //**
		run("Z Project...", "projection=[Average Intensity]");
		selectWindow("AVG_C2-"+acq[i]);
		path = dir2+"Zproj-169-BGsubtr-"+acq[i]; //**
		run("Save", "save=&path"); //**
		close("AVG_C2-"+acq[i]);
		//Save Z-projection of SHG
		selectWindow("C4-"+acq[i]);
		run("Despeckle", "stack"); //**
		run("Z Project...", "projection=[Average Intensity]");
		selectWindow("AVG_C4-"+acq[i]);
		path = dir2+"Zproj-SHG-BGsubtr-"+acq[i]; //**
		run("Save", "save=&path"); //**
		close("*");
	}
}
Comment 8 Ferdinando Pucci 2015-10-07 16:00:17 CDT
thanks Wayne.  I reported the bug because my code used to work but now something changed with latest version. Best
Comment 9 Wayne Rasband 2015-10-07 20:55:08 CDT
You are probably using stacks for the first time. "run('Despeckle')" displays a dialog if the active image is a stack. "run('Despeckle','stack')" never displays a dialog.