[[FsTutorial|top]] | [[FsTutorial/Tools|previous]] == Working with data == === 1.0 Surfaces === Tksurfer holds one main surface. This surface structure has the surface vertex information as well as other information related to the surface, such as additional values for each vertex. Tksurfer can also hold four more surface configurations. These are additional sets of vertex information and locations, but not the other surface information. These configurations are called Inflated, White, Pial, and Original Vertices. '''1.1 Loading surfaces''' <
> The main surface must always be loaded. To load more configurations, use the '''File->Load Surface Configurations...''' submenu. You can also load a different main surface configuration in this menu. This will replace the main vertex information but not the other surface information. '''1.2 Surface display options''' <
> You can select the currently shown surface configuration with the '''View->Surface Configuration''' submenu. Only loaded configurations will be available. You can enable a wireframe overlay with the '''View->Wireframe Overlay''' option. This will draw the surface polygon edges in blue, so you can see exactly where the edges and vertices are. '''1.3 Surface related tools''' <
> There are four tools available to cut surfaces. These tools are available in the '''Tools''' menu and in the Main toolbar. The Cut Line tool ({{attachment:icon_cut_line.gif}}) calculates a line along all the marked vertices in the order that they were marked and cuts the vertices on that line. The Cut Closed Line tool ({{attachment:icon_cut_closed_line.gif}}) does the same, but closes the line from the last marked vertex to the first. In the graphics below, the first image shows some marked vertices. The second shows the results after a Cut Line action, and the third shows the results after a Cut Closed Line action. {{attachment:image1.gif}} The Cut Plane tool requires exactly four marked vertices. The first three define three points on the plane and the fourth defines a point inside the plane. This image shows this process. The surface image has been scaled down to show that the entire surface has been cut away in the second image. {{attachment:image2.gif}} The Cut Area tool is used to cut away one incontiguous area from another. Click in the area you wish to keep and perform the action. The other area will be cut. All cut vertices can be restored with the Clear Cuts tool. '''1.4 Saving surfaces''' <
> Some tools and other functions change the surface vertex information. Other tools change the vertex values and other information. To save these changes to the surface, use the '''File->Save Surface''' option to overwrite the original surface file and '''File->Save Surface As...''' to save it a new location. Note that this does not save the extra surface configurations; these are not part of the main surface structure. === 2.0 Curvature === '''2.1 Loading curvature files''' <
> Use the '''File->Curvature->Load Curvature...''' item to load a curvature file. '''2.2 Curvature display options''' <
> The curvature is displayed as either a green/red color scale or a binary gray background. When no overlay is displayed, the green/red color scale is used. When an overlay is active, the simpler gray is used. The '''View->Configure->Configure Curvature Display''' dialog box allows you to set the midpoint and slope of the curvature color scale. This affects both the green/red and the gray display. '''2.3 Saving curvature files''' <
> Use the '''File->Curvature->Save Curvature''' to save the curvature values and overwrite the original file, or '''File->Curvature->Save Curvature As...''' to save a new curvature file in a new location. === 3.0 Overlay === An overlay is a set of values, 0 or 1 per vertex, displayed with a color scale. It is normally used as a functional activation overlay, but can really be any floating point value per voxel. The source volume can be a .w file, a file containing one value per vertex, previously registered with the volume. It can also be a binary volume or bfile. These are volumes of short integers (.bshort) or floating point values (.bfloat) with a corresponding registration file. Binary volumes can contain multiple time points and conditions. Overlays can be loaded into any of five layers. Tksurfer can display one overlay layer at a time. '''3.1 Loading overlay files''' <
> To load an overlay file, use the '''File->Load Overlay...''' item. You will be prompted for the overlay file name and the layer in which to load the file. Chose the .w file or a .bshort or .bfloat file if you are loading a binary volume. If you are loading a binary volume, you will be prompted for the stem of the volume and a registration file. You may leave the registration file field blank if there is a registration file in the same directory as the binary volume named "register.dat." '''3.2 Overlay file display options''' <
> To select which overlay to show, use the '''View->Overlay Layer''' submenu. The field names are automatically set to the file name loaded. You can change this name by typing a new one into the information area in the Tool window. The display for the current overlay can be configured in the '''View->Configure->Configure Overlay Display''' dialog. If the data you have loaded has multiple time points or conditions, you can select which one to show with the '''Time Point''' and '''Condition''' fields. You can select the color scale to use with the radio buttons in the top area of the dialog. The '''Truncate''' option can be checked to turn off the display of negative values. Check the '''Reverse''' option to reverse the sign of the values as they are drawn in the color scale. '''Inverse and Complex are reserved for future upgrades.''' Also see !SettingTheOverlayColorScale. Click the '''Apply''' button to see your changes. '''3.3 Saving overlay files''' <
> An overlay can only be written out to a .w file; binary volumes cannot be written from overlays. To write a .w file, choose '''File->Save Overlay As...''', and choose a file name and layer from the dialog box. === 4.0 Time course === The Time Course is a binary volume with multiple time points or conditions. The data is displayed in a graph so that all time points can be seen for a given vertex. When a vertex is clicked, the corresponding voxel is found in the binary volume. Tksurfer graphs the data for all time points at the chosen vertex. Loading Time Course Volumes Loading binary volume Overlays and Time Course data is similar. Use the '''File->Load Time Course...''' command to load a time course volume. Tksurfer requires functional volumes to be in binary volume format. It will look for a header file with the same stem as the slice data or just guess the dimensions from the bfile. You need to specify the directory of the data, the stem, and optionally, a registration file. The format of a bfile name looks like this: /path/to/data/stem_000.bfloat <
> /path/to/data/stem_000.bshort The numbers go from 0 to the number of slices minus one. The 'stem' represents any text that appears before the underscore before the number in the bfile. You can specify a registration file to use. If you do not, tksurfer will look in the same directory as the bfile data for a file called register.dat. A registration file is a matrix that defines the translation between anatomical RAS space and functional RAS space. Tksurfer uses this to align the functional volume with the anatomical volume. === 5.0 Time course graph === The Time Course is displayed in a separate graph window. The graph will only be shown if the Time Course volume has more than one time point. Clicking on a vertex in the Display Window finds the corresponding functional voxel based on the registration and displays the values at that voxel for all time points in the graph window. If there are multiple conditions defined in the header file, each condition will show up as a separate line in the graph. The legend on the right side of the graph window displays what line corresponds to what condition. By moving the mouse over a condition label in the legend, the corresponding line in the graph will be highlighted. This is useful for picking out one condition in a crowded graph. You can also zoom into the graph. Click and drag with button 2 to draw a box around the area of interest. The graph will be resized around that box. Click with button 3 to zoom back out. You can specify an average area to graph in two ways. You can click the vertices you want, marking them, and then choose '''Tools->Graph Marked Vertices Avg''' to graph the average. (Note that loading a patch marks vertices, so you can also graph the average of a path this way.) You can also load a label and graph the average of it with the '''Tools->Graph Label Avg. ''' The contents of the graph window can be written to a Postscript file with the '''Tools->Save Graph to Postscript File...''' command. It can then be included in another document or printed. === 6.0 Patches === '''6.1 Loading patches''' <
> Use the '''File->Patch->Load Patch...''' item to load a patch file. '''6.2 Saving patches''' <
> Use the '''File->Patch->Save Patch''' command to overwrite the original file, or '''File->Patch->Save Patch As...''' to save a new patch file in a new location. === 7.0 Labels === '''7.1 Loading labels''' <
> Use '''File->Label->Load Label...''' item to load a label file. '''7.2 Saving labels''' <
> Use '''File->Label->Save Label''' command to overwrite the original file, or '''File->Label->Save Label As...''' to save a new label file in a new location. the current dipole values. === 8.0 Field sign === '''8.1 Loading field sign files''' <
> Use the '''File->Field Sign->Load Field Sign...''' command to load a field sign file. '''8.2 Saving field sign files''' <
> Use the '''File->Field Sign->Save Label''' command to overwrite the original file, or '''File->Field Sign->Save Field Sign As...''' to save a new field sign file in a new location. === 9.0 Field mask === '''9.1 Loading field mask files''' <
> Use the '''File->Field Mask->Load Field Mask...''' item to load a field mask file. '''9.2 Saving field mask files''' <
> Use the '''File->Field Mask->Save Field Mask''' command to overwrite the original file, or '''File->Field Mask->Save Field Mask As...''' to save a new field mask file in a new location.