Skip to content

Commit 08bb7e3

Browse files
committed
add test
1 parent 8720b3a commit 08bb7e3

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

heudiconv/convert.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -894,7 +894,6 @@ def filter_partial_volumes(
894894
new_nii_files.append(fl)
895895
new_bids_files.append(bids_file)
896896
new_bids_metas.append(bids_meta)
897-
print(bids_file)
898897
if len(new_nii_files) == 1:
899898
return new_nii_files[0], new_bids_files[0], new_bids_metas[0]
900899
return new_nii_files, new_bids_files, new_bids_metas

heudiconv/tests/test_heuristics.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,25 @@ def test_scout_conversion(tmp_path: Path) -> None:
183183
assert j[HEUDICONV_VERSION_JSON_KEY] == __version__
184184

185185

186+
def test_partial_xa_conversion(tmp_path: Path) -> None:
187+
args = [
188+
"-b",
189+
"-f",
190+
"convertall",
191+
"-s",
192+
"test",
193+
"--minmeta",
194+
"--files",
195+
op.join(TESTS_DATA_PATH, "xa_4d_interrupted"),
196+
"-o",
197+
str(tmp_path),
198+
]
199+
runner(args)
200+
n_output_files = len(list(tmp_path.glob("*.nii.gz")))
201+
# partial volumes of interrupted scan should have been removed
202+
assert n_output_files == 1
203+
204+
186205
@pytest.mark.parametrize(
187206
"bidsoptions",
188207
[

0 commit comments

Comments
 (0)