#include <tcl.h>
#include <tk.h>
#include "logerr.h"
#include <sadie.h>
#include "chain.h"
#include "chain_provisional.h"
Classes | |
struct | Ring_candidate |
One ring in a list of rings (e.g., candidates for insertion or removal). More... | |
struct | Boxed_boundary |
The association of a chaincoded boundary and its bounding box. More... | |
Defines | |
#define | TEMP_OBJ_ARRAY_LEN 4 |
Typedefs | |
typedef Ring_candidate * | ring_candidatep_t |
Points to a list of (non-contiguous) rings. | |
typedef Boxed_boundary * | boxed_boundaryp_t |
Points to a list of chaincoded boundaries and their bounding boxes. | |
typedef int(* | data_accessor_t )(char *doc, char *pname, int *n, Tcl_Obj *objarr[]) |
An accessor function turns various saved data into Tcl object arrays. | |
Functions | |
int | TREES_add_provisionalCmd (ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) |
Add a new ring boundary between two existing chain-coded boundaries. | |
int | TREES_remove_provisionalCmd (ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) |
Remove an existing ring boundary (re-computing the affected measurements). | |
int | TREES_missing_provisionalCmd (ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) |
Insert a missing ring at an existing ring boundary. | |
int | TREES_display_provisionalCmd (ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) |
Draw a full-resolution provisional ring boundary. | |
int | TREES_display_small_provisionalCmd (ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) |
Draw a low-resolution provisional ring boundary. | |
int | TREES_undisplay_provisionalCmd (ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) |
Delete a provisional ring boundary from the Tk canvas. | |
int | TREES_color_provisionalCmd (ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) |
Change the color of a boundary that is already on the Tk canvas. | |
int | TREES_commit_provisionalCmd (ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) |
Commit a provisional boundary addition to the main Tcl structures of TREES. | |
int | TREES_commit_removalCmd (ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) |
Commit a provisional boundary removal to the main Tcl structures of TREES. | |
int | TREES_addremoverings_Init (Tcl_Interp *interp) |
Create the new Tcl commands associated with adding and removing boundaries. |
There are two aspects to this. We determine provisional changes (provisionally inserted or deleted ring boundaries), and save the revised measurements, but do not modify the main data structures used by the Tcl parts of TREES immediately. Subsequently (presumably with some user interaction) we do commit the provisional changes so that they become indistinguishable from the original contents of the main TREES data structures. Other parts of the program handle the re-analysis (interpolating ring boundaries, computing revised measurements, and so on) and storage of the provisional data: see the chain_provisional.c and chain_provisional.h files for the details.
|
Add a new ring boundary between two existing chain-coded boundaries. Follow the standard Tcl_ObjCmdProc prototype for C glue code in Tcl. On the Tcl side of things, document identifies the grouping of saved settings for a particular analysis, provbnum will identify the new boundary and the two sets of measurements associated with it, mosaic is the string encoding the storage location of the image mosaic, index identifies the data structure holding the region-of-interest definition and other indices into this mosaic, chainmap identifies the lists of full-resolution chain-coded boundaries, scale is the downsampling factor used when creating low-resolution boundaries, x_coord and y_coord are the coordinates within the image mosaic near where we will construct the interpolated boundary, and bbox_name is the name of the Tcl list of bounding box coordinates. The changes get saved into an entry in the hash table and not immediately incorporated into changes to the chain map and measurements.
|
|
Create the new Tcl commands associated with adding and removing boundaries.
|
|
Change the color of a boundary that is already on the Tk canvas. Follow the standard Tcl_ObjCmdProc prototype for C glue code in Tcl. On the Tcl side of things, canvas specifies the Tk canvas within which the drawing takes place, doc identifies the grouping of saved settings for a particular analysis, and provbnum is the number identifying the provisional boundary, and color is the new color to use.
|
|
Commit a provisional boundary addition to the main Tcl structures of TREES. Follow the standard Tcl_ObjCmdProc prototype for C glue code in Tcl. On the Tcl side of things, document identifies the grouping of saved settings for a particular analysis, provbnum identifies the provisional boundary and the sets of measurements associated with it, chain identifies the lists of full-resolution chain-coded boundaries, smallchain identifies the lists of low-resolution chain-coded boundaries, widthlist names the list of total ring widths, profilelist names the list of brightness profile data, diff_profilelist names the list of first-differenced brightness profiles, earlywidthlist names the list of earlywood widths, latewidthlist names the list of latewood widths, boundboxlist names the list of bounding box coordinates, masterlist names the list of ring boundaries (in a form suitable for use in the skeleton plot display with their associated data), and notes is the list of short textual notes by the tree-ring analyst. We return the (integer) index position of the insertion point within the Tcl list in the Tcl result object. The provisional data must already exist, stored in the location identified by document and provbnum. When we commit them, we modify all the primary data structures used by the Tcl parts of TREES to store measurements and housekeeping information, and the next save to a data file should make the changes permanent.
|
|
Commit a provisional boundary removal to the main Tcl structures of TREES. Follow the standard Tcl_ObjCmdProc prototype for C glue code in Tcl. On the Tcl side of things, document identifies the grouping of saved settings for a particular analysis, provbnum identifies the removed boundary and the sets of measurements associated with it, chain identifies the lists of full-resolution chain-coded boundaries, smallchain identifies the lists of low-resolution chain-coded boundaries, widthlist names the list of total ring widths, profilelist names the list of brightness profile data, diff_profilelist names the list of first-differenced brightness profiles, earlywidthlist names the list of earlywood widths, latewidthlist names the list of latewood widths, boundboxlist names the list of bounding box coordinates, masterlist names the list of ring boundaries, and notes is the list of short textual notes by the tree-ring analyst. We return the (integer) index position of the removal point within the Tcl list in the Tcl result object. The provisional data must already exist, stored in the location identified by document and provbnum. When we commit them, we modify all the primary data structures used by the Tcl parts of TREES to store measurements and housekeeping information, and the next save to a data file should make the changes permanent.
|
|
Draw a full-resolution provisional ring boundary. Follow the standard Tcl_ObjCmdProc prototype for C glue code in Tcl. On the Tcl side of things, canvas specifies the Tk canvas within which the drawing takes place (such as the zoom window), x_origin and y_origin define the offsets between the origin used in the image mosaic and the canvas origin, doc identifies the grouping of saved settings for a particular analysis, provbnum is the number identifying the provisional boundary, and color is the color for the lines making up the boundary.
|
|
Draw a low-resolution provisional ring boundary. Follow the standard Tcl_ObjCmdProc prototype for C glue code in Tcl. On the Tcl side of things, canvas specifies the Tk canvas within which the drawing takes place (such as the browse window), doc identifies the grouping of saved settings for a particular analysis, provbnum is the number identifying the provisional boundary, and color is the color for the lines making up the boundary.
|
|
Insert a missing ring at an existing ring boundary. Follow the standard Tcl_ObjCmdProc prototype for C glue code in Tcl. On the Tcl side of things, document identifies the grouping of saved settings for a particular analysis, provbnum will identify the modified set of measurements associated with the removed boundary, mosaic is the string encoding the storage location of the image mosaic, index identifies the data structure holding the region-of-interest definition and other indices into this mosaic, chainmap identifies the lists of full-resolution chain-coded boundaries, smallchainmap identifies the lists of low-resolution chain-coded boundaries, x_coord and y_coord are the coordinates within the image mosaic near the existing boundary, and bbox_name is the name of the Tcl list of bounding box coordinates. The changes get saved into an entry in the hash table and not immediately incorporated into changes to the chain map and measurements. We set the Tcl result object to a boolean flag showing whether the missing ring insertion was successful.
|
|
Remove an existing ring boundary (re-computing the affected measurements). Follow the standard Tcl_ObjCmdProc prototype for C glue code in Tcl. On the Tcl side of things, document identifies the grouping of saved settings for a particular analysis, provbnum will identify the modified set of measurements associated with the removed boundary, mosaic is the string encoding the storage location of the image mosaic, index identifies the data structure holding the region-of-interest definition and other indices into this mosaic, chainmap identifies the lists of full-resolution chain-coded boundaries, smallchainmap identifies the lists of low-resolution chain-coded boundaries, x_coord and y_coord are the coordinates within the image mosaic near the existing boundary, and bbox_name is the name of the Tcl list of bounding box coordinates. The changes get saved into an entry in the hash table and not immediately incorporated into changes to the chain map and measurements. We set the Tcl result object to a boolean flag showing whether the provisional boundary deletion was successful.
|
|
Delete a provisional ring boundary from the Tk canvas. Follow the standard Tcl_ObjCmdProc prototype for C glue code in Tcl. On the Tcl side of things, canvas specifies the Tk canvas within which the drawing takes place, doc identifies the grouping of saved settings for a particular analysis, and provbnum is the number identifying the provisional boundary.
|