Posted by
Krs5 on
URL: http://imagej.273.s1.nabble.com/Weird-macro-behaviour-tp5011475p5011479.html
Dear Anália,
Any change you have spaces in the image name? If so you need: run("Add Image...","image="+[original]);
Kees
Dr Ir K.R. Straatman
Senior Experimental Officer
Advanced Imaging Facility
Centre for Core Biotechnology Services
University of Leicester
http://www2.le.ac.uk/colleges/medbiopsych/facilities-and-services/cbs/lite/aif-----Original Message-----
From: ImageJ Interest Group [mailto:
[hidden email]] On Behalf Of analia
Sent: 06 February 2015 10:48
To:
[hidden email]
Subject: Weird macro behaviour
Dear all,
I have programmed a simple code for the processing of some biological images. Without going into the specifics, the code splits channels, gets the green channel, runs convolution, makes binary and then analyses particles.
So far so good. Then, it uses ROI manager, takes labels and changes color to magenta.
The idea is to overlay the original image at the end. So, the "Add Image..."
command is issued, the resulting image is flattened and saved as tif.
My problem is the run("Add Image...","image="+original) command, or, better said, where I execute it.
If I open a new macro window in ImageJ
(ImageJ->Plugins->Macros->New->Macro), write down the code and execute it from that window (Macros->Run macro), it works just fine.
...
run("Analyze Particles...", "size=0-500 pixel circularity=0-1 show=Nothing add");
roiManager("Show all without labels");
run("Colors...","selection=magenta");
open(<sourcePath>);
original=getTitle();
print(">>>> "+original);
selectImage(4); //1, 2 and 3 correspond to the channels...
roi=getTitle();
print(">>>> "+roi);
run("Add Image...","image="+original);
run("Flatten");
saveAs("Tiff",<destinyPath>+roi);
Now, if I write the macro in a text editor and do
ImageJ->Plugins->Macros->Run the command run("Add
Image...","image="+original) does not work. If I comment it, and save to file the original and the roi (flattened) images, everything is good, but this command doe snot work and I can get the original image to be added to the roi image. How can this be possible?
My machine is a Windows 8.1 64-bit and I am using ImageJ 1.49n.
Probably (more than likely), I am missing some specifics of ImageJ macro programming, but I go over it again, and again, and don't see it (as it usually happens). Please could someone help me?
Many thanks in advance,
Anália
--
View this message in context:
http://imagej.1557.x6.nabble.com/Weird-macro-behaviour-tp5011475.htmlSent from the ImageJ mailing list archive at Nabble.com.
--
ImageJ mailing list:
http://imagej.nih.gov/ij/list.html--
ImageJ mailing list:
http://imagej.nih.gov/ij/list.html