Re: [BoneJ: 269] SMI Macro

83 views
Skip to first unread message

Michael Doube

unread,
Oct 25, 2012, 8:55:40 AM10/25/12
to bonej-users-a...@googlegroups.com, Ben
Hi Ben,

Thanks for the report, but I haven't been able to reproduce it here.
What versions of ImageJ, BoneJ, 3D viewer and Java are you using?
Vanilla ImageJ or Fiji?

Michael



--
Sent from my Nokia N9
On 25/10/2012 13:40 Ben wrote:
Hello Michael,


i was calculating the SMI in a Macro
“run("Structure Model Index", "smi=[Hildebrand & Rüegsegger] voxel=2
mesh=0.500");”
But when I recalculate the SMI within the GUI the result is not the
same (0,8 vs. 1,2)
(Voxel and Mesh Parameters are the same, Bone Foreground 255)
(The recalculation of the BV/TV, DA, Connectivity and thickness
correlates very well)


Any suggestions?


Thank you


Ben
--

Ben

unread,
Oct 25, 2012, 9:15:07 AM10/25/12
to bonej-users-a...@googlegroups.com
Hello Michael,

thank you for your reply.
I use ImageJ (1.47D), BoneJ(1.37),
Java version "1.6.0_24"
OpenJDK Runtime Environment (IcedTe
a6 1.11.4) (6b24-1.11.4-1ubuntu0.12.04.1)
OpenJDK 64-Bit Server VM (build 20.0-b12, mixed mode)
How do I retrieve the information about the 3D Viewer?

with kind regards

Ben

Ben

unread,
Oct 25, 2012, 10:33:35 AM10/25/12
to bonej-users-a...@googlegroups.com
Hello Michael,

I have tried the same procedure on my Windows PC (ImageJ 1.47D), BoneJ (1.37) Java version '1.6.0_20 64-Bit' and there the problem does not exist.
So the Result of the SMI is the same regardless of the procedure (Macro vs. GUI)
Is this a matter of memory?
I start imagej on Linux with this command:
java -jar -Xmx40g -XX:+AggressiveHeap /usr/share/java/ij.jar -ijpath  -macro "$1"_imagej

Thank you
Regards
Ben

Michael Doube

unread,
Oct 25, 2012, 10:53:01 AM10/25/12
to bonej-users-a...@googlegroups.com
Hi Ben,

> I have tried the same procedure on my Windows PC (ImageJ 1.47D), BoneJ
> (1.37) Java version '1.6.0_20 64-Bit' and there the problem does not exist.

I tried in Ubuntu 12.04 with Oracle Java 1.7_07, and all was OK.

> Is this a matter of memory?

I doubt it.

The only way I know to work out the 3D viewer version is to download
it again, remembering the date of the release you are working with.

Have you tried with a different JRE on your 'broken' setup?

Michael

Ben

unread,
Oct 25, 2012, 11:48:26 AM10/25/12
to bonej-users-a...@googlegroups.com
Hello Michael,

I have changed the Java ( java version "1.7.0_07"
OpenJDK Runtime Environment (IcedTea7 2.3.2) (7u7-2.3.2a-0ubuntu0.12.04.1)
OpenJDK 64-Bit Server VM (build 23.2-b09, mixed mode) and the 3D Viewer but nothing changed.
The SMI calculated in the macro is always less then calculated in the GUI (reproducibly).

Regards
Ben

Ben

unread,
Oct 26, 2012, 9:08:34 AM10/26/12
to bonej-users-a...@googlegroups.com

Hello Michael,

I have tried different things:

First: I installed Ubuntu 12_04 64 on Virtualbox with the new Plugins (3D Viewer, BoneJ). Also in this configuration nothing has changed. The SMI is different. (GUI/Macro)

Second: I installed the Oracle Java 7. The SMI is different. (GUI/Macro)

Third: I copied the Plugin Folder from Windows to Linux. The SMI is different. (GUI/Macro)

Forth: I installed FijI, but the effect is the same.

It is curious that the same Stack with the same Macro with the same Plugin gives different SMI Calculations on Windows and on Linux:

On Windows the SMI calculated within the GUI and in the Macro is the same.

On my Linux Machine (Virtualbox) the results are different.

 

 

Best regards

 

Ben

Ben

unread,
Oct 26, 2012, 10:31:04 AM10/26/12
to bonej-users-a...@googlegroups.com

Hello Michael,

 

I think this is a problem with escaping the String in the macro.

The results of H&R and Skyscan are always the same in the macro.

But within the GUI they are not.

 

Regards

 

Ben

Michael Doube

unread,
Oct 29, 2012, 6:40:06 AM10/29/12
to bonej-users-a...@googlegroups.com
Hi Ben,

Thanks for all your efforts to debug this issue.

I still haven't managed to reproduce, using ImageJ v1.7d on:

Ubuntu 12.04 with 64-bit Oracle Java 1.7.0_07, BoneJ 1.3.7
Windows 7 with 64-bit Oracle Java 1.6.0_34, BoneJ 1.3.7

See attached screenshot: even though Windows can't handle the ü character properly, the macro records and runs properly with the same parameters and result as the user dialog.

Would you be able to post your macro here, in case that is where the bug lies?

Best regards,

Michael
Clipboard.png

Michael Doube

unread,
Oct 29, 2012, 6:42:01 AM10/29/12
to bonej-users-a...@googlegroups.com
> I still haven't managed to reproduce, using ImageJ v1.7d*

*v1.47d



Ben

unread,
Oct 29, 2012, 11:22:43 AM10/29/12
to bonej-users-a...@googlegroups.com

Hi Michael,

 

when I record the macro, then this is printed:

run("Structure Model Index", "smi=[Hildebrand & Rüegsegger] voxel=2 mesh=0.500");

When I start this macro within the GUI the result is the same as the result of the command (in this case 2,085)

If I write this macro in a file test.txt and then I start imagej within the console like this:
java -jar -Xmx4g /usr/share/java/ij.jar –macro test

then the result is not the same (it is 1,627) like the SMI Skyscan.

So my workaround is:

In a Script I call Imagej Macro Interpreter (Fiji)

When my macro test.txt is called by this (exec test.txt) then the calculated SMI is fine.


Best regards

Ben

Michael Doube

unread,
Oct 29, 2012, 11:43:07 AM10/29/12
to bonej-users-a...@googlegroups.com
Hi Ben

> If I write this macro in a file test.txt and then I start imagej within
> the console like this:
> java -jar -Xmx4g /usr/share/java/ij.jar �macro test

Right, so it's a console vs GUI problem. I thought you were reporting a
dialog vs. macro problem.

Now I can reproduce it with the test macro:

open("/home/mdoube/Desktop/cheetah_256-binary.tif");
run("Structure Model Index", "smi=[Hildebrand & R�egsegger] voxel=2
mesh=0.500");

And the console command:

java -jar -Xmx4g ij.jar -macro ~/ImageJ/macros/test

I get 0.002 instead of 0.785. And you are right, it is running the
non-recommended SkyScan version of the command - you can see in the
status bar 'dilating voxel model', which is how the algorithm generates
two meshes with different surface area and volume for SMI calculation.

I will send this report upstream to the ImageJ developers.

Michael


Michael Doube

unread,
Nov 1, 2012, 6:47:18 AM11/1/12
to bonej-users-a...@googlegroups.com
Hi Ben,

We found the bug which is due to the way the ü character is handled. I have a workaround in development which will mean the correct option gets used when you call Structure Model Index in a macro from the command line.

Michael
Reply all
Reply to author
Forward
0 new messages