Gray

From VISTA LAB WIKI

Jump to: navigation, search

Contents

[edit] mrVista Volume View

The mrVista Volume View is a structure saved in the global VOLUME{} variable (set by mrGlobals) and an associated window containing a GUI. Volume views can run without the GUI by invoking a "hidden" volume view ( initHiddenVolume(), initHiddenGray() ). It is designed for analysis and visualization of fMRI data in a high-quality reference or "volume" anatomy for a subject.

The Volume View can operate in one of two distinct modes, "Volume" or "Gray". In "Volume" mode, all coordinates in the volume anatomy (dubbed 'vAnatomy' for short) which intersect with the scanned part of the brain for a scanning session are considered. In "Gray" mode, the coordinates are restricted to those which lie within the gray matter, as determined by the segmentation process. The Volume view can be more memory-intensive, but may be more robust to segmentation errors.

The Volume and Gray views are treated as distinct analyses, with the results kept in the [session]/Volume and [session]/Gray directories, respectively. However, the GUI windows have radio buttons which allow you to switch between modes within a given window (although data maps will need to be recomputed for the other view). Also, although a Volume view is sometimes called a 'Gray View' when in "Gray" mode, it is still kept in the VOLUME{} variable, and methods designed for the Volume view generally apply to it. (One exception is David Ress' laminar analysis tools.)


[edit] What's needed

To use the Volume View in "Volume" mode, you'll need:


To use the "Gray" mode, you will need the above as well as:

  • gray matter graphs (.gray) and classification files (.class) for the

left and/or right cerebral hemispheres. (As generated by mrGray or an equivalent program.)

[edit] Installing a Gray-White Segmentation

To specify the segmentation files for a given session, enabling the gray view, you should select the menu Gray | Gray/White Segmentation | Install or Reinstall Segmentation from the Inplane window, or type installSegmentation; in the command window. You will be prompted for the files. You can specify a segmentation for only one of the two hemispheres; simply select 'cancel' when it asks for files associated with the other hemisphere.


[edit] About the reference anatomy

The reference anatomy is intended to be a high-quality, high-resolution anatomical for a scan subject. Details on obtaining, preprocessing, and segmenting this anatomy are given in the Anatomical_Methods page.

It should be noted that the reference anatomy is generally not scaled or spatially warped to fit into a reference space such as Talairach space, although it is often rigid-body rotated and translated to e.g. lie along AC/PC space (or to match a rigid-body template such as the MNI template.) If the relevant points are set for Computing Talairach coordinates, then the Volume View can report the coordinates in Talairach space of a given voxel or ROI; however, the MR volumes themselves remain untransformed.


[edit] Starting a Volume View

To start a volume view:

  • Select Window | Open Volume 3-View Window or Window | Open Gray 3-View Window from an open mrVista window; or
  • Type mrVista 3view , mrVista gray , or mrVista volume in the command window. (you can also enter the first letter only of each argument.)

There are two flavors of GUI for a given view. The default is a '3-view', showing the 3 principal orientation axes for the anatomy (sagittal, coronal, axial), and allowing you to click around and set a cursor location (with crosshairs that can be toggled on or off). There is also a 'single-orientation' view, allowing only one view at a time to be seen, which takes up more of the window. You can find menus to launch the single-orientation windows in Window | Older Window Types .


[edit] The interface

In the 3-view windows, you can set the selected axial, coronal, and sagittal slices to view by clicking around the anatomy. The slice number for each of these orientations are shown in the three edit fields in the lower left-hand side of the main part of the window. You can also step through slices using the buttons labeled "<<" and ">>" below these edit fields. This will page through the slices of the orientation marked with small round radio button to the left of the orientation text.

[edit] Crosshairs

3-View windows have a 'Crosshairs' button to the lower left. When toggled on, this displays the cursor location as a set of crosshairs in each window. The cursor location is the intersection of the 3 view planes currently being displayed. So, in the coronal axes, the vertical line represents the location of the sagittal slice, and the horizontal line represents the location of the axial slice. The coordinates (row, col, slice)in the vAnatomy data of the cursor location are given in the orientation order (axial, coronal, sagittal). So in the screenshot at bottom, the cursor is at voxel (120, 207, 152) in the data matrix of the volume anatomy. Note also that sagittal slices generally run from left to right, early slices being in the left hemisphere and later ones the right hemisphere.

By default each crosshair is two lines with [R G B] color [1 0.5 0.5]. To set the crosshair type to have a gap near the cursor (a la BrainVoyager), set the preference:

setpref('VISTA', 'xHairMethod', 2)  % method 1 is no gap again

To change the crosshair color, set the preference:

setpref('VISTA', 'xHairColor', [color])


[edit] Combining data across scanning sessions

The Volume and Gray views allow you to take data collected from several sessions and combine them into a single analysis. To do this, you will need to do the following steps:

  • Ensure you have a good Alignment from Inplane to Volume for each of the functional sessions, to the same anatomical volume;
  • Transform the time series from each session from the Inplane to the Volume view:
    • For each session, have an Inplane and Volume/Gray window open.
    • In the Volume/Gray window, select the menu Xform | Inplane -> Volume | TSeries (all scans). This menu has two sub-options: linear or nearest-neighbor interpolation. Trilinear interpolation will make the resampled time series values in the volume be spatially interpolated relative to the nearest functional voxels. Nearest-neighbor interpolation will make the resampled time series have the exact same value as the closest functional voxel to each anatomical voxel.
  • Import the functional data from each session into a single target session which will contain all the data:
    • If you would like to create a new, separate session to contain the combined data from all the original sessions, use the function createCombinedSession. This will create a new session structure, with gray/volume coordinates reflecting the intersection of all the input sessions. Alternately, you can choose a single data session as the target session, and import data from the other sessions into this session.
    • Open a Volume/Gray view in the target session.
    • Select the menu Xform | Other Session -> This Session | Import Scan(s). This will prompt you to select a session, data type, and set of scans to import. The code will attempt to import the time series, Traveling Wave Analyses and parameter maps from the other session. It will also ask you to select a data type in which to store the saved data. You can create a new, "Imported" data type for data from each session, then combine multiple data types into a single data type using Edit | Data Type | Group Scans Into Data Type. Alternately, you can import the new data directly into the data type with the other data you want to analyze.
  • Perform subsequent analyses on the data type containing the combined, imported data.


[edit] The MATLAB VOLUME{} variable

The VOLUME variable has a number of special fields, most loaded from the files Volume/coords.mat or Gray/coords.mat. Some of these fields are described here:

  • coords: 3 x nNodes list of coordinates. The first row is the axial slice (+axial means further inferior); the second row is the coronal slice (+coronal means further posterior); the third row is the sagittal slice (+sagittal means further right).
  • nodes (Gray view only):8 x nNodes list of node information, from the gray matter graph. The nodes are:
    1. x coordinate (coronal slice, + is further posterior) (Note that the first two rows are flipped compared to coords)
    2. y coordinate (axial slice, + is further inferior)
    3. z coordinate (sagittal slice, + is further right)
    4. num_edges for the node. This is the number of neighboring nodes.
    5. edge_offset for the node. This is the index in VOLUME.edges of the first edge originating at this node. So, e.g., if you're looking at node J, and edge_offset is 100, and num_edges is 9, then VOLUME.edges(100:108) will return the indices of nodes that are connected to node J by one edge (i.e., the neighbors of node J).
    6. gray matter layer
    7. dist
    8. pqindex
  • edges: list of edge pointers between neighboring gray matter nodes. See notes above for how to index this.
  • allLeftNodes: list of all nodes in the left hemisphere of this segmentation. Conventions are the same as for the coords field. This may include nodes not included in VOLUME.coords, because those coordinates are usually restricted to where you have functional data while allLeftNodes has no restriction.
  • allRightNodes: list of all nodes in the right hemisphere of this segmentation. Same conventions as allLeftNodes.


[edit] gray coords vs. ROI coords vs. gray nodes

If you define an ROI in the gray view, the coordinates of the ROI are in the same convention as for VOLUME.coords. That is, for the nth ROI in your view, VOLUME.ROIs(n).coords will be a 3 x nNodes list of coordinates in the region of interest. The first row is the axial slice (+axial means further inferior); the second row is the coronal slice (+coronal means further posterior); the third row is the sagittal slice (+sagittal means further right).

So, if an ROI coordinate is in they gray coordinates, the column in ROI.coords and the column in VOLUME.coords will be exactly the same.

 isequal( VOLUME{1}.ROIs(1).coords(:,i), VOLUME{1}.coords(:,j) ) 

For the VOLUME.nodes field (as well as the allLeftNodes and allRightNodes fields), the first two rows are flipped (for annoying legacy code reasons). So, column i of the ROI is also present as column j of, say, the set of left-hemisphere nodes, you should be able to verify with something like:

 isequal( VOLUME{1}.ROIs(1).coords(:,i), VOLUME{1}.allLeftNodes([2 1 3],j) ) 

Finally, note that ROI definitions don't have to be restricted to the gray matter nodes in a given session. ROIs may extend past gray matter into white matter or subcortical structures. The ROI menu has a Restrict to gray option which will remove any voxels not in the VOLUME.coords list for a given session.

[edit] Screenshots

Gray 3-View
Single-Orientation View
Personal tools