I (Jacob) migrated laptops. From Windows 10 to Windows 11. From Kotlin sdk 1.2.61 to 1.8.22. From JVM 1.8 to JVM 17. From Ximea API v4.10.0005 to Ximea API v4.26.0001 (xiapi64.dll).
An error is occurring when using the ROIFlowMethod but only on the new laptop with the later versions. (see details below)
Error does not occur on old laptop setup. Error still persists when reverting JVM and Kotlin versions on new laptop. It's possible this error has appeared due to the Ximea API update but needs further investigation
Need to determine if this slicing is needed. Currently I can't see an eventuality where slicing is needed, as the image will have already been "sliced" by a flow or source upstream.
Short term fix detailed below
Error is an off by 1 error due to this line slicing an array: pix_chan.sliceArray(0..(image.w * image.h).toInt())
Fix is to subtract 1 from the upper bound of the range: pix_chan.sliceArray(0..(image.w * image.h)-1.toInt())
Stack trace:
Jun 19, 2023 2:47:46 PM uk.co.strimm.services.LoggerService log
SEVERE: Could not read rectangle overlay data. Error: toIndex (14401) is greater than size (14400).
Jun 19, 2023 2:47:46 PM uk.co.strimm.services.LoggerService log
SEVERE: Stack trace: kotlin.collections.ArraysKt__ArraysJVMKt.copyOfRangeToIndexCheck(ArraysJVM.kt:49)
kotlin.collections.ArraysKt_ArraysJvmKt.copyOfRange(ArraysJvm.kt:1843)
kotlin.collections.ArraysKtArraysKt.sliceArray(_Arrays.kt:4701)
uk.co.strimm.flowMethods.ROIFlowMethod.averageROI(ROIFlowMethod.kt:188)
uk.co.strimm.flowMethods.ROIFlowMethod.run(ROIFlowMethod.kt:55)
uk.co.strimm.streams.ExperimentStream.populateFlows$lambda$28$lambda$27(ExperimentStream.kt:383)
java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1768)
java.base/java.util.concurrent.CompletableFuture$AsyncSupply.exec(CompletableFuture.java:1760)
java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:387)
java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1312)
java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1843)
java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1808)
java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:188)
The following steps have been done:
Short term fix detailed below
pix_chan.sliceArray(0..(image.w * image.h).toInt())
pix_chan.sliceArray(0..(image.w * image.h)-1.toInt())
Stack trace: Jun 19, 2023 2:47:46 PM uk.co.strimm.services.LoggerService log SEVERE: Could not read rectangle overlay data. Error: toIndex (14401) is greater than size (14400). Jun 19, 2023 2:47:46 PM uk.co.strimm.services.LoggerService log SEVERE: Stack trace: kotlin.collections.ArraysKt__ArraysJVMKt.copyOfRangeToIndexCheck(ArraysJVM.kt:49) kotlin.collections.ArraysKt_ArraysJvmKt.copyOfRange(ArraysJvm.kt:1843) kotlin.collections.ArraysKtArraysKt.sliceArray(_Arrays.kt:4701) uk.co.strimm.flowMethods.ROIFlowMethod.averageROI(ROIFlowMethod.kt:188) uk.co.strimm.flowMethods.ROIFlowMethod.run(ROIFlowMethod.kt:55) uk.co.strimm.streams.ExperimentStream.populateFlows$lambda$28$lambda$27(ExperimentStream.kt:383) java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1768) java.base/java.util.concurrent.CompletableFuture$AsyncSupply.exec(CompletableFuture.java:1760) java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:387) java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1312) java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1843) java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1808) java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:188)