Skip to content

Commit

Permalink
final touches for release
Browse files Browse the repository at this point in the history
  • Loading branch information
Carsten Allefeld committed Nov 4, 2016
1 parent 7b79cd2 commit 602e4c6
Show file tree
Hide file tree
Showing 12 changed files with 63 additions and 32 deletions.
Binary file added README.pdf
Binary file not shown.
6 changes: 4 additions & 2 deletions contrasts.m
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@
% contrasts are not orthonormalized!
%
%
% Copyright (C) 2013 Carsten Allefeld
% This file is part of v3 of cvmanova, see
% https://github.com/allefeld/cvmanova/releases
%
% Copyright (C) 2013–2016 Carsten Allefeld


% number of factors
Expand Down Expand Up @@ -61,4 +64,3 @@
% it will be useful, but without any warranty; without even the implied
% warranty of merchantability or fitness for a particular purpose. See the
% GNU General Public License <http://www.gnu.org/licenses/> for more details.

3 changes: 3 additions & 0 deletions cvManovaCore.m
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@
% See also cvManovaSearchlight, cvManovaRegion
%
%
% This file is part of v3 of cvmanova, see
% https://github.com/allefeld/cvmanova/releases
%
% Copyright (C) 2016 Carsten Allefeld


Expand Down
17 changes: 10 additions & 7 deletions cvManovaSearchlight.m
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,23 @@ function cvManovaSearchlight(dirName, slRadius, Cs, permute, lambda)
%
% dirName: directory where the SPM.mat file referring to an estimated
% model is located
% slRadius: radius of the searchlight sphere, in voxels
% slRadius: radius of the searchlight sphere in voxels
% Cs: cell array of contrast vectors or matrices
% permute: whether to compute permutation values
% lambda: regularization parameter (0–1)
%
% Output files are written to the same directory:
% spmD_C####_P####.nii: images of the pattern discriminability D
% contrast and permutation are identified by numbers
% spmD_C####_P####.nii: images of standardized pattern discriminability D_s
% VPSL.nii: image of the number of voxels for each searchlight
% cmsParameters.mat: record of the analysis parameters
% spmD_C####_P####.nii: images of the pattern discriminability D
% contrast and permutation are identified by numbers
% spmDs_C####_P####.nii: images of standardized pattern discriminability D_s
% VPSL.nii: image of the number of voxels for each searchlight
% cmsParameters.mat: record of the analysis parameters
%
%
% Copyright (C) 2013-2016 Carsten Allefeld
% This file is part of v3 of cvmanova, see
% https://github.com/allefeld/cvmanova/releases
%
% Copyright (C) 2013–2016 Carsten Allefeld


fprintf('\n\ncvManovaSearchlight\n\n')
Expand Down
5 changes: 4 additions & 1 deletion fletcher16.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,14 @@
% data: data to be checksummed,
% array of integers in the range 0 to 255 (0xFF)
% checksum: Fletcher-16 checksum,
% integer where each of the bytes is in the range 0 to 254 (0xFE)
% 16-bit integer where each of the bytes is in the range 0 to 254 (0xFE)
%
% https://en.wikipedia.org/wiki/Fletcher%27s_checksum
%
%
% This file is part of v3 of cvmanova, see
% https://github.com/allefeld/cvmanova/releases
%
% Copyright (C) 2016 Carsten Allefeld


Expand Down
8 changes: 5 additions & 3 deletions inestimability.m
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
function ie = inestimability(C, X)

% degree of inestimability of a contrast wrt a design matrix
% degree of inestimability of a contrast w.r.t. a design matrix
%
% ie = inestimability(C, X)
%
Expand All @@ -12,7 +12,10 @@
% part. For a completely inestimable contrast, ie = 1.
%
%
% Copyright (C) 2013 Carsten Allefeld
% This file is part of v3 of cvmanova, see
% https://github.com/allefeld/cvmanova/releases
%
% Copyright (C) 2013–2016 Carsten Allefeld


% maximum "0" observed so far: 4.79*eps
Expand Down Expand Up @@ -46,4 +49,3 @@
% it will be useful, but without any warranty; without even the implied
% warranty of merchantability or fitness for a particular purpose. See the
% GNU General Public License <http://www.gnu.org/licenses/> for more details.

15 changes: 10 additions & 5 deletions loadDataSPM.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,25 @@
% dirName: name of directory that contains SPM.mat
% regions: optional additional region mask(s),
% (cell array of) logical 3D volume(s) or filename(s)
% Ys: MR data (within mask) for each session, scans x voxels
% Xs: design matrix for each session, scans x regressors
% Ys: MR data (within mask), cell array with one element for each
% session, containing an array of size scans × voxels
% Xs: design matrix for each session, cell array with one element
% for each session, containing an array of size scans × regressors
% mask: analysis brain mask, logical 3D volume;
% possibly combined with region mask
% possibly combined with union of region masks
% misc: struct with additional data:
% mat voxels to mm transformation matrix
% fE residual degrees of freedom per session
% fE residual degrees of freedom for each session
% rmvi cell array of mask voxel indices for each region
%
% Y & X and are high-pass filtered and whitened.
% Y includes only those voxels selected through mask.
%
%
% Copyright (C) 2013-2016 Carsten Allefeld
% This file is part of v3 of cvmanova, see
% https://github.com/allefeld/cvmanova/releases
%
% Copyright (C) 2013–2016 Carsten Allefeld


