We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 3057e4a + 73a3527 commit acc40daCopy full SHA for acc40da
httomolibgpu/misc/rescale.py
@@ -139,7 +139,10 @@ def __rescale_to_int(
139
input_min = (perc_range_min * (range_intensity) / 100) + min_value
140
input_max = (perc_range_max * (range_intensity) / 100) + min_value
141
142
- factor = (output_max - output_min) / (input_max - input_min)
+ if (input_max - input_min) != 0.0:
143
+ factor = (output_max - output_min) / (input_max - input_min)
144
+ else:
145
+ factor = 1.0
146
147
res = cp.empty(data.shape, dtype=output_dtype)
148
rescale_kernel = cp.ElementwiseKernel(
0 commit comments