@@ -2349,59 +2349,95 @@ class Warp(AFNICommand):
2349
2349
output_spec = AFNICommandOutputSpec
2350
2350
2351
2351
2352
- class QwarpInputSpec (CommandLineInputSpec ):
2352
+ class QwarpPlusMinusInputSpec (CommandLineInputSpec ):
2353
2353
source_file = File (
2354
- desc = '' ,
2354
+ desc = 'Source image (opposite phase encoding direction than base image). ' ,
2355
2355
argstr = '-source %s' ,
2356
2356
mandatory = True ,
2357
2357
exists = True ,
2358
2358
copyfile = False )
2359
2359
base_file = File (
2360
- desc = '' ,
2360
+ desc = 'Base image (opposite phase encoding direction than source image). ' ,
2361
2361
argstr = '-base %s' ,
2362
2362
mandatory = True ,
2363
2363
exists = True ,
2364
2364
copyfile = False )
2365
- plusminus = traits .Bool (
2366
- desc = '' ,
2367
- argstr = '-plusminus' )
2368
- pmNAMES = traits .List (traits .Str (),
2369
- desc = '' ,
2370
- argstr = '-pmNAMES %' )
2371
2365
pblur = traits .List (traits .Float (),
2372
- desc = '' ,
2373
- argstr = '-pblur %s' )
2366
+ desc = 'The fraction of the patch size that'
2367
+ 'is used for the progressive blur by providing a '
2368
+ 'value between 0 and 0.25. If you provide TWO '
2369
+ 'values, the first fraction is used for '
2370
+ 'progressively blurring the base image and the '
2371
+ 'second for the source image.' ,
2372
+ argstr = '-pblur %g' ,
2373
+ minlen = 1 ,
2374
+ maxlen = 2 )
2374
2375
blur = traits .List (traits .Float (),
2375
- desc = '' ,
2376
- argstr = '-blur %s' )
2376
+ desc = "Gaussian blur the input images by (FWHM) voxels "
2377
+ "before doing the alignment (the output dataset "
2378
+ "will not be blurred). The default is 2.345 (for "
2379
+ "no good reason). Optionally, you can provide 2 "
2380
+ "values, and then the first one is applied to the "
2381
+ "base volume, the second to the source volume. A "
2382
+ "negative blur radius means to use 3D median "
2383
+ "filtering, rather than Gaussian blurring. This "
2384
+ "type of filtering will better preserve edges, "
2385
+ "which can be important in alignment." ,
2386
+ argstr = '-blur %g' ,
2387
+ minlen = 1 ,
2388
+ maxlen = 2 )
2377
2389
noweight = traits .Bool (
2378
- desc = '' ,
2390
+ desc = 'If you want a binary weight (the old default), use this option.'
2391
+ 'That is, each voxel in the base volume automask will be'
2392
+ 'weighted the same in the computation of the cost functional.' ,
2379
2393
argstr = '-noweight' )
2380
2394
minpatch = traits .Int (
2381
- desc = '' ,
2395
+ desc = "Set the minimum patch size for warp searching to 'mm' voxels." ,
2382
2396
argstr = '-minpatch %d' )
2383
2397
nopadWARP = traits .Bool (
2384
- desc = '' ,
2398
+ desc = 'If for some reason you require the warp volume to'
2399
+ 'match the base volume, then use this option to have the output'
2400
+ 'WARP dataset(s) truncated.' ,
2385
2401
argstr = '-nopadWARP' )
2386
2402
2387
2403
2388
- class QwarpOutputSpec (TraitedSpec ):
2404
+ class QwarpPlusMinusOutputSpec (TraitedSpec ):
2389
2405
warped_source = File (
2390
- desc = '' ,
2406
+ desc = 'Undistorted source file. ' ,
2391
2407
exists = True )
2392
2408
warped_base = File (
2393
- desc = '' ,
2409
+ desc = 'Undistorted source file. ' ,
2394
2410
exists = True )
2395
2411
source_warp = File (
2396
- desc = '' ,
2412
+ desc = "Field suceptibility correction warp (in 'mm') for source image." ,
2397
2413
exists = True )
2398
2414
base_warp = File (
2399
- desc = '' ,
2415
+ desc = "Field suceptibility correction warp (in 'mm') for base image." ,
2400
2416
exists = True )
2401
2417
2402
2418
2403
- class Qwarp (CommandLine ):
2404
- _cmd = '3dQwarp -prefix Qwarp.nii.gz'
2419
+ class QwarpPlusMinus (CommandLine ):
2420
+ """A version of 3dQwarp for performing field susceptibility correction
2421
+ using two images with opposing phase encoding directions.
2422
+
2423
+ For complete details, see the `3dQwarp Documentation.
2424
+ <https://afni.nimh.nih.gov/pub/dist/doc/program_help/3dQwarp.html>`_
2425
+
2426
+ Examples
2427
+ ========
2428
+
2429
+ >>> from nipype.interfaces import afni
2430
+ >>> qwarp = afni.QwarpPlusMinus()
2431
+ >>> qwarp.inputs.source_file = 'sub-01_dir-LR_epi.nii.gz'
2432
+ >>> qwarp.inputs.nopadWARP = True
2433
+ >>> qwarp.inputs.base_file = 'sub-01_dir-RL_epi.nii.gz'
2434
+ >>> qwarp.cmdline # doctest: +ALLOW_UNICODE
2435
+ '3dQwarp -prefix Qwarp.nii.gz -plusminus -source sub-01_dir-LR_epi.nii.gz
2436
+ -base sub-01_dir-RL_epi.nii.gz'
2437
+ >>> res = warp.run() # doctest: +SKIP
2438
+
2439
+ """
2440
+ _cmd = '3dQwarp -prefix Qwarp.nii.gz -plusminus'
2405
2441
input_spec = QwarpInputSpec
2406
2442
output_spec = QwarpOutputSpec
2407
2443
0 commit comments