|
10 | 10 |
|
11 | 11 | from ..utils.filemanip import split_filename
|
12 | 12 | from .base import (CommandLine, CommandLineInputSpec, InputMultiPath, traits,
|
13 |
| - TraitedSpec, OutputMultiPath, isdefined, File, Directory) |
| 13 | + TraitedSpec, OutputMultiPath, isdefined, File, Directory, |
| 14 | + PackageInfo) |
| 15 | + |
| 16 | + |
| 17 | +class Info(PackageInfo): |
| 18 | + """Handle dcm2niix version information""" |
| 19 | + |
| 20 | + version_cmd = 'dcm2niix' |
| 21 | + |
| 22 | + @staticmethod |
| 23 | + def parse_version(raw_info): |
| 24 | + m = re.search(r'version (\S+)', raw_info) |
| 25 | + return m[1] if m else None |
14 | 26 |
|
15 | 27 |
|
16 | 28 | class Dcm2niiInputSpec(CommandLineInputSpec):
|
@@ -358,6 +370,10 @@ class Dcm2niix(CommandLine):
|
358 | 370 | output_spec = Dcm2niixOutputSpec
|
359 | 371 | _cmd = 'dcm2niix'
|
360 | 372 |
|
| 373 | + @property |
| 374 | + def version(self): |
| 375 | + return Info.version() |
| 376 | + |
361 | 377 | def _format_arg(self, opt, spec, val):
|
362 | 378 | bools = ['bids_format', 'merge_imgs', 'single_file', 'verbose', 'crop',
|
363 | 379 | 'has_private', 'anon_bids', 'ignore_deriv', 'philips_float']
|
|
0 commit comments