Skip to content

Commit 70ed74c

Browse files
committed
add test createROI expand
1 parent 513d789 commit 70ed74c

File tree

2 files changed

+35
-2
lines changed

2 files changed

+35
-2
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
[![miss_hit_style](https://github.com/cpp-lln-lab/CPP_ROI/actions/workflows/miss_hit_style.yml/badge.svg)](https://github.com/cpp-lln-lab/CPP_ROI/actions/workflows/miss_hit_style.yml)
2+
[![miss_hit_quality](https://github.com/cpp-lln-lab/CPP_ROI/actions/workflows/miss_hit_quality.yml/badge.svg)](https://github.com/cpp-lln-lab/CPP_ROI/actions/workflows/miss_hit_quality.yml)
3+
[![tests and coverage with matlab](https://github.com/cpp-lln-lab/CPP_ROI/actions/workflows/run_tests_matlab.yml/badge.svg)](https://github.com/cpp-lln-lab/CPP_ROI/actions/workflows/run_tests_matlab.yml)
4+
[![codecov](https://codecov.io/gh/cpp-lln-lab/CPP_ROI/branch/main/graph/badge.svg?token=8IoRQtbFUV)](https://codecov.io/gh/cpp-lln-lab/CPP_ROI)
5+
16
# CPP ROI
27

38
Set of Octave and Matlab functions, demos and scripts to help manage ROIs and to

tests/test_createRoi.m

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,12 @@ function test_createRoi_sphere()
3636

3737
function test_createRoi_intersection_mask_sphere()
3838

39-
[roiFinelname, volumeDefiningImage] = prepareRoiAndVolumeDefiningImage();
39+
[roiFilename, volumeDefiningImage] = prepareRoiAndVolumeDefiningImage();
4040

4141
sphere.location = [44 -67 0];
4242
sphere.radius = 5;
4343

44-
specification = struct('mask1', roiFinelname, ...
44+
specification = struct('mask1', roiFilename, ...
4545
'mask2', sphere);
4646

4747
saveImg = true;
@@ -59,6 +59,34 @@ function test_createRoi_intersection_mask_sphere()
5959

6060
end
6161

62+
function test_createRoi_expand
63+
64+
[roiFilename, volumeDefiningImage] = prepareRoiAndVolumeDefiningImage();
65+
66+
sphere.location = [44 -67 0];
67+
sphere.radius = 5;
68+
sphere.maxNbVoxels = 50;
69+
70+
specification = struct('mask1', roiFilename, ...
71+
'mask2', sphere);
72+
73+
saveImg = true;
74+
outputDir = thisDir();
75+
76+
mask = createRoi('expand', specification, volumeDefiningImage, outputDir, saveImg);
77+
78+
basename = 'rspace-MNI_atlas-neurosynth_label-visualMotionExpandVox57_desc-p10pt00_mask';
79+
80+
assertEqual(mask.roi.size, 57);
81+
82+
assertEqual(exist(fullfile(thisDir(), [basename '.nii']), 'file'), 2);
83+
assertEqual(exist(fullfile(thisDir(), [basename '.json']), 'file'), 2);
84+
85+
delete(fullfile(thisDir(), '*.nii'));
86+
delete(fullfile(thisDir(), '*.json'));
87+
88+
end
89+
6290
function value = thisDir()
6391
value = fullfile(fileparts(mfilename('fullpath')));
6492
end

0 commit comments

Comments
 (0)