Main Page | Data Structures | Directories | File List | Data Fields | Globals

tclSadie.c File Reference

The main tclSadie program, joining a Tcl/Tk GUI to the SADIE library. More...

#include <stdio.h>
#include <tcl.h>
#include <tk.h>
#include <string.h>
#include <unistd.h>
#include <sadie.h>
#include "tclsadie.h"
#include "Sadie_Index.h"

Go to the source code of this file.

Initialization function forward declarations.

These functions make the C commands available to the Tcl interpreter.

*int Sadie_FileIO_Init (Tcl_Interp *interp)
 Make the commands defined in this file accessible to the Tcl interpreter.
int Sadie_General_Init (Tcl_Interp *interp)
 Make the commands defined in this file accessible to the Tcl interpreter.
int Sadie_Plot_Init (Tcl_Interp *interp)
 Make the commands defined in this file accessible to the Tcl interpreter.
int Sadie_NewFunctions_Init (Tcl_Interp *interp)
 Make the commands defined in this file accessible to the Tcl interpreter.
int Sadie_Contrast_Init (Tcl_Interp *interp)
 Make the commands defined in this file accessible to the Tcl interpreter.
int Sadie_Filter_Init (Tcl_Interp *interp)
 Make the commands defined in this file accessible to the Tcl interpreter.
int Sadie_Geometry_Init (Tcl_Interp *interp)
 Make the commands defined in this file accessible to the Tcl interpreter.
int Sadie_Multi_Init (Tcl_Interp *interp)
 Make the commands defined in this file accessible to the Tcl interpreter.
int Sadie_Classify_Init (Tcl_Interp *interp)
 Make the commands defined in this file accessible to the Tcl interpreter.
int Sadie_Tools_Init (Tcl_Interp *interp)
 Make the commands defined in this file accessible to the Tcl interpreter.
int Sadie_Image_Init (Tcl_Interp *interp)
 Define a new Tk image format that handles SADIE images.
int Sadie_Proto_Init (Tcl_Interp *interp)

Tcl 8.3 backward-compatibility code.

Provide substitutes for functions present in Tcl 8.4 but missing from 8.3. Tcl 8.4 introduces a family of generic filesystem operations, the Tcl_FS functions, and we use these if possible. However they are absent in Tcl 8.3, so to support it we here provide crude substitutes for only those Tcl_FS functions that tclSadie uses. See the man pages for the Tcl 8.4 versions for more details, but much of the functionality is missing from the substitutes.

Tcl_Obj * Tcl_FSJoinToPath (Tcl_Obj *basePtr, int objc, Tcl_Obj *CONST objv[])
 Append filesystem path segments to an existing path.

Functions

void tclsadie_demolish_hashtable (ClientData clientData)
 The exit handler function used to tear down the global hash table.
int Tcl_AppInit (Tcl_Interp *interp)
 The standard Tcl application initialization hook procedure.
int main (int argc, char *argv[])
 The tclSadie main program: parse command line arguments and start Tcl/Tk.

Variables

sad_doclistp_t global_doclist
 Global hash table holding the ROIs for the lifetime of an image.


Detailed Description

The main tclSadie program, joining a Tcl/Tk GUI to the SADIE library.

As an application based in C using Tcl/Tk for all the user inteaction, a certain amount of boilerplate code is needed to initialize the application and invoke the Tcl interpreter. For full details see Part VI (C Programming) in Welch, B.B., Jones, K. & Hobbs, J. Practical Programming in Tcl/Tk (4th ed.). Prentice Hall: Saddle River, New Jersey: 2003. While tclSadie is currently based on version 8.4 of Tcl/Tk, it includes some code to be backwards-compatible with version 8.3, in particular some crude substitutes for the Tcl 8.4 Tcl_FS functions. The mechanism for using the pure Tcl parts of tclSadie remains very primitive, unchanged since version 7 of Tcl or earlier. A single directory holds all the script files, not structured into packages or in any other way. The initialization code adds the path to this script library directory to the global variable auto_path (which has a special significance to the Tcl interpreter as specifying places to search for script files).

Author:
University of Arizona Digital Image Analysis Lab
Date:
1999, 2004
Version:
Id
tclSadie.c,v 1.2 2005/03/25 04:05:10 mmunro Exp

Definition in file tclSadie.c.


Function Documentation

int main int  argc,
char *  argv[]
 

The tclSadie main program: parse command line arguments and start Tcl/Tk.

This version of main starts tclSadie without invoking the standard Tcl applications such as wish. The optarg utility found in most C support libraries handles command line argument processing: see the usage function for their descriptions.

Parameters:
[in] argc the number of command-line arguments.
[in] argv the command line argument array.
Returns:
zero on success, otherwise an error code.

Definition at line 768 of file tclSadie.c.

References Tcl_AppInit().

int Sadie_Classify_Init Tcl_Interp *  interp  ) 
 

Make the commands defined in this file accessible to the Tcl interpreter.

