#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. |
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).
Definition in file tclSadie.c.
|
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.
Definition at line 768 of file tclSadie.c. References Tcl_AppInit(). |
|
Make the commands defined in this file accessible to the Tcl interpreter.
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(). |
|
Make the commands defined in this file accessible to the Tcl interpreter.
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(). |
|
Make the commands defined in this file accessible to the Tcl interpreter.
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(). |
|
Make the commands defined in this file accessible to the Tcl interpreter.
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(). |
|
Make the commands defined in this file accessible to the Tcl interpreter.
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(). |
|
Make the commands defined in this file accessible to the Tcl interpreter.
Definition at line 682 of file Sadie_Geometry.c. Referenced by Tcl_AppInit(). |
|
Define a new Tk image format that handles SADIE images.
Definition at line 504 of file Sadie_Image.c. References tkImgFmtSADIE. Referenced by Tcl_AppInit(). |
|
Make the commands defined in this file accessible to the Tcl interpreter.
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(). |
|
Make the commands defined in this file accessible to the Tcl interpreter.
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(). |
|
Make the commands defined in this file accessible to the Tcl interpreter.
Definition at line 339 of file Sadie_Plot.c. References Sadie_Plot_CreateROICmd(), Sadie_Plot_ProfileCmd(), and Sadie_Plot_StatisticsCmd(). Referenced by Tcl_AppInit(). |
|
Make the commands defined in this file accessible to the Tcl interpreter.
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(). |
|
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.
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(). |
|
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.
Definition at line 271 of file tclSadie.c. |
|
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).
Definition at line 315 of file tclSadie.c. References dispose_doclist(). Referenced by Tcl_AppInit(). |