Skip to content

Commit

Permalink
Merge pull request #178 from BryanGuillaume/new_release_2.2.1
Browse files Browse the repository at this point in the history
Release SwE Version 2.2.1
  • Loading branch information
BryanGuillaume authored Jun 18, 2020
2 parents bd6e456 + 90d0662 commit 0153229
Show file tree
Hide file tree
Showing 66 changed files with 1,367 additions and 1,369 deletions.
28 changes: 14 additions & 14 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
language: python
# use container-based infrastructure
sudo: required
services:
services:
- docker
cache:
cache:
timeout: 1000
directories:
- test/data
python:
- "3.5"
bundler_args: --retry 9
# command to install dependencies, e.g. pip install -r requirements.txt --use-mirrors
install:
# Install git-lfs
install:
# Install git-lfs
- cd ..
- curl -sLo - https://github.com/github/git-lfs/releases/download/v1.4.1/git-lfs-linux-amd64-1.4.1.tar.gz | tar xzvf -
- export PATH=$PATH:`pwd`/git-lfs-1.4.1
- git lfs install
- git lfs install
# Download data.
- cd SwE-toolbox/test/data
- if ! [ -d .git ]; then git clone https://github.com/NISOx-BDI/SwE-toolbox-testdata.git .; fi
# Delete any previous changes (retry because lfs might download files)
# Delete any previous changes (retry because lfs might download files)
- git checkout master
- travis_retry git reset --hard origin/master
# A second time to allow for 3 more retries as "--retry 9" does not seem to be
Expand All @@ -31,7 +31,7 @@ jobs:
include:
# Each '-' with the same indentation as this comment is a job that is run in parallel in the
# results generation stage.
- stage: Results generation
- stage: Results generation
env:
- testname='p_vox_t_nii'
script:
Expand All @@ -41,7 +41,7 @@ jobs:
- testname='p_vox_f_nii'
script:
- did=$(sudo docker run -ti -d --rm -v `pwd`:/swe cmaumet/octave-spm)
- sudo docker exec -t -i $did octave --no-window-system --eval "addpath('/swe/test');runTest('p', 'vox', 'f', 'nii')"
- sudo docker exec -t -i $did octave --no-window-system --eval "addpath('/swe/test');runTest('p', 'vox', 'f', 'nii')"
- env:
- testname='wb_vox_t_nii'
script:
Expand All @@ -66,7 +66,7 @@ jobs:
- testname='wb_tfce_t_nii'
script:
- did=$(sudo docker run -ti -d --rm -v `pwd`:/swe cmaumet/octave-spm)
- sudo docker exec -t -i $did octave --no-window-system --eval "addpath('/swe/test');runTest('wb', 'tfce', 't', 'nii')"
- sudo docker exec -t -i $did octave --no-window-system --eval "addpath('/swe/test');runTest('wb', 'tfce', 't', 'nii')"
- env:
- testname='wb_tfce_f_nii'
script:
Expand All @@ -81,7 +81,7 @@ jobs:
- testname='p_dat_f_mat'
script:
- did=$(sudo docker run -ti -d --rm -v `pwd`:/swe cmaumet/octave-spm)
- sudo docker exec -t -i $did octave --no-window-system --eval "addpath('/swe/test');runTest('p', 'dat', 'f', 'mat')"
- sudo docker exec -t -i $did octave --no-window-system --eval "addpath('/swe/test');runTest('p', 'dat', 'f', 'mat')"
- env:
- testname='wb_dat_t_mat'
script:
Expand Down Expand Up @@ -111,7 +111,7 @@ jobs:
- testname='p_dpx_f_gii'
script:
- did=$(sudo docker run -ti -d --rm -v `pwd`:/swe cmaumet/octave-spm)
- sudo docker exec -t -i $did octave --no-window-system --eval "addpath('/swe/test');runTest('p', 'dpx', 'f', 'gii')"
- sudo docker exec -t -i $did octave --no-window-system --eval "addpath('/swe/test');runTest('p', 'dpx', 'f', 'gii')"
- env:
- testname='wb_dpx_t_gii'
script:
Expand Down Expand Up @@ -141,7 +141,7 @@ jobs:
- testname='p_dpx_f_cii'
script:
- did=$(sudo docker run -ti -d --rm -v `pwd`:/swe cmaumet/octave-spm)
- sudo docker exec -t -i $did octave --no-window-system --eval "addpath('/swe/test');runTest('p', 'dpx', 'f', 'cii')"
- sudo docker exec -t -i $did octave --no-window-system --eval "addpath('/swe/test');runTest('p', 'dpx', 'f', 'cii')"
- env:
- testname='wb_dpx_t_cii'
script:
Expand All @@ -166,6 +166,6 @@ before_install:
# Update docker version
- sudo apt-get update
- sudo apt-get -y -o Dpkg::Options::="--force-confnew" install docker-ce
- git config --global user.name "TravisCI"
- git config --global user.name "TravisCI"
- git config --global user.email "[email protected]"
- docker pull cmaumet/octave-spm
- docker pull cmaumet/octave-spm
12 changes: 6 additions & 6 deletions @swe_DataType/display.m
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
function display(obj)
% Display a swe_DataType object
% =========================================================================
% Display a swe_DataType object
% =========================================================================
% Bryan Guillaume
% Version Info: $Format:%ci$ $Format:%h$
display(get(obj));
end

