Login  Register

Re: default empty values in Result Table

Posted by Rasband, Wayne (NIH/NIMH) [E] on May 26, 2015; 7:34pm
URL: http://imagej.273.s1.nabble.com/default-empty-values-in-Result-Table-tp5012931p5012948.html

> On May 25, 2015, at 4:13 AM, Emanuele Martini <[hidden email]> wrote:
>
> Hi to all,
> I am working on a jython plugin that permits to track (manually) the
> spindles elongation in a z-stack timelapse experiment.
> So I could have situations where spindle 1 is tracked until frame 10 and
> spindle 2 is track in frames 1,2,5,7.
> I would like to set up the resulttable with automatically NaN or empty
> values (and not 0 like it is) so I could obtain easyly something like that:
> sp1 3.2 12.3 3.4 5.6 7.7 0.5 ...
> sp2 3.7 14.4            4.6       ...
>
> without zero...is it possible?

In the latest ImageJ daily build (1.49u6), enable “NaN empty cells” in Analyze>Set Measurements and empty cells in Results tables created by “Measure” and “Analyze Particles” will be set to NaN. When using a custom ResultTable, use the new ResultTable.setNaNEmptyCells() method to enable NaN empty cells. The following JavaScript example outputs a table with NaN empty cells.

-wayne

   rt = new ResultsTable();
   rt.setNaNEmptyCells(true);
   row = 0;
   for (n=0; n<=2*Math.PI; n += 0.1) {
      rt.setValue("n", row, n);
      if (row>2)
         rt.setValue("Sine(n)", row, Math.sin(n));
      if (row<3||row>6)
         rt.setValue("Cos(n)", row, Math.cos(n));
      row++;
   }
   rt.showRowNumbers(false);
   rt.show("Table with Empty Cells");


> View this message in context: http://imagej.1557.x6.nabble.com/default-empty-values-in-Result-Table-tp5012931.html
> Sent from the ImageJ mailing list archive at Nabble.com.



--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html