Closed
Description
e.g., simple test
def test_scout_conversion(tmpdir):
args = (
"-f reproin --files %s -o %s"
% (TESTS_DATA_PATH, tmpdir)
).split(' ')
print args
runner(args)
results in
(heudiconv) contematto@talete ~/github/heudiconv (fix/emptydir*) $ pytest -sv tests/test_heuristics.py::test_scout_conversion
======================================================================================================== test session starts ========================================================================================================
platform darwin -- Python 2.7.14, pytest-3.4.0, py-1.5.2, pluggy-0.6.0 -- /Users/contematto/anaconda2/envs/heudiconv/bin/python
cachedir: .pytest_cache
rootdir: /Users/contematto/github/heudiconv, inifile: pytest.ini
collected 1 item
tests/test_heuristics.py::test_scout_conversion ['-f', 'reproin', '--files', '/Users/contematto/github/heudiconv/tests/data', '-o', '/private/var/folders/gs/4v1cn8mj4n52qrr9r6xv4ckm0000gn/T/pytest-of-contematto/pytest-13/test_scout_conversion0']
INFO: Running heudiconv version 0.4
INFO: Analyzing 1 dicoms
INFO: Filtering out 0 dicoms based on their filename
INFO: Generated sequence info for 1 studies with 1 entries total
INFO: Processing sequence infos to deduce study/session
INFO: Study session for {'locator': 'Halchenko/Yarik/950_bids_test4', 'session': None, 'subject': 'phantom1sid1'}
INFO: Need to process 1 study sessions
INFO: PROCESSING STARTS: {'session': None, 'outdir': '/private/var/folders/gs/4v1cn8mj4n52qrr9r6xv4ckm0000gn/T/pytest-of-contematto/pytest-13/test_scout_conversion0/Halchenko/Yarik/950_bids_test4', 'subject': 'phantom1sid1'}
INFO: Processing 1 pre-sorted seqinfo entries
INFO: Processing 1 seqinfo entries
INFO: Doing conversion using dcm2niix
INFO: Converting /private/var/folders/gs/4v1cn8mj4n52qrr9r6xv4ckm0000gn/T/pytest-of-contematto/pytest-13/test_scout_conversion0/Halchenko/Yarik/950_bids_test4/phantom1sid1/sub-phantom1sid1/fmap/sub-phantom1sid1_acq-3mm_phasediff (1 DICOMs) -> /private/var/folders/gs/4v1cn8mj4n52qrr9r6xv4ckm0000gn/T/pytest-of-contematto/pytest-13/test_scout_conversion0/Halchenko/Yarik/950_bids_test4/phantom1sid1/sub-phantom1sid1/fmap . Converter: dcm2niix . Output types: ('nii.gz', 'dicom')
INFO: [Node] Setting-up "convert" in "/var/folders/gs/4v1cn8mj4n52qrr9r6xv4ckm0000gn/T/dcm2niix8reZmy/convert".
INFO: [Node] Running "convert" ("nipype.interfaces.dcm2nii.Dcm2niix"), a CommandLine Interface with command:
dcm2niix -b n -z i -x n -t n -m n -f fmap -o /Users/contematto/github/heudiconv -s n -v n /var/folders/gs/4v1cn8mj4n52qrr9r6xv4ckm0000gn/T/dcm2niix8reZmy/convert/1.3.12.2.1107.5.2.43.66112.2016101409263663466202201.dcm
INFO: stdout 2018-02-08T11:05:17.015246:Compression will be faster with 'pigz' installed
INFO: stdout 2018-02-08T11:05:17.015246:Chris Rorden's dcm2niiX version v1.0.20171215 (OpenJPEG build) Clang8.1.0 (64-bit MacOS)
INFO: stdout 2018-02-08T11:05:17.015246:Found 1 DICOM image(s)
INFO: stdout 2018-02-08T11:05:17.015246:Convert 1 DICOM as /private/var/folders/gs/4v1cn8mj4n52qrr9r6xv4ckm0000gn/T/dcm2niix8reZmy/convert/fmap_e2 (64x64x1x1)
INFO: stdout 2018-02-08T11:05:17.015246:Warning: Check that 2D images are not mirrored.
INFO: stdout 2018-02-08T11:05:17.015246:Conversion required 0.004985 seconds (0.003592 for core code).
WARNING: [Node] Error on "convert" (/var/folders/gs/4v1cn8mj4n52qrr9r6xv4ckm0000gn/T/dcm2niix8reZmy/convert)
FAILED
============================================================================================================= FAILURES ==============================================================================================================
_______________________________________________________________________________________________________ test_scout_conversion _______________________________________________________________________________________________________
tests/test_heuristics.py:134: in test_scout_conversion
runner(args)
heudiconv/cli/run.py:120: in main
process_args(args)
heudiconv/cli/run.py:322: in process_args
overwrite=args.overwrite,)
heudiconv/convert.py:194: in prep_conversion
overwrite=overwrite,)
heudiconv/convert.py:272: in convert
bids, tmpdir)
heudiconv/convert.py:397: in nipype_convert
eg = convertnode.run()
../../anaconda2/envs/heudiconv/lib/python2.7/site-packages/nipype/pipeline/engine/nodes.py:487: in run
result = self._run_interface(execute=True)
../../anaconda2/envs/heudiconv/lib/python2.7/site-packages/nipype/pipeline/engine/nodes.py:571: in _run_interface
return self._run_command(execute)
../../anaconda2/envs/heudiconv/lib/python2.7/site-packages/nipype/pipeline/engine/nodes.py:668: in _run_command
_save_resultfile(result, outdir, self.name)
../../anaconda2/envs/heudiconv/lib/python2.7/site-packages/nipype/pipeline/engine/utils.py:244: in save_resultfile
result.outputs.set(**modify_paths(outputs, relative=True, basedir=cwd))
../../anaconda2/envs/heudiconv/lib/python2.7/site-packages/traits/util/deprecated.py:32: in wrapper
return fn(*args, **kw)
../../anaconda2/envs/heudiconv/lib/python2.7/site-packages/traits/has_traits.py:1552: in set
trait_change_notify=trait_change_notify, **traits)
../../anaconda2/envs/heudiconv/lib/python2.7/site-packages/traits/has_traits.py:1544: in trait_set
setattr( self, name, value )
../../anaconda2/envs/heudiconv/lib/python2.7/site-packages/nipype/interfaces/base/traits_extension.py:335: in validate
value = super(MultiPath, self).validate(object, name, newvalue)
../../anaconda2/envs/heudiconv/lib/python2.7/site-packages/traits/trait_types.py:2337: in validate
return TraitListObject( self, object, name, value )
../../anaconda2/envs/heudiconv/lib/python2.7/site-packages/traits/trait_handlers.py:2313: in __init__
raise excp
E TraitError: The trait 'converted_files' of a Dcm2niixOutputSpec instance is an existing file name, but the path '/private/var/folders/gs/4v1cn8mj4n52qrr9r6xv4ckm0000gn/T/dcm2niix8reZmy/convert/fmap_e2.nii.gz' does not exist.
--------------------------------------------------------------------------------------------------------- Captured log call ---------------------------------------------------------------------------------------------------------
run.py 228 INFO Running heudiconv version 0.4
dicoms.py 43 INFO Analyzing 1 dicoms
dicoms.py 60 INFO Filtering out 0 dicoms based on their filename
dicoms.py 256 INFO Generated sequence info for 1 studies with 1 entries total
reproin.py 647 INFO Processing sequence infos to deduce study/session
parser.py 202 INFO Study session for {'locator': 'Halchenko/Yarik/950_bids_test4', 'session': None, 'subject': 'phantom1sid1'}
run.py 242 INFO Need to process 1 study sessions
run.py 308 INFO PROCESSING STARTS: {'session': None, 'outdir': '/private/var/folders/gs/4v1cn8mj4n52qrr9r6xv4ckm0000gn/T/pytest-of-contematto/pytest-13/test_scout_conversion0/Halchenko/Yarik/950_bids_test4', 'subject': 'phantom1sid1'}
convert.py 86 INFO Processing 1 pre-sorted seqinfo entries
reproin.py 409 INFO Processing 1 seqinfo entries
convert.py 184 INFO Doing conversion using dcm2niix
convert.py 246 INFO Converting /private/var/folders/gs/4v1cn8mj4n52qrr9r6xv4ckm0000gn/T/pytest-of-contematto/pytest-13/test_scout_conversion0/Halchenko/Yarik/950_bids_test4/phantom1sid1/sub-phantom1sid1/fmap/sub-phantom1sid1_acq-3mm_phasediff (1 DICOMs) -> /private/var/folders/gs/4v1cn8mj4n52qrr9r6xv4ckm0000gn/T/pytest-of-contematto/pytest-13/test_scout_conversion0/Halchenko/Yarik/950_bids_test4/phantom1sid1/sub-phantom1sid1/fmap . Converter: dcm2niix . Output types: ('nii.gz', 'dicom')
nodes.py 423 INFO [Node] Setting-up "convert" in "/var/folders/gs/4v1cn8mj4n52qrr9r6xv4ckm0000gn/T/dcm2niix8reZmy/convert".
nodes.py 648 INFO [Node] Running "convert" ("nipype.interfaces.dcm2nii.Dcm2niix"), a CommandLine Interface with command:
dcm2niix -b n -z i -x n -t n -m n -f fmap -o /Users/contematto/github/heudiconv -s n -v n /var/folders/gs/4v1cn8mj4n52qrr9r6xv4ckm0000gn/T/dcm2niix8reZmy/convert/1.3.12.2.1107.5.2.43.66112.2016101409263663466202201.dcm
support.py 289 INFO stdout 2018-02-08T11:05:17.015246:Compression will be faster with 'pigz' installed
support.py 289 INFO stdout 2018-02-08T11:05:17.015246:Chris Rorden's dcm2niiX version v1.0.20171215 (OpenJPEG build) Clang8.1.0 (64-bit MacOS)
support.py 289 INFO stdout 2018-02-08T11:05:17.015246:Found 1 DICOM image(s)
support.py 289 INFO stdout 2018-02-08T11:05:17.015246:Convert 1 DICOM as /private/var/folders/gs/4v1cn8mj4n52qrr9r6xv4ckm0000gn/T/dcm2niix8reZmy/convert/fmap_e2 (64x64x1x1)
support.py 289 INFO stdout 2018-02-08T11:05:17.015246:Warning: Check that 2D images are not mirrored.
support.py 289 INFO stdout 2018-02-08T11:05:17.015246:Conversion required 0.004985 seconds (0.003592 for core code).
nodes.py 489 WARNING [Node] Error on "convert" (/var/folders/gs/4v1cn8mj4n52qrr9r6xv4ckm0000gn/T/dcm2niix8reZmy/convert)
===================================================================================================== 1 failed in 3.89 seconds ======================================================================================================