Skip to content

Commit ec35b55

Browse files
committed
added kwarg json_import to mrconvert interface
1 parent ae1e033 commit ec35b55

File tree

1 file changed

+99
-25
lines changed

1 file changed

+99
-25
lines changed

nipype/interfaces/mrtrix3/utils.py

Lines changed: 99 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,11 @@ def _list_outputs(self):
6666

6767
class Mesh2PVEInputSpec(CommandLineInputSpec):
6868
in_file = File(
69-
exists=True, argstr="%s", mandatory=True, position=-3, desc="input mesh"
69+
exists=True,
70+
argstr="%s",
71+
mandatory=True,
72+
position=-3,
73+
desc="input mesh",
7074
)
7175
reference = File(
7276
exists=True,
@@ -134,9 +138,15 @@ class Generate5ttInputSpec(MRTrix3BaseInputSpec):
134138
desc="tissue segmentation algorithm",
135139
)
136140
in_file = File(
137-
exists=True, argstr="%s", mandatory=True, position=-2, desc="input image"
141+
exists=True,
142+
argstr="%s",
143+
mandatory=True,
144+
position=-2,
145+
desc="input image",
146+
)
147+
out_file = File(
148+
argstr="%s", mandatory=True, position=-1, desc="output image"
138149
)
139-
out_file = File(argstr="%s", mandatory=True, position=-1, desc="output image")
140150

141151

142152
class Generate5ttOutputSpec(TraitedSpec):
@@ -173,13 +183,21 @@ def _list_outputs(self):
173183

174184
class TensorMetricsInputSpec(CommandLineInputSpec):
175185
in_file = File(
176-
exists=True, argstr="%s", mandatory=True, position=-1, desc="input DTI image"
186+
exists=True,
187+
argstr="%s",
188+
mandatory=True,
189+
position=-1,
190+
desc="input DTI image",
177191
)
178192

