Login  Register

Increasing macro routine efficiency

Posted by Joaquin Soriano on Oct 23, 2006; 5:11pm
URL: http://imagej.273.s1.nabble.com/Increasing-macro-routine-efficiency-tp3701246.html

I have  built a very large macro and know I'm thinking about increasing his
efficiency by reducing his executing time. This macro combines series of
images and always gives a result window, I think that I could reduce the
macro executing time if I could tell the program not to show me any image
but the last one. The fact is that I don't have any idea about programming
(I built the macro using the plug in "Macro Record"), but it looks intuitive
that the PC "expends time" creating this "intermediary images" and that I
could save time if this images were not created. Am I right? , How can be
that done?

 

For example, if I had to do an XOR between the image stacks 1 and 2 and then
execute a reconstruct command using the image 1 as mask and the result of
the XOR as seed, the macro written by the Macro recorder will be this:

 

imageCalculator("XOR create stack", "1.tif","2.tif");

//run("Image Calculator...", "image1=1.tif operation=XOR image2=2.tif create
stack");

run("BinaryReconstruct ", "mask=1.tif seed=[Result of 1.tif] create white");

 

Then, I would have four stacks as a result of executing this macro: the
original ones ("1.tif" and "2.tif"), the resulting stack ("Reconstructed")
and the stack "Result of 1.tif". I'm not interested in the stack "Result of
1.tif" and I think that creating this image is a waste of time. Can I modify
the "macro code" somehow, in order to avoid creating this stack?

 

PS: if any one has any idea about how to optimize the macros running time,
please let me know, all suggestions are welcome.

 

Thank you very much in advance.

 

Joaquim Soriano Felipe. PhD student.
Dpt. of Medical sciences, School of Medicine-CRIB, University of Castilla-la
Mancha  

 C/ Almansa, 14, 02006 Albacete (Spain).

Tel. +0034-967599200 Ext.2934

Fax. +0034-967599327

[hidden email]