44
44
default is a lower bound of 1.64 (z-score giving one-tailed p < 0.05),
45
45
and the upper bound is disabled.
46
46
47
+ --negative
48
+ If specified, sign-flip the input volume so that the clustering is based
49
+ on the negative tail of the values (note that thresholds and bounds should
50
+ still be given in positive units).
51
+
47
52
Example usage
48
53
-------------
49
54
Define 100 voxel cluster from zstat around seed at [10,20,30]
@@ -159,6 +164,8 @@ class CustomFormatter(argparse.RawTextHelpFormatter,
159
164
help = 'Lower-bound threshold; set to inf or nan to disable' )
160
165
parser .add_argument ('--upper-bound' , type = float , default = 'nan' ,
161
166
help = 'Upper-bound threshold; set to inf or nan to disable' )
167
+ parser .add_argument ('--negative' , action = 'store_true' ,
168
+ help = 'Define cluster from negative values' )
162
169
163
170
# If no arguments given, print help and exit
164
171
if not len (sys .argv ) > 1 :
@@ -175,6 +182,7 @@ class CustomFormatter(argparse.RawTextHelpFormatter,
175
182
start_thresholds = args .start_thr
176
183
lower_bound = args .lower_bound
177
184
upper_bound = args .upper_bound
185
+ negative = args .negative
178
186
179
187
# Append outfile extension if none given
180
188
if '.' not in outfile :
@@ -200,6 +208,10 @@ class CustomFormatter(argparse.RawTextHelpFormatter,
200
208
maskvol = nib .load (initial_mask ).get_fdata ().astype (bool )
201
209
vol *= maskvol
202
210
211
+ # Sign-flip?
212
+ if negative :
213
+ vol *= - 1
214
+
203
215
# Check lower bound appropriate for seed
204
216
if (lower_bound is not None ) and (vol [tuple (seed_coord )] < lower_bound ):
205
217
raise ValueError ('Lower bound cannot exceed value at seed voxel' )
0 commit comments