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 1231 - Local Thickness fails to produce final output
Local Thickness fails to produce final output
Status: NEW
Product: Fiji
Classification: Unclassified
Component: Plugins
unspecified
PC Windows
: P4 normal
Assigned To: ImageJ Bugs Mailing List
Depends on:
Blocks:
 
Reported: 2016-02-23 08:13 CST by Leskel
Modified: 2016-02-25 05:43 CST
2 users (show)

See Also:

Description Leskel 2016-02-23 08:13:48 CST
This macro will produce final output only once:

for (y=0;y<8;y++)
{
run("Leaf (36K)");
run("Duplicate...", " ");
selectWindow("leaf-1.jpg");
run("8-bit");
run("Local Thickness (complete process)", "threshold=100 inverse");
close();
close();
close();
}

Second time (sometimes on the first try already after Fiji restart) it will throw an error:
"Local Thickness to Cleaned-Up Local Thickness" requires an image of type: 32-bit (float) grayscale"

If Local Thickness to Cleaned-Up Local Thickness selected manually from menu and applied to leaf-1_EDT_DR_LT image, it will work (but not always).

Information about your version of Java:

  os.arch => amd64
  os.name => Windows 7
  os.version => 6.1
  java.version => 1.8.0_66
  java.vendor => Oracle Corporation
  java.runtime.name => Java(TM) SE Runtime Environment
  java.runtime.version => 1.8.0_66-b18
  java.vm.name => Java HotSpot(TM) 64-Bit Server VM
  java.vm.version => 25.66-b18
  java.vm.vendor => Oracle Corporation
  java.vm.info => mixed mode
  java.awt.graphicsenv => sun.awt.Win32GraphicsEnvironment
  java.specification.name => Java Platform API Specification
  java.specification.version => 1.8
  sun.cpu.endian => little
  sun.desktop => windows
  file.separator => \

The up-to-date check says: REMIND_LATER

Information relevant to JAVA_HOME related problems:

  JAVA_HOME is set to: C:\Users\bras-lab\DOCUME~1\Victor\Fiji.app/java/win64/jdk1.8.0_66//jre
  imagej.dir => C:\Users\bras-lab\DOCUME~1\Victor\Fiji.app

Information about the version of each plugin:

Activated update sites:
ImageJ: http://update.imagej.net/ (last check:20160217170804)
Fiji: http://update.fiji.sc/ (last check:20160218155537)
Java-8: http://sites.imagej.net/Java-8/ (last check:20160127225850)
Biomedgroup: http://sites.imagej.net/Biomedgroup/ (last check:20160222171815)
BioVoxxel: http://sites.imagej.net/BioVoxxel/ (last check:20160131192112)
MOSAIC ToolSuite: http://mosaic.mpi-cbg.de/Downloads/update/Fiji/MosaicToolsuite/ (last check:20160105155554)

Files not up-to-date:
  9277151f (LOCAL_ONLY) 20160214093038 plugins/Watch_Dir.jar
Comment 1 Jan Eglinger 2016-02-24 05:32:54 CST
This appears to be a race condition, caused by the LocalThickness plugin calling WindowManager.getCurrentImage() (instead of handing over a proper reference to the result image) several times in the source code:

https://github.com/fiji/LocalThickness/blob/master/src/main/java/sc/fiji/localThickness/Local_Thickness_Driver.java#L90-L101

To work around this, you can run the plugin in batch mode. The following macro worked for me:

for (y=0;y<8;y++)
{
    run("Leaf (36K)");
    run("Duplicate...", " ");
    selectWindow("leaf-1.jpg");
    run("8-bit");
    setBatchMode(true);
    run("Local Thickness (complete process)", "threshold=100 inverse");
    setBatchMode(false);
    wait(100);
    close();
    close();
    close();
}

This is just for illustration purpose. Obviously, depending on what you actually want to do, you should run the whole loop in batch mode instead of switching on and off in every iteration.
Comment 2 Jan Eglinger 2016-02-25 05:43:05 CST
The robust way to use Local Thickness from a macro is actually using:

    run("Local Thickness (masked, calibrated, silent)");

Thanks to Richard Domander who added this in Nov 2015, see:

https://github.com/fiji/LocalThickness/commit/10794b9cce408ae99c398896d93379c2d829c10a