Skip to content

Instantly share code, notes, and snippets.

View johncolby's full-sized avatar

John Colby johncolby

  • San Francisco, CA
View GitHub Profile
@johncolby
johncolby / trk_plot.m.diff
Created April 26, 2011 17:33
Tweak to trk_plot to highlight different levels
diff --git a/trk_plot.m b/trk_plot.m
index 30e0a4a..26cf093 100644
--- a/trk_plot.m
+++ b/trk_plot.m
@@ -37,6 +37,9 @@ if nargin < 4 || isempty(slices), slices = header.dim/2; end
if ~isstruct(tracks), error('Tracks must be in structure form. Try running TRK_RESTRUC first.'), end
+levels = [0 25 50 75 100];^M
+levels = round(levels*(97-1)/100 + 1);^M
@johncolby
johncolby / between_grp.R.diff
Created April 20, 2011 15:58
Modified to always do perms on all tracts/hemispheres
diff --git a/example/between_group/between_grp.R b/example/between_group/between_grp.R
index ffeeaeb..e2d1c08 100644
--- a/example/between_group/between_grp.R
+++ b/example/between_group/between_grp.R
@@ -77,16 +77,7 @@ doPerms <- function(df, demog, nPerms=100){
maxT
}
-# Only correct for multiple comparisons across the tracts with a significant
-# Point:Group interaction F-test. Set the corrected p-values of other tracts to 1
@johncolby
johncolby / between_grp.R
Created April 18, 2011 20:35
Updates to between group stats code
exptDir = '/Users/jcolby/Documents/LONI/along-tract-stats/along-tract-stats.git/example/between_group'
grpLabs = c('Control', 'FASD')
thresh = 0.05
nPerms = 100
library(nlme) # Mixed-effects models
library(ggplot2) # Plotting tools
library(plyr) # Data manipulation
library(RColorBrewer) # Color tables
@johncolby
johncolby / trk_compile_data.patch
Created March 29, 2011 17:08
Patches revision 72c87f6 of along-tract-stats to use normal structures instead of datasets
diff --git a/trk_compile_data.m b/trk_compile_data.m
index 0b2ddfe..90d3d15 100644
--- a/trk_compile_data.m
+++ b/trk_compile_data.m
@@ -52,17 +52,12 @@ function [track_means,starting_pts_out] = trk_compile_data(subsDir,subIDs,tract_
if nargin < 7 || isempty(saveASCII), saveASCII = 0; end
if nargin < 6 || isempty(saveTrk), saveTrk = 0; end
if nargin < 5 || isempty(starting_pts_in)
- starting_pts_in = dataset();
-elseif ~iscell(starting_pts_in.Subject) % Reformat to cells if subIDs are all numeric
@johncolby
johncolby / my-first-style.xml
Created February 4, 2011 23:59
Trying to add 'disambiguate-add-year-suffix' and 'collapse'
<?xml version="1.0" encoding="UTF-8"?>
<style xmlns="http://purl.org/net/xbiblio/csl" version="1.0"
class="in-text">
<info>
<title>My First Style</title>
<id>my-first-style</id>
<updated>2008-10-29T21:01:24+00:00</updated>
</info>
<macro name="author-short">
<names variable="author">