Parameters:
[in] interp the main Tcl interpreter.
Returns:
TCL_OK on success, TCL_ERROR on errors.

Definition at line 721 of file Sadie_Classify.c.

References Sadie_Classify_ClusterCmd(), Sadie_Classify_LvlSliceCmd(), Sadie_Classify_MaxLikeCmd(), Sadie_Classify_MinDistCmd(), Sadie_Classify_SegmentCmd(), and Sadie_Classify_SigMapCmd().

Referenced by Tcl_AppInit().

int Sadie_Contrast_Init Tcl_Interp *  interp  ) 
 

Make the commands defined in this file accessible to the Tcl interpreter.

Parameters:
[in] interp the main Tcl interpreter.
Returns:
TCL_OK on success.

Definition at line 645 of file Sadie_Contrast.c.

References Sadie_Contrast_AdaptStretchCmd(), Sadie_Contrast_HisteqStretchCmd(), Sadie_Contrast_LinearStretchCmd(), Sadie_Contrast_LogStretchCmd(), Sadie_Contrast_NormStretchCmd(), Sadie_Contrast_PWLStretchCmd(), Sadie_Contrast_QntStretchCmd(), Sadie_Contrast_RefStretchCmd(), Sadie_Contrast_RootStretchCmd(), Sadie_Contrast_SatStretchCmd(), Sadie_Contrast_SqrStretchCmd(), Sadie_Contrast_TblStretchCmd(), and Sadie_Contrast_ThreshStretchCmd().

Referenced by Tcl_AppInit().

* int Sadie_FileIO_Init Tcl_Interp *  interp  ) 
 

Make the commands defined in this file accessible to the Tcl interpreter.

Parameters:
[in] interp the main Tcl interpreter.
Returns:
TCL_OK on success, TCL_ERROR on errors.

Definition at line 397 of file Sadie_FileIO.c.

References Sadie_FileIO_ImportCmd(), Sadie_FileIO_OpenCmd(), Sadie_FileIO_OpenPNMCmd(), Sadie_FileIO_OpenTIFFCmd(), Sadie_FileIO_SaveCmd(), Sadie_FileIO_SaveEPSCmd(), Sadie_FileIO_SavePNMCmd(), Sadie_FileIO_SaveTEXTCmd(), and Sadie_FileIO_SaveTIFFCmd().

Referenced by Tcl_AppInit().

int Sadie_Filter_Init Tcl_Interp *  interp  ) 
 

Make the commands defined in this file accessible to the Tcl interpreter.

Parameters:
[in] interp the main Tcl interpreter.
Returns:
TCL_OK on success, TCL_ERROR on errors.

Definition at line 957 of file Sadie_Filter.c.

References Sadie_Filter_CAvgFiltCmd(), Sadie_Filter_DivMapCmd(), Sadie_Filter_FFTCmd(), Sadie_Filter_FFTConvCmd(), Sadie_Filter_FFTFiltCmd(), Sadie_Filter_FHTCmd(), Sadie_Filter_ImageConvCmd(), Sadie_Filter_ImageGradCmd(), Sadie_Filter_LibGradCmd(), Sadie_Filter_MajFiltCmd(), Sadie_Filter_MaskConvCmd(), Sadie_Filter_MaskGradCmd(), Sadie_Filter_MaxFiltCmd(), Sadie_Filter_MedFiltCmd(), Sadie_Filter_MinFiltCmd(), Sadie_Filter_PSpectCmd(), and Sadie_Filter_VarMapCmd().

Referenced by Tcl_AppInit().

int Sadie_General_Init Tcl_Interp *  interp  ) 
 

Make the commands defined in this file accessible to the Tcl interpreter.

Parameters:
[in] interp the main Tcl interpreter.
Returns:
TCL_OK on success, TCL_ERROR on errors.

Definition at line 433 of file Sadie_General.c.

References Sadie_General_CloseCmd(), Sadie_General_FinishProgCmd(), Sadie_General_GetNumBandsCmd(), Sadie_General_GetPixelCmd(), Sadie_General_GmaxCmd(), Sadie_General_GminCmd(), Sadie_General_HeightCmd(), Sadie_General_IndexImageCmd(), Sadie_General_InitializeProgCmd(), Sadie_General_SetNameCmd(), and Sadie_General_WidthCmd().

Referenced by Tcl_AppInit().

int Sadie_Geometry_Init Tcl_Interp *  interp  ) 
 

Make the commands defined in this file accessible to the Tcl interpreter.

Parameters:
[in] interp the main Tcl interpreter.
Returns:
TCL_OK on success.

Definition at line 682 of file Sadie_Geometry.c.

Referenced by Tcl_AppInit().

int Sadie_Image_Init Tcl_Interp *  interp  ) 
 

Define a new Tk image format that handles SADIE images.

Parameters:
[in] interp the main Tcl interpreter.
Returns:
TCL_OK on success.

Definition at line 504 of file Sadie_Image.c.

References tkImgFmtSADIE.

Referenced by Tcl_AppInit().

