ROI Coordinates
The coordinates of the individual pixels at the location of, or within ROIs can be written to a disk file.
Writing Coordinates
Pixel coordinates at or within ROIs can be written to a disk file in a tabular format suitable for importing into a spread-sheet for further analysis. The format of a file is given in the file formats section, and is a space (" ") separated tabular format, with the coordinate of each position contributing one row to the table. The values written are the coordinates in 3-D; thus 3 columns are written.
The coordinates written are dependent on the type of ROI:
- Marker and Text ROIs. The position of the Marker/Text is written.
- Line ROIs. The positions of the two ends of the line are written.
- Curved Line and Open Spline ROIs. The positions of points along the line are written.
- All other types of ROI. For each pixel where the centre of the pixel is within the ROI, the coordinates of the pixel centre are written.
The coordinate system used for output is set from within the Preferences, and can be:
L,P,S. First coordinate increases to the subject's left; second coordinate increases to the subject's posterior; third coordinate increases to the subject's superior. This is the coordinate system used by DICOM.
R,A,S. First coordinate increases to the subject's right; second coordinate increases to the subject's anterior; third coordinate increases to the subject's superior. This is the coordinate system used by SPM, FSL etc.
x,y,z. First coordinate increases with image column number (to the right as viewed on screen); second coordinate increases with image row number (to the bottom as viewed on screen); third coordinate increases with increasing slice number.
The coordinate units are mm.
The first line of the output file consists of a header such as
# L P S
to indicate the coordinate system. The different ROIs are separated by either:
- A line with just a hash ('#') character if the ROI has no annotation, or
- A line with a hash character followed by the ROI's annotation, if the ROI is annotated.
Following this, each pixel coordinate for that ROI is then written on a separate line.
Write the ROI coordinates using Write Coordinates from the File menu of the ROI Toolkit:
,
A File Chooser will prompt you for a file name into which to write the coordinates (default extension ".txt"; default file name from the image name). If the file already exists, you will be asked whether you want to:
- Overwrite the existing file. The current set of coordinates will replace those already in the file.
- Append the statistics. The current set of coordinates will be appended to those already in the file.
- Cancel. Nothing is written.
The ROI Toolkit will now write the pixel coordinates for all the ROIs of the image, to the file.