fiji / bUnwarpJ

ImageJ/Fiji plugin for consistent elastic registration of 2D images
http://imagej.net/BUnwarpJ
GNU General Public License v3.0
23 stars 10 forks source link

NegativeArraySizeException thrown by MiscTools.applyTransformationMT() #6

Open GrocottLab opened 4 years ago

GrocottLab commented 4 years ago

Currently, lines 3077-3078 and presumably lines 3158-3159 for colour images (https://github.com/fiji/bUnwarpJ/blame/master/src/main/java/bunwarpj/MiscTools.java#L3077-L3078; https://github.com/fiji/bUnwarpJ/blame/master/src/main/java/bunwarpj/MiscTools.java#L3158-L3159) are sometimes resulting in a negative image height for the last thread so that a NegativeArraySizeException is thrown when the FloatProcessor constructor is called in line 3096.

For example, when targetHeight = 327 and nProc = 40, then for the last thread block_height == -24.

Commenting out lines 3077-3078 appears to fix this issue, resulting in a last block_height == 15.

Please see this forum thread for more info: https://forum.image.sc/t/install-atlas-toolkit-plugin/32175/10

iarganda commented 4 years ago

Hello @GrocottLab! Can you make a pull request with the fix? That would be great!

GrocottLab commented 4 years ago

Hi @iarganda, pull request made. Many thanks.