Up to TkMeditGuide

Back to [:../TkMeditScripting: TkMeditScripting]

Continue to [:../TkMeditFileNameSubstitution: TkMeditFileNameSubstitution]

Scripting

TableOfContents

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.

Anchor(AverageSurfaceVertexPositions) AverageSurfaceVertexPositions numberOfAverages

Anchor(ClearSelection) ClearSelection

Anchor(ClearUndoVolume) ClearUndoVolume

Anchor(DebugPring) DebugPrint string

Anchor(ExportChangedSegmentationVolume) ExportChangedSegmentationVolume volume [destinationDirectory]

Anchor(FlipVolume) FlipVolume xAxis yAxis zAxis

Anchor(GetSubjectDir) GetSubjectDir volume

Anchor(GetSubjectName) GetSubjectName volume

Anchor(GotoMainVertex) GotoMainVertex vertexNumber

Anchor(GotoOriginalVertex) GotoOriginalVertex vertexNumber

Anchor(GotoPialVertex) GotoPialVertex vertexNumber

Anchor(GraphSelectedRegion) GraphSelectedRegion

Anchor(ImportSurfaceAnnotationToSegmentation) ImportSurfaceAnnotationToSegmentation surface annotationFileName colorTableFileName

Anchor(LoadAuxVolume) LoadAuxVolume volumeFileName

Loads volumeFileName as the Aux volume.

Anchor(LoadDTIVolumes) LoadDTIVolumes vectorVolumeFileName intensityVolumeFileName redAxis greenAxis blueAxis

Anchor(LoadFunctionalOverlay) LoadFunctionalOverlay volumeFileName registrationType [registrationFileName]

Anchor(LoadFunctionalTimeCourse) LoadFunctionalTimeCourse volumeFileName registrationType [registrationFileName]

Anchor(LoadGCA) LoadGCA volumeFileName transformFileName

Anchor(LoadGCARenormalization) LoadGCARenormalization renormalizationVolumeFileName

Anchor(LoadHeadPts) LoadHeadPts headPointsFileName transformFileName

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

Anchor(LoadLabel) LoadLabel labelFileName

Anchor(LoadMainSurface) LoadMainSurface surface surfaceFileName

Anchor(LoadOriginalSurface) LoadOriginalSurface surface surfaceFileName

Anchor(LoadPialSurface) LoadPialSurface surface surfaceFileName

Anchor(LoadSegmentationVolume) LoadSegmentationVolume volume volumeFileName colorTableFileName

Anchor(LoadSurfaceAnnotation) LoadSurfaceAnnotation surface annotationFileName

Anchor(LoadVolumeDisplayTransform) LoadVolumeDisplayTransform volume transformFileName

Anchor(LoadVolume) LoadVolume volumeFileName

Anchor(NewControlPoint) NewControlPoint

Anchor(NewSegmentationVolume) NewSegmentationVolume volume fromAnatomicalVolume colorTableFileName

Anchor(Overlay_RestoreRegistration) Overlay_RestoreRegistration

Anchor(Overlay_SaveRegistration) Overlay_SaveRegistration

Anchor(Overlay_SetCondition) Overlay_SetCondition condition

Anchor(Overlay) Overlay_SetDisplayFlag flag value

Anchor(Overlay_SetRegistrationToIdentity) Overlay_SetRegistrationToIdentity

Anchor(Overlay_SetThreshold) Overlay_SetThreshold min mid slope

Anchor(Overlay_SetTimePoint) Overlay_SetTimePoint timePoint

Anchor(Overlay_SetVolumeSampleType) Overlay_SetVolumeSampleType sampleType

Anchor(QuitMedit) QuitMedit

Anchor(ReadCursor)

Anchor(ReadVoxelLabels) ReadVoxelLabels voxelLabelVolume1FileName voxelLabelVolume2FileName

Anchor(RecomputeSegmentation) RecomputeSegmentation volume

Anchor(RedrawAll) RedrawAll

Anchor(RedrawScreen) RedrawScreen

Anchor(RestoreHeadPts) RestoreHeadPts

Anchor(RestorePreviousSegmentation) RestorePreviousSegmentation volume

Anchor(RestoreVolumeFromSnapshot) RestoreVolumeFromSnapshot

Anchor(RotateHeadPts) RotateHeadPts degrees axis

Anchor(RotateOverlayRegistration) RotateOverlayRegistration degrees axis

Anchor(RotateVolume) RotateVolume axis degrees

Anchor(SaveGCA) SaveGCA volumeFileName

Anchor(SaveLabel) SaveLabel labelFileName

Anchor(SaveTIFF) SaveTIFF imageFileName

Anchor(SaveSegmentationVolume) SaveSegmentationVolume volume [destinationDirectory]

Anchor(SaveVolume) SaveVolume volume

Anchor(SaveVolumeAs) SaveVolumeAs volume destinationDirectory

Anchor(ScaleOverlayRegistration) ScaleOverlayRegistration distance axis

Anchor(SelectVoxelsByFuncValuecompareType) SelectVoxelsByFuncValue compareType

Anchor(SendCursor) SendCursor

Anchor(SetBrushInfo) SetBrushInfo brush low high new

Anchor(SetBrushInfoToDefaults) SetBrushInfoToDefaults

Anchor(SetBrushShape) SetBrushShape radius shape 3D

Anchor(SetBrushTarget) SetBrushTarget target

Anchor(SetCursor) SetCursor coordinateSpace x y z

Anchor(SetCursorColor) SetCursorColor r g b

Anchor(SetCursorShape) SetCursorShape shape

