PerkinElmer Operetta CLS Importer And Groovy Parallelization

groovy
parallel
scripting
Tags: #<Tag:0x00007fd69c0daa78> #<Tag:0x00007fd69c0da938> #<Tag:0x00007fd69c0da7f8>

#1

Dear Forum

We finished the release of a little piece of code in order to recreate hyperstacks from a list of TIFF files exported from a PerkinElmer Operetta CLS

You can find the file, information and dependencies here, we will add a page on the ImageJ Wiki soon :slight_smile:

https://c4science.ch/w/bioimaging_and_optics_platform_biop/image-processing/imagej_tools/perkinelmer-stitching/

While it is rather boring on its own, the nice thing was to play around with Parallelization in Groovy using Gpars.

Making Things Parallel In Groovy

So perhaps this might seem obvious to our beloved hardcore coders of code, this really impressed me.

Three lines

import groovyx.gpars.GParsExecutorsPool
  GParsExecutorsPool.withPool(number_of_threads) {
    some_list.eachParallel{ 
      // Everything here will run in parallel
  }
}

We had issues with image files being zipped, thus taking a lot of time for a read (150ms vs 15ms for an uncompressed TIFF of identical dimensions).

With this parallel loop, we went from overnight processing to about 30 minutes for 200Gb of images :tada:

Moreover, I will never use anything other than Groovy for parsing XML files again.

Finally, it was pretty nice to be able to create Java Swing elements using the SwingBuilder().

This language really impresses me.

:end rant: