Skip to content

Commit

Permalink
ENH - some cleanups to function declaration
Browse files Browse the repository at this point in the history
git-svn-id: svn+ssh://svn.fcdonders.nl/home/svnroot/fieldtrip/trunk@11085 0cf7c7f0-3615-4144-b4e6-68da3bce3cd0
  • Loading branch information
robertoostenveld committed Jan 19, 2016
1 parent 054a5c5 commit 8821341
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 10 deletions.
4 changes: 2 additions & 2 deletions besa2fieldtrip.m
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
function [data] = besa2fieldtrip(input)
function data = besa2fieldtrip(input)

% BESA2FIELDTRIP reads and converts various BESA datafiles into a FieldTrip
% data structure, which subsequently can be used for statistical analysis
Expand Down Expand Up @@ -171,7 +171,7 @@
data = [];
data.label = [];
if isfield(tmp, 'ChannelLabels'),
data.label = fixlabels(tmp.ChannelLabels);
data.label = fixlabels(tmp.ChannelLabels);
end;
data.avg = tmp.Data;
data.time = tmp.Time / 1000; % convert to seconds
Expand Down
11 changes: 5 additions & 6 deletions loreta2fieldtrip.m
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
function [source] = loreta2fieldtrip(filename, varargin)
function source = loreta2fieldtrip(filename, varargin)

% LORETA2FIELDTRIP reads and converts a LORETA source reconstruction into a
% FieldTrip data structure, which subsequently can be used for statistical
Expand Down Expand Up @@ -62,7 +62,7 @@
% source.xgrid = -70:5:70;
% source.ygrid = -100:5:65;
% source.zgrid = -45:5:70;

%Note2, ingie: I'm assuming that the above is where the INSIDE of the source
% runs between, looking at the data and the Loreta-Key program, this makes
% a lot of sense. I based the below source.transform on this.
Expand Down Expand Up @@ -101,8 +101,8 @@
activity = fread(fid, [voxnumber 1], 'float=>single');
else
error('you can read either one timeframe, or the complete timecourse');
end
fclose(fid);
end
fclose(fid);
else
% read with textfile
activity = dlmread(filename);
Expand All @@ -118,7 +118,7 @@
else
% read timeframe
activity = activity(:,timeframe);
end
end
end

fprintf('file %s contains %d timepoints\n', filename, Ntime);
Expand Down Expand Up @@ -148,4 +148,3 @@
% do the general cleanup and bookkeeping at the end of the function
ft_postamble callinfo
ft_postamble history source

3 changes: 1 addition & 2 deletions spm2fieldtrip.m
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
function [data] = spm2fieldtrip(D)
function data = spm2fieldtrip(D)

% SPM2FIELDTRIP converts an SPM8 meeg object into a FieldTrip raw data structure
%
Expand Down Expand Up @@ -39,4 +39,3 @@
% data.sampleinfo(i,1) = D.indsample(i);
% data.sampleinfo(i,2) = D.indsample(i) + D.nsamples;
% end

0 comments on commit 8821341

Please sign in to comment.