int Sadie_Multi_Init Tcl_Interp *  interp  ) 
 

Make the commands defined in this file accessible to the Tcl interpreter.

Parameters:
[in] interp the main Tcl interpreter.
Returns:
TCL_OK on success.

Definition at line 578 of file Sadie_Multi.c.

References Sadie_Multi_BIL2BSQCmd(), Sadie_Multi_BSQ2BILCmd(), Sadie_Multi_CombineCmd(), Sadie_Multi_Comp2RealCmd(), Sadie_Multi_CompareCmd(), Sadie_Multi_HSV2RGBCmd(), Sadie_Multi_PCSCmd(), Sadie_Multi_PCTCmd(), Sadie_Multi_Real2CompCmd(), Sadie_Multi_RGB2HSVCmd(), and Sadie_Multi_RotateCubeCmd().

Referenced by Tcl_AppInit().

int Sadie_NewFunctions_Init Tcl_Interp *  interp  ) 
 

Make the commands defined in this file accessible to the Tcl interpreter.

Parameters:
[in] interp the main Tcl interpreter.
Returns:
TCL_OK on success.

Definition at line 396 of file Sadie_NewFunctions.c.

References Sadie_NewFunctions_CheckerboardCmd(), Sadie_NewFunctions_ChirpCmd(), Sadie_NewFunctions_FunctionCmd(), Sadie_NewFunctions_GrayScaleCmd(), Sadie_NewFunctions_RandomCmd(), Sadie_NewFunctions_SineStarCmd(), and Sadie_NewFunctions_SineWaveCmd().

Referenced by Tcl_AppInit().

int Sadie_Plot_Init Tcl_Interp *  interp  ) 
 

Make the commands defined in this file accessible to the Tcl interpreter.

Parameters:
[in] interp the main Tcl interpreter.
Returns:
TCL_OK on success.

Definition at line 339 of file Sadie_Plot.c.

References Sadie_Plot_CreateROICmd(), Sadie_Plot_ProfileCmd(), and Sadie_Plot_StatisticsCmd().

Referenced by Tcl_AppInit().

int Sadie_Tools_Init Tcl_Interp *  interp  ) 
 

Make the commands defined in this file accessible to the Tcl interpreter.

Parameters:
[in] interp the main Tcl interpreter.
Returns:
TCL_OK on success.

Definition at line 295 of file Sadie_Tools.c.

References Sadie_Tools_ContMapCmd(), Sadie_Tools_DestripeCmd(), Sadie_Tools_ReliefCmd(), Sadie_Tools_RMSCmd(), and Sadie_Tools_ScatterCmd().

Referenced by Tcl_AppInit().

int Tcl_AppInit Tcl_Interp *  interp  ) 
 

The standard Tcl application initialization hook procedure.

Because tclSadie uses a custom C main program, rather than the standard wish Tcl/Tk application, it provides its own initialization code. The Tcl library supports a generic hook procedure, Tcl_AppInit, provided by the application; here it invokes all the code needed to register the new Tcl commands (those implemented as C functions) with the Tcl interpreter.The on-line documents describing the Tcl library and Part VI of Welch et. al. Practical Programming in Tcl/Tk describe this in greater detail.

Parameters:
[in] interp the main Tcl interpreter.
Returns:
TCL_OK on success, TCL_ERROR on errors.

Definition at line 704 of file tclSadie.c.

References make_doclist(), Sadie_Classify_Init(), Sadie_Contrast_Init(), Sadie_FileIO_Init(), Sadie_Filter_Init(), Sadie_General_Init(), Sadie_Geometry_Init(), Sadie_Image_Init(), Sadie_Multi_Init(), Sadie_NewFunctions_Init(), Sadie_Plot_Init(), Sadie_Tools_Init(), tclsadie_app_init(), tclsadie_demolish_hashtable(), and tclsadie_private_data_init().

Referenced by main().

Tcl_Obj* Tcl_FSJoinToPath Tcl_Obj *  basePtr,
int  objc,
Tcl_Obj *CONST  objv[]
 

Append filesystem path segments to an existing path.

Given an existing path (which may be NULL) compose a new path by appending segments taken from an array.

Parameters:
[in] basePtr points to the existing path object.
[in] objc the number of path segment objects to append.
[in] objv the array filesystem path segment objects.
Returns:
the new Tcl object (reference count 0) holding the joined path.

Definition at line 271 of file tclSadie.c.

void tclsadie_demolish_hashtable ClientData  clientData  ) 
 

The exit handler function used to tear down the global hash table.

A wrapper to make the function that cleans up the global hash table conform to the Tcl_ExitProc callback prototype so it can work as an exit handler (registered by Tcl_CreateExitHandler).

Parameters:
[in] clientData really points to the application-global hash table.

Definition at line 315 of file tclSadie.c.

References dispose_doclist().

Referenced by Tcl_AppInit().


Generated on Fri Jul 8 14:55:02 2005 for tclSadie by  doxygen 1.4.2