Analyze Particle Overlay - Odd Behavior in Macro

Hi,

I am working on a macro to track the area of motile single cells over time, with images taken every 2 minutes for ~ 3 hours. Each data set has 1~10 cells, and I have dozens of data sets. The contrast is good, and segmentation via automatic thresholding works well.

I am then using analyze particles to get the area of each cell, and I pass that data into Matlab to sort (analyze particles produces out results that are ordered by frame not by cell, and so the results are out of order, especially when cells leave or enter the frame).

Then, I want to pass the indices of deleted rows back into ImageJ, and remove them from the results/overlay, then give the user an opportunity to compare the original image with the overlays to ensure only appropriate cells are being counted for area quantification.

Now here’s where I run into a slight issue. If I use my mouse to click on a row in the results table and delete it, the overlay disappears from the image. But, if I use Table.deleteRows(), the row is deleted but the overlay is not. The macro recorder shows both operations being exactly the same, but their behavior is not. So, without physically clicking on the row and deleting it (obviously not viable), I cannot figure out a way to remove the overlay. Seems like Table.deleteRows() should do the trick, but I have no idea why doesn’t work.

For reference, these are the options I am using for analyze particles: run(“Analyze Particles…”, “size=” + min_cell_area + “-Infinity pixel show=Overlay display exclude clear summarize stack”);

Appreciate any help, thanks!

Upgrade to the latest ImageJ daily build (1.52q21) and Table.deleteRows() will work as expected. Here is macro that reproduces the problem:

  run("Blobs (25K)");
  setAutoThreshold("Default");
  run("Analyze Particles...", "show=Overlay display exclude clear");
  Table.deleteRows(0, 22);

Awesome, that did the trick - thank you!!