Grid Creator

Category: Data Display
Author:
Description: Script to generate a dialogue which applies grids to images. The default set up will apply a 10 x 10 grid scaled to fit the image.The user may change the size of the grid. The default size for the grid along with the upper limit of grid squares can be changed by editing the default values for the dialog at the start of the script. The default variable 'defaultlinehighlights' is currently set to 5 so every 5th line of the grid will be highlighted. Change this to suit. The value can be changed on the fly, by setting the '2nd Grid' field in the dialog. The user may also select a fixed size grid, by selecting the radio box option and entering the required dimensions. Grids can not be > 0.5 x the image size or smaller than the value resulting from the grid limit. When the user sources an image (the foremost one), the size of the image in distance units is shown in the dialog box, to aid selection of appropriate grid sizes. The grid is constructed from line annotations. As such, each line floats and can be moved, so care is needed when working with the image not to disrupt the grid. In later versions of DM it is possible to save the image display incorporating any annotations such as lines. Doing this will incorporate the grid into the image permanently. However, in the as-created form, the grid is easily removed by hitting the Clear Grid button. The image can be closed with the 'Close Image' button. If the image has been modified, the user will be prompted if they wish to save the changes. The script also displays all the pixel values at the grid intersection points and generates some stats on this info.
Comments: Tested on DM versions 3.7, 3.8 and 3.9. The script will apply a grid to an RGB image but generates an error when trying to read pixel values.
Script version: 1.2
DM/GMS version: 3.8.2
Script written as a function: No
Source: Show code
Download Source Code: Download
Download Zip File: Download