@@ -83,7 +83,7 @@ def loop_over_first_n_minus_1_dimensions(arr):
83
83
parser .add_argument ("bvec_file" , type = str , help = "Path to the b-vector file." )
84
84
parser .add_argument ("bval_file" , type = str , help = "Path to the b-value file." )
85
85
parser .add_argument ("--affine" , type = float , nargs = "+" , help = "Affine matrix for NIfTI image." )
86
- parser .add_argument ("--algorithm" , type = str , choices = [ "algorithm1" , "algorithm2" ], default = "OJ_GU_seg" , help = "Select the algorithm to use." )
86
+ parser .add_argument ("--algorithm" , type = str , default = "OJ_GU_seg" , help = "Select the algorithm to use." )
87
87
parser .add_argument ("algorithm_args" , nargs = argparse .REMAINDER , help = "Additional arguments for the algorithm." )
88
88
89
89
args = parser .parse_args ()
@@ -103,7 +103,10 @@ def loop_over_first_n_minus_1_dimensions(arr):
103
103
Dp_image = []
104
104
D_image = []
105
105
106
- for idx , view in tqdm (loop_over_first_n_minus_1_dimensions (data ), desc = f"{ args .algorithm } is fitting" , dynamic_ncols = True , total = 702464 ):
106
+ # This is necessary for the tqdm to display progress bar.
107
+ n = data .ndim
108
+ total_iteration = np .prod (data .shape [:n - 1 ])
109
+ for idx , view in tqdm (loop_over_first_n_minus_1_dimensions (data ), desc = f"{ args .algorithm } is fitting" , dynamic_ncols = True , total = total_iteration ):
107
110
[f_fit , Dp_fit , D_fit ] = fit .osipi_fit (view , bvals )
108
111
f_image .append (f_fit )
109
112
Dp_image .append (Dp_fit )
0 commit comments