Help with macro error

Hello everyone,
I am trying to run a Java script (developed by a lab in Japan) to check microtubule angles and parallelness. But when i run the script i get an macro error message (below)

Here is the Java script which i downloaded here - http://hasezawa.ib.k.u-tokyo.ac.jp/zp/Kbi/FiberAngleMeasureMacro
I already have the KbiPlugins (mentioned in the link above installed in Fiji) . I am also not sure about where to install the ‘scala_library’ in Fiji (again mentioned in the link above)

//
// Measure the mean angle and parallelness of fibers in fluorescence image.
//
// Output (in Results table):
//   * z: z-coordinates (slice number, 1-origin)
//   * theta: mean angle in degree
//   * normAvgRad: parallelness (range: 0-1)
//   * totalPair: number of neighbored-pixel pairs including skeletonize image.
//
// Requirements
//   * ImageJ
//   * KBI (KashiwaBioimageInformatics) ImageJ plugins
//     http://hasezawa.ib.k.u-tokyo.ac.jp/zp/Kbi/ImageJKbiPlugins
//
// Copyright (C) 2010 Natsumaro Kutsuna
// KashiwaBioimageInformatics, Hasezawa Lab,
// Department of Integrated Biosciences,
// Graduate School of Frontier Sciences,
// The University of Tokyo
// http://hasezawa.ib.k.u-tokyo.ac.jp/zp/Kbi/ImageJKbiPlugins

Dialog.create("angle measurements for fiber");
Dialog.addNumber("bandpassFrom", 9);
Dialog.addNumber("bandpassTo", 12);
Dialog.addCheckbox("debug", false)
Dialog.show();
bpFrom = Dialog.getNumber();
bpTo = Dialog.getNumber();
debug = Dialog.getCheckbox();

setBatchMode(!debug);

function dupForDebug(title) {
    if (debug) {
        processId = getImageID();
        run("Duplicate...", "title=" + title);
        selectImage(processId);
    }
}

dupForDebug("0:originalBackup");
run("Kbi Filter2d", "filter=bandPassOps bpmode=gaussian low=" + bpFrom + " hi=" + bpTo + " postproc=none overwrite");
resetMinAndMax();
run("8-bit");
dupForDebug("1:bandPass-8bit");
//run("Threshold...");
//setAutoThreshold();
run("Kbi Filter2d", "filter=thresholdOps thrmode=otsu eightconn border=bg thrisbg overwrite");
dupForDebug("2:thresholdByOtsu");
run("Kbi Filter2d", "filter=filtersForBilevel bilevelmode=bilevelThin isremovedots ispostelong overwrite");
run("Kbi LinesAngle", "mode=eachSlice");

Could someone help me out with this error?
Thanks!
Praveen

Hi @Praveen

just rename the variable “debug”. It is obviously a system variabe (or function) which cannot be used as a normal variable…

Cheers,
Robert

2 Likes

debug is an apparently undocumented macro function:


  • In the ImageJ 1.x text editor, it opens the debug window.
  • In the script editor, it is highlighted as a reserved keyword, but executing it leads to the error message you observed, which clearly is a bug.

Thanks Robert. That seems to work? But like @imagejan mentioned, is this really a bug?