SliceOverlayHelp - MRC CBU Imaging Wiki
location: SliceOverlayHelp

Help for slice_overlay script

This is just the help documentation from the slice_overlay routine, described in the DisplaySlices page. The same help results from typing help slice_overlay at the matlab prompt.

Function to display + manage slice display 
Slice display works on a global structure SO
with fields 
 - img - array of images to display
       - img structs contain fields
            type - one of {'truecolour' 'split', 'contour'};
                  truecolour - displays transparent (see prop) image 
                     overlaid with any previous
                  split - in defined area, replaces image present (SPM
                     type activation display)
                  contour - contour map of image overlaid.  See help
                     for contours function in matlab
            vol - vol struct info (see spm_vol)
                  can also be vol containing image as 3d matrix
                  set with slice_overlay('AddBlobs'...) call
            cmap - colormap for this image
            nancol - color for NaN. If scalar, this is an index into
                   the image cmap.  If 1x3 vector, it's a colour
            prop - proportion of intensity for this cmap/img 
            func - function to apply to image before scaling to cmap
                   (and therefore before min/max thresholding. E.g. a func of
                   'i1(i1==0)=NaN' would convert zeros to NaNs
            range - 2x1 vector of values for image to distribute colormap across
                   the first row of the colormap applies to the first
                   value in 'range', and the last value to the second
                   value in 'range'
            outofrange - behavior for image values to the left and
                   right of image limits in 'range'.  Left means
                   colormap values < 1, i.e for image values <
                   range(1), if (range(1)<range(2)), and image values >
                   range(1) where (range(1)>range(2)). If missing,
                   display min (for Left) and max (for Right) value from colormap. 
                   Otherwise should be a 2 element cell array, where
                   the first element is the colour value for image values
                   left of 'range', and the second is for image values
                   right of 'range'.  Scalar values for
                   colour index the colormap, 3x1 vectors are colour
                   values.  An empty array attracts default settings
                   appropriate to the mode - i.e. transparent colour (where 
                   SO.type is truecolour), or split colour.  Empty cells
                   default to 0. 0 specifies that voxels with this
                   colour do not influence the image (split =
                   background, true = black)
           hold  - resampling order for image (see spm_sample_vol) -
                   default 1
           background - value when resampling outside image - default
                   NaN
           linespec - string, applies only to contour map,
                   e.g. 'w-' for white continuous lines
           contours - vector, applies to contour map only, defines 
                   values in image for which to show contours 
                   (see help contours)
           linewidth - scalar, width in points of contour lines
           
- transform - either - 4x4 transformation to apply to image slice position,
            relative to mm given by slicedef, before display
              or     - text string, one of axial, coronal, sagittal
                       These orientations assume the image is currently
                       (after its mat file has been applied) axially
                       oriented
- slicedef - 2x3 array specifying dimensions for slice images in mm
            where rows are x,and y of slice image, and cols are neg max dim,
            slice separation and pos max dim
- slices   - vector of slice positions in mm in z (of transformed image)
- figure    - figure handle for slice display figure
- refreshf  - flag - if set or empty, refresh axis info for figure
            else assume this is OK
- clf       - flag, non zero -> clear figure before display.  Redundant
              if refreshf == 0
- area      struct with fields
                 position - bottom left, x size y size 1x4 vector of
                     area in which to display slices
                 units    - one of
                   inches,centimeters,normalized,points,{pixels}
                 halign - one of left,{center},right
                 valign - one of top,{middle},bottom
- xslices  - no of slices to display across figure (defaults to an optimum)
- cbar      - if empty, missing, no colourbar.  If an array of integers, then 
            indexes img array, and makes colourbar for each cmap for
            that img.  Cbars specified in order of appearance L->R
- labels - struct can be absent (-> default numerical labels)
                 empty (SO.labels = []) (no labels) or contain fields 
                 colour - colour for label text 
                 size - font size in units normalized to slice axes 
                 format - if = cell array of strings =
                 labels for each slice in Z.  If is string, specifies
                 sprintf format string for labelling in distance of the
                 origin (Xmm=0, Ymm=0) of each slice from plane containing
                 the AC, in mm, in the space of the transformed image
- callback - callback string for button down on image panels.  E.g.
             setting SO.callback to 'slice_overlay(''getpos'')' prints to
             the matlab window the equivalent position in mm of the
             position of a mouse click on one of the image slices
- printstr - string for printing slice overlay figure window, e.g.
             'print -dpsc -painters -noui' (the default)
- printfile - name of file to print output to; default 'slices.ps'

FORMAT slice_overlay
Checks, fills SO struct (slice_overlay('checkso')), and 
displays slice overlay (slice_overlay('display'))

FORMAT slice_overlay('checkso')
Checks SO structure and sets defaults

FORMAT [cmap warnstr] = slice_overlay('getcmap',cmapname)
Gets colormap named in cmapname string

FORMAT [mx mn] = slice_overlay('volmaxmin', vol)
Returns maximum and minimum finite values from vol struct 'vol'

FORMAT slice_overlay('addspm',SPM,VOL,dispf)
Adds SPM blobs as new img to SO struct, split effect, 'hot' colormap, 
Structures SPM and VOL are generated by calls to SPM results
if not passed, they are fetched from the workspace
If dispf is not passed, or nonzero, displays resulting SO figure also

FORMAT slice_overlay('addblobs', imgno, XYZ, vals, mat)
adds SPM blobs to img no 'imgno', as specified in 
XYZ  - 3xN voxel coordinates of N blob values
vals - N blob intensity values
mat  - 4x4 matrix specifying voxels -> mm

FORMAT vol = slice_overlay('blobs2vol', XYZ, vals, mat)
returns (pseudo) vol struct for 3d blob volume specified
in matrices as above

FORMAT slice_overlay('addmatrix', imgno, mat3d, mat)
adds 3d matrix image vol to img imgno.  Optionally
mat  - 4x4 matrix specifying voxels -> mm

FORMAT vol = slice_overlay('matrix2vol', mat3d, mat)
returns (pseudo) vol struct for 3d matrix 
input matrices as above

FORMAT mmpos = slice_overlay('getpos')
returns equivalent position in mm of last click on current axes (gca)
if the axes contain an image slice (empty otherwise)

FORMAT vals = slice_overlay('pointvals', XYZmm, holdlist)
returns IxN matrix with values of each image 1..I, at each
point 1..N specified in 3xN mm coordinate matrix XYZmm
If specified, 'holdlist' contains I values giving hold
values for resampling for each image (see spm_sample_vol)

FORMAT slice_overlay('display')
Displays slice overlay from SO struct

FORMAT slice_overlay('print', filename, printstr) 
Prints slice overlay figure, usually to file.  If filename is not
passed/empty gets filename from SO.printfile.  If printstr is not
passed/empty gets printstr from SO.printstr

V 0.9 8/9/00 Added contour maps (many thanks to Petr Janata for this
idea), expanded colormap reader
 
This program is copyright, or rather copyleft, under the terms of
the GNU public licence; see licence.man or http://www.gnu.org/copyleft

Still beta - take care.  Please report problems to Matthew Brett

MatthewBrett

CbuImaging: SliceOverlayHelp (last edited 2013-03-07 21:22:55 by localhost)