|
Size: 26169
Comment:
|
← Revision 26 as of 2010-07-01 18:08:08 ⇥
Size: 38798
Comment:
|
| Deletions are marked like this. | Additions are marked like this. |
| Line 1: | Line 1: |
| ||Up to TkMeditGuide||Back to [:../TkMeditScripting: TkMeditScripting]||Continue to [:../TkMeditFileNameSubstitution: TkMeditFileNameSubstitution]|| | ||Up to TkMeditGuide||Back to [[../TkMeditScripting| TkMeditScripting]]||Continue to [[../TkMeditSampleScreenshotScript| TkMeditSampleScreenshotScript]]|| |
| Line 5: | Line 6: |
| <<TableOfContents>> |
|
| Line 13: | Line 16: |
| == Commands == Functions arguments are listed by their name followed by their arguments. Arguments in square brackets are optional. <<Anchor(AverageSurfaceVertexPositions)>> ''Average``Surface``Vertex``Positions'' '''''numberOfAverages''''' Averages the vertex positions of the Main surface '''numberOfAverages''' times. <<Anchor(ClearSelection)>> ''Clear``Selection'' Clears the current voxel selection. <<Anchor(ClearUndoVolume)>> ''Clear``Undo``Volume'' Clears the undoable voxels. <<Anchor(DebugPring)>> ''Debug``Print'' '''''string''''' Prints '''string''' to debugging output (either the {{{xdebug_TkMedit.txt}}} file or the screen). <<Anchor(ExportChangedSegmentationVolume)>> ''Export``Changed``Segmentation``Volume'' '''''volume [destinationDirectory]''''' Saves the segmentation '''volume''' in its original location (overwriting the original), or a new location if '''destinationDirectory''' is specified. '''volume''' should be 0 for the Main volume, and 1 for the Aux volume. The volume will be saved in COR format. <<Anchor(FlipVolume)>> ''Flip``Volume'' '''''xAxis yAxis zAxis''''' Flips the Main anatomical volume over an axis. Specify 0 or 1 for '''xAxis''', '''yAxis''', and '''zAxis''' to not flip or flip, respectively, on that axis. Axes are in anatomical index coordinate space. <<Anchor(GetSubjectDir)>> ''Get``Subject``Dir'' '''''volume''''' Returns the subject directory path. '''volume''' should be 0 for the Main volume, and 1 for the Aux volume. <<Anchor(GetSubjectName)>> ''Get``Subject``Name'' '''''volume''''' Returns the subject name. '''volume''' should be 0 for the Main volume, and 1 for the Aux volume. <<Anchor(GotoMainVertex)>> ''Goto``Main``Vertex'' '''''vertexNumber''''' Sets the cursor to the location of the numbered vertex in the Main surface. '''vertexNumber''' should be between 0 and the number of vertices in the surface. <<Anchor(GotoOriginalVertex)>> ''Goto``Original``Vertex'' '''''vertexNumber''''' Sets the cursor to the location of the numbered vertex in the Original surface. '''vertexNumber''' should be between 0 and the number of vertices in the surface. <<Anchor(GotoPialVertex)>> ''Goto``Pial``Vertex'' '''''vertexNumber''''' Sets the cursor to the location of the numbered vertex in the Pial surface. '''vertexNumber''' should be between 0 and the number of vertices in the surface. <<Anchor(GraphSelectedRegion)>> ''Graph``Selected``Region'' Graphs the average timecourse for the selected voxels. <<Anchor(ImportSurfaceAnnotationToSegmentation)>> ''Import``Surface``Annotation``To``Segmentation'' '''''surface annotationFileName colorTableFileName''''' Loads '''annotationFileName''' into a surface, creates a new segmentation volume, and goes through the surface, mapping a vertex location to a voxel in the segmentation volume. For each, it looks up a label value from the RGB color stored in the annotation value using '''colorTableFileName''' and sets the segmentation value to the label value. '''surface''' should be 0 for the Main surface, and 1 for the Aux surface. <<Anchor(LoadAuxVolume)>> ''Load``Aux``Volume'' '''''volumeFileName''''' Loads '''volumeFileName''' as the Aux volume. <<Anchor(LoadDTIVolumes)>> ''Load``DTI``Volumes'' '''''vectorVolumeFileName intensityVolumeFileName redAxis greenAxis blueAxis''''' Loads a DTI volume using '''vectorVolumeFileName''' as the volume containing the vectors, and '''intensityVolumeFileName''' as the volume containing the scaling factor. The former should be a three frame volume and the latter should be a one frame volume. The '''redAxis''', '''greenAxis''', and '''blueAxis''' parameters should be x, y, or z, indicating which value in the vector volume corresponds to which color. <<Anchor(LoadFunctionalOverlay)>> ''Load``Functional``Overlay'' '''''volumeFileName registrationType [registrationFileName]''''' Loads a functional overlay volume from '''volumeFileName'''. You must also specify a '''registrationType''', which should be 0 to find a registration file in the same directory as the data, 1 to use an identity registration, and 2 to specify a file. If 2 is the '''registrationType''', use '''registrationFileName''' to specify the file. The overlay will be displayed in the graphics widnow. <<Anchor(LoadFunctionalTimeCourse)>> ''Load``Functional``Time``Course'' '''''volumeFileName registrationType [registrationFileName]''''' Loads a functional time course volume from '''volumeFileName'''. You must also specify a '''registrationType''', which should be 0 to find a registration file in the same directory as the data, 1 to use an identity registration, and 2 to specify a file. If 2 is the '''registrationType''', use '''registrationFileName''' to specify the file. The time course graph will be displayed in a separate window. <<Anchor(LoadGCA)>> ''Load``GCA'' '''''volumeFileName transformFileName''''' Loads a GCA volume from ''volumeFileName'' using the transform in '''transformFileName'''. <<Anchor(LoadGCARenormalization)>> ''Load``GCA``Renormalization'' '''''renormalizationVolumeFileName''''' Loads a GCA renormalization volume from '''renormalizationVolumeFileName'''. <<Anchor(LoadHeadPts)>> ''Load``Head``Pts'' '''''headPointsFileName transformFileName''''' Loads a head points array from '''headPointsFileName''' using the transform in '''transformFileName'''. <<Anchor(LoadLabel)>> ''Load``Label'' '''''labelFileName''''' Loads a label file from '''labelFileName'''. This will add the voxels in the label file to the selection. <<Anchor(LoadMainSurface)>> ''Load``Main``Surface'' '''''surface surfaceFileName''''' Loads a surface file from '''surfaceFileName'''. '''surface''' should be 0 for the Main surface, and 1 for the Aux surface. Note that this loads the main surface object, and will unload the Original or Pial surface configurations if they exist. <<Anchor(LoadOriginalSurface)>> ''Load``Original``Surface'' '''''surface surfaceFileName''''' Loads the Original vertex configuration from '''surfaceFileName''' into an existing surface. '''surface''' should be 0 for the Main surface, and 1 for the Aux surface. Note that the Main surface (that is, the Main Main or Aux Main) must already be loaded; this just loads in an alternate vertex configuration. <<Anchor(LoadPialSurface)>> ''Load``Pial``Surface'' '''''surface surfaceFileName''''' Loads the Pial vertex configuration from '''surfaceFileName''' into an existing surface. '''surface''' should be 0 for the Main surface, and 1 for the Aux surface. Note that the Main surface (that is, the Main Main or Aux Main) must already be loaded; this just loads in an alternate vertex configuration. <<Anchor(LoadSegmentationVolume)>> ''Load``Segmentation``Volume'' '''''volume volumeFileName colorTableFileName''''' Loads a segmentation volume from '''volumeFileName''' using the color table in '''colorTableFileName'''. volume should be 0 for the Main volume, and 1 for the Aux volume. <<Anchor(LoadSurfaceAnnotation)>> ''Load``Surface``Annotation'' '''''surface annotationFileName''''' Loads a surface annotation file from '''annotationFileName''' into a surface. '''surface''' should be 0 for the Main surface, and 1 for the Aux surface. This will color the vertices and edges of the surface display using the RGB annotation values. <<Anchor(LoadVolumeDisplayTransform)>> ''Load``Volume``Display``Transform'' '''''volume transformFileName''''' Loads a display transform from '''transformFileName''' for an anatomical volume. '''volume''' should be 0 for the Main volume, and 1 for the Aux volume. <<Anchor(LoadVolume)>> ''Load``Volume'' '''''volumeFileName''''' Loads '''volumeFileName''' as the Main volume. <<Anchor(NewControlPoint)>> ''New``Control``Point'' Creates a new control point where the cursor is. <<Anchor(NewSegmentationVolume)>> ''New``Segmentation``Volume'' '''''volume fromAnatomicalVolume colorTableFileName''''' Creates a new segmentation volume based on one of the anatomical volumes using the color table in '''colorTableFileName'''. '''volume''' should be 0 for the Main segmentation volume, and 1 for the Aux segmentation volume, and '''fromAnatomicalVolume''' should be 0 for the Main anatomical volume, and 1 for the Aux anatomical volume. <<Anchor(Overlay_RestoreRegistration)>> ''Overlay_``Restore``Registration'' Restores the functional overlay registration to the last saved value. <<Anchor(Overlay_SaveRegistration)>> ''Overlay_``Save``Registration'' Saves the current overlay registration. Overwrites previous file. <<Anchor(Overlay_SetCondition)>> ''Overlay_``Set``Condition'' '''''condition''''' Sets the functional overlay's current condition. '''condition''' must be with in the valid range of conditions. <<Anchor(Overlay)>> ''Overlay_``Set``Display``Flag'' '''''flag value''''' Sets a display flag for the functional overlay in the current display pane. '''value''' should be 0 or 1. '''flag''' should be one of the following, corresponding to an item in the View, Configure Overlay... dialog box: ||0||Truncate Negative Values|| ||1||Truncate Positive Values|| ||2||Reverse Phase|| ||3||Offset Values|| ||4||Ignore Threshold|| ||5||Grayscale Overlay|| ||6||Opaque Overlay|| <<Anchor(Overlay_SetRegistrationToIdentity)>> ''Overlay_``Set``Registration``To``Identity'' Sets the functional overlay registration to the identity matrix. <<Anchor(Overlay_SetThreshold)>> ''Overlay_``Set``Threshold'' '''''min mid slope''''' Sets the functional overlay threshold. '''min''' and '''mid''' should be valid functional values, and '''slope''' should a positive floating point number. <<Anchor(Overlay_SetTimePoint)>> ''Overlay_``Set``Time``Point'' '''''timePoint''''' Sets the functional overlay's current time point. '''timePoint''' must be with in the valid range of time points <<Anchor(Overlay_SetVolumeSampleType)>> ''Overlay_``Set``Volume``Sample``Type'' '''''sampleType''''' Sets the functional overlay sampling method. '''sampleType''' should be 0 for nearest neighbor sampling and 1 for trilinear sampling. <<Anchor(QuitMedit)>> ''Quit``Medit'' Quits the program. <<Anchor(ReadCursor)>> ''Read``Cursor'' Reads a location from the {{{edit.dat}}} file and sets the cursor to that location. <<Anchor(ReadVoxelLabels)>> ''Read``Voxel``Labels'' '''''voxelLabelVolume1FileName voxelLabelVolume2FileName''''' Reads VLI volumes from '''voxelLabelVolume1FileName''' and '''voxelLabelVolume2FileName'''. <<Anchor(RecomputeSegmentation)>> ''Recompute``Segmentation'' '''''volume''''' Recomputes the Main or Aux segmentation volume based on the Main anatomical volume, the GCA volume, and the specified segmentation volume and its changed values. '''volume''' should be 0 for the Main volume, and 1 for the Aux volume. <<Anchor(RedrawAll)>> ''Redraw``All'' This schedules a redraw of the graphics window which will happen at the next update. It is best suited when a redraw does not need to happen until a series of script commands is finished. <<Anchor(RedrawScreen)>> ''Redraw``Screen'' This forces an immediate redraw of the graphics window. This should be used when a script takes multiple screen captures in the middle of a loop. <<Anchor(RestoreHeadPts)>> ''Restore``Head``Pts'' Restores the head points transformation to the original matrix. <<Anchor(RestorePreviousSegmentation)>> ''Restore``Previous``Segmentation'' '''''volume''''' Restores a segmentation volume to the state it was in before it was recomputed. '''volume''' should be 0 for the Main volume, and 1 for the Aux volume. <<Anchor(RestoreVolumeFromSnapshot)>> ''Restore``Volume``From``Snapshot'' Restores the Main volume to the state it was in when the snapshot was taken. <<Anchor(RotateHeadPts)>> ''Rotate``Head``Pts'' '''''degrees axis''''' Rotates the head points orientation by '''degrees''' degrees over the x, y, or z axis. '''degrees''' can be a floating point number and '''axis''' should be x, y, or z. <<Anchor(RotateOverlayRegistration)>> ''Rotate``Overlay``Registration'' '''''degrees axis''''' Rotates the functional overlay registration by '''degrees''' degrees over the x, y, or z axis. '''degrees''' can be a floating point number and '''axis''' should be x, y, or z. <<Anchor(RotateVolume)>> ''Rotate``Volume'' '''''axis degrees''''' Rotates the Main anatomical volume over the x, y, or z axis by '''degrees''' degrees. '''degrees''' can be a floating point number and '''axis''' should be x, y, or z. <<Anchor(SaveGCA)>> ''Save``GCA'' '''''volumeFileName''''' Saves the GCA volume as '''volumeFileName'''. <<Anchor(SaveLabel)>> ''Save``Label'' '''''labelFileName''''' Saves the current selection as a label file in '''labelFileName'''. <<Anchor(SaveTIFF)>> ''Save``TIFF'' '''''imageFileName''''' Takes a screen shot of the graphics window and saves it as an TIFF file in '''imageFileName'''. <<Anchor(SaveSegmentationVolume)>> ''Save``Segmentation``Volume'' '''''volume [destinationDirectory]''''' Saves the specified segmentation volume in its original location (overwriting the old file), or in a new location if '''destinationDirectory''' is specified. '''volume''' should be 0 for the Main volume, and 1 for the Aux volume. The volume will be saved in COR format. <<Anchor(SaveVolume)>> ''Save``Volume'' '''''volume''''' Saves the anatomical volume in its original location, overwriting the old file. '''volume''' should be 0 for the Main volume, and 1 for the Aux volume. The volume will be saved in COR format. <<Anchor(SaveVolumeAs)>> ''Save``Volume``As'' '''''volume destinationDirectory''''' Saves the anatomical volume in '''destinationDirectory'''. '''volume''' should be 0 for the Main volume, and 1 for the Aux volume. The volume will be saved in COR format. <<Anchor(ScaleOverlayRegistration)>> ''Scale``Overlay``Registration'' '''''distance axis''''' Scales the functional overlay registration by '''distance''' over the x, y, or z axis. '''distance''' can be a floating point number and '''axis''' should be x, y, or z. <<Anchor(SelectVoxelsByFuncValuecompareType)>> ''Select``Voxels``By``Func``Value'' '''''compareType''''' Adds to the selection all contiguous voxels whose functional value pass the comparison with the value under the cursor. '''compareType''' should be one of the following: ||0||Greater than or equal to, or less than or equal to: If the value is positive, this will select all voxels whose value are greater than or equal to the value, and if negative, less than or equal to.|| ||1||Equal to: Values must be equal|| ||2||Greater than or equal to threshold minimum: This will select all voxels whose values are above the threshold minimum|| <<Anchor(SendCursor)>> ''Send``Cursor'' Writes the location of the cursor to the {{{edit.dat}}} file, to be shared with tksurfer. <<Anchor(SetBrushInfo)>> ''Set``Brush``Info'' '''''brush low high new''''' Sets information about the anatomical Edit Voxel Tool shape. '''brush''' should be 2 or 3, for the brush associated with button 2 or 3. '''low''', '''high''', and '''new''' should be within the range of voxel values, and set the threshold and new values for the brush. <<Anchor(SetBrushInfoToDefaults)>> ''Set``Brush``Info``To``Defaults'' Restores the brush info (see above) to the default values. <<Anchor(SetBrushShape)>> ''Set``Brush``Shape'' '''''radius shape 3D''''' Sets the brush shape, which affects both edit tools and the Select Voxels tool. '''radius''' should be an integer greater than 0. '''shape''' should be 0 for circle, and 1 for square. '''3D''' should be 0 for in-plane edits only, and 1 for three dimensional editing. <<Anchor(SetBrushTarget)>> ''Set``Brush``Target'' '''''target''''' Sets the brush Edit Voxel Tool target. '''target''' should be 0 for the Main volume, and 1 for the Aux volume, and 2 for the Main and Aux volume. <<Anchor(SetCursor)>> ''Set``Cursor'' '''''coordinateSpace x y z''''' Sets the cursor in the volume and moves the current slice to display it. '''coordinateSpace''' should be 0 for volume index space, 1 for RAS world space, 2 for surface RAS space, and 3 for (real, not MNI) Talairach space. '''x''', '''y''', and '''z''' can be floating point numbers. <<Anchor(SetCursorColor)>> ''Set``Cursor``Color'' '''''r g b''''' Sets the display color for the cursor. '''r''', '''g''', and '''b''' should be floating point values from 0 to 1. <<Anchor(SetCursorShape)>> ''Set``Cursor``Shape'' '''''shape''''' Sets the display shape for the cursor. '''shape''' should be 0 for crosshair and 1 for diamond. <<Anchor(SetCursorToCenterOfSelection)>> ''Set``Cursor``To``Center``Of``Selection'' Sets the cursor location to the center of the current selection, changing the view appropriately. <<Anchor(SetDTIAlpha)>> ''Set``DTI``Alpha'' '''''alpha''''' Sets the opacity alpha for the DTI overlay. '''alpha''' should be a floating point number between 0 and 1. <<Anchor(SetDisplayConfig)>> ''Set``Display``Config'' '''''numberOfColumns numberOfRows linkPolicy''''' Sets the number of rows and columns of display panes in the graphics window. Calling this function will configure the panes in default orientations and slice numbers. '''numberOfCols''' and '''numberOfRows''' should be between 1 and 4. '''linkPolicy''' should be one of the following: ||0||None: Normal link policy; cursor actions in other panes don't affect each other.|| ||1||Cursor: Changing the cursor in one pane will set the cursor in other panes. Zoom levels are linked. Orientation changes are linked. When the display is set to this configuration, all panes are set to different orientations around the cursor.|| ||2||Slice: Changing the slice number in one view will change all other views by the same amount. Cursor changes are not linked. Zoom levels are linked. Orientation changes are linked. When the display is first set to this configuration, all panes are set to the same orientation but to different slices.|| <<Anchor(SetDisplayFlag)>> ''Set``Display``Flag'' '''''flag value''''' Sets a display flag for the current display pane. '''flag''' should be an index number below, '''value''' should be 0 or 1. flag should be one of the following, corresponding to an item in the View menu: ||1||Aux Volume|| ||2||Anatomical Volume|| ||3||Cursor|| ||4||Main Surface|| ||5||Original Surface|| ||6||Pial Surface|| ||7||Interpolate Surface Vertices|| ||8||Surface Vertices|| ||9||Control Points|| ||10||Selection|| ||11||Functional Overlay|| ||12||Functional Color Scale Bar|| ||13||Mask to Functional Overlay|| ||14||Mask Overlay to Aux Volume|| ||15||Segmentation Volume Overlay|| ||16||Aux Segmentation Volume|| ||17||Segmentation Label Volume Count|| ||18||DTI Overlay|| ||20||Focus Frame|| ||21||Undoable Voxels|| ||22||Axes|| ||23||Maximum Intensity Porjection|| ||24||Head Points|| ||25||Verbose GCA Dump|| <<Anchor(SetFloodSelectParams)>> ''Set``Flood``Select``Params'' '''''3D sourceVolume fuzziness distance''''' Sets the parameters for the flood select part of the Select Voxels tool. '''3D''' should be 0 or 1. '''sourceVolume''' should be 0 for the Main anatomical volume, 1 for the Aux anatomical volume, 2 for the Main segmentation volume, and 3 for the Aux segmentation volume. '''fuzziness''' and '''distance''' should be floating point numbers. <<Anchor(SetFuncOverlayAlpha)>> ''Set``Func``Overlay``Alpha'' '''''alpha''''' Sets the opacity alpha for the functional overlay. '''alpha''' should be a floating point number between 0 and 1. <<Anchor(SetGCADisplayStatus)>> ''Set``GCA``Display``Status'' '''''displayIntermediateResults''''' Sets the display status for GCA operations. '''displayIntermediateResults''' should be 0 or 1. <<Anchor(SetLinkedCursorFlag)>> ''Set``Linked``Cursor``Flag'' '''''linked''''' Sets cursor linking on or off. '''linked''' should be 0 or 1. <<Anchor(SetOrientation)>> ''Set``Orientation'' '''''orientation''''' Sets the orientation of the current display pane. '''orientation''' should be 0 for coronal, 1 for horizontal, or 2 for sagittal. <<Anchor(SetSegBrushInfo)>> ''Set``Seg``Brush``Info'' '''''newValue 3D sourceVolume fuzziness distance''''' Sets the parameters for the Edit Segmentation tool, both brush and fill parameters. '''newValue''' should be a valid index in the currently loaded color table. '''3D''' should be 0 or 1. '''sourceVolume''' should be 0 for the Main anatomical volume, 1 for the Aux anatomical volume, 2 for the Main segmentation volume, and 3 for the Aux segmentation volume. '''fuzziness''' and '''distance''' should be floating point numbers. <<Anchor(SetSegmentationAlpha)>> ''Set``Segmentation``Alpha'' '''''alpha''''' Sets the opacity alpha for the segmentation overlay. '''alpha''' should be a floating point number between 0 and 1. <<Anchor(SetSelectedHeadPointLabel)>> ''Set``Selected``Head``Point``Label'' '''''label''''' Sets the label for the currently selected head point. '''label''' should be a string. <<Anchor(SetSlice)>> ''Set``Slice'' '''''sliceNumber''''' Sets the slice number in the currently selected display pane for the anatomical volume. Note that this may trigger updates in other panes due to cursor linking. '''sliceNumber''' should be within the valid range of volume index coordinates. <<Anchor(SetSurfaceDistanceAtCursor)>> ''Set``Surface``Distance``At``Cursor'' Copies the current surface distance value into the Main surface vertex nearest the cursor. <<Anchor(SetSurfaceLineColor)>> ''Set``Surface``Line``Color'' '''''surface set r g b''''' Sets the surface line color. '''surface''' should be 0 for the Main surface, and 1 for the Aux surface. '''set''' should be 0 for Main, 1 for Original, and 2 for Pial. '''r''', '''g''', and '''b''' should be floating numbers from 0 to 1. <<Anchor(SetSurfaceLineWidth)>> ''Set``Surface``Line``Width'' '''''surface set width''''' Sets the surface line width. '''surface''' should be 0 for the Main surface, and 1 for the Aux surface. '''set''' should be 0 for Main, 1 for Original, and 2 for Pial. '''width''' should be an integer. <<Anchor(SetTool)>> ''Set``Tool'' '''''tool''''' Sets the currently active tool. '''tool''' should be 0 for Navigate, 1 for Select Voxels, 2 for Edit Voxels, 3 for Edit Segmentation, or 4 for Edit Control Points. <<Anchor(SetVolumeBrightnessContrast)>> ''Set``Volume``Brightness``Contrast'' '''''volume brightness contrast''''' Sets the brightness and contrast values for a volume. '''volume''' should be 0 for the Main volume, and 1 for the Aux volume. '''brightness''' should be a floating point number from 0 to 1 (0 is brighter than 1) and '''contrast''' should be a floating point number from 0 to 30. <<Anchor(SetVolumeColorScale)>> ''Set``Volume``Color``Scale'' '''''volume brightness contrast min max''''' Sets the color (grayscale, really) scale for a volume. '''volume''' should be 0 for the Main volume, and 1 for the Aux volume. '''brightness''' should be a floating point number from 0 to 1 (0 is brighter than 1) and '''contrast''' should be a floating point number from 0 to 30. '''min''' and '''max''' define the values for black and white and should be valid numbers in the voxel value range. <<Anchor(SetVolumeMinMax)>> ''Set``Volume``Min``Max'' '''''volume min max''''' Sets the color (grayscale, really) scale for a volume. '''volume''' should be 0 for the Main volume, and 1 for the Aux volume. '''min''' and '''max''' define the values for black and white and should be valid numbers in the voxel value range. <<Anchor(SetVolumeResampleMethod)>> ''Set``Volume``Resample``Method'' '''''volume method''''' Sets the resampling method for an anatomical volume. '''volume''' should be 0 for the Main volume, and 1 for the Aux volume. '''method''' should be 0 for RAS and 1 for slice. <<Anchor(SetVolumeSampleType)>> ''Set``Volume``Sample``Type'' '''''volume sampleType''''' Sets the sampling method for an anatomical volume. '''volume''' should be 0 for the Main volume, and 1 for the Aux volume. '''sampleType''' should be 0 for nearest neighbor, 1 for trilinear, and 2 for sinc. <<Anchor(SetZoomCenter)>> ''Set``Zoom``Center'' '''''x y z''''' Sets the zoom center of the current display pane, changing the visible area without setting the cursor. '''x''', '''y''', and '''z''' should be integers in the anatomical index space. <<Anchor(SetZoomLevel)>> ''Set``Zoom``Level'' '''''level''''' Sets the zoom level of the current display pane. '''level''' should be an integer from 1 to 128. <<Anchor(ShowNearestInterpolatedMainVertex)>> ''Show``Nearest``Interpolated``Main``Vertex'' Sets the cursor to the point of the nearest interpolated vertex on the Main surface configuration. <<Anchor(ShowNearestInterpolatedOriginalVertex)>> ''Show``Nearest``Interpolated``Original``Vertex'' Sets the cursor to the point of the nearest interpolated vertex on the Original surface configuration. <<Anchor(ShowNearestInterpolatedPialVertex)>> ''Show``Nearest``Interpolated``Pial``Vertex'' Sets the cursor to the point of the nearest interpolated vertex on the Pial surface configuration. <<Anchor(ShowNearestMainVertex)>> ''Show``Nearest``Main``Vertex'' Sets the cursor to the point of the vertex on the Main surface configuration. <<Anchor(ShowNearestOriginalVertex)>> ''Show``Nearest``Original``Vertex'' Sets the cursor to the point of the vertex on the Original surface configuration. <<Anchor(ShowNearestPialVertex)>> ''Show``Nearest``Pial``Vertex'' Sets the cursor to the point of the vertex on the Pial surface configuration. <<Anchor(SmartCutAtCursor)>> ''Smart``Cut``At``Cursor'' Performs a smart cut operation at the current cursor location. <<Anchor(SmoothFunctionalOverlay)>> ''Smooth``Functional``Overlay'' '''''sigma''''' Smooths the functional overlay volume with given sigma. sigma should be a floating point number. <<Anchor(SnapshotVolume)>> ''Snapshot``Volume'' Saves the state of the Main anatomical volume so it can be restored later. <<Anchor(ThresholdVolume)>> ''Threshold``Volume'' '''''thresholdValue direction newValue''''' Performs a thresholding operation on the Main anatomical volume. '''thresholdValue''' is the value above or below which all values will be set to '''newValue''', and both must be valid anatomical values. '''direction''' should be 0 for below, or 1 for above. <<Anchor(TimeCourse_PrintSelection)>> ''Time``Course_``Print``Selection``RangeToFile'' '''''fileName''''' Prints information about the averaged time course values over all time points for the selected voxels to a text file '''fileName'''. <<Anchor(TimeCourse_SetDisplayFlag)>> ''Time``Course_``Set``Display``Flag'' '''''flag value''''' Sets a display flag for the functional time course. '''value''' should be 0 or 1. '''flag''' should be one of the following, corresponding to an item in the View, Configure Time Course... dialog box: ||7||Open Graph Window|| ||8||Offset Values|| ||9||Show Prestim Offset|| <<Anchor(TimeCourse_SetNumPreStimPoints)>> ''Time``Course_``Set``Num``Pre``Stim``Points'' '''''numPoints''''' Sets the number of pre-stim time points in the time course volume to '''numPoints'''. <<Anchor(TimeCourse_SetTimeResolution)>> ''Time``Course_``Set``Time``Resolution'' '''''resolution''''' Sets the time resolution of the time course volume to '''resolution'''. <<Anchor(TranslateHeadPts)>> ''Translate``Head``Pts'' '''''distance axis''''' Translates the head points orientation by '''distance''' units over the x, y, or z axis. '''axis''' can be x, y, or z. <<Anchor(UndoLastEdit)>> ''Undo``Last``Edit'' Performs and undo. <<Anchor(UnloadAllSurfaces)>> ''Unload``All``Surfaces'' Unloads the Main and Aux surface. <<Anchor(UnloadGCA)>> ''UnloadGCA'' Unloads the GCA volume. <<Anchor(UnloadSurface)>> ''Unload``Surface'' '''''surface''''' Unloads a surface. '''surface''' should be 0 for the Main surface, or 1 for the Aux surface. <<Anchor(UnloadVolume)>> ''Unload``Volume'' '''''volume''''' Unloads an anatomical volume. '''volume''' should be 0 for the Main volume, or 1 for the Aux volume. <<Anchor(UnloadVolumeDisplayTransform)>> ''Unload``Volume``Display``Transform'' '''''volume''''' Unloads an anatomical volume display transform. '''volume''' should be 0 for the Main volume's transform, or 1 for the Aux volume's transform. <<Anchor(WriteControlPointFile)>> ''Write``Control``Point``File'' Writes the control points to the control.dat file. This is done automatically when adding a new point, but not when removing a point. <<Anchor(WriteHeadPointsFile)>> ''Write``Head``Points``File'' Writes the head points file. This overwrites the previous file. <<Anchor(WriteHeadPointsTransform)>> ''Write``Head``Points``Transform'' Writes the head points transform file. This overwrites the previous file. <<Anchor(WriteSurfaceValues)>> ''Write``Surface``Values'' '''''surface valueFileName''''' Writes the a surface's vertex values to a value file '''valueFileName'''. '''surface''' should be 0 for the Main surface, or 1 for the Aux surface. |
|
| Line 15: | Line 641: |
| [#AverageSurfaceVertexPositions AverageSurfaceVertexPositions] == Commands == Functions arguments are listed by their name followed by their arguments. Arguments in square brackets are optional. [[Anchor(AverageSurfaceVertexPositions)]] ''Average``Surface``Vertex``Positions'' '''''numberOfAverages''''' Averages the vertex positions of the Main surface '''numberOfAverages''' times. ''Clear``Selection'' Clears the current voxel selection. ''Clear``Undo``Volume'' Clears the undoable voxels. ''Debug``Print'' '''''string''''' Prints '''string''' to debugging output (either the {{{xdebug_TkMedit.txt}}} file or the screen). script commands index ExportChangedSegmentationVolume volume [destinationDirectory] Saves the segmentation volume in its original location (overwriting the original), or a new location if destinationDirectory is specified. volume should be 0 for the Main volume, and 1 for the Aux volume. The volume will be saved in COR format. script commands index FlipVolume xAxis yAxis zAxis Flips the Main anatomical volume over an axis. Specify 0 or 1 for xAxis, yAxis, and zAxis to not flip or flip, respectively, on that axis. Axes are in anatomical index coordinate space. script commands index GetSubjectDir Returns the subject directory path. volume should be 0 for the Main volume, and 1 for the Aux volume. script commands index GetSubjectName Returns the subject name. volume should be 0 for the Main volume, and 1 for the Aux volume. script commands index GotoMainVertex vertexNumber Sets the cursor to the location of the numbered vertex in the Main surface. vertexNumber should be between 0 and the number of vertices in the surface. script commands index GotoOriginalVertex vertexNumber Sets the cursor to the location of the numbered vertex in the Original surface. vertexNumber should be between 0 and the number of vertices in the surface. script commands index GotoPialVertex vertexNumber Sets the cursor to the location of the numbered vertex in the Pial surface. vertexNumber should be between 0 and the number of vertices in the surface. script commands index GraphSelectedRegion Graphs the average timecourse for the selected voxels. script commands index ImportSurfaceAnnotationToSegmentation surface annotationFileName colorTableFileName Loads annotationFileName into a surface, creates a new segmentation volume, and goes through the surface, mapping a vertex location to a voxel in the segmentation volume. For each, it looks up a label value from the RGB color stored in the annotation value using colorTableFileName and sets the segmentation value to the label value. surface should be 0 for the Main surface, and 1 for the Aux surface. script commands index LoadAuxVolume volumeFileName Loads volumeFileName as the Aux volume. script commands index LoadDTIVolumes vectorVolumeFileName intensityVolumeFileName redAxis greenAxis blueAxis Loads a DTI volume using vectorVolumeFileName as the volume containing the vectors, and intensityVolumeFileNameas the volume containing the scaling factor. The former should be a three frame volume and the latter should be a one frame volume. The redAxis, greenAxis, and blueAxis parameters should be x, y, or z, indicating which value in the vector volume corresponds to which color. script commands index LoadFunctionalOverlay volumeFileName [registrationFileName] Loads a functional overlay volume from volumeFileName. Can also apply an option registration transformation from registrationFileName. The overlay will be displayed in the graphics widnow. script commands index LoadFunctionalTimeCourse volumeFileName [registrationFileName] Loads a functional time course volume from volumeFileName. Can also apply an option registration transformation from registrationFileName. The time course graph will be displayed in a separate window. script commands index LoadGCA volumeFileName transformFileName Loads a GCA volume from volumeFileName using the transform in transformFileName. script commands index LoadGCARenormalization renormalizationVolumeFileName Loads a GCA renormalization volume from renormalizationVolumeFileName. script commands index LoadHeadPts headPointsFileName transformFileName Loads a head points array from headPointsFileName using the transform in transformFileName . script commands index LoadLabel labelFileName Loads a label file from labelFileName. This will add the voxels in the label file to the selection. script commands index LoadMainSurface surface surfaceFileName Loads a surface file from surfaceFileName. surface should be 0 for the Main surface, and 1 for the Aux surface. Note that this loads the main surface object, and will unload the Original or Pial surface configurations if they exist. script commands index LoadOriginalSurface surface surfaceFileName Loads the Original vertex configuration from surfaceFileName into an existing surface. surface should be 0 for the Main surface, and 1 for the Aux surface. Note that the Main surface (that is, the Main Main or Aux Main) must already be loaded; this just loads in an alternate vertex configuration. script commands index LoadPialSurface surface surfaceFileName Loads the Pial vertex configuration from surfaceFileName into an existing surface. surface should be 0 for the Main surface, and 1 for the Aux surface. Note that the Main surface (that is, the Main Main or Aux Main) must already be loaded; this just loads in an alternate vertex configuration. script commands index LoadSegmentationVolume volume volumeFileName colorTableFileName Loads a segmentation volume from volumeFileName using the color table in colorTableFileName. volume should be 0 for the Main volume, and 1 for the Aux volume. script commands index LoadSurfaceAnnotation surface annotationFileName Loads a surface annotation file from annotationFileName into a surface. surface should be 0 for the Main surface, and 1 for the Aux surface. This will color the vertices and edges of the surface display using the RGB annotation values. script commands index LoadVolumeDisplayTransform volume transformFileName Loads a display transform from transformFileName for an anatomical volume. volume should be 0 for the Main volume, and 1 for the Aux volume. script commands index LoadVolume volumeFileName Loads volumeFileName as the Main volume. script commands index NewControlPoint Creates a new control point where the cursor is. script commands index NewSegmentationVolume volume fromAnatomicalVolume colorTableFileName Creates a new segmentation volume based on one of the anatomical volumes using the color table in colorTableFileName. volume should be 0 for the Main segmentation volume, and 1 for the Aux segmentation volume, and fromAnatomicalVolume should be 0 for the Main anatomical volume, and 1 for the Aux anatomical volume. script commands index Overlay RestoreRegistration Restores the functional overlay registration to the last saved value. script commands index Overlay SaveRegistration Saves the current overlay registration. Overwrites previous file. script commands index Overlay_SetCondition condition Sets the functional overlay's current condition. condition must be with in the valid range of conditions. script commands index Overlay_SetDisplayFlag flag value Sets a display flag for the functional overlay in the current display pane. value should be 0 or 1. flag should be one of the following, corresponding to an item in the View, Configure Overlay... dialog box: script commands index 0 Truncate Negative Values 1 Truncate Positive Values 2 Reverse Phase 3 Offset Values 4 Ignore Threshold 5 Grayscale Overlay 6 Opaque Overlay Overlay_SetRegistrationToIdentity Sets the functional overlay registration to the identity matrix. script commands index Overlay_SetThreshold min mid slope Sets the functional overlay threshold. min and mid should be valid functional values, and slope should a positive floating point number. script commands index Overlay_SetTimePoint timePoint Sets the functional overlay's current time point. timePoint must be with in the valid range of time points script commands index Overlay_SetVolumeSampleType sampleType Sets the functional overlay sampling method. sampleType should be 0 for nearest neighbor sampling and 1 for trilinear sampling. script commands index QuitMedit Quits the program. script commands index ReadCursor Reads a location from the edit.dat file and sets the cursor to that location. script commands index ReadVoxelLabels voxelLabelVolume1FileName voxelLabelVolume2FileName Reads VLI volumes from voxelLabelVolume1FileName and voxelLabelVolume2FileName. script commands index RecomputeSegmentation volume Recomputes the Main or Aux segmentation volume based on the Main anatomical volume, the GCA volume, and the specified segmentation volume and its changed values. volume should be 0 for the Main volume, and 1 for the Aux volume. script commands index RedrawAll This schedules a redraw of the graphics window which will happen at the next update. It is best suited when a redraw does not need to happen until a series of script commands is finished. script commands index RedrawScreen This forces an immediate redraw of the graphics window. This should be used when a script takes multiple screen captures in the middle of a loop. script commands index RestoreHeadPts Restores the head points transformation to the original matrix. script commands index RestorePreviousSegmentation volume Restores a segmentation volume to the state it was in before it was recomputed. volume should be 0 for the Main volume, and 1 for the Aux volume. script commands index RestoreVolumeFromSnapshot Restores the Main volume to the state it was in when the snapshot was taken. script commands index RotateHeadPts degrees axis Rotates the head points orientation by degrees degrees over the x, y, or z axis. degrees can be a floating point number and axis should be x, y, or z. script commands index RotateOverlayRegistration degrees axis Rotates the functional overlay registration by degrees degrees over the x, y, or z axis. degrees can be a floating point number and axis should be x, y, or z. script commands index RotateVolume axis degrees Rotates the Main anatomical volume over the x, y, or z axis by degrees degrees. degrees can be a floating point number and axis should be x, y, or z. script commands index SaveGCA volumeFileName Saves the GCA volume as volumeFileName. script commands index SaveLabel labelFileName Saves the current selection as a label file in labelFileName. script commands index SaveRGB imageFileName Takes a screen shot of the graphics window and saves it as an RGB file in imageFileName. script commands index SaveSegmentationVolume volume [destinationDirectory] Saves the specified segmentation volume in its original location (overwriting the old file), or in a new location if destinationDirectory is specified. volume should be 0 for the Main volume, and 1 for the Aux volume. The volume will be saved in COR format. script commands index SaveVolume volume Saves the anatomical volume in its original location, overwriting the old file. volume should be 0 for the Main volume, and 1 for the Aux volume. The volume will be saved in COR format. script commands index SaveVolumeAs volume destinationDirectory Saves the anatomical volume in destinationDirectory. volume should be 0 for the Main volume, and 1 for the Aux volume. The volume will be saved in COR format. script commands index ScaleOverlayRegistration distance axis Scales the functional overlay registration by distance over the x, y, or z axis. distance can be a floating point number and axis should be x, y, or z. script commands index SelectVoxelsByFuncValuecompareType compareType Adds to the selection all contiguous voxels whose functional value pass the comparison with the value under the cursor. compareType should be one of the following: script commands index 0 Greater than or equal to, or less than or equal to: If the value is positive, this will select all voxels whose value are greater than or equal to the value, and if negative, less than or equal to. 1 Equal to: Values must be equal 2 Greater than or equal to threshold minimum: This will select all voxels whose values are above the threshold minimum SendCursor Writes the location of the cursor to the edit.dat file, to be shared with tksurfer. script commands index SetBrushInfo brush low high new Sets information about the anatomical Edit Voxel Tool shape. brush should be 2 or 3, for the brush associated with button 2 or 3. low, high, and new should be within the range of voxel values, and set the threshold and new values for the brush. script commands index SetBrushInfoToDefaults Restores the brush info (see above) to the default values. script commands index SetBrushShape radius shape 3D Sets the brush shape, which affects both edit tools and the Select Voxels tool. radius should be an integer greater than 0. shape should be 0 for circle, and 1 for square. 3D should be 0 for in-plane edits only, and 1 for three dimensional editing. script commands index SetBrushTarget target Sets the brush Edit Voxel Tool target. target should be 0 for the Main volume, and 1 for the Main and Aux volume. script commands index SetCursor coordinateSpace x y z Sets the cursor in the volume and moves the current slice to display it. coordinateSpace should be 0 for volume index space, 1 for RAS world space, and 2 for Talairach space. x, y, and z can be floating point numbers. script commands index SetCursorColor r g b Sets the display color for the cursor. r, g, and b should be floating point values from 0 to 1. script commands index SetCursorShape shape Sets the display shape for the cursor. shape should be 0 for crosshair and 1 for diamond. script commands index SetCursorToCenterOfSelection Sets the cursor location to the center of the current selection, changing the view appropriately. script commands index SetDTIAlpha alpha Sets the opacity alpha for the DTI overlay. alpha should be a floating point number between 0 and 1. script commands index SetDisplayConfig numberOfColumns numberOfRows linkPolicy Sets the number of rows and columns of display panes in the graphics window. Calling this function will configure the panes in default orientations and slice numbers. numberOfCols and numberOfRows should be between 1 and 4. linkPolicy should be one of the following: script commands index 0 None: Normal link policy; cursor actions in other panes don't affect each other. 1 Cursor: Changing the cursor in one pane will set the cursor in other panes. Zoom levels are linked. Orientation changes are linked. When the display is set to this configuration, all panes are set to different orientations around the cursor. 2 Slice: Changing the slice number in one view will change all other views by the same amount. Cursor changes are not linked. Zoom levels are linked. Orientation changes are linked. When the display is first set to this configuration, all panes are set to the same orientation but to different slices. SetDisplayFlag flag value Sets a display flag for the current display pane. value should be 0 or 1. flag should be one of the following, corresponding to an item in the View menu: script commands index 1 Aux Volume 2 Anatomical Volume 3 Cursor 4 Main Surface 5 Original Surface 6 Pial Surface 7 Interpolate Surface Vertices 8 Surface Vertices 9 Control Points 10 Selection 11 Functional Overlay 12 Functional Color Scale Bar 13 Mask to Functional Overlay 14 Histogram Percent Change 15 Segmentation Volume Overlay 16 Aux Segmentation Volume 17 Segmentation Label Volume Count 18 DTI Overlay 20 Focus Frame 21 Undoable Voxels 22 Axes 23 Maximum Intensity Porjection 24 Head Points SetFloodSelectParams 3D sourceVolume fuzziness distance Sets the parameters for the flood select part of the Select Voxels tool. 3D should be 0 or 1. sourceVolume should be 0 for the Main anatomical volume, 1 for the Aux anatomical volume, 2 for the Main segmentation volume, and 3 for the Aux segmentation volume. fuzziness and distance should be floating point numbers. script commands index SetFuncOverlayAlpha alpha Sets the opacity alpha for the functional overlay. alpha should be a floating point number between 0 and 1. script commands index SetGCADisplayStatus displayIntermediateResults Sets the display status for GCA operations. displayIntermediateResults should be 0 or 1. script commands index SetLinkedCursorFlag linked Sets cursor linking on or off. linked should be 0 or 1. script commands index SetOrientation orientation Sets the orientation of the current display pane. orientation should be 0 for coronal, 1 for horizontal, or 2 for sagittal. script commands index SetSegBrushInfo newValue 3D sourceVolume fuzziness distance Sets the parameters for the Edit Segmentation tool, both brush and fill parameters. newValue should be a valid index in the currently loaded color table. 3D should be 0 or 1. sourceVolume should be 0 for the Main anatomical volume, 1 for the Aux anatomical volume, 2 for the Main segmentation volume, and 3 for the Aux segmentation volume. fuzziness and distance should be floating point numbers. script commands index SetSegmentationAlpha alpha Sets the opacity alpha for the segmentation overlay. alpha should be a floating point number between 0 and 1. script commands index SetSelectedHeadPointLabel label Sets the label for the currently selected head point. label should be a string. script commands index SetSlice sliceNumber Sets the slice number in the currently selected display pane for the anatomical volume. Note that this may trigger updates in other panes due to cursor linking. sliceNumber should be within the valid range of volume index coordinates. script commands index SetSurfaceDistanceAtCursor Copies the current surface distance value into the Main surface vertex nearest the cursor. script commands index SetSurfaceLineColor surface set r g b Sets the surface line color. surface should be 0 for the Main surface, and 1 for the Aux surface. set should be 0 for Main, 1 for Original, and 2 for Pial. r, g, and b should be floating numbers from 0 to 1. script commands index SetSurfaceLineWidth surface set width Sets the surface line width. surface should be 0 for the Main surface, and 1 for the Aux surface. set should be 0 for Main, 1 for Original, and 2 for Pial. width should be an integer. script commands index SetTool tool Sets the currently active tool. tool should be 0 for Navigate, 1 for Select Voxels, 2 for Edit Voxels, 3 for Edit Segmentation, or 4 for Edit Control Points. script commands index SetVolumeBrightnessContrast volume brightness contrast Sets the brightness and contrast values for a volume. volume should be 0 for the Main volume, and 1 for the Aux volume. brightness should be a floating point number from 0 to 1 (0 is brighter than 1) and contrast should be a floating point number from 0 to 30.script commands index SetVolumeColorScale volume brightness contrast min max Sets the color (grayscale, really) scale for a volume. volume should be 0 for the Main volume, and 1 for the Aux volume. brightness should be a floating point number from 0 to 1 (0 is brighter than 1) and contrast should be a floating point number from 0 to 30. min and max define the values for black and white and should be valid numbers in the voxel value range. script commands index SetVolumeMinMax volume min max Sets the color (grayscale, really) scale for a volume. volume should be 0 for the Main volume, and 1 for the Aux volume. min and max define the values for black and white and should be valid numbers in the voxel value range. script commands index SetVolumeResampleMethod volume method Sets the resampling method for an anatomical volume. volume should be 0 for the Main volume, and 1 for the Aux volume. method should be 0 for RAS and 1 for slice. script commands index SetVolumeSampleTypevolume sampleType Sets the sampling method for an anatomical volume. volume should be 0 for the Main volume, and 1 for the Aux volume. sampleType should be 0 for nearest neighbor, 1 for trilinear, and 2 for sinc. script commands index SetZoomCenter x y z Sets the zoom center of the current display pane, changing the visible area without setting the cursor. x, y, and z should be integers in the anatomical index space. script commands index SetZoomLevel level Sets the zoom level of the current display pane. level should be an integer from 1 to 128. script commands index ShowNearestInterpolatedMainVertex Sets the cursor to the point of the nearest interpolated vertex on the Main surface configuration. script commands index ShowNearestInterpolatedOriginalVertex Sets the cursor to the point of the nearest interpolated vertex on the Original surface configuration. script commands index ShowNearestInterpolatedPialVertex Sets the cursor to the point of the nearest interpolated vertex on the Pial surface configuration. script commands index ShowNearestMainVertex Sets the cursor to the point of the vertex on the Main surface configuration. script commands index ShowNearestOriginalVertex Sets the cursor to the point of the vertex on the Original surface configuration. script commands index ShowNearestPialVertex Sets the cursor to the point of the vertex on the Pial surface configuration. script commands index SmartCutAtCursor Performs a smart cut operation at the current cursor location. script commands index SmoothFunctionalOverlay sigma Smooths the functional overlay volume with given sigma. sigma should be a floating point number. script commands index SnapshotVolume Saves the state of the Main anatomical volume so it can be restored later. script commands index ThresholdVolume thresholdValue direction newValue Performs a thresholding operation on the Main anatomical volume. thresholdValue is the value above or below which all values will be set to newValue, and both must be valid anatomical values. direction should be 0 for below, or 1 for above. script commands index TimeCourse_PrintSelectionRangeToFile fileName Prints information about the averaged time course values over all time points for the selected voxels to a text file fileName. script commands index TimeCourse_SetDisplayFlagflag flag value Sets a display flag for the functional time course. value should be 0 or 1. flag should be one of the following, corresponding to an item in the View, Configure Time Course... dialog box: script commands index 7 Open Graph Window 8 Offset Values 9 Show Prestim Offset TimeCourse_SetNumPreStimPoints numPoints Sets the number of pre-stim time points in the time course volume to numPoints. script commands index TimeCourse_SetTimeResolution resolution Sets the time resolution of the time course volume to resolution. script commands index TranslateHeadPts distance axis Translates the head points orientation by distance units over the x, y, or z axis. axis can be x, y, or z. script commands index UndoLastEdit Performs and undo. script commands index UnloadAllSurfaces Unloads the Main and Aux surface. script commands index UnloadGCA Unloads the GCA volume. script commands index UnloadSurface surface Unloads a surface. surface should be 0 for the Main surface, or 1 for the Aux surface. script commands index UnloadVolume volume Unloads an anatomical volume. volume should be 0 for the Main volume, or 1 for the Aux volume. script commands index UnloadVolumeDisplayTransformvolume Unloads an anatomical volume display transform. volume should be 0 for the Main volume's transform, or 1 for the Aux volume's transform. script commands index WriteControlPointFile Writes the control points to the control.dat file. This is done automatically when adding a new point, but not when removing a point. script commands index WriteHeadPointsFile Writes the head points file. This overwrites the previous file. script commands index WriteHeadPointsTransform Writes the head points transform file. This overwrites the previous file. script commands index WriteSurfaceValues surface valueFileName Writes the a surface's vertex values to a value file valueFileName. surface should be 0 for the Main surface, or 1 for the Aux surface. script commands 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]] |
Up to TkMeditGuide |
Back to TkMeditScripting |
Continue to TkMeditSampleScreenshotScript |
Scripting
Contents
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
Averages the vertex positions of the Main surface numberOfAverages times.
ClearSelection
- Clears the current voxel selection.
ClearUndoVolume
- Clears the undoable voxels.
DebugPrint string
Prints string to debugging output (either the xdebug_TkMedit.txt file or the screen).
ExportChangedSegmentationVolume volume [destinationDirectory]
Saves the segmentation volume in its original location (overwriting the original), or a new location if destinationDirectory is specified. volume should be 0 for the Main volume, and 1 for the Aux volume. The volume will be saved in COR format.
FlipVolume xAxis yAxis zAxis
Flips the Main anatomical volume over an axis. Specify 0 or 1 for xAxis, yAxis, and zAxis to not flip or flip, respectively, on that axis. Axes are in anatomical index coordinate space.
GetSubjectDir volume
Returns the subject directory path. volume should be 0 for the Main volume, and 1 for the Aux volume.
GetSubjectName volume
Returns the subject name. volume should be 0 for the Main volume, and 1 for the Aux volume.
GotoMainVertex vertexNumber
Sets the cursor to the location of the numbered vertex in the Main surface. vertexNumber should be between 0 and the number of vertices in the surface.
GotoOriginalVertex vertexNumber
Sets the cursor to the location of the numbered vertex in the Original surface. vertexNumber should be between 0 and the number of vertices in the surface.
GotoPialVertex vertexNumber
Sets the cursor to the location of the numbered vertex in the Pial surface. vertexNumber should be between 0 and the number of vertices in the surface.
GraphSelectedRegion
- Graphs the average timecourse for the selected voxels.
ImportSurfaceAnnotationToSegmentation surface annotationFileName colorTableFileName
Loads annotationFileName into a surface, creates a new segmentation volume, and goes through the surface, mapping a vertex location to a voxel in the segmentation volume. For each, it looks up a label value from the RGB color stored in the annotation value using colorTableFileName and sets the segmentation value to the label value. surface should be 0 for the Main surface, and 1 for the Aux surface.
LoadAuxVolume volumeFileName
Loads volumeFileName as the Aux volume.
LoadDTIVolumes vectorVolumeFileName intensityVolumeFileName redAxis greenAxis blueAxis
Loads a DTI volume using vectorVolumeFileName as the volume containing the vectors, and intensityVolumeFileName as the volume containing the scaling factor. The former should be a three frame volume and the latter should be a one frame volume. The redAxis, greenAxis, and blueAxis parameters should be x, y, or z, indicating which value in the vector volume corresponds to which color.
LoadFunctionalOverlay volumeFileName registrationType [registrationFileName]
Loads a functional overlay volume from volumeFileName. You must also specify a registrationType, which should be 0 to find a registration file in the same directory as the data, 1 to use an identity registration, and 2 to specify a file. If 2 is the registrationType, use registrationFileName to specify the file. The overlay will be displayed in the graphics widnow.
LoadFunctionalTimeCourse volumeFileName registrationType [registrationFileName]
Loads a functional time course volume from volumeFileName. You must also specify a registrationType, which should be 0 to find a registration file in the same directory as the data, 1 to use an identity registration, and 2 to specify a file. If 2 is the registrationType, use registrationFileName to specify the file. The time course graph will be displayed in a separate window.
LoadGCA volumeFileName transformFileName
Loads a GCA volume from volumeFileName using the transform in transformFileName.
LoadGCARenormalization renormalizationVolumeFileName
Loads a GCA renormalization volume from renormalizationVolumeFileName.
LoadHeadPts headPointsFileName transformFileName
Loads a head points array from headPointsFileName using the transform in transformFileName.
LoadLabel labelFileName
Loads a label file from labelFileName. This will add the voxels in the label file to the selection.
LoadMainSurface surface surfaceFileName
Loads a surface file from surfaceFileName. surface should be 0 for the Main surface, and 1 for the Aux surface. Note that this loads the main surface object, and will unload the Original or Pial surface configurations if they exist.
LoadOriginalSurface surface surfaceFileName
Loads the Original vertex configuration from surfaceFileName into an existing surface. surface should be 0 for the Main surface, and 1 for the Aux surface. Note that the Main surface (that is, the Main Main or Aux Main) must already be loaded; this just loads in an alternate vertex configuration.
LoadPialSurface surface surfaceFileName
Loads the Pial vertex configuration from surfaceFileName into an existing surface. surface should be 0 for the Main surface, and 1 for the Aux surface. Note that the Main surface (that is, the Main Main or Aux Main) must already be loaded; this just loads in an alternate vertex configuration.
LoadSegmentationVolume volume volumeFileName colorTableFileName
Loads a segmentation volume from volumeFileName using the color table in colorTableFileName. volume should be 0 for the Main volume, and 1 for the Aux volume.
LoadSurfaceAnnotation surface annotationFileName
Loads a surface annotation file from annotationFileName into a surface. surface should be 0 for the Main surface, and 1 for the Aux surface. This will color the vertices and edges of the surface display using the RGB annotation values.
LoadVolumeDisplayTransform volume transformFileName
Loads a display transform from transformFileName for an anatomical volume. volume should be 0 for the Main volume, and 1 for the Aux volume.
LoadVolume volumeFileName
Loads volumeFileName as the Main volume.
NewControlPoint
- Creates a new control point where the cursor is.
NewSegmentationVolume volume fromAnatomicalVolume colorTableFileName
Creates a new segmentation volume based on one of the anatomical volumes using the color table in colorTableFileName. volume should be 0 for the Main segmentation volume, and 1 for the Aux segmentation volume, and fromAnatomicalVolume should be 0 for the Main anatomical volume, and 1 for the Aux anatomical volume.
Overlay_RestoreRegistration
- Restores the functional overlay registration to the last saved value.
Overlay_SaveRegistration
- Saves the current overlay registration. Overwrites previous file.
Overlay_SetCondition condition
Sets the functional overlay's current condition. condition must be with in the valid range of conditions.
Overlay_SetDisplayFlag flag value
Sets a display flag for the functional overlay in the current display pane. value should be 0 or 1. flag should be one of the following, corresponding to an item in the View, Configure Overlay... dialog box:
0
Truncate Negative Values
1
Truncate Positive Values
2
Reverse Phase
3
Offset Values
4
Ignore Threshold
5
Grayscale Overlay
6
Opaque Overlay
Overlay_SetRegistrationToIdentity
- Sets the functional overlay registration to the identity matrix.
Overlay_SetThreshold min mid slope
Sets the functional overlay threshold. min and mid should be valid functional values, and slope should a positive floating point number.
Overlay_SetTimePoint timePoint
Sets the functional overlay's current time point. timePoint must be with in the valid range of time points
Overlay_SetVolumeSampleType sampleType
Sets the functional overlay sampling method. sampleType should be 0 for nearest neighbor sampling and 1 for trilinear sampling.
QuitMedit
- Quits the program.
ReadCursor
Reads a location from the edit.dat file and sets the cursor to that location.
ReadVoxelLabels voxelLabelVolume1FileName voxelLabelVolume2FileName
Reads VLI volumes from voxelLabelVolume1FileName and voxelLabelVolume2FileName.
RecomputeSegmentation volume
Recomputes the Main or Aux segmentation volume based on the Main anatomical volume, the GCA volume, and the specified segmentation volume and its changed values. volume should be 0 for the Main volume, and 1 for the Aux volume.
RedrawAll
- This schedules a redraw of the graphics window which will happen at the next update. It is best suited when a redraw does not need to happen until a series of script commands is finished.
RedrawScreen
- This forces an immediate redraw of the graphics window. This should be used when a script takes multiple screen captures in the middle of a loop.
RestoreHeadPts
- Restores the head points transformation to the original matrix.
RestorePreviousSegmentation volume
Restores a segmentation volume to the state it was in before it was recomputed. volume should be 0 for the Main volume, and 1 for the Aux volume.
RestoreVolumeFromSnapshot
- Restores the Main volume to the state it was in when the snapshot was taken.
RotateHeadPts degrees axis
Rotates the head points orientation by degrees degrees over the x, y, or z axis. degrees can be a floating point number and axis should be x, y, or z.
RotateOverlayRegistration degrees axis
Rotates the functional overlay registration by degrees degrees over the x, y, or z axis. degrees can be a floating point number and axis should be x, y, or z.
RotateVolume axis degrees
Rotates the Main anatomical volume over the x, y, or z axis by degrees degrees. degrees can be a floating point number and axis should be x, y, or z.
SaveGCA volumeFileName
Saves the GCA volume as volumeFileName.
SaveLabel labelFileName
Saves the current selection as a label file in labelFileName.
SaveTIFF imageFileName
Takes a screen shot of the graphics window and saves it as an TIFF file in imageFileName.
SaveSegmentationVolume volume [destinationDirectory]
Saves the specified segmentation volume in its original location (overwriting the old file), or in a new location if destinationDirectory is specified. volume should be 0 for the Main volume, and 1 for the Aux volume. The volume will be saved in COR format.
SaveVolume volume
Saves the anatomical volume in its original location, overwriting the old file. volume should be 0 for the Main volume, and 1 for the Aux volume. The volume will be saved in COR format.
SaveVolumeAs volume destinationDirectory
Saves the anatomical volume in destinationDirectory. volume should be 0 for the Main volume, and 1 for the Aux volume. The volume will be saved in COR format.
ScaleOverlayRegistration distance axis
Scales the functional overlay registration by distance over the x, y, or z axis. distance can be a floating point number and axis should be x, y, or z.
SelectVoxelsByFuncValue compareType
Adds to the selection all contiguous voxels whose functional value pass the comparison with the value under the cursor. compareType should be one of the following:
0
Greater than or equal to, or less than or equal to: If the value is positive, this will select all voxels whose value are greater than or equal to the value, and if negative, less than or equal to.
1
Equal to: Values must be equal
2
Greater than or equal to threshold minimum: This will select all voxels whose values are above the threshold minimum
SendCursor
Writes the location of the cursor to the edit.dat file, to be shared with tksurfer.
SetBrushInfo brush low high new
Sets information about the anatomical Edit Voxel Tool shape. brush should be 2 or 3, for the brush associated with button 2 or 3. low, high, and new should be within the range of voxel values, and set the threshold and new values for the brush.
SetBrushInfoToDefaults
- Restores the brush info (see above) to the default values.
SetBrushShape radius shape 3D
Sets the brush shape, which affects both edit tools and the Select Voxels tool. radius should be an integer greater than 0. shape should be 0 for circle, and 1 for square. 3D should be 0 for in-plane edits only, and 1 for three dimensional editing.
SetBrushTarget target
Sets the brush Edit Voxel Tool target. target should be 0 for the Main volume, and 1 for the Aux volume, and 2 for the Main and Aux volume.
SetCursor coordinateSpace x y z
Sets the cursor in the volume and moves the current slice to display it. coordinateSpace should be 0 for volume index space, 1 for RAS world space, 2 for surface RAS space, and 3 for (real, not MNI) Talairach space. x, y, and z can be floating point numbers.
SetCursorColor r g b
Sets the display color for the cursor. r, g, and b should be floating point values from 0 to 1.
SetCursorShape shape
Sets the display shape for the cursor. shape should be 0 for crosshair and 1 for diamond.
SetCursorToCenterOfSelection
- Sets the cursor location to the center of the current selection, changing the view appropriately.
SetDTIAlpha alpha
Sets the opacity alpha for the DTI overlay. alpha should be a floating point number between 0 and 1.
SetDisplayConfig numberOfColumns numberOfRows linkPolicy
Sets the number of rows and columns of display panes in the graphics window. Calling this function will configure the panes in default orientations and slice numbers. numberOfCols and numberOfRows should be between 1 and 4. linkPolicy should be one of the following:
0
None: Normal link policy; cursor actions in other panes don't affect each other.
1
Cursor: Changing the cursor in one pane will set the cursor in other panes. Zoom levels are linked. Orientation changes are linked. When the display is set to this configuration, all panes are set to different orientations around the cursor.
2
Slice: Changing the slice number in one view will change all other views by the same amount. Cursor changes are not linked. Zoom levels are linked. Orientation changes are linked. When the display is first set to this configuration, all panes are set to the same orientation but to different slices.
SetDisplayFlag flag value
Sets a display flag for the current display pane. flag should be an index number below, value should be 0 or 1. flag should be one of the following, corresponding to an item in the View menu:
1
Aux Volume
2
Anatomical Volume
3
Cursor
4
Main Surface
5
Original Surface
6
Pial Surface
7
Interpolate Surface Vertices
8
Surface Vertices
9
Control Points
10
Selection
11
Functional Overlay
12
Functional Color Scale Bar
13
Mask to Functional Overlay
14
Mask Overlay to Aux Volume
15
Segmentation Volume Overlay
16
Aux Segmentation Volume
17
Segmentation Label Volume Count
18
DTI Overlay
20
Focus Frame
21
Undoable Voxels
22
Axes
23
Maximum Intensity Porjection
24
Head Points
25
Verbose GCA Dump
SetFloodSelectParams 3D sourceVolume fuzziness distance
Sets the parameters for the flood select part of the Select Voxels tool. 3D should be 0 or 1. sourceVolume should be 0 for the Main anatomical volume, 1 for the Aux anatomical volume, 2 for the Main segmentation volume, and 3 for the Aux segmentation volume. fuzziness and distance should be floating point numbers.
SetFuncOverlayAlpha alpha
Sets the opacity alpha for the functional overlay. alpha should be a floating point number between 0 and 1.
SetGCADisplayStatus displayIntermediateResults
Sets the display status for GCA operations. displayIntermediateResults should be 0 or 1.
SetLinkedCursorFlag linked
Sets cursor linking on or off. linked should be 0 or 1.
SetOrientation orientation
Sets the orientation of the current display pane. orientation should be 0 for coronal, 1 for horizontal, or 2 for sagittal.
SetSegBrushInfo newValue 3D sourceVolume fuzziness distance
Sets the parameters for the Edit Segmentation tool, both brush and fill parameters. newValue should be a valid index in the currently loaded color table. 3D should be 0 or 1. sourceVolume should be 0 for the Main anatomical volume, 1 for the Aux anatomical volume, 2 for the Main segmentation volume, and 3 for the Aux segmentation volume. fuzziness and distance should be floating point numbers.
SetSegmentationAlpha alpha
Sets the opacity alpha for the segmentation overlay. alpha should be a floating point number between 0 and 1.
SetSelectedHeadPointLabel label
Sets the label for the currently selected head point. label should be a string.
SetSlice sliceNumber
Sets the slice number in the currently selected display pane for the anatomical volume. Note that this may trigger updates in other panes due to cursor linking. sliceNumber should be within the valid range of volume index coordinates.
SetSurfaceDistanceAtCursor
- Copies the current surface distance value into the Main surface vertex nearest the cursor.
SetSurfaceLineColor surface set r g b
Sets the surface line color. surface should be 0 for the Main surface, and 1 for the Aux surface. set should be 0 for Main, 1 for Original, and 2 for Pial. r, g, and b should be floating numbers from 0 to 1.
SetSurfaceLineWidth surface set width
Sets the surface line width. surface should be 0 for the Main surface, and 1 for the Aux surface. set should be 0 for Main, 1 for Original, and 2 for Pial. width should be an integer.
SetTool tool
Sets the currently active tool. tool should be 0 for Navigate, 1 for Select Voxels, 2 for Edit Voxels, 3 for Edit Segmentation, or 4 for Edit Control Points.
SetVolumeBrightnessContrast volume brightness contrast
Sets the brightness and contrast values for a volume. volume should be 0 for the Main volume, and 1 for the Aux volume. brightness should be a floating point number from 0 to 1 (0 is brighter than 1) and contrast should be a floating point number from 0 to 30.
SetVolumeColorScale volume brightness contrast min max
Sets the color (grayscale, really) scale for a volume. volume should be 0 for the Main volume, and 1 for the Aux volume. brightness should be a floating point number from 0 to 1 (0 is brighter than 1) and contrast should be a floating point number from 0 to 30. min and max define the values for black and white and should be valid numbers in the voxel value range.
SetVolumeMinMax volume min max
Sets the color (grayscale, really) scale for a volume. volume should be 0 for the Main volume, and 1 for the Aux volume. min and max define the values for black and white and should be valid numbers in the voxel value range.
SetVolumeResampleMethod volume method
Sets the resampling method for an anatomical volume. volume should be 0 for the Main volume, and 1 for the Aux volume. method should be 0 for RAS and 1 for slice.
SetVolumeSampleType volume sampleType
Sets the sampling method for an anatomical volume. volume should be 0 for the Main volume, and 1 for the Aux volume. sampleType should be 0 for nearest neighbor, 1 for trilinear, and 2 for sinc.
SetZoomCenter x y z
Sets the zoom center of the current display pane, changing the visible area without setting the cursor. x, y, and z should be integers in the anatomical index space.
SetZoomLevel level
Sets the zoom level of the current display pane. level should be an integer from 1 to 128.
ShowNearestInterpolatedMainVertex
- Sets the cursor to the point of the nearest interpolated vertex on the Main surface configuration.
ShowNearestInterpolatedOriginalVertex
- Sets the cursor to the point of the nearest interpolated vertex on the Original surface configuration.
ShowNearestInterpolatedPialVertex
- Sets the cursor to the point of the nearest interpolated vertex on the Pial surface configuration.
ShowNearestMainVertex
- Sets the cursor to the point of the vertex on the Main surface configuration.
ShowNearestOriginalVertex
- Sets the cursor to the point of the vertex on the Original surface configuration.
ShowNearestPialVertex
- Sets the cursor to the point of the vertex on the Pial surface configuration.
SmartCutAtCursor
- Performs a smart cut operation at the current cursor location.
SmoothFunctionalOverlay sigma
- Smooths the functional overlay volume with given sigma. sigma should be a floating point number.
SnapshotVolume
- Saves the state of the Main anatomical volume so it can be restored later.
ThresholdVolume thresholdValue direction newValue
Performs a thresholding operation on the Main anatomical volume. thresholdValue is the value above or below which all values will be set to newValue, and both must be valid anatomical values. direction should be 0 for below, or 1 for above.
TimeCourse_PrintSelectionRangeToFile fileName
Prints information about the averaged time course values over all time points for the selected voxels to a text file fileName.
TimeCourse_SetDisplayFlag flag value
Sets a display flag for the functional time course. value should be 0 or 1. flag should be one of the following, corresponding to an item in the View, Configure Time Course... dialog box:
7
Open Graph Window
8
Offset Values
9
Show Prestim Offset
TimeCourse_SetNumPreStimPoints numPoints
Sets the number of pre-stim time points in the time course volume to numPoints.
TimeCourse_SetTimeResolution resolution
Sets the time resolution of the time course volume to resolution.
TranslateHeadPts distance axis
Translates the head points orientation by distance units over the x, y, or z axis. axis can be x, y, or z.
UndoLastEdit
- Performs and undo.
UnloadAllSurfaces
- Unloads the Main and Aux surface.
UnloadGCA
- Unloads the GCA volume.
UnloadSurface surface
Unloads a surface. surface should be 0 for the Main surface, or 1 for the Aux surface.
UnloadVolume volume
Unloads an anatomical volume. volume should be 0 for the Main volume, or 1 for the Aux volume.
UnloadVolumeDisplayTransform volume
Unloads an anatomical volume display transform. volume should be 0 for the Main volume's transform, or 1 for the Aux volume's transform.
WriteControlPointFile
- Writes the control points to the control.dat file. This is done automatically when adding a new point, but not when removing a point.
WriteHeadPointsFile
- Writes the head points file. This overwrites the previous file.
WriteHeadPointsTransform
- Writes the head points transform file. This overwrites the previous file.
WriteSurfaceValues surface valueFileName
Writes the a surface's vertex values to a value file valueFileName. surface should be 0 for the Main surface, or 1 for the Aux surface.
Index
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
