Skip to content

Commit 22e2599

Browse files
authored
Merge pull request #728 from cpp-lln-lab/dev
[REL] v2.1.0
2 parents eeb9a71 + 8ec594d commit 22e2599

38 files changed

+486
-192
lines changed

CITATION.cff

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ cff-version: 1.2.0
22

33
title: "CPP SPM"
44

5-
version: 2.0.0
5+
version: 2.1.0
66

77
abstract: CPP_SPM is a set pipelines and tools for Octave/MATLAB to process and analyze BIDS data sets using SPM.
88

demos/MoAE/moae_01_bids_app.m

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,14 @@
9898
opt.results(1).montage.slices = -4:2:16;
9999
opt.results(1).nidm = true();
100100

101+
opt.results(2).nodeName = 'run_level';
102+
opt.results(2).name = {'listening_inf_baseline'};
103+
opt.results(2).p = 0.01;
104+
opt.results(2).k = 10;
105+
opt.results(2).MC = 'none';
106+
opt.results(2).csv = true;
107+
opt.results(2).atlas = 'AAL';
108+
101109
cpp_spm(bids_dir, output_dir, 'subject', ...
102110
'participant_label', {subject_label}, ...
103111
'action', 'stats', ...

demos/lesion_detection/run_lesion.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@
2222

2323
bidsCopyInputFolder(opt);
2424

25-
% Step 1: segmentation
25+
%% Step 1: segmentation
2626
bidsLesionSegmentation(opt);
2727

28-
% % Step 2: lesion abnormalities
28+
%% Step 2: lesion abnormalities
2929
bidsLesionAbnormalitiesDetection(opt);
3030

3131
% % Step 3: overlap map

docs/cpp_spm-manual.pdf

502 KB
Binary file not shown.

src/IO/renameSegmentParameter.m

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,17 @@ function renameSegmentParameter(BIDS, subLabel, opt)
88
%
99
% (C) Copyright 2020 CPP_SPM developers
1010

11+
opt = set_spm_2_bids_defaults(opt);
12+
1113
[anatImage, anatDataDir] = getAnatFilename(BIDS, opt, subLabel);
1214

1315
segmentParam = spm_select('FPList', anatDataDir, ['^.*', ...
1416
spm_file(anatImage, 'basename'), ...
1517
'_seg8.mat$']);
1618

17-
bf = bids.File(anatImage);
18-
bf.entities.label = bf.suffix;
19-
20-
bf.suffix = 'segparam';
21-
bf.extension = '.mat';
19+
newFilename = spm_2_bids(segmentParam, opt.spm_2_bids);
2220

23-
newName = spm_file(segmentParam, 'filename', bf.filename);
21+
newName = spm_file(segmentParam, 'filename', newFilename);
2422

2523
if ~isempty(segmentParam)
2624
movefile(segmentParam, newName);

src/IO/renameUnwarpParameter.m

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,24 +12,21 @@ function renameUnwarpParameter(BIDS, subLabel, opt)
1212
return
1313
end
1414

15+
opt = set_spm_2_bids_defaults(opt);
16+
1517
for iTask = 1:numel(opt.taskName)
1618

1719
unwarpParam = spm_select('FPListRec', BIDS.pth, ...
1820
['^.*sub-' subLabel '.*_task-' opt.taskName{iTask} '.*_bold_uw.mat$']);
1921

2022
for iFile = 1:size(unwarpParam, 1)
2123

22-
inputFilename = strrep(unwarpParam(iFile, :), '_uw.', '.');
23-
24-
bf = bids.File(inputFilename);
25-
bf.entities.label = bf.suffix;
26-
bf.suffix = 'unwarpparam';
27-
bf.extension = '.mat';
24+
newFilename = spm_2_bids(unwarpParam(iFile, :), opt.spm_2_bids);
2825

29-
newName = spm_file(unwarpParam(iFile, :), 'filename', bf.filename);
26+
outputFile = spm_file(unwarpParam(iFile, :), 'filename', newFilename);
3027

3128
if ~isempty(unwarpParam(iFile, :))
32-
movefile(unwarpParam(iFile, :), newName);
29+
movefile(unwarpParam(iFile, :), outputFile);
3330
end
3431

3532
end

src/batches/lesion/setBatchLesionAbnormalitiesDetection.m

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121

2222
outliers_detection = opt.toolbox.ALI.outliers_detection;
2323

24+
outliers_detection.step3mask{1} = resizeAliMask(opt);
25+
2426
for i = 1:size(images, 1)
2527

2628
% 1. Define smoothed segmented tissue images of patients

src/batches/lesion/setBatchLesionSegmentation.m

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,16 @@
2121

2222
[anatImage, anatDataDir] = getAnatFilename(BIDS, opt, subLabel);
2323

24-
hdr = spm_vol(fullfile(anatDataDir, anatImage));
25-
voxRes = diag(hdr.mat);
26-
voxRes = min(voxRes(1:3));
27-
unified_segmentation.step1vox = abs(voxRes);
24+
% TODO
25+
% this needs to be changed
26+
% - to be consistent across subject
27+
% - to reslice the size of the mask that is then used for lesion detection
28+
%
29+
% hdr = spm_vol(fullfile(anatDataDir, anatImage));
30+
% voxRes = diag(hdr.mat);
31+
% voxRes = min(voxRes(1:3));
32+
% unified_segmentation.step1vox = abs(voxRes);
33+
2834
unified_segmentation.step1data{1} = fullfile(anatDataDir, anatImage);
2935

3036
matlabbatch{end + 1}.spm.tools.ali.unified_segmentation = unified_segmentation;

0 commit comments

Comments
 (0)