Up to TkMeditGuide

Back to TkMeditScripting

Continue to TkMeditSampleScreenshotScript

Scripting

This section assumes you are familiar with Tcl and how to write basic scripts.

Most of TkMedit's functions have Tcl bindings. As you have probably noticed, the interface is just a Tk/Tix window. You can look at the interface script, TkMedit.tcl, to see how most of the functionality is used. Following is a list of Tcl commands defined by TkMedit. You can use these commands in your own scripts and call them with the -tcl command line option to execute them on startup. TkMedit can run in a kind of batch mode in this fashion, altho it still requires X and has to be able to open its main window.

You can also enter these script commands from the shell that TkMedit was launched in. You can use the Tcl source command to load a script file from the Tcl shell as well.

This list is provided for reference. If you can figure out something that works, great, but it is not officially a feature of TkMedit.

Commands

Functions arguments are listed by their name followed by their arguments. Arguments in square brackets are optional.

AverageSurfaceVertexPositions numberOfAverages

ClearSelection

ClearUndoVolume

DebugPrint string

ExportChangedSegmentationVolume volume [destinationDirectory]

FlipVolume xAxis yAxis zAxis

GetSubjectDir volume

GetSubjectName volume

GotoMainVertex vertexNumber

GotoOriginalVertex vertexNumber

GotoPialVertex vertexNumber

GraphSelectedRegion

ImportSurfaceAnnotationToSegmentation surface annotationFileName colorTableFileName

LoadAuxVolume volumeFileName

Loads volumeFileName as the Aux volume.

LoadDTIVolumes vectorVolumeFileName intensityVolumeFileName redAxis greenAxis blueAxis

LoadFunctionalOverlay volumeFileName registrationType [registrationFileName]

LoadFunctionalTimeCourse volumeFileName registrationType [registrationFileName]

LoadGCA volumeFileName transformFileName

LoadGCARenormalization renormalizationVolumeFileName

LoadHeadPts headPointsFileName transformFileName

Loads a head points array from headPointsFileName using the transform in transformFileName.

LoadLabel labelFileName

LoadMainSurface surface surfaceFileName

LoadOriginalSurface surface surfaceFileName

LoadPialSurface surface surfaceFileName

LoadSegmentationVolume volume volumeFileName colorTableFileName

LoadSurfaceAnnotation surface annotationFileName

LoadVolumeDisplayTransform volume transformFileName

LoadVolume volumeFileName

NewControlPoint

NewSegmentationVolume volume fromAnatomicalVolume colorTableFileName

Overlay_RestoreRegistration

Overlay_SaveRegistration

Overlay_SetCondition condition

Overlay_SetDisplayFlag flag value

Overlay_SetRegistrationToIdentity

Overlay_SetThreshold min mid slope

Overlay_SetTimePoint timePoint

Overlay_SetVolumeSampleType sampleType

QuitMedit

ReadVoxelLabels voxelLabelVolume1FileName voxelLabelVolume2FileName

RecomputeSegmentation volume

RedrawAll

RedrawScreen

RestoreHeadPts

RestorePreviousSegmentation volume

RestoreVolumeFromSnapshot

RotateHeadPts degrees axis

RotateOverlayRegistration degrees axis

RotateVolume axis degrees

SaveGCA volumeFileName

SaveLabel labelFileName

SaveTIFF imageFileName

SaveSegmentationVolume volume [destinationDirectory]

SaveVolume volume

SaveVolumeAs volume destinationDirectory

ScaleOverlayRegistration distance axis

SelectVoxelsByFuncValue compareType

SendCursor

SetBrushInfo brush low high new

SetBrushInfoToDefaults

SetBrushShape radius shape 3D

SetBrushTarget target

SetCursor coordinateSpace x y z

SetCursorColor r g b

SetCursorShape shape

SetCursorToCenterOfSelection

SetDTIAlpha alpha

SetDisplayConfig numberOfColumns numberOfRows linkPolicy

SetDisplayFlag flag value

SetFloodSelectParams 3D sourceVolume fuzziness distance

SetFuncOverlayAlpha alpha

SetGCADisplayStatus displayIntermediateResults

SetLinkedCursorFlag linked

SetOrientation orientation

SetSegBrushInfo newValue 3D sourceVolume fuzziness distance

SetSegmentationAlpha alpha

SetSelectedHeadPointLabel label

SetSlice sliceNumber

SetSurfaceDistanceAtCursor

SetSurfaceLineColor surface set r g b

SetSurfaceLineWidth surface set width

SetTool tool

SetVolumeBrightnessContrast volume brightness contrast

SetVolumeColorScale volume brightness contrast min max

SetVolumeMinMax volume min max

SetVolumeResampleMethod volume method

SetVolumeSampleType volume sampleType

SetZoomCenter x y z

SetZoomLevel level

ShowNearestInterpolatedMainVertex

ShowNearestInterpolatedOriginalVertex

ShowNearestInterpolatedPialVertex

ShowNearestMainVertex

ShowNearestOriginalVertex

ShowNearestPialVertex

SmartCutAtCursor

SmoothFunctionalOverlay sigma

SnapshotVolume

ThresholdVolume thresholdValue direction newValue

TimeCourse_PrintSelectionRangeToFile fileName

TimeCourse_SetDisplayFlag flag value

