@@ -83,6 +83,9 @@ def _build_arg_parser():
8383 'and weights of model. Default is '
8484 '[%(default)s]. If the file does not exist, it '
8585 'will be downloaded.' )
86+ parser .add_argument ('--volume_size' , default = 128 , type = int ,
87+ help = 'Size of volume to resample to for inference. '
88+ 'Only modify if you know what you are doing. ' )
8689 parcel_group = parser .add_mutually_exclusive_group ()
8790 parcel_group .add_argument ('--nb_pts' , type = int , default = 10 ,
8891 help = 'Number of divisions per bundle. Default is'
@@ -130,7 +133,7 @@ def main():
130133
131134 # TODO in future release: infer these from model
132135 n_coefs = 45
133- img_size = 128
136+ img_size = args . volume_size
134137
135138 # Check the number of coefficients in the input fODF
136139 if C < n_coefs :
@@ -164,12 +167,16 @@ def main():
164167 # Predict label maps. `predict` is a generator
165168 # yielding one label map per bundle and its name.
166169 for y_hat_label , b_name in predict (
167- model , resampled_img .get_fdata (dtype = np .float32 ), n_coefs ,
168- label_function , DEFAULT_BUNDLES , args .keep_biggest_blob ,
169- args .half_precision ,
170- logging .getLogger ().getEffectiveLevel () < logging .WARNING
170+ model ,
171+ resampled_img .get_fdata (dtype = np .float32 ),
172+ n_coefs ,
173+ label_function ,
174+ DEFAULT_BUNDLES ,
175+ args .min_blob_size ,
176+ args .keep_biggest_blob ,
177+ half_precision = args .half_precision ,
178+ verbose = logging .getLogger ().getEffectiveLevel () < logging .WARNING
171179 ):
172-
173180 # Format the output as a nifti image
174181 label_img = nib .Nifti1Image (y_hat_label ,
175182 resampled_img .affine ,
0 commit comments