179193
out_fa = File(argstr="-fa %s", desc="output FA file")
180194
out_adc = File(argstr="-adc %s", desc="output ADC file")
181-
out_evec = File(argstr="-vector %s", desc="output selected eigenvector(s) file")
182-
out_eval = File(argstr="-value %s", desc="output selected eigenvalue(s) file")
195+
out_evec = File(
196+
argstr="-vector %s", desc="output selected eigenvector(s) file"
197+
)
198+
out_eval = File(
199+
argstr="-value %s", desc="output selected eigenvalue(s) file"
200+
)
183201
component = traits.List(
184202
[1],
185203
usedefault=True,
@@ -194,7 +212,8 @@ class TensorMetricsInputSpec(CommandLineInputSpec):
194212
exists=True,
195213
argstr="-mask %s",
196214
desc=(
197-
"only perform computation within the specified binary" " brain mask image"
215+
"only perform computation within the specified binary"
216+
" brain mask image"
198217
),
199218
)
200219
modulate = traits.Enum(
@@ -246,10 +265,18 @@ def _list_outputs(self):
246265

247266
class ComputeTDIInputSpec(CommandLineInputSpec):
248267
in_file = File(
249-
exists=True, argstr="%s", mandatory=True, position=-2, desc="input tractography"
268+
exists=True,
269+
argstr="%s",
270+
mandatory=True,
271+
position=-2,
272+
desc="input tractography",
250273
)
251274
out_file = File(
252-
"tdi.mif", argstr="%s", usedefault=True, position=-1, desc="output TDI file"
275+
"tdi.mif",
276+
argstr="%s",
277+
usedefault=True,
278+
position=-1,
279+
desc="output TDI file",
253280
)
254281
reference = File(
255282
exists=True,
@@ -274,7 +301,8 @@ class ComputeTDIInputSpec(CommandLineInputSpec):
274301
)
275302
max_tod = traits.Int(
276303
argstr="-tod %d",
277-
desc="generate a Track Orientation " "Distribution (TOD) in each voxel.",
304+
desc="generate a Track Orientation "
305+
"Distribution (TOD) in each voxel.",
278306
)
279307

280308
contrast = traits.Enum(
@@ -353,7 +381,8 @@ class ComputeTDIInputSpec(CommandLineInputSpec):
353381
"(these lengths are then taken into account during TWI calculation)",
354382
)
355383
ends_only = traits.Bool(
356-
argstr="-ends_only", desc="only map the streamline" " endpoints to the image"
384+
argstr="-ends_only",
385+
desc="only map the streamline" " endpoints to the image",
357386
)
358387

359388
tck_weights = File(
@@ -363,7 +392,8 @@ class ComputeTDIInputSpec(CommandLineInputSpec):
363392
)
364393
nthreads = traits.Int(
365394
argstr="-nthreads %d",
366-
desc="number of threads. if zero, the number" " of available cpus will be used",
395+
desc="number of threads. if zero, the number"
396+
" of available cpus will be used",
367397
nohash=True,
368398
)
369399

@@ -438,10 +468,18 @@ def _list_outputs(self):
438468

439469
class TCK2VTKInputSpec(CommandLineInputSpec):
440470
in_file = File(
441-
exists=True, argstr="%s", mandatory=True, position=-2, desc="input tractography"
471+
exists=True,
472+
argstr="%s",
473+
mandatory=True,
474+
position=-2,
475+
desc="input tractography",
442476
)
443477
out_file = File(
444-
"tracks.vtk", argstr="%s", usedefault=True, position=-1, desc="output VTK file"
478+
"tracks.vtk",
479+
argstr="%s",
480+
usedefault=True,
481+
position=-1,
482+
desc="output VTK file",
445483
)
446484
reference = File(
447485
exists=True,
@@ -460,7 +498,8 @@ class TCK2VTKInputSpec(CommandLineInputSpec):
460498

461499
nthreads = traits.Int(
462500
argstr="-nthreads %d",
463-
desc="number of threads. if zero, the number" " of available cpus will be used",
501+
desc="number of threads. if zero, the number"
502+
" of available cpus will be used",
464503
nohash=True,
465504
)
466505

@@ -498,9 +537,15 @@ def _list_outputs(self):
498537

499538
class DWIExtractInputSpec(MRTrix3BaseInputSpec):
500539
in_file = File(
501-
exists=True, argstr="%s", mandatory=True, position=-2, desc="input image"
540+
exists=True,
541+
argstr="%s",
542+
mandatory=True,
543+
position=-2,
544+
desc="input image",
545+
)
546+
out_file = File(
547+
argstr="%s", mandatory=True, position=-1, desc="output image"
502548
)
503-
out_file = File(argstr="%s", mandatory=True, position=-1, desc="output image")
504549
bzero = traits.Bool(argstr="-bzero", desc="extract b=0 volumes")
505550
nobzero = traits.Bool(argstr="-no_bzero", desc="extract non b=0 volumes")
506551
singleshell = traits.Bool(
@@ -549,7 +594,11 @@ def _list_outputs(self):
549594

550595
class MRConvertInputSpec(MRTrix3BaseInputSpec):
551596
in_file = File(
552-
exists=True, argstr="%s", mandatory=True, position=-2, desc="input image"
597+
exists=True,
598+
argstr="%s",
599+
mandatory=True,
600+
position=-2,
601+
desc="input image",
553602
)
554603
out_file = File(
555604
"dwi.mif",
@@ -566,7 +615,10 @@ class MRConvertInputSpec(MRTrix3BaseInputSpec):
566615
desc="extract data at the specified coordinates",
567616
)
568617
vox = traits.List(
569-
traits.Float, sep=",", argstr="-vox %s", desc="change the voxel dimensions"
618+
traits.Float,
619+
sep=",",
620+
argstr="-vox %s",
621+
desc="change the voxel dimensions",
570622
)
571623
axes = traits.List(
572624
traits.Int,
@@ -580,6 +632,12 @@ class MRConvertInputSpec(MRTrix3BaseInputSpec):
580632
argstr="-scaling %s",
581633
desc="specify the data scaling parameter",
582634
)
635+
json_import = File(
636+
exists=True,
637+
argstr="-json_import %s",
638+
mandatory=False,
639+
desc="import data from a JSON file into header key-value pairs",
640+
)
583641

584642

585643
class MRConvertOutputSpec(TraitedSpec):
@@ -615,9 +673,15 @@ def _list_outputs(self):
615673

616674
class MRMathInputSpec(MRTrix3BaseInputSpec):
617675
in_file = File(
618-
exists=True, argstr="%s", mandatory=True, position=-3, desc="input image"
676+
exists=True,
677+
argstr="%s",
678+
mandatory=True,
679+
position=-3,
680+
desc="input image",
681+
)
682+
out_file = File(
683+
argstr="%s", mandatory=True, position=-1, desc="output image"
619684
)
620-
out_file = File(argstr="%s", mandatory=True, position=-1, desc="output image")
621685
operation = traits.Enum(
622686
"mean",
623687
"median",
@@ -637,7 +701,9 @@ class MRMathInputSpec(MRTrix3BaseInputSpec):
637701
desc="operation to computer along a specified axis",
638702
)
639703
axis = traits.Int(
640-
0, argstr="-axis %d", desc="specfied axis to perform the operation along"
704+
0,
705+
argstr="-axis %d",
706+
desc="specfied axis to perform the operation along",
641707
)
642708

643709

@@ -677,7 +743,11 @@ def _list_outputs(self):
677743

678744
class MRResizeInputSpec(MRTrix3BaseInputSpec):
679745
in_file = File(
680-
exists=True, argstr="%s", position=-2, mandatory=True, desc="input DWI image"
746+
exists=True,
747+
argstr="%s",
748+
position=-2,
749+
mandatory=True,
750+
desc="input DWI image",
681751
)
682752
image_size = traits.Tuple(
683753
(traits.Int, traits.Int, traits.Int),
@@ -794,7 +864,9 @@ class SHConvInputSpec(CommandLineInputSpec):
794864

795865

796866
class SHConvOutputSpec(TraitedSpec):
797-
out_file = File(exists=True, desc="the output convoluted spherical harmonics file")
867+
out_file = File(
868+
exists=True, desc="the output convoluted spherical harmonics file"
869+
)
798870

799871

800872
class SHConv(CommandLine):
@@ -858,7 +930,9 @@ class SH2AmpInputSpec(CommandLineInputSpec):
858930

859931

860932
class SH2AmpOutputSpec(TraitedSpec):
861-
out_file = File(exists=True, desc="the output convoluted spherical harmonics file")
933+
out_file = File(
934+
exists=True, desc="the output convoluted spherical harmonics file"
935+
)
862936

863937

864938
class SH2Amp(CommandLine):

0 commit comments

Comments
 (0)