Signal to Noise in Multi-band EPI

The other day, we did a test with different multi-band scan parameters (inspired by Ben Inglis’s seminar on this topic). Our standard scan sequence uses multi-band factor 8 (MB8) in order to maximize both spatial and temporal resolution (1.8×1.8×1.8mm voxel size and 875ms TRs). If we sacrifice temporal resolution (because, really, the underlying physiological process is slow enough that a TR of a couple of seconds is okay), then we can drop the MB factor to 4 but keep the same spatial resolution (1.8×1.8×1.8mm and 1800ms TRs). To compare these two sets of parameters, we collected resting-state fMRI for the same amount of time (since the MB8 sequence had shorter TRs, I got more time points for that scan than for the MB4 scan–this is okay since usually we think that more data points means you have better signal to noise ratio or SNR). As a quick and dirty measure of SNR, I calculated the mean signal in each voxel over time divided by the standard deviation within each voxel over time. Here’s the comparison of SNR for MB factor 4 minus factor 8. Warmer colors (red) indicates higher SNR for the MB4 than the MB8 scan sequence. Cooler colors (blue) indicates the reverse.

MB4-MB8_ax1.png

Continue reading

Posted in fMRI, Methods, Research | Leave a comment

Online vs. On-campus Classes

I’ve taught Behavioral Neurobiology every semester (including summer terms) for the past 8 years (24 sections so far!). I think that I’m finally getting a handle on how to do it. A few years ago, I was asked to teach an online version of the same course for BYU Independent Study. I tried to structure the online course as closely as I could to my on-campus sections: I recorded my same lectures to post online, I used many of the same quiz and exam questions, I give mostly the same writing assignments. So, how do students do in the online course versus the on-campus one? The short version is “not as well”.

Students in my on-campus course score higher than students in the online course by 18% on the midterm and 10% on the final exam, although scores on the same writing assignment are almost identical. Interestingly, scores on quizzes (averaged across all the quizzes in the course) are 15 percentage points higher in the online course than the on-campus course. Here’s where it gets really interesting: when you look at how people do on quizzes compared to how they do on other assignments, there’s almost no correlation for the online course, but a pretty high correlation in the on-campus course.

IS-OnCampus_comparison_correls.png

I’m a firm believer in using the testing effect (or retrieval practice) as a means of improving long-term memory retention. This is why I give weekly in-class quizzes in my on-campus course and quizzes at the end of each unit in the online course (even though student’s in my on-campus courses don’t necessarily see the benefit of frequent quizzes).

So what’s the difference between the two classes? I suspect that it comes down to the fact that the online quizzes are open-book while the on-campus ones are not. Exams are closed-book for both. Students in the on-campus course must deeply encode the information to be able to retrieve it on weekly quizzes, which in turn helps them retrieve the information for the exams. Thus, students in the online course are able to score well on the quizzes but they are not using these retrieval opportunities to prepare for the exams.

If you’re contemplating taking an online course versus a course in person, you might be better off choosing the in-person course. These data seem to indicate that the structure of the course will help you to encode the information better (and hopefully retain it long-term).

Posted in Psychology, Teaching | Leave a comment

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

remember-imagine
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.

Posted in Uncategorized | 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’.

AvgErpTopo

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 - kirwan@byu.edu
% 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.');
end

%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}), ...
    str2double(windowTimes{3})+1);

%%Ask user for which cells to plot
cells= listdlg('PromptString','Select conditions to plot:',...
                      'SelectionMode','multiple',...
                      'ListString',EPdata.cellNames);

%%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)};
end

%%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');
else
    [filename, pathname] = uigetfile('*.ced','Select Electrode Location File');
    eloc = readlocs([pathname filename]);
end

%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}];

end 

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

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

end 

%%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';
numlines=1;
defaultanswer={num2str(dataMin), num2str(dataMax)};
answer=inputdlg(prompt,name,numlines,defaultanswer);

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;
else
    threeD = false;
end

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

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

figure; hold on;

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

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

    end
end

%add labels to the rows
for cel = 1:nCells
    subplot(nCells,nWindows+2,subplotInds(cel,1));
    set(gca,'Visible','off');
    text(.5,.5,cellNames(cel),'HorizontalAlignment','Center');
end

%add colorbar
subplot(nCells,nWindows+2,sub2ind([nWindows+2,nCells],nWindows+2,1));
set(gca,'Visible','off');
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!

OLYMPUS DIGITAL CAMERA OLYMPUS DIGITAL CAMERA OLYMPUS DIGITAL CAMERA OLYMPUS DIGITAL CAMERA OLYMPUS DIGITAL CAMERA

Posted in Uncategorized | Leave a comment

Pi Day

One of the great things about my lab students…

PiDay2013

…is that if you mention that lab meeting happens to be on Pi Day, they all bring pie.

Posted in Uncategorized | Leave a comment