Chapter 01-3: Adding values to the results table |
This third chapter describes how to add values to the results table in imagej. Basically you could store values in variables and arrays. But sometimes it is easier or more convenient to add them to the results table, especially if you want to quickly display them on the screen.
Step 01: Create new Text Window |
In this case there is no image necessary. Just open a new text window: --> File --> New --> Text Window
Step 02: Compute the simple macro |
Some simple code sample for the imagej macro language. Just copy the code into a new imagej text window and run the macro.
// This is an example for adding values to the results tabel. No image is necessary.
// Add a single value to the results tabel
Step 03: Enjoy the results table |
As
you can see the labeling starts with point1. The first row in the
results table shows the single point in the first part of the macro.
After this entry the nResults (nResults is a imagej variable for the
amount of rows in the results table) is exactly 1 as you can see in the
first row in the Log window. It's always good to use the
print() command in imagej if you want to display the contents of your
variables. The rows 2-4 are showing the values of the x-/y-coord
array.