Skip to content

Commit ebcf024

Browse files
authored
Merge pull request #12 from cpp-lln-lab/remi-fix
[FIX] minor fixes and typos
2 parents 3923980 + eb52505 commit ebcf024

File tree

4 files changed

+11
-7
lines changed

4 files changed

+11
-7
lines changed

src/roi/createRoi.m

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
% (C) Copyright 2021 CPP ROI developers
22

3-
function mask = createRoi(type, specification, volumeDefiningImage, outputDir, saveImg)
3+
function [mask, outputFile] = createRoi(type, specification, volumeDefiningImage, outputDir, saveImg)
44
%
55
% Returns a mask to be used as a ROI by ``spm_summarize``.
66
% Can also save the ROI as binary image.
@@ -210,8 +210,9 @@
210210

211211
end
212212

213+
outputFile = [];
213214
if saveImg
214-
saveRoi(mask, volumeDefiningImage, outputDir);
215+
outputFile = saveRoi(mask, volumeDefiningImage, outputDir);
215216
end
216217

217218
end
@@ -283,7 +284,7 @@
283284

284285
end
285286

286-
function saveRoi(mask, volumeDefiningImage, outputDir)
287+
function outputFile = saveRoi(mask, volumeDefiningImage, outputDir)
287288

288289
if strcmp(mask.def, 'sphere')
289290

@@ -307,8 +308,11 @@ function saveRoi(mask, volumeDefiningImage, outputDir)
307308
'mat');
308309
saveroi(roiObject, ...
309310
fullfile(outputDir, tempFile));
311+
312+
outputFile = fullfile(outputDir, roiName);
313+
310314
mars_rois2img(fullfile(outputDir, tempFile), ...
311-
fullfile(outputDir, roiName), ...
315+
outputFile, ...
312316
spm_vol(volumeDefiningImage));
313317
delete(fullfile(outputDir, tempFile));
314318

src/utils/converToValidCamelCase.m renamed to src/utils/convertToValidCamelCase.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
% (C) Copyright 2021 CPP ROI developers
22

3-
function str = converToValidCamelCase(str)
3+
function str = convertToValidCamelCase(str)
44
%
55
% Removes non alphanumeric characters and uppercase first letter of all
66
% words but the first

src/utils/createFilename.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
if ~any(strcmp(thisEntity, {'filename', 'type', 'ext'})) && ...
1313
~isempty(p.(thisEntity))
14-
thisLabel = converToValidCamelCase(p.(thisEntity));
14+
thisLabel = convertToValidCamelCase(p.(thisEntity));
1515
newName = [newName '_' thisEntity '-' thisLabel]; %#ok<AGROW>
1616
end
1717

src/utils/renameFile.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
% (C) Copyright 2021 CPP ROI developers
22

3-
function file = renameFile(file, specification)
3+
function newName = renameFile(file, specification)
44

55
pth = spm_fileparts(file);
66
p = bids.internal.parse_filename(file);

0 commit comments

Comments
 (0)