Commit ec0fdb47507824b890c7e7461fb0752b1748dfc0
1 parent
2988ca4d
changes in stretch function
Showing
2 changed files
with
1 additions
and
1 deletions
Show diff stats
stim/image/image.h
@@ -403,7 +403,7 @@ public: | @@ -403,7 +403,7 @@ public: | ||
403 | double range = maxval - minval; //calculate the current range of the image | 403 | double range = maxval - minval; //calculate the current range of the image |
404 | double desired_range = high - low; //calculate the desired range of the image | 404 | double desired_range = high - low; //calculate the desired range of the image |
405 | for (size_t n = 0; n < N; n++) { //for each element in the image | 405 | for (size_t n = 0; n < N; n++) { //for each element in the image |
406 | - result.data()[n] = desired_range * (img[n] - minval) / range; | 406 | + result.data()[n] = desired_range * (img[n] - minval) / range + low; |
407 | } | 407 | } |
408 | return result; | 408 | return result; |
409 | } | 409 | } |