display(get(obj));

end
10 changes: 5 additions & 5 deletions @swe_DataType/eq.m
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
function out = eq(a,b)
% Overload the '==' operator for we_DataType objects
% Overload the '==' operator for we_DataType objects
% =========================================================================
% Bryan Guillaume
% Version Info: $Format:%ci$ $Format:%h$

out = strcmp(a.value, b.value);
% Version Info: $Format:%ci$ $Format:%h$

end
out = strcmp(a.value, b.value);

end
10 changes: 5 additions & 5 deletions @swe_DataType/get.m
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
function out = get(obj)
% Get a swe_DataType object
% =========================================================================
% Get a swe_DataType object
% =========================================================================
% Bryan Guillaume
% Version Info: $Format:%ci$ $Format:%h$

out = obj.value;

end
out = obj.value;

end
8 changes: 4 additions & 4 deletions @swe_DataType/swe_DataType.m
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
% =========================================================================
% Bryan Guillaume
% Version Info: $Format:%ci$ $Format:%h$

availableDataTypes = {'Nifti', 'Gifti', 'Cifti', 'Mat', 'VolumeMat', 'SurfaceMat'};

if nargin == 0
error( "swe_DataType cannot be initialized empty; choose from 'Nifti', 'Gifti', 'Cifti', 'Mat', 'VolumeMat' or 'SurfaceMat'.");
end
Expand All @@ -17,7 +17,7 @@
end

obj.value = dataType;

obj = class(obj, 'swe_DataType');

