Paper on the CNS website

Stefania Ashby’s paper is featured on the Cognitive Neuroscience Society’s website.

Posted in Uncategorized | Leave a comment

Remembering the past and imagining the future: New paper from the lab

Figure caption: A comparison of fMRI activation for remembering the past (warm colors) vs. imagining the future (cool colors).

The lab has a new paper out: “Remembering and imagining differentially engage the hippocampus: A multivariate fMRI investigation”. There is increasing evidence that the part of the brain necessary for remembering past experience (the hippocampus) is also needed for imagining the future. If you have damage to this brain structure, you’re impaired at both tasks. Also, many neuroimaging studies have shown similar levels of activation in the hippocampus in response to both tasks (though the pattern of activation may be different between the two).

In this paper, we use multivoxel pattern analysis (MVPA) to investigate how the hippocampus responds to these two tasks. This method uses a machine learning algorithm to try to pick apart different task conditions based on the overall pattern of fMRI activation within a given brain structure. When we looked at the pattern of activation across the whole brain, not surprisingly, the algorithm was able to tell the two tasks apart with high accuracy. When we restricted the data to just the hippocampus, the algorithm was still able to tell the two conditions apart, indicating that they differentially engage the hippocampus.

This study was the brain child of Stefania Ashby, who as an undergrad conceived the experimental design, did all the pilot work, and collected most of the scan data. Unfortunately (for me), she graduated and got a job, so she had to wait for me to finish data collection and analysis for this to see the light of day. Hopefully the wait was worth it!

The paper is in Cognitive Neuroscience (paywalled, unfortunately; let me know if you’d like a pdf).

Posted in Research | Tagged , | 1 Comment

rotating brain

rotating brain

I’ve been messing around with Mango as part of my data analysis pipeline. It’s great for some simple tasks, and does some things quite beautifully. Like create a surface of a volume, add an overlay, and then animate the whole thing. To create this figure, I did our standard analysis in afni, did a t-test for two conditions (viewing high-calorie food stimuli minus low-calorie food stimuli) and saved the output as nifti files. From there, it was Mango to create the surface and cut-away model and render/animate it, quicktime to capture the animation, and photoshop to convert to a gif.

Image | Posted on by | 1 Comment

SPM Tutorials

I found a series of tutorials on SPM and put them together as a playlist:

Posted in Uncategorized | Leave a comment

New Paper! (Warning: Shameless self promotion)

DJ Shelton’s paper just came out in Behavioral Brain Research. In it, we show that self-reported depression scores correlated with memory discrimination, presumably due to reduced pattern separation processes in the hippocampus associated with lower neurogenesis rates. Read it!

Posted in Uncategorized | Leave a comment

Average topographical plots for ERP data

If you use the EP Toolkit for ERP analysis, you can make great topographical plots of the scalp distribution of ERPs for single points in time. Problem is that reviewers like to see plots for averages over windows of time (in, say, 100ms increments). If you want to make such plots (like the one below), you can use the following code. You need to save a grand average .ept file first, but everything else should be pretty self explanatory. Copy the code below into the Matlab editor and save it as something like ‘plotAvgTopos.m’.


function plotAvgTopos
% Function to plot average topographical maps from ERP PCA toolbox files.
% Depends on the EEGlab toolbox for core functionality. If you have the ERP
% PCA toolbox installed, then you already have the EEGlab toolbox as well.
% Requires that you have saved out a grand average .ept file using the ERP
% PCA toolbox.
% The resulting matlab figure can be manipulated in the figure window or
% can be saved out as an image file to be edited using an image editing
% package (e.g., photoshop).
% Brock Kirwan -
% 5/13/2013

%%Preference variables 
azimuth = 80;  %azimuth (rotation around the IS axis) for 3D plot
elevation = 45; %elevation (rotation around the LR axis) for 3D plot

%%Locate and load the grand average ept file
%ask the user to indicate the file
[filename, pathname] = uigetfile('*.ept','Select Grand Average EPT File');

%then load it. This loads in a structure called EPdata.
load([pathname filename],'-mat');

%%Ask user for epochs to average
windowTimes = inputdlg({'Start avg time (in ms relative to stim onset)', 'Stop avg time', 'Number of windows'}, 'Epochs');

%error checking
if str2double(windowTimes{1}) >= str2double(windowTimes{2})
    error('Start time must be less than end time.');

