我主要使用宏语言。
对于我的宏,我要求用户从图像中选择一些元素。一个是椭圆选择,另一个是多边形。我在投资回报率管理器中有这两个投资回报率,我想保留它们。
当我对图像进行进一步分析以隔离不同组织时,我需要使用分析粒子向ROI管理器添加更多ROI,但是当我添加它们时,它会删除用户选择的ROI。
有没有办法将ROI附加到列表中,还是需要重新排序我的宏?
run("Select None"); //Selecting nothing just in case
setTool(1); //Elliptical tool
while (selectionType != 1) {
message= "Elliptical Selection Required\n Please select the Peduncle Attachment Zone";
waitForUser(message);
}
roiManager("Add");
// User selection of Seed Cavity
// hexagonal (polygon) selection
run("Select None"); //Selecting nothing just in case
setTool(2); //Elliptical tool
while (selectionType != 2) {
message= "Polygonal Selection Required\n Please select the Seed Cavity";
waitForUser(message);
}
roiManager("Add");
run("Select None"); //clear current selection
//threshold here
//analyze particles
run("8-bit");
setThreshold(0, 128);
setOption("BlackBackground", false);
run("Convert to Mask");
correctLUT(); //checks if inverted and corrects
run("Analyze Particles...", "size=55000-Infinity circularity=0.65-1.00 show=Masks display exclude add");
function correctLUT() {
invertedLUT = is("Inverting LUT");
if (invertedLUT == 1) {
run("Invert LUT");
run("Invert");
}
}