end
end
32 changes: 16 additions & 16 deletions @swe_cifti/Contents.m
Original file line number Diff line number Diff line change
Expand Up @@ -18,59 +18,59 @@
% dat.dim = [64 64 32];
% dat.dtype = 'FLOAT64-BE';
% dat.offset = ceil(348/8)*8;
%
%
% % alternatively:
% % dat = file_array( 'junk.nii',dim,dtype,off,scale,inter)
%
%
% disp(dat)
%
%
% % Create an empty NIFTI structure
% N = nifti;
%
%
% fieldnames(N) % Dump fieldnames
%
%
% % Creating all the NIFTI header stuff
% N.dat = dat;
% N.mat = [2 0 0 -110 ; 0 2 0 -110; 0 0 -2 92; 0 0 0 1];
% N.mat_intent = 'xxx'; % dump possibilities
% N.mat_intent = 'Scanner';
% N.mat0 = N.mat;
% N.mat0_intent = 'Aligned';
%
%
% N.diminfo.slice = 3;
% N.diminfo.phase = 2;
% N.diminfo.frequency = 2;
% N.diminfo.slice_time.code='xxx'; % dump possibilities
% N.diminfo.slice_time.code='xxx'; % dump possibilities
% N.diminfo.slice_time.code = 'sequential_increasing';
% N.diminfo.slice_time.start = 1;
% N.diminfo.slice_time.end = 32;
% N.diminfo.slice_time.duration = 3/32;
%
%
% N.intent.code='xxx' ; % dump possibilities
% N.intent.code='FTEST'; % or N.intent.code=4;
% N.intent.param = [4 8];
%
%
% N.timing.toffset = 28800;
% N.timing.tspace=3;
% N.descrip = 'This is a NIFTI-1 file';
% N.aux_file='aux-file-name.txt';
% N.cal = [0 1];
%
%
% create(N); % Writes hdr info
%
%
% dat(:,:,:)=0; % Write out the data as all zeros
%
%
% [i,j,k] = ndgrid(1:64,1:64,1:32);
% dat(find((i-32).^2+(j-32).^2+(k*2-32).^2 < 30^2))=1; % Write some ones in the file
% dat(find((i-32).^2+(j-32).^2+(k*2-32).^2 < 15^2))=2;
%
%
%
%
% % displaying a slice
% imagesc(dat(:,:,12));colorbar
%
%
% % get a handle to 'junk.nii';
% M=nifti('junk.nii');
%
%
% imagesc(M.dat(:,:,12));
%
% _______________________________________________________________________
Expand Down
16 changes: 8 additions & 8 deletions @swe_cifti/create.m
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,21 @@ function create(obj,wrt)


for i=1:numel(obj)

o = obj(i);

if ~isa(o.dat,'file_array'), error('Data must be a file_array.'); end

fname = o.dat.fname;
if isempty(fname), error('No filename to write to.'); end

%-Write NIFTI header
sts = write_hdr_raw(fname, o.hdr, o.dat.dtype(end-1)=='B');
if ~sts, error('Unable to write header for "%s".',fname); end

%-Write extra information
write_extras(fname,o.extras);

%-Create an empty image file if necessary
if nargin>1 && any(wrt==1)
[pth,nam] = fileparts(fname);
Expand All @@ -37,8 +37,8 @@ function create(obj,wrt)
ext = '.img';
end
o.dat.fname = fullfile(pth,[nam ext]);

initialise(o.dat);
end

end
2 changes: 1 addition & 1 deletion @swe_cifti/subsasgn.m
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
if length(subs)>1
t = subsref(objs,subs(1));
% A lot of this stuff is a little flakey, and may cause Matlab to bomb.
%
%
%if numel(t) ~= nargin-2,
% error('The number of outputs should match the number of inputs.');
%end;
Expand Down
6 changes: 3 additions & 3 deletions @swe_cifti/subsref.m
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
if s
d = findindict(s,'units');
if ~isempty(d)
t = diag([d.rescale*[1 1 1] 1])*t;
t = diag([d.rescale*[1 1 1] 1])*t;
end
end

Expand Down Expand Up @@ -151,12 +151,12 @@
se = double(h.slice_end)+1;
ss = max(ss,1);
se = min(se,double(h.dim(t.slice+1)));

sd = double(h.slice_duration);
s = double(bitand(h.xyzt_units,24));
d = findindict(s,'units');
if d.rescale, sd = sd*d.rescale; end

ns = (se-ss+1);
d = findindict(sc,'sliceorder');
if isempty(d)
Expand Down
8 changes: 4 additions & 4 deletions @swe_cifti/swe_cifti.m
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
case {1, 2}
if isa(varargin{1},'swe_cifti')
h = varargin{1};

elseif ischar(varargin{1})
if size(varargin{1},1)>1
h = swe_cifti(cellstr(varargin{1}));
Expand Down Expand Up @@ -75,7 +75,7 @@
h = class(h,'swe_cifti');

elseif isstruct(varargin{1})

h = struct('hdr', varargin{1}.hdr,...
'dat', varargin{1}.dat,...
'extras', varargin{1}.extras);
Expand All @@ -92,8 +92,8 @@
else
error('Don''t know what to do yet.');
end

otherwise
error('Don''t know what to do yet.');
end
end
end
Loading

0 comments on commit 0153229

Please sign in to comment.