Skip to content

Commit 7c8380e

Browse files
author
Jessey Wright
committed
fix(interfaces): amend some of the input traits
1 parent 35cc4c9 commit 7c8380e

File tree

1 file changed

+45
-40
lines changed

1 file changed

+45
-40
lines changed

nipype/interfaces/afni/model.py

Lines changed: 45 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -723,18 +723,16 @@ class MemaInputSpec(AFNICommandInputSpec):
723723
different from 3dttest++.
724724
"""
725725

726-
unequal_variance = traits.Bool(
727-
desc='Model cross-subjects variability difference between'
726+
equal_variance = traits.Bool(
727+
True,
728+
desc='Assume same cross-subjects variability between GROUP1 and GROUP2'
729+
' (homoskedasticity) (Default); or'
730+
' Model cross-subjects variability difference between'
728731
' GROUP1 and GROUP2 (heteroskedasticity). This option'
729732
' may NOT be invoked when covariate is present in the'
730733
' model.',
731-
argstr='-unequal_variance'
732-
)
733-
734-
equal_variance = traits.Bool(
735-
desc='Assume same cross-subjects variability between GROUP1 and GROUP2'
736-
' (homoskedasticity) (Default)',
737-
argstr='-equal_variance'
734+
argstr='-equal_variance', #-unequal_variance
735+
usedefault=True,
738736
)
739737

740738
#Other arguments
@@ -756,25 +754,23 @@ class MemaInputSpec(AFNICommandInputSpec):
756754
)
757755

758756
covariates_center = traits.Str(
759-
desc='Centering rule for covariates. You can provide centering rules for each coveriate,'
760-
' or specify mean centering or no centering (using 0). If no specification is made each'
761-
' covariate will be centered about its own mean. See AFNI documentation for usage.',
757+
desc="""\
758+
Centering rule for covariates. You can provide centering rules for each coveriate,
759+
or specify mean centering or no centering (using 0). If no specification is made each
760+
covariate will be centered about its own mean.
761+
-covariates_center COV_1=CEN_1 [COV_2=CEN_2 ... ]: (for 1 group)
762+
-covariates_center COV_1=CEN_1.A CEN_1.B [COV_2=CEN_2.A CEN_2.B ... ]:
763+
(for 2 groups)
764+
where COV_K is the name assigned to the K-th covariate,
765+
either from the header of the covariates file, or from the option
766+
-covariates_name. This makes clear which center belongs to which
767+
covariate. When two groups are used, you need to specify a center for
768+
each of the groups (CEN_K.A, CEN_K.B).
769+
Example: If you had covariates age, and weight, you would use:
770+
-covariates_center age = 78 55 weight = 165 198""",
762771
argstr='covariates_center %s'
763772
)
764773

765-
""""
766-
-covariates_center COV_1=CEN_1 [COV_2=CEN_2 ... ]: (for 1 group)
767-
-covariates_center COV_1=CEN_1.A CEN_1.B [COV_2=CEN_2.A CEN_2.B ... ]:
768-
(for 2 groups)
769-
where COV_K is the name assigned to the K-th covariate,
770-
either from the header of the covariates file, or from the option
771-
-covariates_name. This makes clear which center belongs to which
772-
covariate. When two groups are used, you need to specify a center for
773-
each of the groups (CEN_K.A, CEN_K.B).
774-
Example: If you had covariates age, and weight, you would use:
775-
-covariates_center age = 78 55 weight = 165 198
776-
"""
777-
778774
covariates_model = traits.Tuple(
779775
traits.Enum('same', 'different', desc='Specify the center'),
780776
traits.Enum('same', 'different', desc='Specify the slope'),
@@ -789,10 +785,10 @@ class MemaInputSpec(AFNICommandInputSpec):
789785
for each of the covariates. Similarly for the slope.
790786
"""
791787

792-
covariates_name = traits.Str(
788+
covariates_name = traits.List(Str,
793789
desc='Specify the name of each of the N covariates. Only needed if covariate file does'
794790
' not have a header. Default is to name covariates cov1, cov2, ...',
795-
argstr='-coveriates_names %s')
791+
argstr='-covariates_names %s')
796792

797793
debugArgs = traits.Bool(
798794
desc='Enable R to save parameters in a file called .3dMEMA.dbg.AFNI.args in the current'
@@ -819,7 +815,7 @@ class MemaInputSpec(AFNICommandInputSpec):
819815
argstr='-mask %s'
820816
)
821817

