Skip to content

Commit cae8192

Browse files
authored
Merge pull request #84 from cpp-lln-lab/fix_gunzip
[FIX] gunzipping with octave
2 parents 994ea07 + cdd112c commit cae8192

File tree

2 files changed

+20
-6
lines changed

2 files changed

+20
-6
lines changed

src/atlas/extractRoiFromAtlas.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
% roiImage = extractRoiFromAtlas(outputDir, atlasName, roiName, hemisphere)
99
%
1010
% :param outputDir:
11-
% :param atlasName: ``wang``, ``neuromorphometrics``, ``'hcpex'``
11+
% :param atlasName: ``'wang'``, ``'visfatlas'``, ``'neuromorphometrics'``, ``'hcpex'``
1212
% :param roiName: run ``getLookUpTable(atlasName)`` to get a list of ROI names to choose from
1313
% :param hemisphere: ``L`` or ``R``
1414
% :type outputDir: string

src/atlas/unzipAtlas.m

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,23 @@ function unzipAtlas(atlas)
2121
'subj_vol_all'), ...
2222
'^.*_dseg.nii.gz$');
2323

24-
gunzip(cellstr(labelImages));
24+
if isOctave()
25+
gunzipWithOctave(cellstr(labelImages));
26+
else
27+
gunzip(cellstr(labelImages));
28+
end
2529

2630
end
2731

2832
case 'visfatlas'
2933

3034
file = fullfile(atlasDir, 'visfAtlas/space-MNI_atlas-visfAtlas_dseg.nii.gz');
3135

32-
gunzip(file);
36+
if isOctave()
37+
gunzipWithOctave(file);
38+
else
39+
gunzip(file);
40+
end
3341

3442
case 'hcpex'
3543

@@ -39,11 +47,17 @@ function unzipAtlas(atlas)
3947

4048
file = fullfile(returnAtlasDir('hcpex'), 'HCPex.nii.gz');
4149
if isOctave()
42-
copyfile(file, fullfile(returnAtlasDir('hcpex'), 'HCPex.nii.gz.bak'));
50+
gunzipWithOctave(file);
51+
else
52+
gunzip(file);
4353
end
4454

45-
gunzip(file);
46-
4755
end
4856

4957
end
58+
59+
function gunzipWithOctave(file)
60+
copyfile(file, [file '.bak']);
61+
gunzip(file);
62+
copyfile([file '.bak'], file);
63+
end

0 commit comments

Comments
 (0)