DiameterJ macro problem

I downloaded Fiji and Diameter J from https://imagej.net/DiameterJ(DiameterJ v. 1.018 for Fiji)

When I tried to use macro to analyze SEM image, some errors occurred.
I don’t have any experience java and ImageJ program,
so please give me advices
I attach error messages

The first one is appeared when I tried to follow instructions to use DiameterJ_Segment.ijm.
(Fiji - Plugins - Diameter J - Diameter J Segment)
Undefined variable in line 159
var path0 = + name [0];
But when I try (Fiji - Plugins - Macros - Run - DiameterJ_Segment.ijm.), no problem.

After doing segmentation and running macro DiameterJ_1-018,
second message is appeared.
Row (-4) out of range in line 322
Char_Length_Mean = getResult (“Branch length”, nResults -4 <)>;

Thank you


I’m encountering the same errors. Have you found a way to solve it? Every time I try to analyse a batch of images in the same directory, fiji will only analyse the first one. With ImageJ, the same error occurs.


1 Like


I have the same error with the second one. It works with another computer, but not mine.
I am using fiji 1.52 with DiameterJ 1.018.


I get this with Pore_SD = getResult(“Area”, nResults -4<)>; When computing 1-018.

If I don’t apply cropping when segmenting, the error is avoided.

Hi, I am new in ImageJ and DiameterJ, following the training example of https://sites.google.com/site/diameterj/home I am getting the same error:
Error: Row (-4) out of range in line 323:
Char_Length_Mean = getResult ( “Branch length” , nResults - 4 <)> ;
As suggested, I tried to no cropping the images but I get always the same error.
I am running ImageJ 1.52n and DiameterJ 1-018
Have someone solved the problem?
Any suggestions would be appreciate.

Han anybody solved this issues? I have the same problem and I can´t solve it

At the end, I “solved” changing OS. It works on Linux. On windows, I haven’t found a way to make it works.

oh ok. Thank you for replying :slight_smile: I cannot use Linux on my work pc now, but it is good to know it!

if it can help, you can use a bootable pendrive with ubuntu or your favorite distribution and run DiameterJ on it.

tagging @DiameterJ for better reach.

The error appears to occur with the newest version of ImageJ (v1.53), and possibly the use of the nResults and Results macros.

A fix may be reverting to a previous version. While ImageJ is open, navigate to ‘Help’ in the toolbar, and select ‘Update ImageJ’ from the drop-down menu. From the pop-up, select a previous version (try v1.51), then click ‘OK’ and restart to program.

That should resolve the ‘out of bounds’ error you were receiving. Just make sure no new errors occur from using an outdated version!

1 Like

Hello every one!
I’ve already solved that problems by using the package that I share on the link below. As NHotaling (in other questions of this forum and Eric_oliverio above said, it is a version problem of Image J (FIJI).So, now I’m working with the v1.51w version, and both the segmentation and diameterJ 1.018 plugins run well.
Hopefully this would be helpful.

this fixed it for me! Thanks!