File tree Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Original file line number Diff line number Diff line change 1818log = logging .getLogger (__name__ )
1919
2020
21- def run (dcmpth , fcomment = "" , timestamp = True ):
21+ def run (dcmpth , fcomment = "converted-from-DICOM_ " , timestamp = True ):
2222 dcmpth = Path (dcmpth )
2323 assert dcmpth .is_dir ()
2424 log .info ("convert" )
25- res = nimpa .dcm2nii (dcmpth , fcomment = fcomment , timestamp = timestamp )
25+ res = nimpa .dcm2nii (dcmpth , fprefix = fcomment , timestamp = timestamp )
2626 log .debug ("output file:%s" , res )
2727 return res
Original file line number Diff line number Diff line change 1+ from pathlib import Path
2+
3+ import pytest
4+
5+
6+ @pytest .mark .timeout (30 * 60 ) # 30m
7+ def test_dcm2nii (datain ):
8+ dcmpth = Path (datain ['mumapDCM' ])
9+ assert not list (dcmpth .glob ('test_dcm2nii_*.nii*' ))
10+ dcm2nii = pytest .importorskip ("amypet.dcm2nii" )
11+ dcm2nii .run (datain ['mumapDCM' ], fcomment = "test_dcm2nii_" )
12+ assert list (dcmpth .glob ('test_dcm2nii_*.nii*' ))
13+ for f in dcmpth .glob ('test_dcm2nii_*.nii*' ):
14+ f .unlink ()
You can’t perform that action at this time.
0 commit comments