822-
max_zeros = traits.Float(
818+
max_zeros = traits.Range( # Please revise all the other possible settings
823819
desc='Do not compute statistics at any voxel that has'
824820
' more than MM zero beta coefficients or GLTs.'
825821
'Setting -max_zeros to 0.25 means process data only at voxels'
@@ -828,7 +824,9 @@ class MemaInputSpec(AFNICommandInputSpec):
828824
' integer less than the number of subjects, or a fraction'
829825
' between 0 and 1. Alternatively option -missing_data'
830826
' can be used to handle missing data.',
831-
argstr='-max_zeros %f'
827+
min=0.0, max=1.0,
828+
argstr='-max_zeros %f',
829+
xor=['missing_data'],
832830
)
833831

834832
""""
@@ -847,13 +845,16 @@ class MemaInputSpec(AFNICommandInputSpec):
847845
can be used to handle missing data.
848846
"""
849847

850-
missing_data = traits.Str(
848+
missing_data = traits.Either(
849+
0,
850+
traits.List(File(exists=True), minlen=1, maxlen=2,),
851851
desc='This option corrects for inflated statistics for the voxels where'
852852
' some subjects do not have any data available due to imperfect'
853853
' spatial alignment or other reasons. The absence of this option'
854854
' means no missing data will be assumed.',
855-
argstr='-missing_data %s'
856-
)
855+
argstr='-missing_data %s',
856+
xor=['max_zeros']
857+
)
857858

858859
""""
859860
-missing_data: This option corrects for inflated statistics for the voxels where
@@ -871,7 +872,7 @@ class MemaInputSpec(AFNICommandInputSpec):
871872
in that group.
872873
"""
873874

874-
outliers = traits.Bool(
875+
outliers = traits.Bool( # Please combine with -no_model_outliers
875876
desc = 'Model outlier betas with a Laplace distribution of'
876877
' of subject-specific error. Default is -no_model_outliers',
877878
argstr ='-model_outliers'
@@ -880,14 +881,15 @@ class MemaInputSpec(AFNICommandInputSpec):
880881
nonzeros = traits.Float(
881882
desc = 'Do not compute statistics at any voxel that has'
882883
' less than NN non-zero beta values. This options is'
883-
' complimentary to -max_zeroes, and matches an option in'
884+
' complimentary to -max_zeros, and matches an option in'
884885
' the interactive 3dMEMA mode. NN is basically (number of'
885886
' unique subjects - MM). Alternatively option -missing_data'
886887
' can be used to handle missing data.',
887-
argstr = '-n_nonzero %f'
888+
argstr = '-n_nonzero %f',
889+
xor=['missing_data']
888890
)
889891

890-
noHKtest = traits.Bool(
892+
noHKtest = traits.Bool( # Please combine with -KHtest
891893
desc='Do not make the Hartung-Knapp adjustment. -KHtest is'
892894
' the default with t-statistic output.',
893895
argstr='-no_HKtest'
@@ -898,7 +900,7 @@ class MemaInputSpec(AFNICommandInputSpec):
898900
argstr ='-no_model_outliers'
899901
)
900902

901-
noresidualZ = traits.Bool(
903+
noresidualZ = traits.Bool( # Combine with -residualZ
902904
desc='Do not output residuals and their Z values (Default).',
903905
argstr='-no_residual_Z'
904906
)
@@ -918,10 +920,13 @@ class MemaInputSpec(AFNICommandInputSpec):
918920
)
919921

920922
rio = traits.Bool(
921-
desc='use R's' io functions',
923+
desc='use R\'s io functions',
922924
argstr='-rio')
923925

924-
verbosity = traits.Int(
926+
verbosity = traits.Range(
927+
1,
928+
usedefault=True,
929+
min=0,
925930
desc='An integer specifying verbosity level. 0 is quiet, 1+ is talkative.',
926931
argstr='-verb %d')
927932

@@ -932,7 +937,7 @@ class MemaOutputSpec(AFNICommandOutputSpec):
932937
exists=True
933938
)
934939
args = File(
935-
desc='Arguments file for debugging, generated if -debugArgs is set')
940+
desc='Arguments file for debugging, generated if -dbArgs is set')
936941

937942

938943
class Mema(AFNICommand):

0 commit comments

Comments
 (0)