@@ -1186,6 +1186,7 @@ def _list_outputs(self):
1186
1186
outputs ["out_file" ] = op .abspath (self .inputs .out_file )
1187
1187
return outputs
1188
1188
1189
+
1189
1190
class MaskFilterInputSpec (CommandLineInputSpec ):
1190
1191
in_file = File (
1191
1192
exists = True ,
@@ -1195,33 +1196,31 @@ class MaskFilterInputSpec(CommandLineInputSpec):
1195
1196
desc = "Input mask" ,
1196
1197
)
1197
1198
filter = traits .Str (
1198
- mandatory = True ,
1199
+ mandatory = True ,
1199
1200
argstr = "%s" ,
1200
1201
position = - 2 ,
1201
- desc = "Filter to perform (e.g. dilate, erode)"
1202
+ desc = "Filter to perform (e.g. dilate, erode)" ,
1202
1203
)
1203
1204
out_file = File (
1204
1205
name_source = ["input_image" ],
1205
1206
mandatory = True ,
1206
1207
argstr = "%s" ,
1207
1208
position = - 1 ,
1208
- desc = "Output mask"
1209
- )
1210
- npass = traits .Int (
1211
- argstr = "-npass %d" ,
1212
- position = 1 ,
1213
- desc = "Number of passes"
1209
+ desc = "Output mask" ,
1214
1210
)
1211
+ npass = traits .Int (argstr = "-npass %d" , position = 1 , desc = "Number of passes" )
1212
+
1215
1213
1216
1214
class MaskFilterOutputSpec (TraitedSpec ):
1217
1215
out_file = File (exists = True , desc = "the filtered output mask" )
1218
1216
1217
+
1219
1218
class MaskFilter (CommandLine ):
1220
1219
"""
1221
- Perform filtering operations on 3D / 4D mask images.
1220
+ Perform filtering operations on 3D / 4D mask images.
1222
1221
Only supports dilate / erode filters at the moment.
1223
1222
For more information see: https://mrtrix.readthedocs.io/en/latest/reference/commands/maskfilter.html
1224
-
1223
+
1225
1224
1226
1225
Example
1227
1226
-------
@@ -1240,52 +1239,40 @@ class MaskFilter(CommandLine):
1240
1239
_cmd = "maskfilter"
1241
1240
input_spec = MaskFilterInputSpec
1242
1241
output_spec = MaskFilterOutputSpec
1243
-
1242
+
1244
1243
def _list_outputs (self ):
1245
1244
outputs = self .output_spec ().get ()
1246
1245
outputs ["out_file" ] = op .abspath (self .inputs .out_file )
1247
1246
return outputs
1248
-
1247
+
1248
+
1249
1249
class MTNormaliseInputSpec (MRTrix3BaseInputSpec ):
1250
1250
wm_fod = File (
1251
1251
argstr = "%s" ,
1252
1252
exists = True ,
1253
1253
position = 1 ,
1254
- desc = "input fod of white matter tissue compartment"
1254
+ desc = "input fod of white matter tissue compartment" ,
1255
1255
)
1256
1256
out_file_wm = File (
1257
- argstr = "%s" ,
1258
- position = 2 ,
1259
- desc = "output file of white matter tissue compartment"
1257
+ argstr = "%s" , position = 2 , desc = "output file of white matter tissue compartment"
1260
1258
)
1261
1259
gm_fod = File (
1262
1260
argstr = "%s" ,
1263
1261
exists = True ,
1264
1262
position = 3 ,
1265
- desc = "input fod of grey matter tissue compartment"
1263
+ desc = "input fod of grey matter tissue compartment" ,
1266
1264
)
1267
1265
out_file_gm = File (
1268
- argstr = "%s" ,
1269
- position = 4 ,
1270
- desc = "output file of grey matter tissue compartment"
1266
+ argstr = "%s" , position = 4 , desc = "output file of grey matter tissue compartment"
1271
1267
)
1272
1268
csf_fod = File (
1273
- argstr = "%s" ,
1274
- exists = True ,
1275
- position = 5 ,
1276
- desc = "input fod of CSF tissue compartment"
1269
+ argstr = "%s" , exists = True , position = 5 , desc = "input fod of CSF tissue compartment"
1277
1270
)
1278
1271
out_file_csf = File (
1279
- argstr = "%s" ,
1280
- position = 6 ,
1281
- desc = "output file of CSF tissue compartment 3"
1282
- )
1283
- mask = File (
1284
- argstr = "-mask %s" ,
1285
- exists = True ,
1286
- position = - 1 ,
1287
- desc = "input brain mask"
1272
+ argstr = "%s" , position = 6 , desc = "output file of CSF tissue compartment 3"
1288
1273
)
1274
+ mask = File (argstr = "-mask %s" , exists = True , position = - 1 , desc = "input brain mask" )
1275
+
1289
1276
1290
1277
class MTNormaliseOutputSpec (TraitedSpec ):
1291
1278
out_file_wm = File (exists = True , desc = "the normalized white matter fod" )
@@ -1310,9 +1297,9 @@ class MTNormalise(CommandLine):
1310
1297
>>> mtn.inputs.out_file_gm = 'gmfod_norm.mif'
1311
1298
>>> mtn.inputs.out_file_csf = 'csffod_norm.mif'
1312
1299
>>> mtn.inputs.mask = 'mask.mif'
1313
- >>> mtn.cmdline
1300
+ >>> mtn.cmdline
1314
1301
'mtnormalise wmfod.mif wmfod_norm.mif gmfod.mif gmfod_norm.mif csffod.mif csffod_norm.mif -mask mask.mif'
1315
- >>> mtn.run()
1302
+ >>> mtn.run()
1316
1303
"""
1317
1304
1318
1305
_cmd = "mtnormalise"
@@ -1325,7 +1312,7 @@ def _list_outputs(self):
1325
1312
outputs ["out_file_gm" ] = op .abspath (self .inputs .out_file_gm )
1326
1313
outputs ["out_file_csf" ] = op .abspath (self .inputs .out_file_csf )
1327
1314
return outputs
1328
-
1315
+
1329
1316
1330
1317
class Generate5tt2gmwmiInputSpec (MRTrix3BaseInputSpec ):
1331
1318
in_file = File (
@@ -1334,19 +1321,19 @@ class Generate5tt2gmwmiInputSpec(MRTrix3BaseInputSpec):
1334
1321
mandatory = True ,
1335
1322
position = - 2 ,
1336
1323
desc = "the input 5TT segmented anatomical image" ,
1337
- )
1324
+ )
1338
1325
mask_out = File (
1339
1326
"mask_gmwmi.mif" ,
1340
1327
argstr = "%s" ,
1341
1328
mandatory = True ,
1342
1329
position = - 1 ,
1343
1330
desc = "the output mask image" ,
1344
- )
1331
+ )
1345
1332
mask_in = File (
1346
1333
argstr = "-mask_in %s" ,
1347
1334
position = - 3 ,
1348
- desc = "filter an imput mask image according to those voxels that lie upon the grey matter - white matter boundary" ,
1349
- )
1335
+ desc = "filter an input mask image according to those voxels that lie upon the grey matter - white matter boundary" ,
1336
+ )
1350
1337
1351
1338
1352
1339
class Generate5tt2gmwmiOutputSpec (TraitedSpec ):
@@ -1355,7 +1342,7 @@ class Generate5tt2gmwmiOutputSpec(TraitedSpec):
1355
1342
1356
1343
class Generate5tt2gmwmi (CommandLine ):
1357
1344
"""
1358
- Generate a mask image appropriate for seeding streamlines on
1345
+ Generate a mask image appropriate for seeding streamlines on
1359
1346
the grey matter-white matter interface
1360
1347
1361
1348
@@ -1366,9 +1353,9 @@ class Generate5tt2gmwmi(CommandLine):
1366
1353
>>> gmwmi = mrt.Generate5TT2GMWMI()
1367
1354
>>> gmwmi.inputs.in_file = '5tt_in.mif'
1368
1355
>>> gmwmi.inputs.mask_out = 'mask_gmwmi.mif'
1369
- >>> gmwmi.cmdline
1356
+ >>> gmwmi.cmdline
1370
1357
'5tt2gmwmi 5tt_in.mif mask_gmwmi.mif'
1371
- >>> gmwmi.run()
1358
+ >>> gmwmi.run()
1372
1359
"""
1373
1360
1374
1361
_cmd = "5tt2gmwmi"
@@ -1378,4 +1365,4 @@ class Generate5tt2gmwmi(CommandLine):
1378
1365
def _list_outputs (self ):
1379
1366
outputs = self .output_spec ().get ()
1380
1367
outputs ["mask_out" ] = op .abspath (self .inputs .mask_out )
1381
- return outputs
1368
+ return outputs
0 commit comments