Skip to content

Commit b3cd282

Browse files
committed
reuse set up
1 parent 330239d commit b3cd282

File tree

1 file changed

+3
-18
lines changed

1 file changed

+3
-18
lines changed

tests/test_getPeakCoordinates.m

+3-18
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,10 @@
1010

1111
function test_getPeakCoordinates_basic()
1212

13-
roiImage = extractRoiFromAtlas(pwd, 'wang', 'V1v', 'L');
13+
inputDir = setUpDemoData();
14+
dataImage = fullfile(inputDir, 'inputs', 'TStatistic.nii');
1415

15-
dataImage = fullfile(demoDir(), 'TStatistic.nii');
16+
roiImage = extractRoiFromAtlas(pwd, 'wang', 'V1v', 'L');
1617

1718
reslicedImages = resliceRoiImages(dataImage, roiImage);
1819

@@ -22,20 +23,4 @@ function test_getPeakCoordinates_basic()
2223
assertEqual(voxelCoord, [28 8 24]);
2324
assertElementsAlmostEqual(maxVal, 1.6212, 'absolute', 1e-3);
2425

25-
delete('*hemi-L_space-MNI_atlas-wang_label-V1v_mask.*');
26-
27-
end
28-
29-
function value = thisDir()
30-
value = fileparts(mfilename('fullpath'));
31-
end
32-
33-
function value = demoDir()
34-
35-
value = fullfile(thisDir(), '..', 'demos', 'roi', 'inputs');
36-
37-
if exist(fullfile(value, 'TStatistic.nii'), 'file') == 0
38-
gunzip(fullfile(value, '*.gz'));
39-
end
40-
4126
end

0 commit comments

Comments
 (0)