Aims:
A distance transform takes a mask as input and outputs an image in which the pixel values represent the shortest distance from the pixel to the border of the object.
Continue the code from the last exercise! Apply the Exact Euclidean Distance Transform
to the nucleus
mask. Use the particle analyzer to add the spots to the roi-manager and eliminate very small objects in
the same time. Make sure the min. intensity is measured (Set Measurements
). Activate the EDT image and
measure the rois.
roiManager("reset");
inputImageID = getImageID();
inTitle = getTitle();
DoG(1.4, 3);
setAutoThreshold("Triangle dark");
run("Convert to Mask");
run("Watershed");
spotsMaskID = getImageID();
selectImage(inputImageID);
run("Duplicate...", "duplicate channels=2-2");
setAutoThreshold("Triangle dark");
run("Convert to Mask");
nucleusMaskID = getImageID();
imageCalculator("and", spotsMaskID, nucleusMaskID);
your code starts after this line
selectImage(nucleusMaskID);
run("Exact Euclidean Distance Transform (3D)");
selectImage(spotsMaskID);
run("Analyze Particles...", "size=50-Infinity show=Nothing add");
selectImage("EDT");
rename(inTitle);
run("Set Measurements...", "min centroid center display add redirect=None decimal=3");
roiManager("measure");
close();
close();
close();
roiManager("show all without labels");
Label | Min | Max | X | Y | XM | YM |
---|---|---|---|---|---|---|
cell.tif:0001-0664 | 5.000 | 20.100 | 965.779 | 663.541 | 966.129 | 664.711 |
cell.tif:0002-0663 | 6.000 | 19.105 | 983.881 | 662.552 | 983.939 | 663.423 |
cell.tif:0003-0667 | 7.071 | 20.100 | 1012.868 | 666.588 | 1012.906 | 667.463 |
cell.tif:0004-0671 | 7.616 | 22.091 | 941.944 | 670.198 | 941.963 | 671.209 |
cell.tif:0005-0674 | 6.000 | 17.029 | 915.800 | 674.510 | 915.822 | 675.274 |
cell.tif:0006-0676 | 4.123 | 17.720 | 902.533 | 676.238 | 903.057 | 677.334 |
cell.tif:0007-0675 | 18.974 | 28.862 | 960.578 | 675.591 | 960.635 | 675.902 |
cell.tif:0008-0689 | 28.018 | 44.407 | 1007.199 | 688.452 | 1007.038 | 688.934 |
cell.tif:0009-0691 | 31.305 | 43.417 | 1020.580 | 691.788 | 1020.618 | 692.080 |
cell.tif:0010-0695 | 5.099 | 16.279 | 867.115 | 695.656 | 867.641 | 696.200 |
cell.tif:0011-0698 | 16.553 | 31.385 | 1072.849 | 698.091 | 1072.706 | 698.687 |
cell.tif:0012-0713 | 8.602 | 20.616 | 855.441 | 712.665 | 855.761 | 713.245 |
cell.tif:0013-0717 | 25.612 | 36.620 | 874.899 | 717.500 | 875.093 | 717.641 |
cell.tif:0014-0723 | 5.657 | 17.692 | 837.315 | 723.370 | 837.905 | 724.037 |
cell.tif:0015-0726 | 71.253 | 79.310 | 970.900 | 726.777 | 970.897 | 726.839 |
cell.tif:0016-0728 | 10.000 | 22.204 | 1139.263 | 728.421 | 1138.815 | 728.935 |
cell.tif:0017-0732 | 6.708 | 20.000 | 1151.908 | 731.931 | 1151.523 | 732.800 |
cell.tif:0018-0736 | 18.682 | 33.615 | 845.899 | 737.645 | 846.306 | 738.043 |
cell.tif:0019-0734 | 3.000 | 13.454 | 1165.077 | 734.325 | 1164.851 | 735.202 |
cell.tif:0020-0734 | 40.361 | 49.041 | 877.978 | 733.935 | 878.024 | 734.040 |
cell.tif:0021-0749 | 12.369 | 29.547 | 1167.235 | 749.960 | 1166.497 | 750.709 |
cell.tif:0022-0755 | 90.139 | 105.361 | 1017.077 | 754.974 | 1016.951 | 755.109 |
cell.tif:0023-0757 | 83.863 | 93.295 | 917.183 | 757.400 | 917.218 | 757.456 |
cell.tif:0024-0761 | 93.557 | 110.635 | 942.552 | 761.747 | 942.610 | 761.913 |
cell.tif:0025-0763 | 4.472 | 19.723 | 814.758 | 763.737 | 815.960 | 764.052 |
cell.tif:0026-0791 | 17.464 | 37.577 | 818.506 | 791.395 | 819.271 | 791.367 |
cell.tif:0027-0796 | 40.608 | 47.802 | 1179.696 | 796.716 | 1179.635 | 796.771 |
cell.tif:0028-0800 | 7.071 | 22.361 | 799.631 | 801.263 | 800.573 | 801.638 |
cell.tif:0029-0802 | 8.485 | 25.239 | 1219.944 | 801.821 | 1218.855 | 802.383 |
cell.tif:0030-0816 | 89.140 | 104.805 | 1127.883 | 815.655 | 1127.790 | 815.801 |
cell.tif:0031-0821 | 108.227 | 125.873 | 903.054 | 821.679 | 903.180 | 821.795 |
cell.tif:0032-0825 | 75.611 | 85.907 | 862.557 | 825.490 | 862.626 | 825.528 |
cell.tif:0033-0825 | 5.385 | 20.248 | 1255.238 | 826.030 | 1254.630 | 827.014 |
cell.tif:0034-0853 | 160.524 | 179.725 | 1046.928 | 852.430 | 1046.891 | 852.513 |
cell.tif:0035-0850 | 23.770 | 31.953 | 803.255 | 851.066 | 803.408 | 851.165 |
cell.tif:0036-0856 | 62.626 | 76.400 | 1201.724 | 855.895 | 1201.605 | 856.035 |
cell.tif:0037-0864 | 11.662 | 32.202 | 1284.349 | 864.224 | 1283.428 | 864.911 |
cell.tif:0038-0878 | 4.123 | 17.493 | 1308.610 | 877.917 | 1307.603 | 878.169 |
cell.tif:0039-0880 | 20.616 | 36.797 | 1287.416 | 880.303 | 1287.045 | 880.757 |
cell.tif:0040-0893 | 53.824 | 66.483 | 1259.029 | 894.067 | 1258.887 | 894.178 |
cell.tif:0041-0892 | 5.657 | 17.000 | 1316.653 | 892.629 | 1316.150 | 893.173 |
cell.tif:0042-0897 | 40.311 | 48.549 | 1280.044 | 897.426 | 1279.996 | 897.527 |
cell.tif:0043-0903 | 30.529 | 44.777 | 1293.778 | 904.278 | 1293.429 | 904.450 |
cell.tif:0044-0905 | 159.806 | 174.668 | 1109.593 | 904.947 | 1109.523 | 905.007 |
cell.tif:0045-0904 | 180.424 | 187.545 | 1086.208 | 903.931 | 1086.195 | 903.948 |
cell.tif:0046-0911 | 4.123 | 32.016 | 1316.414 | 913.321 | 1314.392 | 913.642 |
cell.tif:0047-0906 | 154.175 | 164.770 | 1122.000 | 906.025 | 1121.978 | 906.062 |
cell.tif:0048-0928 | 37.577 | 52.811 | 1294.189 | 928.433 | 1293.845 | 928.466 |
cell.tif:0049-0944 | 50.010 | 66.708 | 1285.190 | 945.546 | 1284.840 | 945.531 |
cell.tif:0050-0941 | 8.944 | 21.378 | 1329.118 | 941.294 | 1328.429 | 941.783 |
cell.tif:0051-0945 | 236.212 | 244.002 | 1048.577 | 945.638 | 1048.566 | 945.653 |
cell.tif:0052-0945 | 247.976 | 255.783 | 1032.375 | 945.554 | 1032.365 | 945.568 |
cell.tif:0053-0950 | 12.000 | 28.460 | 760.827 | 950.265 | 761.521 | 950.862 |
cell.tif:0054-0957 | 18.000 | 36.056 | 1318.648 | 957.797 | 1317.785 | 957.999 |
cell.tif:0055-0956 | 121.758 | 129.973 | 1218.173 | 955.827 | 1218.139 | 955.834 |
cell.tif:0056-0968 | 233.944 | 241.963 | 983.013 | 968.000 | 983.032 | 968.005 |
cell.tif:0057-0981 | 7.000 | 19.416 | 1332.625 | 981.257 | 1331.837 | 981.280 |
cell.tif:0058-0985 | 148.930 | 160.078 | 891.345 | 984.881 | 891.393 | 984.886 |
cell.tif:0059-1007 | 283.551 | 300.147 | 1037.452 | 1008.093 | 1037.439 | 1008.161 |
cell.tif:0060-1001 | 7.810 | 20.100 | 1334.420 | 1000.734 | 1333.651 | 1001.041 |
cell.tif:0061-1003 | 4.000 | 20.881 | 741.444 | 1002.946 | 742.978 | 1003.247 |
cell.tif:0062-1004 | 153.209 | 169.579 | 1184.521 | 1003.829 | 1184.400 | 1003.847 |
cell.tif:0063-1014 | 33.242 | 48.703 | 769.000 | 1013.132 | 769.431 | 1013.055 |
cell.tif:0064-1022 | 125.172 | 132.673 | 857.682 | 1022.245 | 857.710 | 1022.254 |
cell.tif:0065-1036 | 113.437 | 120.880 | 841.605 | 1036.658 | 841.640 | 1036.655 |
cell.tif:0066-1041 | 291.342 | 303.975 | 1026.346 | 1041.869 | 1026.387 | 1041.884 |
cell.tif:0067-1044 | 3.000 | 21.024 | 1333.397 | 1043.383 | 1332.072 | 1044.021 |
cell.tif:0068-1046 | 101.124 | 113.111 | 1239.399 | 1046.335 | 1239.301 | 1046.312 |
cell.tif:0069-1063 | 9.000 | 21.095 | 734.126 | 1062.726 | 734.818 | 1062.648 |
cell.tif:0070-1058 | 9.487 | 18.974 | 1333.698 | 1057.984 | 1333.267 | 1058.002 |
cell.tif:0071-1062 | 266.558 | 274.607 | 993.814 | 1062.729 | 993.829 | 1062.737 |
cell.tif:0072-1067 | 95.005 | 104.307 | 1247.639 | 1067.576 | 1247.581 | 1067.572 |
cell.tif:0073-1072 | 66.370 | 79.310 | 791.587 | 1071.933 | 791.745 | 1071.927 |
cell.tif:0074-1074 | 82.000 | 93.021 | 1261.129 | 1073.624 | 1261.040 | 1073.596 |
cell.tif:0075-1073 | 182.176 | 192.260 | 906.300 | 1073.186 | 906.339 | 1073.189 |
cell.tif:0076-1077 | 140.089 | 149.496 | 1196.525 | 1076.175 | 1196.489 | 1076.169 |
cell.tif:0077-1081 | 73.110 | 80.306 | 1271.354 | 1080.725 | 1271.303 | 1080.689 |
cell.tif:0078-1085 | 124.535 | 134.848 | 1209.276 | 1084.908 | 1209.254 | 1084.829 |
cell.tif:0079-1085 | 177.544 | 186.979 | 1148.439 | 1084.048 | 1148.402 | 1084.053 |
cell.tif:0080-1089 | 10.000 | 32.558 | 1327.924 | 1089.814 | 1326.125 | 1090.565 |
cell.tif:0081-1091 | 102.005 | 110.000 | 1234.258 | 1090.711 | 1234.218 | 1090.692 |
cell.tif:0082-1093 | 112.009 | 124.487 | 835.415 | 1092.559 | 835.517 | 1092.523 |
cell.tif:0083-1098 | 75.928 | 99.247 | 1253.479 | 1097.890 | 1253.202 | 1097.668 |
cell.tif:0084-1101 | 123.911 | 135.624 | 846.232 | 1101.366 | 846.309 | 1101.363 |
cell.tif:0085-1103 | 152.322 | 166.412 | 1163.463 | 1103.343 | 1163.351 | 1103.359 |
cell.tif:0086-1108 | 277.894 | 294.410 | 1012.882 | 1108.779 | 1012.913 | 1108.724 |
cell.tif:0087-1104 | 101.789 | 110.454 | 1224.266 | 1104.578 | 1224.221 | 1104.559 |
cell.tif:0088-1116 | 7.211 | 24.042 | 1326.121 | 1117.810 | 1325.086 | 1117.655 |
cell.tif:0089-1107 | 203.961 | 213.860 | 1106.082 | 1106.280 | 1106.054 | 1106.268 |
cell.tif:0090-1110 | 25.632 | 42.450 | 1306.506 | 1110.115 | 1306.007 | 1110.069 |
cell.tif:0091-1113 | 87.983 | 100.170 | 1232.380 | 1113.528 | 1232.290 | 1113.464 |
cell.tif:0092-1112 | 70.803 | 80.212 | 1255.572 | 1112.225 | 1255.514 | 1112.197 |
cell.tif:0093-1115 | 146.123 | 154.324 | 866.000 | 1115.296 | 866.033 | 1115.307 |
cell.tif:0094-1120 | 60.745 | 70.725 | 1261.757 | 1120.833 | 1261.679 | 1120.783 |
cell.tif:0095-1129 | 19.647 | 37.696 | 1304.450 | 1129.779 | 1303.823 | 1129.224 |
cell.tif:0096-1142 | 54.708 | 71.610 | 1252.894 | 1142.732 | 1252.531 | 1142.675 |
cell.tif:0097-1145 | 140.730 | 150.416 | 865.796 | 1145.326 | 865.840 | 1145.330 |
cell.tif:0098-1156 | 7.211 | 19.647 | 1301.934 | 1156.250 | 1300.876 | 1156.584 |
cell.tif:0099-1178 | 15.264 | 29.069 | 1279.472 | 1177.897 | 1279.271 | 1177.211 |
cell.tif:0100-1183 | 130.096 | 151.489 | 879.233 | 1182.915 | 879.362 | 1182.742 |
cell.tif:0101-1182 | 108.780 | 126.890 | 1178.667 | 1182.341 | 1178.519 | 1182.321 |
cell.tif:0102-1189 | 92.914 | 109.179 | 1193.918 | 1188.973 | 1193.738 | 1188.939 |
cell.tif:0103-1191 | 170.496 | 178.732 | 1114.485 | 1191.576 | 1114.458 | 1191.568 |
cell.tif:0104-1193 | 21.587 | 33.956 | 1267.702 | 1193.202 | 1267.297 | 1193.172 |
cell.tif:0105-1202 | 182.332 | 191.638 | 1095.066 | 1201.302 | 1095.062 | 1201.270 |
cell.tif:0106-1200 | 113.886 | 121.758 | 1171.336 | 1200.844 | 1171.296 | 1200.850 |
cell.tif:0107-1204 | 16.279 | 30.017 | 1271.011 | 1204.118 | 1270.501 | 1203.885 |
cell.tif:0108-1212 | 95.509 | 118.962 | 1177.798 | 1212.876 | 1177.398 | 1212.854 |
cell.tif:0109-1214 | 39.000 | 55.073 | 1241.169 | 1215.148 | 1240.888 | 1214.919 |
cell.tif:0110-1217 | 93.606 | 109.786 | 859.528 | 1216.951 | 859.656 | 1216.844 |
cell.tif:0111-1218 | 160.552 | 171.732 | 1108.270 | 1218.649 | 1108.246 | 1218.604 |
cell.tif:0112-1218 | 187.843 | 194.165 | 1056.519 | 1218.577 | 1056.518 | 1218.561 |
cell.tif:0113-1232 | 65.000 | 77.473 | 1208.989 | 1233.228 | 1208.858 | 1233.152 |
cell.tif:0114-1238 | 127.475 | 141.485 | 1134.450 | 1238.162 | 1134.344 | 1238.150 |
cell.tif:0115-1239 | 57.801 | 67.956 | 824.649 | 1239.014 | 824.722 | 1238.921 |
cell.tif:0116-1242 | 8.062 | 24.515 | 1265.560 | 1242.280 | 1264.517 | 1242.144 |
cell.tif:0117-1270 | 2.828 | 10.817 | 1266.095 | 1269.879 | 1265.657 | 1269.480 |
cell.tif:0118-1271 | 39.623 | 53.824 | 835.374 | 1271.123 | 835.531 | 1270.917 |
cell.tif:0119-1280 | 76.368 | 88.459 | 1167.500 | 1280.593 | 1167.429 | 1280.488 |
cell.tif:0120-1282 | 14.866 | 29.000 | 812.978 | 1282.519 | 813.417 | 1282.075 |
cell.tif:0121-1281 | 117.337 | 126.909 | 958.516 | 1281.742 | 958.546 | 1281.703 |
cell.tif:0122-1289 | 118.512 | 135.794 | 1023.796 | 1290.167 | 1023.735 | 1290.005 |
cell.tif:0123-1288 | 3.606 | 14.318 | 1253.261 | 1287.403 | 1252.377 | 1287.284 |
cell.tif:0124-1296 | 12.806 | 27.295 | 826.670 | 1297.734 | 827.095 | 1297.405 |
cell.tif:0125-1293 | 12.000 | 27.893 | 1239.824 | 1293.954 | 1238.984 | 1293.889 |
cell.tif:0126-1302 | 16.401 | 31.241 | 1228.104 | 1303.253 | 1227.698 | 1302.846 |
cell.tif:0127-1302 | 116.090 | 124.278 | 992.451 | 1301.992 | 992.468 | 1301.956 |
cell.tif:0128-1312 | 68.447 | 88.119 | 1122.490 | 1312.434 | 1122.275 | 1312.166 |
cell.tif:0129-1314 | 3.606 | 13.892 | 825.559 | 1315.912 | 826.124 | 1315.550 |
cell.tif:0130-1322 | 40.853 | 59.481 | 1160.986 | 1322.237 | 1160.714 | 1321.878 |
cell.tif:0131-1327 | 79.756 | 90.604 | 963.750 | 1327.385 | 963.740 | 1327.272 |
cell.tif:0132-1329 | 26.926 | 42.438 | 1185.941 | 1329.624 | 1185.660 | 1329.276 |
cell.tif:0133-1332 | 9.849 | 19.698 | 1212.012 | 1332.012 | 1211.626 | 1331.833 |
cell.tif:0134-1336 | 10.817 | 27.785 | 861.151 | 1336.394 | 862.125 | 1336.070 |
cell.tif:0135-1337 | 16.971 | 26.907 | 1197.512 | 1337.549 | 1197.276 | 1337.333 |
cell.tif:0136-1345 | 20.000 | 45.607 | 1155.160 | 1344.985 | 1154.404 | 1344.063 |
cell.tif:0137-1350 | 28.844 | 42.720 | 903.690 | 1349.603 | 903.937 | 1349.328 |
cell.tif:0138-1353 | 33.526 | 44.294 | 1124.685 | 1354.131 | 1124.539 | 1353.979 |
cell.tif:0139-1365 | 15.811 | 29.206 | 1146.263 | 1364.737 | 1146.146 | 1364.291 |
cell.tif:0140-1366 | 39.850 | 53.141 | 954.216 | 1366.745 | 954.311 | 1366.532 |
cell.tif:0141-1371 | 38.626 | 49.649 | 1062.801 | 1370.582 | 1062.815 | 1370.391 |
cell.tif:0142-1371 | 17.804 | 33.541 | 1122.892 | 1371.020 | 1122.364 | 1370.609 |
cell.tif:0143-1382 | 19.209 | 37.577 | 950.125 | 1384.315 | 950.076 | 1383.540 |
cell.tif:0144-1378 | 36.056 | 45.880 | 967.336 | 1378.045 | 967.334 | 1377.874 |
cell.tif:0145-1383 | 10.296 | 17.205 | 1127.441 | 1383.755 | 1127.298 | 1383.515 |
cell.tif:0146-1406 | 9.220 | 25.080 | 1017.229 | 1405.570 | 1016.714 | 1404.820 |
cell.tif:0147-1408 | 5.099 | 13.000 | 1034.643 | 1408.339 | 1034.517 | 1407.937 |
your code ends before this line
function DoG(sigma1, sigma2) {
run("Duplicate...", " ");
bigBlurID = getImageID();
run("Duplicate...", " ");
smallBlurID = getImageID();
run("Gaussian Blur...", "sigma="+sigma1);
selectImage(bigBlurID);
bigBlurTitle = getTitle();
run("Gaussian Blur...", "sigma="+sigma2);
imageCalculator("subtract", smallBlurID, bigBlurID);
close(bigBlurTitle);
}