@@ -27,3 +27,113 @@ function test_copy_anat_only()
2727 assertEqual(numel(bids .query(BIDS , ' data' )), 1 );
2828
2929end
30+
31+ function test_copy_no_task()
32+
33+ inputPath = fullfile(getMoaeDir(), ' inputs' , ' raw' );
34+
35+ outputPath = tempName();
36+
37+ bidspm(inputPath , outputPath , ' subject' , ...
38+ ' action' , ' copy' , ...
39+ ' verbosity' , 0 );
40+
41+ BIDS = bids .layout(fullfile(outputPath , ' derivatives' , ' bidspm-preproc' ), ...
42+ ' verbose' , false , ...
43+ ' use_schema' , false );
44+
45+ assertEqual(numel(bids .query(BIDS , ' data' )), 3 );
46+
47+ end
48+
49+ function test_copy_filter_suffix()
50+
51+ inputPath = fullfile(getMoaeDir(), ' inputs' , ' raw' );
52+
53+ outputPath = tempName();
54+
55+ bidspm(inputPath , outputPath , ' subject' , ...
56+ ' action' , ' copy' , ...
57+ ' bids_filter_file' , struct(' bold' , struct(' modality' , ' func' , ...
58+ ' suffix' , ' events' )), ...
59+ ' verbosity' , 0 );
60+
61+ BIDS = bids .layout(fullfile(outputPath , ' derivatives' , ' bidspm-preproc' ), ...
62+ ' verbose' , false , ...
63+ ' use_schema' , false );
64+
65+ assertEqual(numel(bids .query(BIDS , ' data' )), 1 );
66+
67+ end
68+
69+ function test_copy_filter_session()
70+
71+ inputPath = getTestDataDir(' raw' );
72+
73+ outputPath = tempName();
74+
75+ bidspm(inputPath , outputPath , ' subject' , ...
76+ ' action' , ' copy' , ...
77+ ' participant_label' , {' 01' , ' ctrl01' }, ...
78+ ' task' , {' vismotion' }, ...
79+ ' bids_filter_file' , struct(' bold' , struct(' modality' , ' func' , ...
80+ ' suffix' , ' events' , ...
81+ ' ses' , ' 01' )), ...
82+ ' verbosity' , 0 );
83+
84+ BIDS = bids .layout(fullfile(outputPath , ' derivatives' , ' bidspm-preproc' ), ...
85+ ' verbose' , false , ...
86+ ' use_schema' , false );
87+
88+ assertEqual(numel(bids .query(BIDS , ' data' )), 8 );
89+
90+ end
91+
92+ function test_copy_filter_anat()
93+
94+ inputPath = getTestDataDir(' raw' );
95+
96+ outputPath = tempName();
97+
98+ bidspm(inputPath , outputPath , ' subject' , ...
99+ ' action' , ' copy' , ...
100+ ' participant_label' , {' 01' , ' ctrl01' }, ...
101+ ' task' , {' vismotion' }, ...
102+ ' bids_filter_file' , struct(' anat' , struct(' modality' , ' anat' , ...
103+ ' suffix' , ' T1w' , ...
104+ ' ses' , ' 01' )), ...
105+ ' verbosity' , 0 );
106+
107+ BIDS = bids .layout(fullfile(outputPath , ' derivatives' , ' bidspm-preproc' ), ...
108+ ' verbose' , false , ...
109+ ' use_schema' , false );
110+
111+ assertEqual(numel(bids .query(BIDS , ' data' )), 2 );
112+
113+ end
114+
115+ function test_copy_several_filter()
116+
117+ inputPath = getTestDataDir(' raw' );
118+
119+ outputPath = tempName();
120+
121+ bidspm(inputPath , outputPath , ' subject' , ...
122+ ' action' , ' copy' , ...
123+ ' participant_label' , {' 01' , ' ctrl01' }, ...
124+ ' task' , {' vismotion' }, ...
125+ ' bids_filter_file' , struct(' anat' , struct(' modality' , ' anat' , ...
126+ ' suffix' , ' T1w' , ...
127+ ' ses' , ' 01' ), ...
128+ ' bold' , struct(' modality' , ' func' , ...
129+ ' suffix' , ' events' , ...
130+ ' ses' , ' 01' )), ...
131+ ' verbosity' , 0 );
132+
133+ BIDS = bids .layout(fullfile(outputPath , ' derivatives' , ' bidspm-preproc' ), ...
134+ ' verbose' , false , ...
135+ ' use_schema' , false );
136+
137+ assertEqual(numel(bids .query(BIDS , ' data' )), 10 );
138+
139+ end
0 commit comments