logosmall
CCP LAB TOOLS


 

uconv.nawk

This script formats an avg_stats file for |stat (or R)
It will work for both timecourses and magnitudes.
e.g. uconv.nawk avg_stats_file [options]
This should work with multiple files of any format

Can be used to format for SPSS by also using sort and /usr/local/ccp-tools/uc2SPSS
e.g. uconv.nawk avg_stats file [nosplit] | sort | uc2SPSS

options:

these options should come after all filenames that you want to process

abbrev: abbreviates some of the output so it doesn't take up the whole screen (primarily for use with plot_timecourse)
nosplit: will not split timecourse names by _ or +
(default: splits by _ or +)
-diffsplit regexp: will split timecourse by regexp rather than default
(default: splits by _ or +)
domat: will format so that timecourses are in a matrix
this is different from using uc2SPSS, but allows quick formating for matrix multiplication in R (or matlab, even)
(default: one column of data)
witherr: prints std.errs as additional column if in file.
help: prints this message

 

plot_timecourse

This script plots out average statistics using xmgrace (new xmgr)
It will print magnitudes as bar graphs, if it's a magnitudes file
The current version computes the average, and therefore
allows for the exclusion of certain trials or participants..

Usage: plot_timecourse input_file -r region.name -t 1,2,7-10, -dims 3,2

The first argument must be the input_file (any format  avg_stats file from fidl - it uses uconv.nawk to process the data)

optional arguments:

-r region.name tells the program which region to plot (default: first region in file)

This can be a fragment of the region name, as long as it's the end of the name, e.g. value2 would work for a region named voxel_value2. This can be specified multiple times to look at different regions in the same plot.

-t tc,tc,tc or firsttc-lasttc (or any combination) determines which timecourses to plot (default all), or reorders them for display purposes (will rearrange colors and other stylistic aspects)

-n will normalize by subtracting the first frame (only relevant for timecourse data)

-ts N will shift where 0 is on the x-axis to right N frames.

-witherr will plot error bars as well (s.e.)

-verbose will print out a bunch of info as well as plot it...

-onlyverbose will print out a bunch of info and will not do anything else...

-dims x,y,z,w determines aspects of plot (default: Nconds,1,1,1)

x,y,z,w corresponds to design: number of levels for each factor, must have 4 or fewer numbers

controls number of different colors,linestyles,symbols, and symbol fills respectively

-quiet will not display anything but will produce a datafile named region.xmgr and a parameter file region.pars

-ps will produce a post script file for printing region.ps

-pdf will produce a pdf file region.pdf

-i input_file will take additional files as input (a new -i flag is needed for each additional file)

-xcl string will remove any line in hte data file from the computations via reg.exp.

-email will email you a pdf version of the image.

 

doAvgEff

 

This script is supposed to make it easier to get average magnitudes, z-scores, or timecourses on a region-wise basis

As a default, it also records standard deviation images, unless you are doing z-scores (z-scores haven't been used in a while, so that argument may be broken)

Arguments:

glm_list (1st arg, if used (default: list_of_glms.glm_list))

-r region_file (i.e. time_ROI[.4dfp.img])

 ##### Use only one of the -c or -tc options #####

##### may change in future so can use both #####

-tc columns of design matrix if you want timecourses (in 1-8,9-16 format)

-c contrasts you want mags or zs of (in 1-3,5 format)

 -o output file (default: avg_stats_for_regions.txt)

-z makes it do z-scores in stead of magnitudes

-rois 1-3,7 (default: first 100 rois in region file) NOTE: must come after -r argument)

-vv 2-4,8 (aternative to -rois, you pass it the voxel value) NOTE: must come after -r argument)

-ne NO EXECUTE - just output command (useful for debugging)

 e.g. doAvgEff ../list_of_glms.list -r my_region -c 1-4

e.g. doAvgEff -r my_region -tc 1-64 -rois 5

 

do_anovas

This program will run ROI-level ANOVAs for all regions within an avg_stats file.

