@@ -2949,107 +2949,6 @@ def _list_outputs(self):
2949
2949
return outputs
2950
2950
2951
2951
2952
- class QwarpPlusMinusInputSpec (CommandLineInputSpec ):
2953
- source_file = File (
2954
- desc =
2955
- 'Source image (opposite phase encoding direction than base image).' ,
2956
- argstr = '-source %s' ,
2957
- mandatory = True ,
2958
- exists = True ,
2959
- copyfile = False )
2960
- base_file = File (
2961
- desc =
2962
- 'Base image (opposite phase encoding direction than source image).' ,
2963
- argstr = '-base %s' ,
2964
- mandatory = True ,
2965
- exists = True ,
2966
- copyfile = False )
2967
- pblur = traits .List (
2968
- traits .Float (),
2969
- desc = 'The fraction of the patch size that'
2970
- 'is used for the progressive blur by providing a '
2971
- 'value between 0 and 0.25. If you provide TWO '
2972
- 'values, the first fraction is used for '
2973
- 'progressively blurring the base image and the '
2974
- 'second for the source image.' ,
2975
- argstr = '-pblur %s' ,
2976
- minlen = 1 ,
2977
- maxlen = 2 )
2978
- blur = traits .List (
2979
- traits .Float (),
2980
- desc = "Gaussian blur the input images by (FWHM) voxels "
2981
- "before doing the alignment (the output dataset "
2982
- "will not be blurred). The default is 2.345 (for "
2983
- "no good reason). Optionally, you can provide 2 "
2984
- "values, and then the first one is applied to the "
2985
- "base volume, the second to the source volume. A "
2986
- "negative blur radius means to use 3D median "
2987
- "filtering, rather than Gaussian blurring. This "
2988
- "type of filtering will better preserve edges, "
2989
- "which can be important in alignment." ,
2990
- argstr = '-blur %s' ,
2991
- minlen = 1 ,
2992
- maxlen = 2 )
2993
- noweight = traits .Bool (
2994
- desc = 'If you want a binary weight (the old default), use this option.'
2995
- 'That is, each voxel in the base volume automask will be'
2996
- 'weighted the same in the computation of the cost functional.' ,
2997
- argstr = '-noweight' )
2998
- minpatch = traits .Int (
2999
- desc = "Set the minimum patch size for warp searching to 'mm' voxels." ,
3000
- argstr = '-minpatch %d' )
3001
- nopadWARP = traits .Bool (
3002
- desc = 'If for some reason you require the warp volume to'
3003
- 'match the base volume, then use this option to have the output'
3004
- 'WARP dataset(s) truncated.' ,
3005
- argstr = '-nopadWARP' )
3006
-
3007
-
3008
- class QwarpPlusMinusOutputSpec (TraitedSpec ):
3009
- warped_source = File (desc = 'Undistorted source file.' , exists = True )
3010
- warped_base = File (desc = 'Undistorted base file.' , exists = True )
3011
- source_warp = File (
3012
- desc = "Field suceptibility correction warp (in 'mm') for source image." ,
3013
- exists = True )
3014
- base_warp = File (
3015
- desc = "Field suceptibility correction warp (in 'mm') for base image." ,
3016
- exists = True )
3017
-
3018
-
3019
- class QwarpPlusMinus (CommandLine ):
3020
- """A version of 3dQwarp for performing field susceptibility correction
3021
- using two images with opposing phase encoding directions.
3022
-
3023
- For complete details, see the `3dQwarp Documentation.
3024
- <https://afni.nimh.nih.gov/pub/dist/doc/program_help/3dQwarp.html>`_
3025
-
3026
- Examples
3027
- ========
3028
-
3029
- >>> from nipype.interfaces import afni
3030
- >>> qwarp = afni.QwarpPlusMinus()
3031
- >>> qwarp.inputs.source_file = 'sub-01_dir-LR_epi.nii.gz'
3032
- >>> qwarp.inputs.nopadWARP = True
3033
- >>> qwarp.inputs.base_file = 'sub-01_dir-RL_epi.nii.gz'
3034
- >>> qwarp.cmdline
3035
- '3dQwarp -prefix Qwarp.nii.gz -plusminus -base sub-01_dir-RL_epi.nii.gz -nopadWARP -source sub-01_dir-LR_epi.nii.gz'
3036
- >>> res = warp.run() # doctest: +SKIP
3037
-
3038
- """
3039
- _cmd = '3dQwarp -prefix Qwarp.nii.gz -plusminus'
3040
- input_spec = QwarpPlusMinusInputSpec
3041
- output_spec = QwarpPlusMinusOutputSpec
3042
-
3043
- def _list_outputs (self ):
3044
- outputs = self .output_spec ().get ()
3045
- outputs ['warped_source' ] = os .path .abspath ("Qwarp_PLUS.nii.gz" )
3046
- outputs ['warped_base' ] = os .path .abspath ("Qwarp_MINUS.nii.gz" )
3047
- outputs ['source_warp' ] = os .path .abspath ("Qwarp_PLUS_WARP.nii.gz" )
3048
- outputs ['base_warp' ] = os .path .abspath ("Qwarp_MINUS_WARP.nii.gz" )
3049
-
3050
- return outputs
3051
-
3052
-
3053
2952
class QwarpInputSpec (AFNICommandInputSpec ):
3054
2953
in_file = File (
3055
2954
desc =
@@ -3718,3 +3617,54 @@ def _list_outputs(self):
3718
3617
def _gen_filename (self , name ):
3719
3618
if name == 'out_file' :
3720
3619
return self ._gen_fname (self .inputs .source_file , suffix = '_QW' )
3620
+
3621
+
3622
+ class QwarpPlusMinusInputSpec (QwarpInputSpec ):
3623
+ source_file = File (
3624
+ desc = 'Source image (opposite phase encoding direction than base image)' ,
3625
+ argstr = '-source %s' ,
3626
+ exists = True ,
3627
+ deprecated = '1.1.2' ,
3628
+ new_name = 'in_file' ,
3629
+ copyfile = False )
3630
+ out_file = File (
3631
+ argstr = '-prefix %s' ,
3632
+ value = 'Qwarp.nii.gz' ,
3633
+ position = 0 ,
3634
+ usedefault = True ,
3635
+ desc = "Output file" )
3636
+ plusminus = traits .Bool (
3637
+ True ,
3638
+ usedefault = True ,
3639
+ position = 1 ,
3640
+ desc = 'Normally, the warp displacements dis(x) are defined to match'
3641
+ 'base(x) to source(x+dis(x)). With this option, the match'
3642
+ 'is between base(x-dis(x)) and source(x+dis(x)) -- the two'
3643
+ 'images \' meet in the middle\' . For more info, view Qwarp` interface' ,
3644
+ argstr = '-plusminus' ,
3645
+ xor = ['duplo' , 'allsave' , 'iwarp' ])
3646
+
3647
+
3648
+ class QwarpPlusMinus (Qwarp ):
3649
+ """A version of 3dQwarp for performing field susceptibility correction
3650
+ using two images with opposing phase encoding directions.
3651
+
3652
+ For complete details, see the `3dQwarp Documentation.
3653
+ <https://afni.nimh.nih.gov/pub/dist/doc/program_help/3dQwarp.html>`_
3654
+
3655
+ Examples
3656
+ ========
3657
+
3658
+ >>> from nipype.interfaces import afni
3659
+ >>> qwarp = afni.QwarpPlusMinus()
3660
+ >>> qwarp.inputs.in_file = 'sub-01_dir-LR_epi.nii.gz'
3661
+ >>> qwarp.inputs.nopadWARP = True
3662
+ >>> qwarp.inputs.base_file = 'sub-01_dir-RL_epi.nii.gz'
3663
+ >>> qwarp.cmdline
3664
+ '3dQwarp -prefix Qwarp.nii.gz -plusminus -base sub-01_dir-RL_epi.nii.gz \
3665
+ -source sub-01_dir-LR_epi.nii.gz -nopadWARP'
3666
+ >>> res = warp.run() # doctest: +SKIP
3667
+
3668
+ """
3669
+
3670
+ input_spec = QwarpPlusMinusInputSpec
0 commit comments