diff --git a/.gitignore b/.gitignore index 6217e31..502cf71 100644 --- a/.gitignore +++ b/.gitignore @@ -1,9 +1,10 @@ -/FrameAverager.1.4.18/build/ -/FrameAverager.1.4.16/build/ -/FrameAverager/build/ -.gitignore -/FrameAverager/nbproject/private/ -/FrameAverager.1.4.16/nbproject/private/ -/FrameAverager.1.4.18/nbproject/private/ -/BitDepthDowngrader/nbproject/private/ -/BitDepthDowngrader/build/ \ No newline at end of file +/FrameAverager.1.4.18/build/ +/FrameAverager.1.4.16/build/ +/FrameAverager/build/ +.gitignore +/FrameAverager/nbproject/private/ +/FrameAverager.1.4.16/nbproject/private/ +/FrameAverager.1.4.18/nbproject/private/ +/BitDepthDowngrader/nbproject/private/ +/BitDepthDowngrader/build/ +FrameAverager.2.0/build/ diff --git a/FrameAverager.2.0/MANIFEST.MF b/FrameAverager.2.0/MANIFEST.MF new file mode 100644 index 0000000..e069867 --- /dev/null +++ b/FrameAverager.2.0/MANIFEST.MF @@ -0,0 +1,9 @@ +Manifest-Version: 1.0 +Ant-Version: Apache Ant 1.9.7 +Created-By: 1.8.0_101-b13 (Oracle Corporation) +Signature-Title: FrameAverager +Signature-Vendor: Marine Biological Laboratory (Rudolf Oldenbourg) +Application-Plugin: Micro-Manager +Built-By: Nick +Built-Date: 08-19-2018 + diff --git a/FrameAverager.2.0/build.xml b/FrameAverager.2.0/build.xml new file mode 100644 index 0000000..6eb861a --- /dev/null +++ b/FrameAverager.2.0/build.xml @@ -0,0 +1,101 @@ + + + + + + + + + + + Builds, tests, and runs the project FrameAverager + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/FrameAverager.2.0/build/classes/edu/mbl/cdp/frameaverage/About$1.class b/FrameAverager.2.0/build/classes/edu/mbl/cdp/frameaverage/About$1.class new file mode 100644 index 0000000..c39c57b Binary files /dev/null and b/FrameAverager.2.0/build/classes/edu/mbl/cdp/frameaverage/About$1.class differ diff --git a/FrameAverager.2.0/build/classes/edu/mbl/cdp/frameaverage/About$2.class b/FrameAverager.2.0/build/classes/edu/mbl/cdp/frameaverage/About$2.class new file mode 100644 index 0000000..000ca31 Binary files /dev/null and b/FrameAverager.2.0/build/classes/edu/mbl/cdp/frameaverage/About$2.class differ diff --git a/FrameAverager.2.0/build/classes/edu/mbl/cdp/frameaverage/About.class b/FrameAverager.2.0/build/classes/edu/mbl/cdp/frameaverage/About.class new file mode 100644 index 0000000..6140715 Binary files /dev/null and b/FrameAverager.2.0/build/classes/edu/mbl/cdp/frameaverage/About.class differ diff --git a/FrameAverager.2.0/build/classes/edu/mbl/cdp/frameaverage/FrameAverager.class b/FrameAverager.2.0/build/classes/edu/mbl/cdp/frameaverage/FrameAverager.class new file mode 100644 index 0000000..56cd68c Binary files /dev/null and b/FrameAverager.2.0/build/classes/edu/mbl/cdp/frameaverage/FrameAverager.class differ diff --git a/FrameAverager.2.0/build/classes/edu/mbl/cdp/frameaverage/FrameAveragerControls$1.class b/FrameAverager.2.0/build/classes/edu/mbl/cdp/frameaverage/FrameAveragerControls$1.class new file mode 100644 index 0000000..6e73cb5 Binary files /dev/null and b/FrameAverager.2.0/build/classes/edu/mbl/cdp/frameaverage/FrameAveragerControls$1.class differ diff --git a/FrameAverager.2.0/build/classes/edu/mbl/cdp/frameaverage/FrameAveragerControls$10.class b/FrameAverager.2.0/build/classes/edu/mbl/cdp/frameaverage/FrameAveragerControls$10.class new file mode 100644 index 0000000..f2c07f6 Binary files /dev/null and b/FrameAverager.2.0/build/classes/edu/mbl/cdp/frameaverage/FrameAveragerControls$10.class differ diff --git a/FrameAverager.2.0/build/classes/edu/mbl/cdp/frameaverage/FrameAveragerControls$2.class b/FrameAverager.2.0/build/classes/edu/mbl/cdp/frameaverage/FrameAveragerControls$2.class new file mode 100644 index 0000000..cc86fb5 Binary files /dev/null and b/FrameAverager.2.0/build/classes/edu/mbl/cdp/frameaverage/FrameAveragerControls$2.class differ diff --git a/FrameAverager.2.0/build/classes/edu/mbl/cdp/frameaverage/FrameAveragerControls$3.class b/FrameAverager.2.0/build/classes/edu/mbl/cdp/frameaverage/FrameAveragerControls$3.class new file mode 100644 index 0000000..d50cd4f Binary files /dev/null and b/FrameAverager.2.0/build/classes/edu/mbl/cdp/frameaverage/FrameAveragerControls$3.class differ diff --git a/FrameAverager.2.0/build/classes/edu/mbl/cdp/frameaverage/FrameAveragerControls$4.class b/FrameAverager.2.0/build/classes/edu/mbl/cdp/frameaverage/FrameAveragerControls$4.class new file mode 100644 index 0000000..c93390e Binary files /dev/null and b/FrameAverager.2.0/build/classes/edu/mbl/cdp/frameaverage/FrameAveragerControls$4.class differ diff --git a/FrameAverager.2.0/build/classes/edu/mbl/cdp/frameaverage/FrameAveragerControls$5.class b/FrameAverager.2.0/build/classes/edu/mbl/cdp/frameaverage/FrameAveragerControls$5.class new file mode 100644 index 0000000..0b81d08 Binary files /dev/null and b/FrameAverager.2.0/build/classes/edu/mbl/cdp/frameaverage/FrameAveragerControls$5.class differ diff --git a/FrameAverager.2.0/build/classes/edu/mbl/cdp/frameaverage/FrameAveragerControls$6.class b/FrameAverager.2.0/build/classes/edu/mbl/cdp/frameaverage/FrameAveragerControls$6.class new file mode 100644 index 0000000..4c66eb2 Binary files /dev/null and b/FrameAverager.2.0/build/classes/edu/mbl/cdp/frameaverage/FrameAveragerControls$6.class differ diff --git a/FrameAverager.2.0/build/classes/edu/mbl/cdp/frameaverage/FrameAveragerControls$7.class b/FrameAverager.2.0/build/classes/edu/mbl/cdp/frameaverage/FrameAveragerControls$7.class new file mode 100644 index 0000000..3a3d291 Binary files /dev/null and b/FrameAverager.2.0/build/classes/edu/mbl/cdp/frameaverage/FrameAveragerControls$7.class differ diff --git a/FrameAverager.2.0/build/classes/edu/mbl/cdp/frameaverage/FrameAveragerControls$8.class b/FrameAverager.2.0/build/classes/edu/mbl/cdp/frameaverage/FrameAveragerControls$8.class new file mode 100644 index 0000000..8e0aa7a Binary files /dev/null and b/FrameAverager.2.0/build/classes/edu/mbl/cdp/frameaverage/FrameAveragerControls$8.class differ diff --git a/FrameAverager.2.0/build/classes/edu/mbl/cdp/frameaverage/FrameAveragerControls$9.class b/FrameAverager.2.0/build/classes/edu/mbl/cdp/frameaverage/FrameAveragerControls$9.class new file mode 100644 index 0000000..1cd87cc Binary files /dev/null and b/FrameAverager.2.0/build/classes/edu/mbl/cdp/frameaverage/FrameAveragerControls$9.class differ diff --git a/FrameAverager.2.0/build/classes/edu/mbl/cdp/frameaverage/FrameAveragerControls.class b/FrameAverager.2.0/build/classes/edu/mbl/cdp/frameaverage/FrameAveragerControls.class new file mode 100644 index 0000000..6f1dbd8 Binary files /dev/null and b/FrameAverager.2.0/build/classes/edu/mbl/cdp/frameaverage/FrameAveragerControls.class differ diff --git a/FrameAverager.2.0/build/classes/edu/mbl/cdp/frameaverage/FrameAveragerProcessor$1.class b/FrameAverager.2.0/build/classes/edu/mbl/cdp/frameaverage/FrameAveragerProcessor$1.class new file mode 100644 index 0000000..f323293 Binary files /dev/null and b/FrameAverager.2.0/build/classes/edu/mbl/cdp/frameaverage/FrameAveragerProcessor$1.class differ diff --git a/FrameAverager.2.0/build/classes/edu/mbl/cdp/frameaverage/FrameAveragerProcessor.class b/FrameAverager.2.0/build/classes/edu/mbl/cdp/frameaverage/FrameAveragerProcessor.class new file mode 100644 index 0000000..5c580e2 Binary files /dev/null and b/FrameAverager.2.0/build/classes/edu/mbl/cdp/frameaverage/FrameAveragerProcessor.class differ diff --git a/FrameAverager.2.0/build/classes/edu/mbl/cdp/frameaverage/FrameAveragerRunnable.class b/FrameAverager.2.0/build/classes/edu/mbl/cdp/frameaverage/FrameAveragerRunnable.class new file mode 100644 index 0000000..bdf1d7b Binary files /dev/null and b/FrameAverager.2.0/build/classes/edu/mbl/cdp/frameaverage/FrameAveragerRunnable.class differ diff --git a/FrameAverager.2.0/build/classes/edu/mbl/cdp/frameaverage/TaggedFrameAverager.class b/FrameAverager.2.0/build/classes/edu/mbl/cdp/frameaverage/TaggedFrameAverager.class new file mode 100644 index 0000000..9a8d78c Binary files /dev/null and b/FrameAverager.2.0/build/classes/edu/mbl/cdp/frameaverage/TaggedFrameAverager.class differ diff --git a/FrameAverager.2.0/build/classes/edu/mbl/cdp/frameaverage/frameIcon.png b/FrameAverager.2.0/build/classes/edu/mbl/cdp/frameaverage/frameIcon.png new file mode 100644 index 0000000..58fda9a Binary files /dev/null and b/FrameAverager.2.0/build/classes/edu/mbl/cdp/frameaverage/frameIcon.png differ diff --git a/FrameAverager.2.0/dist/FrameAverager.jar b/FrameAverager.2.0/dist/FrameAverager.jar new file mode 100644 index 0000000..827bbf5 Binary files /dev/null and b/FrameAverager.2.0/dist/FrameAverager.jar differ diff --git a/FrameAverager.2.0/doc/ReadMe.txt b/FrameAverager.2.0/doc/ReadMe.txt new file mode 100644 index 0000000..abe1a87 --- /dev/null +++ b/FrameAverager.2.0/doc/ReadMe.txt @@ -0,0 +1,7 @@ +FrameAverager Plugin for MicroManager +by Amitabh Verma & Grant Harris +Marine Biological Laboratory, 2012 + + +Please refer to: +http://www.openpolscope.org/pages/MMPlugin_Frame_Averager.htm \ No newline at end of file diff --git a/FrameAverager.2.0/nbproject/build-impl.xml b/FrameAverager.2.0/nbproject/build-impl.xml new file mode 100644 index 0000000..6044456 --- /dev/null +++ b/FrameAverager.2.0/nbproject/build-impl.xml @@ -0,0 +1,1380 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set src.src.dir + Must set build.dir + Must set dist.dir + Must set build.classes.dir + Must set dist.javadoc.dir + Must set build.test.classes.dir + Must set build.test.results.dir + Must set build.classes.excludes + Must set dist.jar + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set javac.includes + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + No tests executed. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set JVM to use for profiling in profiler.info.jvm + Must set profiler agent JVM arguments in profiler.info.jvmargs.agent + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select some files in the IDE or set javac.includes + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + To run this application from the command line without Ant, try: + + + + + + + java -cp "${run.classpath.with.dist.jar}" ${main.class} + + + + + + + + + + + + + + + + + + + + + + + + + To run this application from the command line without Ant, try: + + java -jar "${dist.jar.resolved}" + + + + + + + + + + + + + + + + + + + + + + + + Must select one file in the IDE or set run.class + + + + Must select one file in the IDE or set run.class + + + + + + + + + + + + + + + + + + + + + + + Must select one file in the IDE or set debug.class + + + + + Must select one file in the IDE or set debug.class + + + + + Must set fix.includes + + + + + + + + + + This target only works when run from inside the NetBeans IDE. + + + + + + + + + Must select one file in the IDE or set profile.class + This target only works when run from inside the NetBeans IDE. + + + + + + + + + This target only works when run from inside the NetBeans IDE. + + + + + + + + + + + + + This target only works when run from inside the NetBeans IDE. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select one file in the IDE or set run.class + + + + + + Must select some files in the IDE or set test.includes + + + + + Must select one file in the IDE or set run.class + + + + + Must select one file in the IDE or set applet.url + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select some files in the IDE or set javac.includes + + + + + + + + + + + + + + + + + + Some tests failed; see details above. + + + + + + + + + Must select some files in the IDE or set test.includes + + + + Some tests failed; see details above. + + + + Must select some files in the IDE or set test.class + Must select some method in the IDE or set test.method + + + + Some tests failed; see details above. + + + + + Must select one file in the IDE or set test.class + + + + Must select one file in the IDE or set test.class + Must select some method in the IDE or set test.method + + + + + + + + + + + + + + Must select one file in the IDE or set applet.url + + + + + + + + + Must select one file in the IDE or set applet.url + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/FrameAverager.2.0/nbproject/genfiles.properties b/FrameAverager.2.0/nbproject/genfiles.properties new file mode 100644 index 0000000..e3b407e --- /dev/null +++ b/FrameAverager.2.0/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=5bada172 +build.xml.script.CRC32=bb72cc98 +build.xml.stylesheet.CRC32=28e38971@1.50.2.46 +# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. +# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. +nbproject/build-impl.xml.data.CRC32=bc4483b9 +nbproject/build-impl.xml.script.CRC32=8c556dc1 +nbproject/build-impl.xml.stylesheet.CRC32=6ddba6b6@1.53.1.46 diff --git a/FrameAverager.2.0/nbproject/private/config.properties b/FrameAverager.2.0/nbproject/private/config.properties new file mode 100644 index 0000000..e69de29 diff --git a/FrameAverager.2.0/nbproject/private/private.properties b/FrameAverager.2.0/nbproject/private/private.properties new file mode 100644 index 0000000..87ab5ba --- /dev/null +++ b/FrameAverager.2.0/nbproject/private/private.properties @@ -0,0 +1,7 @@ +compile.on.save=false +do.depend=false +do.jar=true +javac.debug=true +javadoc.preview=true +user.properties.file=C:\\Users\\Nick\\AppData\\Roaming\\NetBeans\\8.2\\build.properties +work.dir=D:\\ExtProgramFiles\\Micro-Manager-2.0beta diff --git a/FrameAverager.2.0/nbproject/private/private.xml b/FrameAverager.2.0/nbproject/private/private.xml new file mode 100644 index 0000000..ca95026 --- /dev/null +++ b/FrameAverager.2.0/nbproject/private/private.xml @@ -0,0 +1,13 @@ + + + + + + file:/C:/Users/Nick/Documents/Bitbucket/Micro-Manager-Addons/FrameAverager.2.0/src/edu/mbl/cdp/frameaverage/FrameAveragerRunnable.java + file:/C:/Users/Nick/Documents/Bitbucket/Micro-Manager-Addons/FrameAverager.2.0/src/edu/mbl/cdp/frameaverage/FrameAveragerFactory.java + file:/C:/Users/Nick/Documents/Bitbucket/Micro-Manager-Addons/FrameAverager.2.0/src/edu/mbl/cdp/frameaverage/FrameAveragerPlugin.java + file:/C:/Users/Nick/Documents/Bitbucket/Micro-Manager-Addons/FrameAverager.2.0/src/edu/mbl/cdp/frameaverage/FrameAveragerProcessor.java + file:/C:/Users/Nick/Documents/Bitbucket/Micro-Manager-Addons/FrameAverager.2.0/src/edu/mbl/cdp/frameaverage/FrameAveragerConfigurator.java + + + diff --git a/FrameAverager.2.0/nbproject/project.properties b/FrameAverager.2.0/nbproject/project.properties new file mode 100644 index 0000000..734f539 --- /dev/null +++ b/FrameAverager.2.0/nbproject/project.properties @@ -0,0 +1,167 @@ +annotation.processing.enabled=true +annotation.processing.enabled.in.editor=false +annotation.processing.processors.list= +annotation.processing.run.all.processors=true +annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output +application.title=FrameAverager +application.vendor=CDP-HPPAV +build.classes.dir=${build.dir}/classes +build.classes.excludes=**/*.java,**/*.form +# This directory is removed when the project is cleaned: +build.dir=build +build.generated.dir=${build.dir}/generated +build.generated.sources.dir=${build.dir}/generated-sources +# Only compile against the classpath explicitly listed here: +build.sysclasspath=ignore +build.test.classes.dir=${build.dir}/test/classes +build.test.results.dir=${build.dir}/test/results +# Uncomment to specify the preferred debugger connection transport: +#debug.transport=dt_socket +debug.classpath=\ + ${run.classpath} +debug.test.classpath=\ + ${run.test.classpath} +# This directory is removed when the project is cleaned: +dist.dir=dist +dist.jar=${dist.dir}/FrameAverager.jar +dist.javadoc.dir=${dist.dir}/javadoc +endorsed.classpath= +excludes= +file.reference.Big.jar=D:\\ExtProgramFiles\\Micro-Manager-2.0beta\\plugins\\Micro-Manager\\Big.jar +file.reference.bsh-2.0b6.jar=D:\\ExtProgramFiles\\Micro-Manager-2.0beta\\plugins\\Micro-Manager\\bsh-2.0b6.jar +file.reference.clojure-1.3.0.jar=D:\\ExtProgramFiles\\Micro-Manager-2.0beta\\plugins\\Micro-Manager\\clojure-1.3.0.jar +file.reference.commons-math-2.2.jar=D:\\ExtProgramFiles\\Micro-Manager-2.0beta\\plugins\\Micro-Manager\\commons-math-2.2.jar +file.reference.commons-math3-3.4.1.jar=D:\\ExtProgramFiles\\Micro-Manager-2.0beta\\plugins\\Micro-Manager\\commons-math3-3.4.1.jar +file.reference.core.cache-0.6.2.jar=D:\\ExtProgramFiles\\Micro-Manager-2.0beta\\plugins\\Micro-Manager\\core.cache-0.6.2.jar +file.reference.core.memoize-0.5.2.jar=D:\\ExtProgramFiles\\Micro-Manager-2.0beta\\plugins\\Micro-Manager\\core.memoize-0.5.2.jar +file.reference.data.json-0.1.1.jar=D:\\ExtProgramFiles\\Micro-Manager-2.0beta\\plugins\\Micro-Manager\\data.json-0.1.1.jar +file.reference.eventbus-1.4.jar=D:\\ExtProgramFiles\\Micro-Manager-2.0beta\\plugins\\Micro-Manager\\eventbus-1.4.jar +file.reference.formats-api-5.1.1.jar=D:\\ExtProgramFiles\\Micro-Manager-2.0beta\\plugins\\Micro-Manager\\formats-api-5.1.1.jar +file.reference.formats-common-5.1.1.jar=D:\\ExtProgramFiles\\Micro-Manager-2.0beta\\plugins\\Micro-Manager\\formats-common-5.1.1.jar +file.reference.gentyref-1.1.0.jar=D:\\ExtProgramFiles\\Micro-Manager-2.0beta\\plugins\\Micro-Manager\\gentyref-1.1.0.jar +file.reference.gson-2.2.4.jar=D:\\ExtProgramFiles\\Micro-Manager-2.0beta\\plugins\\Micro-Manager\\gson-2.2.4.jar +file.reference.guava-17.0.jar=D:\\ExtProgramFiles\\Micro-Manager-2.0beta\\plugins\\Micro-Manager\\guava-17.0.jar +file.reference.iconloader-GIT.jar=D:\\ExtProgramFiles\\Micro-Manager-2.0beta\\plugins\\Micro-Manager\\iconloader-GIT.jar +file.reference.ij.jar=D:\\ExtProgramFiles\\Micro-Manager-2.0beta\\ij.jar +file.reference.ImageFlipper-src=../../Projs/MMJ_/src/plugins/ImageFlipper/src +file.reference.jcommon-1.0.23.jar=D:\\ExtProgramFiles\\Micro-Manager-2.0beta\\plugins\\Micro-Manager\\jcommon-1.0.23.jar +file.reference.jfreechart-1.0.19.jar=D:\\ExtProgramFiles\\Micro-Manager-2.0beta\\plugins\\Micro-Manager\\jfreechart-1.0.19.jar +file.reference.joda-time-2.2.jar=D:\\ExtProgramFiles\\Micro-Manager-2.0beta\\plugins\\Micro-Manager\\joda-time-2.2.jar +file.reference.kryo-2.24.0.jar=D:\\ExtProgramFiles\\Micro-Manager-2.0beta\\plugins\\Micro-Manager\\kryo-2.24.0.jar +file.reference.logback-classic-1.1.1.jar=D:\\ExtProgramFiles\\Micro-Manager-2.0beta\\plugins\\Micro-Manager\\logback-classic-1.1.1.jar +file.reference.logback-core-1.1.1.jar=D:\\ExtProgramFiles\\Micro-Manager-2.0beta\\plugins\\Micro-Manager\\logback-core-1.1.1.jar +file.reference.miglayout-core-4.2.jar=D:\\ExtProgramFiles\\Micro-Manager-2.0beta\\plugins\\Micro-Manager\\miglayout-core-4.2.jar +file.reference.miglayout-swing-4.2.jar=D:\\ExtProgramFiles\\Micro-Manager-2.0beta\\plugins\\Micro-Manager\\miglayout-swing-4.2.jar +file.reference.minlog-1.2.jar=D:\\ExtProgramFiles\\Micro-Manager-2.0beta\\plugins\\Micro-Manager\\minlog-1.2.jar +file.reference.MMAcqEngine.jar=D:\\ExtProgramFiles\\Micro-Manager-2.0beta\\plugins\\Micro-Manager\\MMAcqEngine.jar +file.reference.MMCoreJ.jar=D:\\ExtProgramFiles\\Micro-Manager-2.0beta\\plugins\\Micro-Manager\\MMCoreJ.jar +file.reference.MMJ_.jar=D:\\ExtProgramFiles\\Micro-Manager-2.0beta\\plugins\\Micro-Manager\\MMJ_.jar +file.reference.objenesis-2.1.jar=D:\\ExtProgramFiles\\Micro-Manager-2.0beta\\plugins\\Micro-Manager\\objenesis-2.1.jar +file.reference.ome-xml-5.1.1.jar=D:\\ExtProgramFiles\\Micro-Manager-2.0beta\\plugins\\Micro-Manager\\ome-xml-5.1.1.jar +file.reference.Projector.jar=D:\\ExtProgramFiles\\Micro-Manager-2.0beta\\plugins\\Micro-Manager\\Projector.jar +file.reference.protobuf-java-2.5.0.jar=D:\\ExtProgramFiles\\Micro-Manager-2.0beta\\plugins\\Micro-Manager\\protobuf-java-2.5.0.jar +file.reference.rsyntaxtextarea-2.5.2.jar=D:\\ExtProgramFiles\\Micro-Manager-2.0beta\\plugins\\Micro-Manager\\rsyntaxtextarea-2.5.2.jar +file.reference.scijava-common-2.46.0.jar=D:\\ExtProgramFiles\\Micro-Manager-2.0beta\\plugins\\Micro-Manager\\scijava-common-2.46.0.jar +file.reference.serializer-2.7.1.jar=D:\\ExtProgramFiles\\Micro-Manager-2.0beta\\plugins\\Micro-Manager\\serializer-2.7.1.jar +file.reference.slf4j-api-1.7.6.jar=D:\\ExtProgramFiles\\Micro-Manager-2.0beta\\plugins\\Micro-Manager\\slf4j-api-1.7.6.jar +file.reference.swingx-0.9.5.jar=D:\\ExtProgramFiles\\Micro-Manager-2.0beta\\plugins\\Micro-Manager\\swingx-0.9.5.jar +file.reference.TSFProto-SVN.jar=D:\\ExtProgramFiles\\Micro-Manager-2.0beta\\plugins\\Micro-Manager\\TSFProto-SVN.jar +file.reference.xalan-2.7.1.jar=D:\\ExtProgramFiles\\Micro-Manager-2.0beta\\plugins\\Micro-Manager\\xalan-2.7.1.jar +file.reference.xml-apis-1.3.04.jar=D:\\ExtProgramFiles\\Micro-Manager-2.0beta\\plugins\\Micro-Manager\\xml-apis-1.3.04.jar +includes=** +jar.archive.disabled=${jnlp.enabled} +jar.compress=true +jar.index=${jnlp.enabled} +javac.classpath=\ + ${libs.swing-layout.classpath}:\ + ${file.reference.ij.jar}:\ + ${file.reference.Big.jar}:\ + ${file.reference.MMAcqEngine.jar}:\ + ${file.reference.MMCoreJ.jar}:\ + ${file.reference.MMJ_.jar}:\ + ${file.reference.Projector.jar}:\ + ${file.reference.TSFProto-SVN.jar}:\ + ${file.reference.bsh-2.0b6.jar}:\ + ${file.reference.clojure-1.3.0.jar}:\ + ${file.reference.commons-math-2.2.jar}:\ + ${file.reference.commons-math3-3.4.1.jar}:\ + ${file.reference.core.cache-0.6.2.jar}:\ + ${file.reference.core.memoize-0.5.2.jar}:\ + ${file.reference.data.json-0.1.1.jar}:\ + ${file.reference.eventbus-1.4.jar}:\ + ${file.reference.formats-api-5.1.1.jar}:\ + ${file.reference.formats-common-5.1.1.jar}:\ + ${file.reference.gentyref-1.1.0.jar}:\ + ${file.reference.gson-2.2.4.jar}:\ + ${file.reference.guava-17.0.jar}:\ + ${file.reference.iconloader-GIT.jar}:\ + ${file.reference.jcommon-1.0.23.jar}:\ + ${file.reference.jfreechart-1.0.19.jar}:\ + ${file.reference.joda-time-2.2.jar}:\ + ${file.reference.kryo-2.24.0.jar}:\ + ${file.reference.logback-classic-1.1.1.jar}:\ + ${file.reference.logback-core-1.1.1.jar}:\ + ${file.reference.miglayout-core-4.2.jar}:\ + ${file.reference.miglayout-swing-4.2.jar}:\ + ${file.reference.minlog-1.2.jar}:\ + ${file.reference.objenesis-2.1.jar}:\ + ${file.reference.ome-xml-5.1.1.jar}:\ + ${file.reference.protobuf-java-2.5.0.jar}:\ + ${file.reference.rsyntaxtextarea-2.5.2.jar}:\ + ${file.reference.scijava-common-2.46.0.jar}:\ + ${file.reference.serializer-2.7.1.jar}:\ + ${file.reference.slf4j-api-1.7.6.jar}:\ + ${file.reference.swingx-0.9.5.jar}:\ + ${file.reference.xalan-2.7.1.jar}:\ + ${file.reference.xml-apis-1.3.04.jar} +# Space-separated list of extra javac options +javac.compilerargs= +javac.deprecation=false +javac.external.vm=false +javac.processorpath=\ + ${javac.classpath} +javac.source=1.6 +javac.target=1.6 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +javac.test.processorpath=\ + ${javac.test.classpath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding=${source.encoding} +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +jnlp.codebase.type=no.codebase +jnlp.descriptor=application +jnlp.enabled=false +jnlp.mixed.code=default +jnlp.offline-allowed=false +jnlp.signed=false +jnlp.signing= +jnlp.signing.alias= +jnlp.signing.keystore= +main.class=ij.ImageJ +manifest.file=manifest.mf +meta.inf.dir=${src.dir}/META-INF +mkdist.disabled=true +no.dependencies=true +platform.active=default_platform +run.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +# Space-separated list of JVM arguments used when running the project +# (you may also define separate properties like run-sys-prop.name=value instead of -Dname=value +# or test-sys-prop.name=value to set system properties for unit tests): +run.jvmargs= +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +source.encoding=UTF-8 +src.src.dir=src diff --git a/FrameAverager.2.0/nbproject/project.xml b/FrameAverager.2.0/nbproject/project.xml new file mode 100644 index 0000000..ae892c6 --- /dev/null +++ b/FrameAverager.2.0/nbproject/project.xml @@ -0,0 +1,14 @@ + + + org.netbeans.modules.java.j2seproject + + + FrameAverager + + + + + + + + diff --git a/FrameAverager.2.0/src/edu/mbl/cdp/frameaverage/FrameAveragerConfigurator.form b/FrameAverager.2.0/src/edu/mbl/cdp/frameaverage/FrameAveragerConfigurator.form new file mode 100644 index 0000000..c804b16 --- /dev/null +++ b/FrameAverager.2.0/src/edu/mbl/cdp/frameaverage/FrameAveragerConfigurator.form @@ -0,0 +1,90 @@ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/FrameAverager.2.0/src/edu/mbl/cdp/frameaverage/FrameAveragerConfigurator.java b/FrameAverager.2.0/src/edu/mbl/cdp/frameaverage/FrameAveragerConfigurator.java new file mode 100644 index 0000000..df9beb0 --- /dev/null +++ b/FrameAverager.2.0/src/edu/mbl/cdp/frameaverage/FrameAveragerConfigurator.java @@ -0,0 +1,157 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package edu.mbl.cdp.frameaverage; + + +import org.micromanager.internal.utils.MMFrame; +import org.micromanager.data.ProcessorConfigurator; +import org.micromanager.PropertyMap; +import org.micromanager.Studio; +import org.micromanager.LogManager; + + +public class FrameAveragerConfigurator extends MMFrame implements ProcessorConfigurator { + + private final Studio studio_; + private PropertyMap settings_; + private final LogManager log_; + + /** + * Creates new form FrameAveragerControls + */ + public FrameAveragerConfigurator(PropertyMap settings, Studio studio) { + studio_ = studio; + settings_ = settings; + log_ = studio.logs(); + initComponents(); + super.loadAndRestorePosition(200, 200); + } + + @Override + public PropertyMap getSettings() { + PropertyMap.PropertyMapBuilder builder = studio_.data().getPropertyMapBuilder(); + try{ + builder.putInt("numAverages", Integer.parseInt(numFramesField.getText().trim())); + } + catch(NumberFormatException e){ + log_.showMessage("A valid number was not specified. Got: " + numFramesField.getText().trim()); + } + return builder.build(); + } + + @Override + public void cleanup() { + dispose(); + } + + @Override + public void showGUI() { + pack(); + setVisible(true); + } + + + private void updateNumFramesField() { + int num; + String str = numFramesField.getText().trim().toString(); + try { + num = (int) Integer.parseInt(str); + } catch(NumberFormatException e) { + log_.showMessage("A valid number was not specified. Defaulting to 4."); + num = 4; + } + if (num < 2) { + log_.showMessage("Can not average less than 2 frames. Defaulting to 4."); + num = 4; + } + numFramesField.setText(Integer.toString(num)); + } + + + /** + * This method is called from within the constructor to initialize the form. + * WARNING: Do NOT modify this code. The content of this method is always + * regenerated by the Form Editor. + */ + @SuppressWarnings("unchecked") + // //GEN-BEGIN:initComponents + private void initComponents() { + + jCheckBox1 = new javax.swing.JCheckBox(); + jPanel1 = new javax.swing.JPanel(); + jLabel1 = new javax.swing.JLabel(); + numFramesField = new javax.swing.JTextField(); + + jCheckBox1.setText("jCheckBox1"); + + setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); + setResizable(false); + addWindowListener(new java.awt.event.WindowAdapter() { + public void windowClosing(java.awt.event.WindowEvent evt) { + formWindowClosing(evt); + } + }); + + jPanel1.setAutoscrolls(true); + jPanel1.setMinimumSize(new java.awt.Dimension(332, 142)); + jPanel1.setPreferredSize(new java.awt.Dimension(332, 142)); + jPanel1.setLayout(new java.awt.GridLayout(1, 2)); + + jLabel1.setText("Averages"); + jPanel1.add(jLabel1); + + numFramesField.setText("4"); + numFramesField.setToolTipText(""); + numFramesField.addFocusListener(new java.awt.event.FocusAdapter() { + public void focusLost(java.awt.event.FocusEvent evt) { + numFramesFieldFocusLost(evt); + } + }); + numFramesField.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + numFramesFieldActionPerformed(evt); + } + }); + jPanel1.add(numFramesField); + numFramesField.getAccessibleContext().setAccessibleName(""); + + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); + getContentPane().setLayout(layout); + layout.setHorizontalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 151, javax.swing.GroupLayout.PREFERRED_SIZE)) + ); + layout.setVerticalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() + .addGap(0, 0, Short.MAX_VALUE) + .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE)) + ); + + pack(); + }// //GEN-END:initComponents + + private void numFramesFieldActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_numFramesFieldActionPerformed + updateNumFramesField(); + }//GEN-LAST:event_numFramesFieldActionPerformed + + private void formWindowClosing(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowClosing + + }//GEN-LAST:event_formWindowClosing + + private void numFramesFieldFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_numFramesFieldFocusLost + updateNumFramesField(); + }//GEN-LAST:event_numFramesFieldFocusLost + + // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JCheckBox jCheckBox1; + private javax.swing.JLabel jLabel1; + private javax.swing.JPanel jPanel1; + private javax.swing.JTextField numFramesField; + // End of variables declaration//GEN-END:variables +} diff --git a/FrameAverager.2.0/src/edu/mbl/cdp/frameaverage/FrameAveragerFactory.java b/FrameAverager.2.0/src/edu/mbl/cdp/frameaverage/FrameAveragerFactory.java new file mode 100644 index 0000000..c106d4e --- /dev/null +++ b/FrameAverager.2.0/src/edu/mbl/cdp/frameaverage/FrameAveragerFactory.java @@ -0,0 +1,30 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package edu.mbl.cdp.frameaverage; + +import org.micromanager.data.Processor; +import org.micromanager.data.ProcessorFactory; +import org.micromanager.PropertyMap; +import org.micromanager.Studio; + +/** + * + * @author Nick + */ +public class FrameAveragerFactory implements ProcessorFactory{ + + private final Studio studio_; + private final PropertyMap settings_; + + public FrameAveragerFactory(Studio studio, PropertyMap settings) { + studio_ = studio; + settings_ = settings; + } + @Override + public Processor createProcessor() { + return new FrameAveragerProcessor(studio_, settings_.getInt("numAverages")); + } +} diff --git a/FrameAverager.2.0/src/edu/mbl/cdp/frameaverage/FrameAveragerPlugin.java b/FrameAverager.2.0/src/edu/mbl/cdp/frameaverage/FrameAveragerPlugin.java new file mode 100644 index 0000000..e25f8a8 --- /dev/null +++ b/FrameAverager.2.0/src/edu/mbl/cdp/frameaverage/FrameAveragerPlugin.java @@ -0,0 +1,94 @@ +package edu.mbl.cdp.frameaverage; + +/* + * Copyright © 2009 – 2013, Marine Biological Laboratory + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of + * the authors and should not be interpreted as representing official policies, + * either expressed or implied, of any organization. + * + * Multiple-Frame Averaging plug-in for Micro-Manager + * @author Amitabh Verma (averma@mbl.edu), Grant Harris (gharris@mbl.edu) + * Marine Biological Laboratory, Woods Hole, Mass. + * + * + * Updated for Micromanager 2.0 by Nick Anthony (nicholas.anthony@northwestern.edu) + * Backman Photonics Lab, Northwestern University, Evanston, IL. + */ + +import javax.swing.JFrame; +import mmcorej.CMMCore; +import org.micromanager.Studio; +import org.micromanager.acquisition.internal.AcquisitionWrapperEngine; +import org.micromanager.data.ProcessorPlugin; +import org.micromanager.data.ProcessorConfigurator; +import org.micromanager.data.ProcessorFactory; +import org.micromanager.PropertyMap; + +import org.scijava.plugin.SciJavaPlugin; +import org.scijava.plugin.Plugin; + +@Plugin(type = ProcessorPlugin.class) +public class FrameAveragerPlugin implements ProcessorPlugin, SciJavaPlugin { + + public static String menuName = "Frame Averager"; + public static String tooltipDescription = "Multiple-Frame Averaging"; + public static String versionNumber = "1.1"; + public static String copyright = ""; + + private Studio studio_; + + @Override + public void setContext(Studio studio) { + studio_ = studio; + } + + @Override + public ProcessorConfigurator createConfigurator(PropertyMap settings) { + return new FrameAveragerConfigurator(settings, studio_); + } + + @Override + public ProcessorFactory createFactory(PropertyMap settings) { + return new FrameAveragerFactory(studio_, settings); + } + + @Override + public String getHelpText() { + return tooltipDescription; + } + + @Override + public String getName() { + return menuName; + } + + @Override + public String getVersion() { + return versionNumber; + } + + @Override + public String getCopyright() { + return copyright; + } +} diff --git a/FrameAverager.2.0/src/edu/mbl/cdp/frameaverage/FrameAveragerProcessor.java b/FrameAverager.2.0/src/edu/mbl/cdp/frameaverage/FrameAveragerProcessor.java new file mode 100644 index 0000000..2de3654 --- /dev/null +++ b/FrameAverager.2.0/src/edu/mbl/cdp/frameaverage/FrameAveragerProcessor.java @@ -0,0 +1,279 @@ +package edu.mbl.cdp.frameaverage; + +/* + * Copyright © 2009 – 2013, Marine Biological Laboratory + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of + * the authors and should not be interpreted as representing official policies, + * either expressed or implied, of any organization. + * + * Multiple-Frame Averaging plug-in for Micro-Manager + * @author Amitabh Verma (averma@mbl.edu), Grant Harris (gharris@mbl.edu) + * Marine Biological Laboratory, Woods Hole, Mass. + * + */ +import org.micromanager.internal.utils.MDUtils; +import org.micromanager.internal.utils.ReportingUtils; + +import org.micromanager.data.Processor; +import org.micromanager.Studio; +import org.micromanager.data.ProcessorContext; +import org.micromanager.data.Image; +import org.micromanager.data.SummaryMetadata; +import org.micromanager.acquisition.internal.TaggedImageQueue; +import org.micromanager.data.Coords; +import org.micromanager.data.Metadata; +import org.micromanager.data.internal.DefaultImage; + +public class FrameAveragerProcessor extends Processor { + + Studio studio_; + int numAverages_; + TaggedImageQueue imageQueue; + boolean debugLogEnabled_ = true; + Image[] imageArray; + + public FrameAveragerProcessor(Studio studio, int averages) { + studio_ = studio; + numAverages_ = averages; + imageArray = new Image[numAverages_]; + studio_.acquisitions().attachRunnable(-1, -1, -1, -1, new FrameAveragerRunnable(this)); + imageQueue = new TaggedImageQueue(); + } + + @Override + public void cleanup(ProcessorContext context) { + studio_.acquisitions().clearRunnables(); + } + + @Override + public SummaryMetadata processSummaryMetadata(SummaryMetadata metadata) { + SummaryMetadata.SummaryMetadataBuilder builder = metadata.copy(); + builder.userName("FrameAverager"); + return builder.build(); + } + + @Override + public void processImage(Image image, ProcessorContext context) { + + Image imageOnError = image; + try { + if (studio_.acquisitions().isAcquisitionRunning()) { + if (debugLogEnabled_) { + ReportingUtils.logMessage("Queue has" + Integer.toString(imageQueue.size())); + } + imageArray[0] = image; + int i = 1; + while (!imageQueue.isEmpty()) { + imageArray[i++] = studio_.data().convertTaggedImage(imageQueue.take()); //Lets make an array with the acquisition image first and then the queued images after. + } + } + // Only applies for Live - MultiD and Snap collect images elsewhere (in Runnable and Poison-Image-Delay thread) + // when in Live collect (n-1) required images from stream + // when averaging array is filled skip this step and continue to + // compute and produce avg. image + else if (studio_.live().getIsLiveModeOn()) { //Rolling average for live mode. + for (int i = 1; i < numAverages_; i++) { + imageArray[i-1] = imageArray[i]; + } + imageArray[numAverages_-1] = image; + } + // if we are not in a state where we have acquired some frames for averaging + // this case would be for Snap or end of Live routine where additional images + // are needed to be acquired to fill the averaging array + // a Poison image indicates EOL + else { //We are not in an acquisition or live mode so we must be taking a snap shot. + acquireImages(); + imageArray[0] = image; + int i = 1; + while (!imageQueue.isEmpty()) { + imageArray[i++] = studio_.data().convertTaggedImage(imageQueue.take()); //Lets make an array with the acquisition image first and then the queued images after. + } + /*if (taggedImage == null || TaggedImageQueue.isPoison(taggedImage)) { + new Thread("Poison-Image-Delay") { + public void run() { + tfa.fa.taggedImageArray[0] = tfa.fa.taggedImageArray[1]; + + if (!studio_.core().isSequenceRunning()) { + acquireImages(); + } + + computeProduceAndEmpty(); // on to computing avg. frame + + if (debugLogEnabled_) { + studio_.core().logMessage("FrameAvg: exiting processor"); + } + produce(TaggedImageQueue.POISON); + } + }.start(); + return; + } */ + } + + Image avg = getAverage(imageArray); // on to computing avg. frame + context.outputImage(avg); + } catch (Exception ex) { + context.outputImage(imageOnError); + ReportingUtils.logError("FrameAvg, in Process: " + ex.toString()); + imageQueue.clear(); + } + } + + private Image getAverage(Image[] imArray) { + try { + if (debugLogEnabled_) { + ReportingUtils.logMessage("FrameAvg: computing..."); + } + int width = imArray[0].getHeight(); + int height = imArray[0].getWidth(); + int imgDepth = imArray[0].getBytesPerPixel(); + + if (imgDepth > 2) { + studio_.logs().showError("Frame Averager Plugin does not support images with greater than 16 bit bitdepth."); + } + + int dimension = width * height; + byte[] pixB; + byte[] retB = new byte[dimension]; + short[] pixS; + short[] retS = new short[dimension]; + float[] retF = new float[dimension]; + Object result = null; + + for (int i = 0; i < imArray.length; i++) { + if (imgDepth == 1) { + pixB = (byte[]) imArray[i].getRawPixels(); + for (int j = 0; j < dimension; j++) { + retF[j] = (float) (retF[j] + (int) (pixB[j] & 0xff)); + } + } else if (imgDepth == 2) { + pixS = (short[]) imArray[i].getRawPixels(); + for (int j = 0; j < dimension; j++) { + retF[j] = (float) (retF[j] + (int) (pixS[j] & 0xffff)); + } + } + } + if (imgDepth == 1) { + for (int j = 0; j < dimension; j++) { + retB[j] = (byte) (int) (retF[j] / imArray.length); + } + result = retB; + } else if (imgDepth == 2) { + for (int j = 0; j < dimension; j++) { + retS[j] = (short) (int) (retF[j] / imArray.length); + } + result = retS; + } + + Metadata md = imArray[0].getMetadata(); + Coords co = imArray[0].getCoords(); + Image averagedImage = new DefaultImage(result,width,height,imgDepth,1,co,md); + if (debugLogEnabled_) { + ReportingUtils.logMessage("FrameAvg: produced averaged image"); + } + return averagedImage; + + } catch (Exception ex) { + ReportingUtils.logError("Error: FrameAvg, while producing averaged img: "+ ex.toString()); + return imArray[0]; + } + } + + /* public void acquireImagesStartSequence() { + try { + tfa.getCMMCore().waitForDevice(tfa.getCMMCore().getCameraDevice()); + tfa.getCMMCore().clearCircularBuffer(); + String cam = tfa.getCMMCore().getCameraDevice(); + +// CMMCore::startSequenceAcquisition(long numImages, double intervalMs, bool stopOnOverflow) +// @param numImages Number of images requested from the camera +// @param intervalMs interval between images, currently only supported by Andor cameras +// @param stopOnOverflow whether or not the camera stops acquiring when the circular buffer is full + studio_.core().startSequenceAcquisition(numAverages_-1, 0, false); + + long now = System.currentTimeMillis(); + int frame = 1;// keep 0 free for the image from engine + // reference BurstExample.bsh + + while (studio_.core().getRemainingImageCount() > 0 || studio_.isSequenceRunning(cam)) { + if (studio_.core().getRemainingImageCount() > 0) { + tfa.fa.taggedImageArray[frame] = tfa.getCMMCore().popNextTaggedImage(); + frame++; + } + } + long itTook = System.currentTimeMillis() - now; + if (debugLogEnabled_) { + ReportingUtils.logMessage("Averaging Acquisition took: " + itTook + " milliseconds for " + numAverages_ + " frames"); + } + + } catch (Exception ex) { + ex.printStackTrace(); + ReportingUtils.logMessage("FrameAvg Error"); + } + } */ + + + public void acquireImages() { + try { + studio_.core().waitForDevice(studio_.core().getCameraDevice()); + studio_.core().clearCircularBuffer(); + String cam = studio_.core().getCameraDevice(); + +// CMMCore::startSequenceAcquisition(long numImages, double intervalMs, bool stopOnOverflow) +// @param numImages Number of images requested from the camera +// @param intervalMs interval between images, currently only supported by Andor cameras +// @param stopOnOverflow whether or not the camera stops acquiring when the circular buffer is full + studio_.core().startSequenceAcquisition(numAverages_-1, 0, false); + + long now = System.currentTimeMillis(); + int frame = 1;// keep 0 free for the image from engine + // reference BurstExample.bsh + + while (studio_.core().getRemainingImageCount() > 0 || studio_.core().isSequenceRunning(cam)) { + if (studio_.core().getRemainingImageCount() > 0) { + imageQueue.add(studio_.core().popNextTaggedImage()); + frame++; + /* + if (proc_.display_ != null) { + if (proc_.display_.acquisitionIsRunning()) { + proc_.display_.displayStatusLine("Image Avg. Acquiring No. " + frame); + } + } + */ + } + } + long itTook = System.currentTimeMillis() - now; + try { + studio_.core().stopSequenceAcquisition(); + } catch (Exception ex) { + ex.printStackTrace(); + ReportingUtils.logMessage("ERROR: FrameAvg: " + ex.getMessage()); + } + if (debugLogEnabled_) { + ReportingUtils.logMessage("Averaging Acquisition took: " + itTook + " milliseconds for "+numAverages_ + " frames"); + } + } catch (Exception ex) { + ex.printStackTrace(); + ReportingUtils.logMessage("FrameAvg Error"); + } + } +} \ No newline at end of file diff --git a/FrameAverager.2.0/src/edu/mbl/cdp/frameaverage/FrameAveragerRunnable.java b/FrameAverager.2.0/src/edu/mbl/cdp/frameaverage/FrameAveragerRunnable.java new file mode 100644 index 0000000..29b6694 --- /dev/null +++ b/FrameAverager.2.0/src/edu/mbl/cdp/frameaverage/FrameAveragerRunnable.java @@ -0,0 +1,62 @@ +package edu.mbl.cdp.frameaverage; + +/* + * Copyright © 2009 – 2013, Marine Biological Laboratory + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of + * the authors and should not be interpreted as representing official policies, + * either expressed or implied, of any organization. + * + * Multiple-Frame Averaging plug-in for Micro-Manager + * @author Amitabh Verma (averma@mbl.edu), Grant Harris (gharris@mbl.edu) + * Marine Biological Laboratory, Woods Hole, Mass. + * + */ + +import org.micromanager.internal.utils.ReportingUtils; +import org.micromanager.Studio; + + +public class FrameAveragerRunnable implements Runnable { + + Studio studio_; + FrameAveragerProcessor proc_; + + FrameAveragerRunnable(FrameAveragerProcessor proc) { + studio_ = proc.studio_; + proc_ = proc; + } + + @Override + public void run() { + try { + ReportingUtils.logMessage("FrameAvg: entering runnable"); + studio_.acquisitions().setPause(true); + proc_.acquireImages(); + studio_.acquisitions().setPause(false); + } catch (Exception ex) { + ex.printStackTrace(); + ReportingUtils.logMessage("ERROR: FrameAvg: while entering runnable"); + } + } + +}