% default argument values
Expand Down
13 changes: 8 additions & 5 deletions runSearchlight.m
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
% res = runSearchlight(checkpoint, slRadius, mask, fun, ...)
%
% checkpoint: name of checkpoint file ([] to disable checkpointing)
% slRadius: radius of searchlight, in voxels
% slRadius: radius of searchlight in voxels
% mask: 3-dimensional logical array indicating which voxels to use
% fun: function to call with voxel indices within window
% ...: additional arguments are passed through to the function
% res: results, 2-dimensional matrix, voxels x output values
% res: results, array of size voxels × output values
% p: number of voxels in each searchlight, column vector
%
% The function has to be of the form r = fun(mvi, ...)
Expand All @@ -21,17 +21,20 @@
%
% A voxel is included in the searchlight if its distance from the center is
% *smaller than or equal to* the radius. Note that fractional values are
% possible. Run slSizes for a table of meaningful values and resulting
% possible. Run slSize for a table of meaningful values and resulting
% searchlight sizes
%
% Intermediate results are saved at regular intervals to the checkpoint
% file, if given. On a subsequent run, if the checkpoint file exists, its
% contents are loaded and the computation continues from that point.
%
% See also slSizes
% See also slSize
%
%
% Copyright (C) 2013-2016 Carsten Allefeld
% This file is part of v3 of cvmanova, see
% https://github.com/allefeld/cvmanova/releases
%
% Copyright (C) 2013–2016 Carsten Allefeld


% normalize checkpoint file name, preserving emptiness
Expand Down
6 changes: 4 additions & 2 deletions signPermutations.m
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@
% permutation, ones(n, 1).
%
%
% Copyright (C) 2013-2016 Carsten Allefeld
% This file is part of v3 of cvmanova, see
% https://github.com/allefeld/cvmanova/releases
%
% Copyright (C) 2013–2016 Carsten Allefeld


if nargin < 2
Expand Down Expand Up @@ -42,4 +45,3 @@
% it will be useful, but without any warranty; without even the implied
% warranty of merchantability or fitness for a particular purpose. See the
% GNU General Public License <http://www.gnu.org/licenses/> for more details.

5 changes: 4 additions & 1 deletion spmReadVolMatched.m
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,12 @@
% consistent. Only the fields mat (4 × 4 matrix) and dim (1 × 3 vector)
% have to be present.
%
% See also spmCoords, spm_write_sn, spm_slice_vol
% See also spm_write_sn, spm_slice_vol
%
%
% This file is part of v3 of cvmanova, see
% https://github.com/allefeld/cvmanova/releases
%
% Copyright (C) 2016 Carsten Allefeld
% adapted from spm_read_vols and John Ashburner's reslice.m, v1.42
% see https://www2.warwick.ac.uk/fac/sci/statistics/staff/academic-research/nichols/scripts/spm/johnsgems/#Gem8
Expand Down
5 changes: 4 additions & 1 deletion spmReadVolsMasked.m
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,12 @@
% memory spikes and to gain speed. This is achieved by directly accessing
% memory-mapped data via the volume structs' file_array object V.private.raw.
%
% See also spmUnMask, spmReadMatched, spmCoords
% See also spmUnMask, spmReadVolMatched, spmCoords
%
%
% This file is part of v3 of cvmanova, see
% https://github.com/allefeld/cvmanova/releases
%
% Copyright (C) 2016 Carsten Allefeld

% This function is about 2–3 times faster than spm_read_vols on a local
Expand Down
12 changes: 7 additions & 5 deletions spmWriteImage.m
Original file line number Diff line number Diff line change
Expand Up @@ -38,19 +38,22 @@
% For background information, see
% http://nifti.nimh.nih.gov/nifti-1/documentation/nifti1fields/
%
% It is however possible to store floating-point data that only attain
% discrete and linearly-spaced values (e.g. ratios) using an integer data
% type using the linear transformation feature of the NIfTI format,
% It is possible to store floating-point data that only attain discrete and
% linearly-spaced values (e.g. ratios) using an integer data type using the
% linear transformation feature of the NIfTI format,
% spmWriteImage(int, fname, mat, 'scl_slope', slope, 'scl_inter', inter)
% where int is of class uint8, uint16, or uint32. Upon reading the file,
% the integer data are automatically transformed according to
% Y = double(int) * slope + inter;
% This way the image file may be kept substantially smaller. Note however
% that 'scl_slope' and 'scl_inter' are stored only with single precision.
%
% See also spmCoords, nifti/Contents
% See also nifti/Contents
%
%
% This file is part of v3 of cvmanova, see
% https://github.com/allefeld/cvmanova/releases
%
% Copyright (C) 2016 Carsten Allefeld


Expand Down Expand Up @@ -139,4 +142,3 @@
% it will be useful, but without any warranty; without even the implied
% warranty of merchantability or fitness for a particular purpose. See the
% GNU General Public License <http://www.gnu.org/licenses/> for more details.

0 comments on commit 602e4c6

Please sign in to comment.