Converted abstract base devices into generics

So that the plugin still plays nice if people try to use unexpected
hardware, I've added rudimentary support for most typical MM devices. X/Y
stages will be supported through the GenericXYStage class, but the other
types will be supported through their base classes - Stage, Laser, Camera,
etc.

These classes generally don't have any fancy features -- if the laser
doesn't have a Power property, the power can't be changed. Likewise for
stages and Velocity. Some guesses are given here and there.

Signed-off-by: Luke Stuyvenberg <stuyvenberg@wisc.edu>
Fixed line endings in SPIMSetup

I have no idea how those got entered as DOS/Windows line endings --
Eclipse is configured to create new files as UNIX...

Signed-off-by: Luke Stuyvenberg <stuyvenberg@wisc.edu>
Device manager: fixes & ProgAcq support

More ProgAcq support for the new device manager

snapImage is done through setup.getCamera, laser on/off is done through
setup.getLaser, etc.

Signed-off-by: Luke Stuyvenberg <stuyvenberg@wisc.edu>

Some more fixes for new device manager

Some of the more obscure uses of the core interfaces are hard to spot.

Signed-off-by: Luke Stuyvenberg <stuyvenberg@wisc.edu>
Async handler: Reworked & added monitor

Reworked async output handler

It now queues stack begin/end events, to ensure they don't happen out of
order with the slice writes, and to save us the problem of (very
synchronously) emptying the queue in between each view.

Signed-off-by: Luke Stuyvenberg <stuyvenberg@wisc.edu>

Added async monitor

In effort to debug the asynchronous writing (or at least gain some insight
into its present state), I added a monitor which graphs the size of the
event/slice queue over time and mentions when it is writing things (sort
of).

So far, I have learned that it writes things pretty quickly. The highest
queue count I saw so far was 5 (out of 228), and this was while I had
another program scouring the hard drive in the background. Prime95 doesn't
even seem to faze it. I may make an effort to slow down or otherwise delay
the writing -- it is still using time which might be best spent during
acquisition (or perhaps not? Perhaps the time it is borrowing all comes
from waits and sleeps on the acquisition thread. It warrants investigation.)

Signed-off-by: Luke Stuyvenberg <stuyvenberg@wisc.edu>

Improved async monitor implementation