It will produce a file anova.xxx for each region, where xxx is the region name.

Usage:

do_anovas avg_stats_file options

options include:

columns    specify the factors (for anova |stat program)

               (default will just do a main effect of time)

nosplit    will not split the effect names by /_/

               (default: splits effect names by _)

noclean    will leave the formatted files, and print their names to the screen

               (default: delete them)

forcemag   will force it to ignore the effect of time

               (default: effect of time used as a factor)

-xcl cond  will exclude (as a regular expression) cond from the analysis (can be used multiple times) (default: use all conditions)

Example: do_anovas avg_stats.txt 2 3 -xcl ABC -xcl XYZ -xcl BLAH

 

chendl

takes Macfiles  (with \r as endline) as stdin or as arguments and substitutes \r with \n, so it's appropriate for analysis on UNIX machines

 

get_ROI_CofM.csh

computes center of mass for all the regions in the first argument.

The first argument is the region file (as well as what the statistic map that compute_regions_stats uses to compute centroid)

The second argument is the output name

 

format_regcofm

formats center of mass txt files produced by fidl into a nice table that's easier to read.

 

MRstudies.jr

different version of MRstudies that I like

 

NTstudies.jr

different version of NTstudies that I like, it gives you a warning if files are missing or wrong size

 

ls2conc

This will look for files and write a .conc file to stdout

It takes multiple optional arguments:

-help prints this message

-filter filter, where filter is a piece of the file name

default: all files in the path

-path path, where path is the path (relative or absolute) to the appropriate 4dfp files

default: current working directory

x y z... (any number of numbers)

will reorder the files. These numbers are relative the number of files found,

 so 5 7 8 will take the 5th, 7th and 8th files located, but will break if less

than 8 files are found

default: all files found (in alphabetical order)

-only, in conjunction with any set of numbers, will produce of conc of only the selected files.

default: N numbers are required, where N is the number of files

e.g. ls2conc -path ../T88/ -filter rmsp

ls2conc -path ../T88/ -filter rmsp 4 2 3 1

this is useful to add to preprocessing scripts so you don't have to create them later.

 

rename_rois.csh

this takes a center of mass text file and a region file, and then renames all the rois in the region file with roi_centerofmasscoordinates.

 

strip_headers

This script will remove all region names from an ifh so that logical and algebraic operations can be performed on the 4dfp in fidl.

It will produce a new 4dfp stack with _noreg added to the name.

Usage: strip_headers image[.4dfp.img|.4dfp.ifh|.4dfp.i]

The argument passed to me can be either a stem or a full filename

Examples (all of the following work):

strip_headers avg_stats

strip_headers avg_stats.4dfp.img

strip_headers avg_stats.4dfp.ifh

strip_headers avg_stats.4dfp.i

strip_headers avg_stats.4dfp

Any of these will produce a 4dfp stack avg_stats_noreg.4dfp.img

with no regions in the .ifh file, but with the exact same voxel values as the original image.

 

summarize_glm

takes a glm as an argument, and prints out a table specifying information about the glm, like the name of each effect, which columns they occupy in the design matrix, which effects they are, etc. it's particularly useful combined with doAvgEff

 

uc2SPSS

takes the output of uconv.nawk and processes the file for SPSS (e.g. one line per person). It needs to be sorted on before it's used uconv.nawk file | sort | uc2SPSS

 

voxval2regname

this takes at least 1 argument (the name of a region file)

if this is the only argument, it simply prints a table of the regions, their respective voxel values, and their names.

if there is more than 1 argument, then the other arguments should be numbers that reflect the voxel values of the regions that you're interested in.

e.g. voxval2regname filename 2 5 6

wille printout a table with the names of the regions that are identified by voxel values 2,5, and 6.

 

 cor4dfps

Usage: cor4dfps in1 in2 in3 in4

Where in1 in2É are the names of each input 4dfp file (with or without .4dfp.img)

This returns a text file with a voxel-wise corrrelation matrix as well as some additional information to the screen (mean and sd of the correlations).