"We" say, in France (understanding that the "we" excludes the people of Marseilles), that the people of Marseilles have a tendency to exaggerate their stories. And it is stated, by these local people, that one day a sardine (the little fish!) blocked the entrance to the port. But this is not said in jest, a slight distortion maybe! In 1778, the Viscount of Barras, officer of the marine infantry regiment from Pondichery in India was captured by the British. Benefiting from special accords for prisoner of war exchanges, he embarked the following year on a boat, named the "Sartine", which was not armed. To prevent potential attacks upon it, the captain would raise certain cartel flags that the enemy would recognize. However, the rule was not respected, because on May 1st, 10 months after being at sea without incident, a British war boat attacked the "Sartine" with two fatal canon volleys. The ship finished its trip and ran aground at the entrance to the old port. It is therefore not a "sardine" that blocked the port of Marseilles but a ship named "La Sartine", on a beautiful spring day in 1780!
/now/dead/directory/subject1/sess1/image_01.img
/now/dead/directory/subject1/sess1/image_02.img
...
/now/dead/directory/subject1/sess2/image_01.img
...
/now/dead/directory/subject2/sess1/image_01.img
etc.
Time passed, you reorganized your files, and these images have now moved to another directory, like this:
/currently/extant/path/subject1/sess1/image_01.img
/currently/extant/path/subject1/sess1/image_02.img
...
/currently/extant/path/subject1/sess2/image_01.img
...
/currently/extant/path/subject2/sess1/image_01.img
etc.
When you ask MarsBaR to estimate the original design, it looks for /now/dead/directory/subject1/sess1/image_01.img, but the file does not exist. To fix this, you will need to change the filenames in the design to match the new image locations.
If you have MarsBaR > 0.30, you can first check if this is the problem. Click on Design and choose Check image names in design. You should see an error message in the matlab console window if the images are not where the design says they are.
Next, you need to find the correct root path to the images. The root path is the shared common path for all the image names. In the above example, the shared common path for the correct image filenames is /currently/extant/path.
To do the fix, you click on Design and choose Change design path to images. In the SPM input window you will see the current root directory printed in bold text. In the example above, this would be: /now/dead/directory.
You select /currently/extant/path using the SPM file selection window that has just appeared. If all went well, you can check it has worked with MarsBaR > 0.30; click Design, choose Check image names in design and hope that you get the message: All images in design appear to exist in the matlab window.
The same thing from the command line would be:
D = mardo('/path/to/spm/mat/SPM.mat');
D = cd_images(D, '/currently/extant/path');
save_spm(D);
Here's how it goes. You select the event using the MarsBaR percent signal change interface. MarsBaR does the following:
This example script assumes your design is stored in "/my/path/SPM.mat" and you have an ROI stored in "/my/path/my_roi.mat".
spm_name = '/my/path/SPM.mat'; roi_file = '/my/path/my_roi.mat'; % Make marsbar design object D = mardo(spm_name); % Make marsbar ROI object R = maroi(roi_file); % Fetch data into marsbar data object Y = get_marsy(R, D, 'mean'); % Get contrasts from original design xCon = get_contrasts(D); % Estimate design on ROI data E = estimate(D, Y); % Put contrasts from original design back into design object E = set_contrasts(E, xCon); % get design betas b = betas(E); % get stats and stuff for all contrasts into statistics structure marsS = compute_contrasts(E, 1:length(xCon));See the help for the compute_contrasts function for details on the contents of the marsS structure.
roi_file = 'my_roi.mat';
t_imgs = strvcat('spmT_0002.img', 'spmT_0003.img');
thresholds = [3.4 4.6];
roi_obj = maroi(roi_file);
y = getdata(roi_obj, t_imgs);
n_voxels = size(y, 2);
for i = 1:size(t_imgs, 1)
pc_above_thresh(i) = sum(y(i,:) > thresholds(i)) / n_voxels * 100;
end
In script form, this would be something like:
roi_files = spm_get(Inf,'*roi.mat', 'Select ROI files');
des_path = spm_get(1, 'SPM.mat', 'Select SPM.mat');
rois = maroi('load_cell', roi_files); % make maroi ROI objects
des = mardo(des_path); % make mardo design object
mY = get_marsy(rois{:}, des, 'mean'); % extract data into marsy data object
y = summary_data(mY); % get summary time course(s)
The script to do this might be:
roi_files = spm_get(Inf,'*roi.mat', 'Select ROI files');
P = spm_get(Inf,'*.img','Select images');
rois = maroi('load_cell', roi_files); % make maroi ROI objects
mY = get_marsy(rois{:}, P, 'mean'); % extract data into marsy data object
y = summary_data(mY); % get summary time course(s)
In batch mode this would look like:
% Make marsbar design object D = mardo(spm_name); % Set fmristat AR modelling D = autocorr(D, 'fmristat', 2);
As this is just a very similar approach to averaging, there is no constraint that the signal should be at zero at 0 seconds. Just for example, random noise will mean than the average signal at 0 seconds will not be exactly zero.
For more information on the FIR method used for the PSTH, you might want to have a look at these papers:
Ollinger JM, Shulman GL, Corbetta M. Separating processes within a trial in event-related functional MRI. Neuroimage. 2001 Jan;13(1):210-7.
Dale AM. Optimal experimental design for event-related fMRI. Hum Brain Mapp. 1999;8(2-3):109-14.
Russ Poldrack also has a some matlab tutorials including FIR, and another page on FIR modelling.
% Get definitions of all events in model
[e_specs, e_names] = event_specs(E);
n_events = size(e_specs, 2);
% Bin size in seconds for FIR
bin_size = tr(E);
% Length of FIR in seconds
fir_length = 24;
% Number of FIR time bins to cover length of FIR
bin_no = fir_length / bin_size;
% Options - here 'single' FIR model, return estimated % signal change
opts = struct('single', 1, 'percent', 1);
% Return time courses for all events in fir_tc matrix
for e_s = 1:n_events
fir_tc(:, e_s) = event_fitted_fir(E, e_specs(:,e_s), bin_size, ...
bin_no, opts);
end
If your events have the same name across sessions, and you want to
average across the events with the same name:
% Get compound event types structure
ets = event_types_named(E);
n_event_types = length(ets);
% Bin size in seconds for FIR
bin_size = tr(E);
% Length of FIR in seconds
fir_length = 24;
% Number of FIR time bins to cover length of FIR
bin_no = fir_length / bin_size;
% Options - here 'single' FIR model, return estimated % signal change
opts = struct('single', 1, 'percent', 1);
for e_t = 1:n_event_types
fir_tc(:, e_t) = event_fitted_fir(E, ets(e_t).e_spec, bin_size, ...
bin_no, opts);
end
% Get definitions of all events in model [e_specs, e_names] = event_specs(E); n_events = size(e_specs, 2); dur = 0; % Return percent signal esimate for all events in design for e_s = 1:n_events pct_ev(e_s) = event_signal(E, e_specs(:,e_s), dur); end
If you did not use OLS, then the first approach is more valid, as in this case, you have estimated the autocorrelation from the ROI itself, rather than the whole (activated) brain, which is the default SPM approach.
OLS at the single subject level is valid (is not biased), but is likely to be less powerful than the alternative (which is removing the autocorrelation - "whitening"). In practice the difference between using and not using OLS is often small.
The first approach also saves you having to run the SPM models at the single subject model, but you have often done this in any case.
Of course, the meaning of the results is slightly different. SVC allows you to say that some part of your candidate region is active (allowing for example that most of it could be deactivated). MarsBaR would likely find no significant change in that situation.
Summary: which you prefer depends on the exact question you want to answer, which in turn depends on the region definition that you are using.
The decision of smoothing is a trade-off between trying to:
This is caused by a bug in matlab. At the time of writing this uigetfile bug on linux was documented at the given link on the Mathworks site; if the link goes stale, you will probably find it by searching with the terms "uigetfile linux". It's a bizarre bug, which causes matlab to appear not to find files when you click on them in the matlab "uigetfile" interface that MarsBaR uses. If you are using the default method of running matlab, which uses the fancy Java desktop, you can get round it using the workaround documented at the link above, which is to run the following command:
setappdata(0,'UseNativeSystemDialogs',false)in matlab, before you ever start a file selection dialog, such as those in MarsBaR. Future versions of MarsBaR will do this automatically.
This fix doesn't work if you are running in non-Java mode - which is what you get if you start matlab with:
matlab -nojvmIn that case, you will need to either select the file using the keyboard, rather than the mouse, or type the file name directly into the file selection box.
There are some other odd wrinkles to the behaviour of the uigetfile interface in matlab 7, which should be fixed in marsbar version 0.40 and above. For details,search for comments containing 'uigetfile' in mars_uifile.m.
> Warning: No valid data for roi 1 ...This is almost invariably because you are sampling from SPM results images, that have NaNs at the edges of the brain. Marsbar uses linear resampling by default to get the data from the images, so voxels at the edge of the brain disappear due to resampling with NaN values. The fix is to change the ROI resampling to nearest neighbour using something like:
roi_filename = 'my_roi.mat'; my_roi = maroi(roi_filename); my_roi = spm_hold(my_roi, 0); % set NN resampling saveroi(my_roi, roi_filename);and then rerun the data extraction... Last Refreshed: Wed Aug 29 11:58:50 BST 2007