Anchor(SetCursorToCenterOfSelection) SetCursorToCenterOfSelection

Anchor(SetDTIAlpha) SetDTIAlpha alpha

Anchor(SetDisplayConfig) SetDisplayConfig numberOfColumns numberOfRows linkPolicy

Anchor(SetDisplayFlag) SetDisplayFlag flag value

Anchor(SetFloodSelectParams) SetFloodSelectParams 3D sourceVolume fuzziness distance

Anchor(SetFuncOverlayAlpha) SetFuncOverlayAlpha alpha

Anchor(SetGCADisplayStatus) SetGCADisplayStatus displayIntermediateResults

Anchor(SetLinkedCursorFlag) SetLinkedCursorFlag linked

Anchor(SetOrientation) SetOrientation orientation

Anchor(SetSegBrushInfo) SetSegBrushInfo newValue 3D sourceVolume fuzziness distance

Anchor(SetSegmentationAlpha) SetSegmentationAlpha alpha

Anchor(SetSelectedHeadPointLabel) SetSelectedHeadPointLabel label

Anchor(SetSlice) SetSlice sliceNumber

Anchor(SetSurfaceDistanceAtCursor) SetSurfaceDistanceAtCursor

Anchor(SetSurfaceLineColor) SetSurfaceLineColor surface set r g b

Anchor(SetSurfaceLineWidth) SetSurfaceLineWidth surface set width

Anchor(SetTool) SetTool tool

Anchor(SetVolumeBrightnessContrast) SetVolumeBrightnessContrast volume brightness contrast

Anchor(SetVolumeColorScale) SetVolumeColorScale volume brightness contrast min max

Anchor(SetVolumeMinMax) SetVolumeMinMax volume min max

Anchor(SetVolumeResampleMethod) SetVolumeResampleMethod volume method

Anchor(SetVolumeSampleType) SetVolumeSampleType volume sampleType

Anchor(SetZoomCenter) SetZoomCenter x y z

Anchor(SetZoomLevel) SetZoomLevel level

Anchor(ShowNearestInterpolatedMainVertex) ShowNearestInterpolatedMainVertex

Anchor(ShowNearestInterpolatedOriginalVertex) ShowNearestInterpolatedOriginalVertex

Anchor(ShowNearestInterpolatedPialVertex) ShowNearestInterpolatedPialVertex

Anchor(ShowNearestMainVertex) ShowNearestMainVertex

Anchor(ShowNearestOriginalVertex) ShowNearestOriginalVertex

Anchor(ShowNearestPialVertex) ShowNearestPialVertex

Anchor(SmartCutAtCursor) SmartCutAtCursor

Anchor(SmoothFunctionalOverlay) SmoothFunctionalOverlay sigma

Anchor(SnapshotVolume) SnapshotVolume

Anchor(ThresholdVolume) ThresholdVolume thresholdValue direction newValue

Anchor(TimeCourse_PrintSelection) TimeCourse_PrintSelectionRangeToFile fileName

Anchor(TimeCourse_SetDisplayFlag) TimeCourse_SetDisplayFlag flag value

Anchor(TimeCourse_SetNumPreStimPoints) TimeCourse_SetNumPreStimPoints numPoints

Anchor(TimeCourse_SetTimeResolution) TimeCourse_SetTimeResolution resolution

Anchor(TranslateHeadPts) TranslateHeadPts distance axis

Anchor(UndoLastEdit) UndoLastEdit

Anchor(UnloadAllSurfaces) UnloadAllSurfaces

Anchor(UnloadGCA) UnloadGCA

Anchor(UnloadSurface) UnloadSurface surface

Anchor(UnloadVolume) UnloadVolume volume

Anchor(UnloadVolumeDisplayTransform) UnloadVolumeDisplayTransform volume

Anchor(WriteControlPointFile) WriteControlPointFile

Anchor(WriteHeadPointsFile) WriteHeadPointsFile

Anchor(WriteHeadPointsTransform) WriteHeadPointsTransform

Anchor(WriteSurfaceValues) WriteSurfaceValues surface valueFileName

Index

[#AverageSurfaceVertexPositions AverageSurfaceVertexPositions]

Anatomical

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

DTI

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

Functional

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

Control Points

[#NewControlPoint NewControlPoint] [#WriteControlPointFile WriteControlPointFile]

GCA

[#LoadGCA LoadGCA] [#LoadGCARenormalization LoadGCARenormalization] [#SaveGCA SaveGCA] [#SetGCADisplayStatus SetGCADisplayStatus] [#UnloadGCA UnloadGCA]

Head Points

[#LoadHeadPts LoadHeadPts] [#RestoreHeadPts RestoreHeadPts] [#RotateHeadPts RotateHeadPts] [#SetSelectedHeadPointLabel SetSelectedHeadPointLabel] [#TranslateHeadPts TranslateHeadPts] [#TranslateOverlayRegisgtration TranslateOverlayRegisgtration] [#WriteHeadPointsFile WriteHeadPointsFile] [#WriteHeadPointsTransform WriteHeadPointsTransform]

I/O

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

Misc

[#DebugPrint DebugPrint] [#QuitMedit QuitMedit] [#SaveRGB SaveRGB] [#SetTool SetTool]

Selection

[#ClearSelection ClearSelection] [#LoadLabel LoadLabel] [#SaveLabel SaveLabel] [#SetCursorToCenterOfSelection SetCursorToCenterOfSelection] [#SetFloodSelectParams SetFloodSelectParams]

Surface

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

Segmentation

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

Viewing

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