The monitoring process is now a runnable, instantiated by the wrapper (and
not the writer thread). The writing variable is also controlled in the
wrapper (so it doesn't flicker so much).

Signed-off-by: Luke Stuyvenberg <stuyvenberg@wisc.edu>
Remove anti-drift options

Those stuck around quite a bit longer than they needed to. The interface
is still in place, on the off-chance we find we need a new mode (perhaps
full-3D phase correlation, if the calculation can be made viable).

Signed-off-by: Luke Stuyvenberg <stuyvenberg@wisc.edu>
Added acquisition options dialog

The more obscure/less used options will be relegated to a dialog
accessible by a button on the acquisition tab. This lets me clean up the
UI by removing lesser-used options from the main window, and also put in
options for debugging that won't bother the users. For example, there is
now a checkbox under that dialog which enables/disables the async output
monitor; most users may not care what the async is presently doing, but if
it's being problematic for someone, they can check on it that way. I
intend to add acquisition profiling to this dialog as well.

Signed-off-by: Luke Stuyvenberg <stuyvenberg@wisc.edu>
Stopped wild deletion of destination directories

Before, the plugin would delete any and all files it could under the
destination directory. In hindsight, this might've caused enormous grief
to someone unprepared, as the message gave no indication this would occur.

To remedy this, I added a warning to the message, and filtered the files
by filename -- the plugin will delete all .ome.tiff in the destination
directory, but nothing else. This may need revision if another output
handler is ever made, unlikely though it may be.

Signed-off-by: Luke Stuyvenberg <stuyvenberg@wisc.edu>
Profiling: Added simple 'profiling' to acquisition

Added simple 'profiling' to acquisition process.

It just keeps track of a bunch of separate System.nanoTime()s and prints
them when it's done.

Signed-off-by: Luke Stuyvenberg <stuyvenberg@wisc.edu>

Slightly reformatted profiler output

I moved the percent-time above each child timer, and added a percent sign
after it.

Signed-off-by: Luke Stuyvenberg <stuyvenberg@wisc.edu>
Added LayoutUtils.form and made use of it

Greatly simplifies certain types of UI creation.

Signed-off-by: Luke Stuyvenberg <stuyvenberg@wisc.edu>
Finished implementing pixel size calibration

It can now create the calibrations it calculates. Also cleaned up a few
parts of it.

Signed-off-by: Luke Stuyvenberg <stuyvenberg@wisc.edu>
Various fixes in autocalibrator

Temporary fix to default pixel size (set to .652). (Pixel size should
really be removed from the SPIMCalibrator interface and its implementors;
this is now the responsibility of PixelSizeCalibrator.)

Made tweaks frame appear alongside main window.

Set bead scanning to use proper motor steps.

Made laser stay on for the entire scan.

Probably other things I'm forgetting.

Signed-off-by: Luke Stuyvenberg <stuyvenberg@wisc.edu>
Fix applyCalibratedRotation in SPIMAcquisition

It was still on the 0..100 scale for the twister; we've moved to degrees
now. I also made the rotation more sensitive; this was mostly to test the
calibration.

Signed-off-by: Luke Stuyvenberg <stuyvenberg@wisc.edu>
Added snapImage to SPIMSetup

A simple utility function that flashes the laser if autoShutter is off and
calls the camera's snapImage, returning that result.

Signed-off-by: Luke Stuyvenberg <stuyvenberg@wisc.edu>
Updated Cobolt class to match latest MM code

Alexis' changes to the Cobolt DAL consist of turning the device into a
shutter, renaming the Power property to PowerSetpoint, and changing the
scale from W to mW. I've revised the Cobolt class to reflect these
differences. (The class is presently identical in function to the Coherent
Cube class, but these should not be folded into each other; future
functionality enhancements may make separate files worthwhile.)

Signed-off-by: Luke Stuyvenberg <stuyvenberg@wisc.edu>
Improved auto-calibration

The auto-calibration can now work off highest-intensity and weighted
average rather than requiring a gaussian fit -- this is helpful in cases
where the beads aren't significant enough to detect conventionally (i.e.
using off-frequencies to stop them from showing up too brightly in
reconstructed data).

Improved some things in the iterative sphere fitter; it works alright
around a 90-degree sweep of beads, but as with the hypersphere fitter, it
works best with a full circle.

Signed-off-by: Luke Stuyvenberg <stuyvenberg@wisc.edu>
Bugfix on stage position importing

Only affected the sliders tab (which may be deprecated soon anyway); the
spinner number model had changed to Doubles instead of Integers, but the
cast was still to Integer.

Signed-off-by: Luke Stuyvenberg <stuyvenberg@wisc.edu>
Removed pixel size component from SPIMCalibrator

The SPIMCalibrator interface is now solely for determining the axis of
rotation. Before long it will likely be de-interfaced in favor of solely
the autocalibrator.

Signed-off-by: Luke Stuyvenberg <stuyvenberg@wisc.edu>
Further improvements to SPIMAutoCalibrator

Removed the min_sigma option for Z (it didn't work very well before, and
isn't possible/sensible with the new X/Y options). Also cleaned up bits
here and there, and added a circle representing the fit to the 3D view if
the axis has been determined.

Signed-off-by: Luke Stuyvenberg <stuyvenberg@wisc.edu>
Modified build scripts to accommodate Jenkins

Jenkins can't run openspim.sh, but still needs to get 3rdpartypublic, the
JDK, and Fiji... I moved those fetch bits into prepare-for-build.sh which
is invoked from build.sh; for most users, there won't be much difference,
since openspim.sh calls build.sh anyway.

Signed-off-by: Luke Stuyvenberg <stuyvenberg@wisc.edu>
Revamped live controls

The live-window mouse controls are now a separate class. This lets me add
some useful functionality and also fixes a bug where, after dragging in
the live window, then moving the stage via the sliders, the stages would
move to their pre-drag positions.

The new controls, however, do not automatically hook -- there is now a
checkbox on the bottom of the first tab to enable them, though they will
warn about the presence of MM's live window hooks. Rotation via the mouse
will not be available until the checkbox is manually clicked.

Signed-off-by: Luke Stuyvenberg <stuyvenberg@wisc.edu>