TimeCourse_SetNumPreStimPoints numPoints

TimeCourse_SetTimeResolution resolution

TranslateHeadPts distance axis

UndoLastEdit

UnloadAllSurfaces

UnloadGCA

UnloadSurface surface

UnloadVolume volume

UnloadVolumeDisplayTransform volume

WriteControlPointFile

WriteHeadPointsFile

WriteHeadPointsTransform

WriteSurfaceValues surface valueFileName

Index

AverageSurfaceVertexPositions

Anatomical

FlipVolume LoadAuxVolume LoadVolume LoadVolumeDisplayTransform RestoreVolumeFromSnapshot RotateVolume SaveVolume SaveVolumeAs SetVolumeBrightnessContrast SetVolumeColorScale SetVolumeMinMax SetVolumeResampleMethod SetVolumeSampleType SmartCutAtCursor SnapshotVolume ThresholdVolume UndoLastEdit UnloadVolume UnloadVolumeDisplayTransform

DTI

LoadDTIVolumes SetDTIAlpha Editing ClearUndoVolume FlipVolume RestoreVolumeFromSnapshot RotateVolume SetBrushInfo SetBrushInfoToDefaults SetBrushShape SetBrushTarget SetSegBrushInfo SetTool SmartCutAtCursor SnapshotVolume ThresholdVolume UndoLastEdit

Functional

GraphSelectedRegion LoadFunctionalOverlay LoadFunctionalTimeCourse Overlay_RestoreRegistration Overlay_SaveRegistration Overlay_SetCondition Overlay_SetDisplayFlag Overlay_SetRegistrationToIdentity Overlay_SetThreshold Overlay_SetTimePoint Overlay_SetVolumeSampleType RotateOverlayRegistration ScaleOverlayRegisgtration SelectVoxelsByFuncValue SetFuncOverlayAlpha SmoothFunctionalOverlay TimeCourse_PrintSelectionRangeToFile TimeCourse_SetDisplayFlag TimeCourse_SetNumPreStimPoints TimeCourse_SetTimeResolution

Control Points

NewControlPoint WriteControlPointFile

GCA

LoadGCA LoadGCARenormalization SaveGCA SetGCADisplayStatus UnloadGCA

Head Points

LoadHeadPts RestoreHeadPts RotateHeadPts SetSelectedHeadPointLabel TranslateHeadPts TranslateOverlayRegisgtration WriteHeadPointsFile WriteHeadPointsTransform

I/O

LoadAuxVolume LoadDTIVolumes LoadFunctionalOverlay LoadFunctionalTimeCourse LoadGCA LoadGCARenormalization LoadHeadPts LoadLabel LoadMainSurface LoadOriginalSurface LoadPialSurface LoadSegmentationVolume LoadSurfaceAnnoation LoadVolume LoadVolumeDisplayTransform ReadCursor ReadVoxelLabels SaveGCA SaveLabel SaveRGB SaveSegmentationVolume SaveVolume SaveVolumeAs UnloadAllSurfaces UnloadGCA UnloadSurface UnloadVolume UnloadVolumeDisplayTransform WriteControlPointFile WriteHeadPointsFile WriteHeadPointsTransform WriteSurfaceValues

Misc

DebugPrint QuitMedit SaveRGB SetTool

Selection

ClearSelection LoadLabel SaveLabel SetCursorToCenterOfSelection SetFloodSelectParams

Surface

AverageSurfaceVertexPositions GotoMainVertex GotoOriginalVertex GotoPialVertex LoadMainSurface LoadOriginalSurface LoadPialSurface LoadSurfaceAnnoation SetSurfaceDistanceAtCursor SetSurfaceLineColor SetSurfaceLineWidth ShowNearestInterpolatedMainVertex ShowNearestInterpolatedOriginalVertex ShowNearestInterpolatedPialVertex ShowNearestMainVertex ShowNearestOriginalVertex ShowNearestPialVertex UnloadAllSurfaces UnloadSurface WriteSurfaceValues

Segmentation

ExportChangedSegmentationVolume GetSubjectDir GetSubjectName ImportSurfaceAnnotationToSegmentation LoadSegmentationVolume NewSegmentationVolume ReadVoxelLabels RecomputeSegmentation RestorePreviousSegmentation SaveSegmentationVolume SetSegmentationAlpha UndoLastEdit

Viewing

ReadCursor RedrawAll RedrawScreen SendCursor SetCursor SetCursorColor SetCursorShape SetDTIAlpha SetDisplayConfig SetDisplayFlag SetFuncOverlayAlpha SetLinkedCursorFlag SetOrientation SetSegmentationAlpha SetSlice SetSurfaceLineColor SetSurfaceLineWidth SetVolumeBrightnessContrast SetVolumeColorScale SetVolumeMinMax SetVolumeResampleMethod SetVolumeSampleType SetZoomCenter SetZoomLevel ShowNearestInterpolatedMainVertex ShowNearestInterpolatedOriginalVertex ShowNearestInterpolatedPialVertex ShowNearestMainVertex ShowNearestOriginalVertex ShowNearestPialVertex TimeCourse_SetDisplayFlag

TkMeditGuide/TkMeditReference/TkMeditScripting (last edited 2010-07-01 18:08:08 by tanha)