Posted by
Cammer, Michael on
Jun 07, 2017; 1:34pm
URL: http://imagej.273.s1.nabble.com/problem-with-Merge-Channels-and-renaming-tp5018849p5018855.html
Actually, the problem is worse than that. To do things to the result window after the macro stops, I need to click on the image twice or else the first time doing an operation returns an error that an image needs to be selected.
=*===========================================================*=
Michael Cammer, DART Microscopy Laboratory, NYU Langone Medical Center
Cell: 914-309-3270 (this is for calling, not texting) Office: Skirball 2nd Floor main office, back right
http://ocs.med.nyu.edu/microscopy &
http://microscopynotes.com/-----Original Message-----
From: ImageJ Interest Group [mailto:
[hidden email]] On Behalf Of PEARSON Matthew
Sent: Wednesday, June 07, 2017 2:36 AM
To:
[hidden email]
Subject: Re: problem with Merge Channels and renaming
Hi Michael,
I think you're right that the active image should be the merge but to get around this you could use selectWindow (); to try to force the merge to be active? I realise this would only be a temporary workaround if it works!
Thanks,
Matt
-------- Original message --------
From: "Cammer, Michael" <
[hidden email]>
Date: 07/06/2017 02:19 (GMT+00:00)
To:
[hidden email]
Subject: problem with Merge Channels and renaming
I'm having a problem with renaming an image after using run("Merge Channels..." with ImageJ 1.51o (which according to the update command in the help menu is the daily build) and both Java 1.6 and 1.8.
In the macro below, at the end an image that is not the result of the Merge Channels gets renamed. If the only other wndow open is the original, then the original is renamed.
Help appreciated.
Regards,
Michael
/==================================
macro "Proper Eq of RGB per channel" {
//original = getImageID;
title = getTitle;
run("Duplicate...", "title=temp");
run("Split Channels");
selectWindow("temp (blue)");
run("Enhance Contrast...", "saturated=0 equalize");
selectWindow("temp (green)");
run("Enhance Contrast...", "saturated=0 equalize");
selectWindow("temp (red)");
run("Enhance Contrast...", "saturated=0 equalize");
run("Merge Channels...", "c1=[temp (red)] c2=[temp (green)] c3=[temp (blue)]");
rename("EQ_" + title);
}
_________________________________________
Michael Cammer, Optical Microscopy Specialist
http://ocs.med.nyu.edu/microscopy https://urldefense.proofpoint.com/v2/url?u=http-3A__microscopynotes.com_&d=DQIFAw&c=j5oPpO0eBH1iio48DtsedbOBGmuw5jHLjgvtN2r4ehE&r=oU_05LztNstAydlbm5L5GDu_vAdjXk3frDLx_CqKkuo&m=M69Y9Gke41XnqN9Sp7h6PpvnQqDcwwFHASmooE1l0lQ&s=2LmX0tW7RJXPLG_h9LWVsn5ORIfI7zOp3-6mFA8MMfM&e=Cell: (914) 309-3270
------------------------------------------------------------
This email message, including any attachments, is for the sole use of the intended recipient(s) and may contain information that is proprietary, confidential, and exempt from disclosure under applicable law. Any unauthorized review, use, disclosure, or distribution is prohibited. If you have received this email in error please notify the sender by return email and delete the original message. Please note, the recipient should check this email and any attachments for the presence of viruses. The organization accepts no liability for any damage caused by any virus transmitted by this email.
=================================
--
ImageJ mailing list:
https://urldefense.proofpoint.com/v2/url?u=http-3A__imagej.nih.gov_ij_list.html&d=DQIFAw&c=j5oPpO0eBH1iio48DtsedbOBGmuw5jHLjgvtN2r4ehE&r=oU_05LztNstAydlbm5L5GDu_vAdjXk3frDLx_CqKkuo&m=M69Y9Gke41XnqN9Sp7h6PpvnQqDcwwFHASmooE1l0lQ&s=QxpSVd0tXqEN8N8oMwbqUL_MNzSCSD187e2N_ARy0ZQ&e=
--
ImageJ mailing list:
https://urldefense.proofpoint.com/v2/url?u=http-3A__imagej.nih.gov_ij_list.html&d=DQIFAw&c=j5oPpO0eBH1iio48DtsedbOBGmuw5jHLjgvtN2r4ehE&r=oU_05LztNstAydlbm5L5GDu_vAdjXk3frDLx_CqKkuo&m=M69Y9Gke41XnqN9Sp7h6PpvnQqDcwwFHASmooE1l0lQ&s=QxpSVd0tXqEN8N8oMwbqUL_MNzSCSD187e2N_ARy0ZQ&e=
------------------------------------------------------------
This email message, including any attachments, is for the sole use of the intended recipient(s) and may contain information that is proprietary, confidential, and exempt from disclosure under applicable law. Any unauthorized review, use, disclosure, or distribution is prohibited. If you have received this email in error please notify the sender by return email and delete the original message. Please note, the recipient should check this email and any attachments for the presence of viruses. The organization accepts no liability for any damage caused by any virus transmitted by this email.
=================================
--
ImageJ mailing list:
http://imagej.nih.gov/ij/list.html