%These are the windows (in ms relative to stim onset) that you want to plot
%  should look something like: [300, 400, 500, 600]
windows = linspace(str2double(windowTimes{1}), ...
    str2double(windowTimes{2}), ...

%%Ask user for which cells to plot
cells= listdlg('PromptString','Select conditions to plot:',...

%%Read in some info from the EPdata structure
%Figure out the sampling period. Usually 4ms.
period = 1/EPdata.Fs*1000;
%get the sample numbers based on the sampling period.
windInd = windows/period;
%add the baseline samples. Usually 50.
windInd = windInd + EPdata.baseline;

%Count up the number of windows and conditions to plot.
nWindows = length(windows)-1;
nCells = length(cells);
for cel = 1:nCells
    cellNames{cel} = EPdata.cellNames{cells(cel)};

%%Ask user for and read electrode location file
if exist('/Applications/EP_Toolkit/electrodes/GSN-Hydrocel-129.ced','file');
    eloc = readlocs('/Applications/EP_Toolkit/electrodes/GSN-Hydrocel-129.ced');
    [filename, pathname] = uigetfile('*.ced','Select Electrode Location File');
    eloc = readlocs([pathname filename]);

%get rid of FID electrodes
eloc(1:3) = [];

%%ask the user if there are any comparisons
ButtonName = questdlg('Any subtractions?', ...
                         'Question', ...
                         'Yes', 'No', 'No');

if strcmp(ButtonName,'Yes')
    posCell = listdlg('PromptString', 'Select positive (+) condition:', ...
        'SelectionMode', 'single', ...
        'ListString', cellNames);
    negCell = listdlg('PromptString','Select negative (-) condition:', ...
        'SelectionMode', 'single', ...
        'ListString', cellNames);
    cellNames{nCells + 1} = [cellNames{posCell} '-' cellNames{negCell}];


%%Loop over windows and conditions to get averaged data
%place-holder variable
data = zeros(size(,1),nWindows,nCells);

for win = 1:nWindows
    for cel = 1:nCells
        data(:,win,cel) = mean(,windInd(win):windInd(win+1),cells(cel)),2);
if strcmp(ButtonName,'Yes')
    data = cat(3,data,data(:,:,posCell) - data(:,:,negCell));
    nCells = nCells + 1;


%%set the min/max scale for the color map
dataMin = min(min(min(data)));
dataMax = max(max(max(data)));

prompt={'Enter the minimum value:','Enter the maximum value:'};
name='Values for color scale';
defaultanswer={num2str(dataMin), num2str(dataMax)};

dataMin = str2double(answer{1});
dataMax = str2double(answer{2});

%%2D or 3D?
plotTypeButton = questdlg('What kind of plot?', ...
                         'Question', ...
                         '2D', '3D', '2D');

if strcmp(plotTypeButton,'3D')
    threeD = true;
    threeD = false;

%%loop over the windows and conditions and plot them.
if threeD
    headplot('setup', eloc, 'headSplines.spl');

%subplot indices
subplotInds = 1:(nWindows+2)*nCells;
subplotInds = reshape(subplotInds,nWindows+2,nCells)';

figure; hold on;

for win = 1:nWindows
    for cel = 1:nCells

        if threeD
            headplot(data(:,win,cel), 'headSplines.spl', ...
                'maplimits', [dataMin, dataMax], ...
                'electrodes', 'off', ...
                'view', [azimuth, elevation]);
            topoplot(data(:,win,cel), eloc, ...
                'maplimits', [dataMin, dataMax], ...
                'shading', 'interp', ...
                'numcontour', 0);
        if cel == 1
            title([num2str(windows(win)) '-' num2str(windows(win+1)) 'ms']);


%add labels to the rows
for cel = 1:nCells

%add colorbar
h = colorbar;
set(h,'YLim',[dataMin dataMax]);
set(h,'CLim',[dataMin dataMax]);
caxis([dataMin dataMax]);
set(h,'YTick',[dataMin dataMax]);
hold off;
Posted in Uncategorized | Leave a comment

Spring Lab Dinner

I don’t think that we can properly call this a BBQ since it was freezing outside and no one over the age of 10 dared to go out. Still, a fun time as always. Thanks to everyone who came!


Posted in Uncategorized | Leave a comment