@@ -1186,6 +1186,7 @@ def _list_outputs(self):
11861186 outputs ["out_file" ] = op .abspath (self .inputs .out_file )
11871187 return outputs
11881188
1189+
11891190class MaskFilterInputSpec (CommandLineInputSpec ):
11901191 in_file = File (
11911192 exists = True ,
@@ -1195,33 +1196,31 @@ class MaskFilterInputSpec(CommandLineInputSpec):
11951196 desc = "Input mask" ,
11961197 )
11971198 filter = traits .Str (
1198- mandatory = True ,
1199+ mandatory = True ,
11991200 argstr = "%s" ,
12001201 position = - 2 ,
1201- desc = "Filter to perform (e.g. dilate, erode)"
1202+ desc = "Filter to perform (e.g. dilate, erode)" ,
12021203 )
12031204 out_file = File (
12041205 name_source = ["input_image" ],
12051206 mandatory = True ,
12061207 argstr = "%s" ,
12071208 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" ,
12141210 )
1211+ npass = traits .Int (argstr = "-npass %d" , position = 1 , desc = "Number of passes" )
1212+
12151213
12161214class MaskFilterOutputSpec (TraitedSpec ):
12171215 out_file = File (exists = True , desc = "the filtered output mask" )
12181216
1217+
12191218class MaskFilter (CommandLine ):
12201219 """
1221- Perform filtering operations on 3D / 4D mask images.
1220+ Perform filtering operations on 3D / 4D mask images.
12221221 Only supports dilate / erode filters at the moment.
12231222 For more information see: https://mrtrix.readthedocs.io/en/latest/reference/commands/maskfilter.html
1224-
1223+
12251224
12261225 Example
12271226 -------
@@ -1240,52 +1239,40 @@ class MaskFilter(CommandLine):
12401239 _cmd = "maskfilter"
12411240 input_spec = MaskFilterInputSpec
12421241 output_spec = MaskFilterOutputSpec
1243-
1242+
12441243 def _list_outputs (self ):
12451244 outputs = self .output_spec ().get ()
12461245 outputs ["out_file" ] = op .abspath (self .inputs .out_file )
12471246 return outputs
1248-
1247+
1248+
12491249class MTNormaliseInputSpec (MRTrix3BaseInputSpec ):
12501250 wm_fod = File (
12511251 argstr = "%s" ,
12521252 exists = True ,
12531253 position = 1 ,
1254- desc = "input fod of white matter tissue compartment"
1254+ desc = "input fod of white matter tissue compartment" ,
12551255 )
12561256 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"
12601258 )
12611259 gm_fod = File (
12621260 argstr = "%s" ,
12631261 exists = True ,
12641262 position = 3 ,
1265- desc = "input fod of grey matter tissue compartment"
1263+ desc = "input fod of grey matter tissue compartment" ,
12661264 )
12671265 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"
12711267 )
12721268 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"
12771270 )
12781271 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"
12881273 )
1274+ mask = File (argstr = "-mask %s" , exists = True , position = - 1 , desc = "input brain mask" )
1275+
12891276
12901277class MTNormaliseOutputSpec (TraitedSpec ):
12911278 out_file_wm = File (exists = True , desc = "the normalized white matter fod" )
@@ -1310,9 +1297,9 @@ class MTNormalise(CommandLine):
13101297 >>> mtn.inputs.out_file_gm = 'gmfod_norm.mif'
13111298 >>> mtn.inputs.out_file_csf = 'csffod_norm.mif'
13121299 >>> mtn.inputs.mask = 'mask.mif'
1313- >>> mtn.cmdline
1300+ >>> mtn.cmdline
13141301 '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()
13161303 """
13171304
13181305 _cmd = "mtnormalise"
@@ -1325,7 +1312,7 @@ def _list_outputs(self):
13251312 outputs ["out_file_gm" ] = op .abspath (self .inputs .out_file_gm )
13261313 outputs ["out_file_csf" ] = op .abspath (self .inputs .out_file_csf )
13271314 return outputs
1328-
1315+
13291316
13301317class Generate5tt2gmwmiInputSpec (MRTrix3BaseInputSpec ):
13311318 in_file = File (
@@ -1334,19 +1321,19 @@ class Generate5tt2gmwmiInputSpec(MRTrix3BaseInputSpec):
13341321 mandatory = True ,
13351322 position = - 2 ,
13361323 desc = "the input 5TT segmented anatomical image" ,
1337- )
1324+ )
13381325 mask_out = File (
13391326 "mask_gmwmi.mif" ,
13401327 argstr = "%s" ,
13411328 mandatory = True ,
13421329 position = - 1 ,
13431330 desc = "the output mask image" ,
1344- )
1331+ )
13451332 mask_in = File (
13461333 argstr = "-mask_in %s" ,
13471334 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+ )
13501337
13511338
13521339class Generate5tt2gmwmiOutputSpec (TraitedSpec ):
@@ -1355,7 +1342,7 @@ class Generate5tt2gmwmiOutputSpec(TraitedSpec):
13551342
13561343class Generate5tt2gmwmi (CommandLine ):
13571344 """
1358- Generate a mask image appropriate for seeding streamlines on
1345+ Generate a mask image appropriate for seeding streamlines on
13591346 the grey matter-white matter interface
13601347
13611348
@@ -1366,9 +1353,9 @@ class Generate5tt2gmwmi(CommandLine):
13661353 >>> gmwmi = mrt.Generate5TT2GMWMI()
13671354 >>> gmwmi.inputs.in_file = '5tt_in.mif'
13681355 >>> gmwmi.inputs.mask_out = 'mask_gmwmi.mif'
1369- >>> gmwmi.cmdline
1356+ >>> gmwmi.cmdline
13701357 '5tt2gmwmi 5tt_in.mif mask_gmwmi.mif'
1371- >>> gmwmi.run()
1358+ >>> gmwmi.run()
13721359 """
13731360
13741361 _cmd = "5tt2gmwmi"
@@ -1378,4 +1365,4 @@ class Generate5tt2gmwmi(CommandLine):
13781365 def _list_outputs (self ):
13791366 outputs = self .output_spec ().get ()
13801367 outputs ["mask_out" ] = op .abspath (self .inputs .mask_out )
1381- return outputs
1368+ return outputs
0 commit comments