edu.mbl.jif.camera.camacq
Class CamAcq
java.lang.Object
edu.mbl.jif.camera.camacq.CamAcq
public class
CamAcq
extends
java.lang.Object
edu.mbl.jig.camera.CamAcq
CamAcq:
Creates Camera, Display, Acquisitioner, DataRecorder, objects
and
wraps them in a
set of methods for easy access - eg. for access by ImageJ
plugins....
Calling
getInstance() creates the singleton instance of
CamAcq,
starts the
Application, sets itself as an
ApplicationListener,
and waits for it
to complete (when applicationDidInit is
called).
It also
initializes the camera and opens the CamAcqJ user
interface.
|
static int
|
DEPTH_BYTE
|
|
static int
|
DEPTH_SHORT
|
|
long
|
acquireImage
(java.lang.Object imageArray)
returns
acquisition time
|
|
void
|
addParms(java.awt.image.BufferedImage img,
java.lang.String timeDate)
|
|
void
|
addParms(ImageProcessor ip,
java.lang.String timeDate)
|
|
void
|
addSliceIfNecessary
(ImageStack _stack, int n)
Adds
a slice to an ImageStack if currently has < n
slices
|
|
void
|
|
|
void
|
|
|
boolean
|
|
|
void
|
cancel()
Cancel
any pending operations
|
|
void
|
|
|
void
|
captureImageToStack
(ImageStack _stack,
int _slice)
Acquire
an image and append it to the specified ImagePlus stack at the
specified slice.
|
|
void
|
captureImageToStack
(int _slice)
Acquire
an image and append/insert it to the current ImagePlus stack at the
specified slice.
|
|
void
|
|
|
void
|
|
|
void
|
|
|
void
|
captureStackFinish
(java.lang.String name)
Finish
the capture of an ImageStack Saves the file, updates the scale, and
displays the window.
|
|
void
|
|
|
long
|
|
|
boolean
|
checkDirOK(java.lang.String path)
Check
to see that a directory exists
|
|
void
|
|
|
void
|
|
|
static void
|
dataStripe(java.awt.image.BufferedImage bImage,
java.lang.String data)
|
|
void
|
displayClose
() Close
and dispose the live camera display frame.
|
|
boolean
|
displayIsOn()
Is
the live camera display open and streaming? Display
control
|
|
void
|
|
|
void
|
|
|
void
|
|
|
void
|
|
|
java.lang.String
|
|
|
boolean
|
|
|
int
|
|
|
CameraInterface
|
|
|
java.awt.Rectangle
|
getCameraROI
() Get
the current camera Region of Interest (ROI)
|
|
int
|
getDepth()
Get
image bit-depth for acquistion Acquisition
control
|
|
DisplayLiveCamera
|
getDisplay()
Gets
the live camera display (a DisplayLiveCamera, which extends JFrame)
Display control
|
|
double
|
|
|
double
|
|
|
double
|
|
|
int
|
|
|
java.lang.String
|
getFilePrefix
() Get
the prefix string used for auto-naming files
|
|
double
|
getGain()
Get
the current camera gain.
|
|
int
|
getHeight()
Get
current height of image returned from camera.
|
|
java.lang.String
|
|
|
int
|
getImagesInSequence
() Set
the number of images (intervals) when acquiring a sequence of
images.
|
|
double
|
getInitDelay
() Get
the initial delay for acquiring a sequence of
images.
|
|
|
|
|
double
|
|
|
int
|
getMultiFrame
() Get
number of exposures for Multi-frame acquisition Acquisition
control
|
|
int
|
getOffset()
Get
the current camera offset (absolute)
|
|
java.awt.Rectangle
|
|
|
double
|
getSpeed()
Get
the current camera readout speed
|
|
int
|
getWidth()
Get
current width of image returned from camera.
|
|
boolean
|
|
|
boolean
|
isAveraging()
Is
averaging set for multi-frame acquisition.
|
|
boolean
|
|
|
boolean
|
|
|
boolean
|
|
|
boolean
|
|
|
boolean
|
|
|
void
|
|
|
java.lang.String
|
makeFilename
() Creates
a new filename for an image based on currently selected naming
scheme.
|
|
ImagePlus
|
|
|
ImagePlus
|
newCaptureStackByte
(int numberOfSlices)
Creates
a new ImagePlus with numberOfSlices in preparation for image
capture.
|
|
ImagePlus
|
newCaptureStackShort
() Creates
a new ImagePlus with numberOfSlices in preparation for image
capture.
|
|
ImagePlus
|
newCaptureStackShort
(int numberOfSlices)
Creates
a new ImagePlus with numberOfSlices in preparation for image
capture.
|
|
void
|
|
|
void
|
|
|
void
|
reset()
Reset
everything to its default values.
|
|
void
|
setAutoSave(boolean t)
Set
Auto-saving of images as they are acquired
|
|
void
|
setAveraging
(boolean b)
Set
averaging or integration for multi-frame
acquisition.
|
|
void
|
setBinning(int _binning)
Set
the camera binning 1x1, 2x2, or 4x4
|
|
void
|
setCameraROI
(java.awt.Rectangle roi)
Set
camera Region of Interest, ROI
|
|
void
|
|
|
void
|
setDeBug(boolean t)
Enable
debugging output.
|
|
void
|
setDepth(int _depth)
Set
image bit-depth for acquistion Acquisition
control
|
|
void
|
setExposure(double _exposure)
Set
the exposure time (milliseconds) for the camera
|
|
void
|
setExposureAcq
(double _exposure)
Set
the exposure time (milliseconds) for the camera for image
acquisition
|
|
void
|
setExposureStream
(double _exposure)
Set
camera exposure time (in microseconds) for the camera when
streaming
|
|
void
|
setFileCounter
(int _fileCount)
Sets
the value of the file counter for file naming using when
prefix.
|
|
void
|
setFilePrefix
(java.lang.String _prefix)
Sets
the file prefix, used to label image files.
|
|
void
|
setGain(float _gain)
Set
camera gain, normalized (for acq.)
|
|
void
|
setGainAcq(float _gain)
Set
the current camera gain for acquisition.
|
|
void
|
setGainSteam
(float _gain)
Set
the current camera gain for streaming.
|
|
void
|
setImageDirectory
(java.lang.String _dir)
Set
the directory/folder for saving image data.
|
|
void
|
|
|
void
|
setImagesInSequence
(int n)
Set
the number of images (intervals) when acquiring a sequence of
images.
|
|
void
|
setInitDelay
(double i)
Set
the initial delay when acquiring a sequence of
images.
|
|
void
|
setInterval(double i)
Set
the time interval for acquiring a sequence of
images.
|
|
void
|
setMirrorImage
(boolean t)
Enable
mirroring of image both for display and
acquisition.
|
|
void
|
setMultiFrame
(int n)
Set
number of exposures for Multi-frame acquisition (May or may not be
averaged, see setAveraging()) Acquisition
control
|
|
void
|
setOffset(int _offset)
Set
camera absolute Offset.
|
|
void
|
setPutOnDesk
(boolean t)
Put
the acquired image in a window on the desktop
|
|
void
|
|
|
void
|
setScale(ImagePlus _imp)
setScale
-- Scales the ImageJ image for display 0-255 for byte type 0-4095
for short type
|
|
void
|
setSelectedROI
(java.awt.Rectangle roi)
Sets
the ROI in the live display.
|
|
void
|
setSpeed(double _speed)
Set
camera readout speed, in megaHertz
|
|
void
|
|
|
void
|
|
|
void
|
|
|
void
|
|
|
void
|
terminate()
Called
to shutdown the camera and display when
exiting.
|
|
void
|
wait(int msecs)
Wait
for n milliseconds
|
|
Methods inherited
from class java.lang.Object
|
|
clone, equals,
finalize, getClass, hashCode, notify, notifyAll, toString, wait,
wait, wait
|
DEPTH_BYTE
public static
final int DEPTH_BYTE
See Also:
DEPTH_SHORT
public static
final int DEPTH_SHORT
See Also:
getInstance
public
staticCamAcqgetInstance()
Returns the instance
of CamAcq. CamAcq is a Singleton... do not try to instantiate.
Instead, use CamAcq.getInstance().
Returns:
The singleton
instance of CamAcq
applicationDidInit
public void
applicationDidInit()
Notification from
Application that initialization has completed. For implementation
of ApplicationListener.
canApplicationExit
public boolean
canApplicationExit()
Called by
Application when exiting to assure complete shutdown. For
implementation of ApplicationListener.
Returns:
Gives the
Application permission to exit.
applicationExiting
public void
applicationExiting()
Notification from
the Application that it is exiting. For implementation of
ApplicationListener.
isCameraOpen
public boolean
isCameraOpen()
Is the camera
open?
Returns:
Is camera
open
getCamera
public
CameraInterface getCamera()
Get the
camera.
Returns:
Camera attached to
CamAcq
closeCamera
public void
closeCamera()
Close the camera and
driver.
getWidth
public int
getWidth()
Get current width of
image returned from camera.
Returns:
image
width
getHeight
public int
getHeight()
Get current height
of image returned from camera.
Returns:
image
height
getExposure
public double
getExposure()
Get current camera
exposure setting
Returns:
exposure
setExposureStream
public void
setExposureStream(double _exposure)
Set camera exposure
time (in microseconds) for the camera when
streaming
Parameters:
_exposure-
exposure
setExposureAcq
public void
setExposureAcq(double _exposure)
Set the exposure
time (milliseconds) for the camera for image
acquisition
Parameters:
_exposure-
exposure
setExposure
public void
setExposure(double _exposure)
Set the exposure
time (milliseconds) for the camera
Parameters:
_exposure- exposure
time
getExposureMin
public double
getExposureMin()
Get minimum
allowable camera exposure setting
Returns:
minimum
exposure
getExposureMax
public double
getExposureMax()
Get minimum
allowable camera exposure setting
Returns:
maximum
exposure
getGain
public double
getGain()
Get the current
camera gain.
Returns:
Normalized Gain.
Expressed in micro units
setGainSteam
public void
setGainSteam(float _gain)
Set the current
camera gain for streaming.
Parameters:
_gain- Normalized
gain
setGainAcq
public void
setGainAcq(float _gain)
Set the current
camera gain for acquisition.
Parameters:
_gain- Normalized
gain
setGain
public void
setGain(float _gain)
Set camera gain,
normalized (for acq.)
Parameters:
_gain- Normalized gain
>=1.0
getOffset
public int
getOffset()
Get the current
camera offset (absolute)
Returns:
Absolute
offset
setOffset
public void
setOffset(int _offset)
Set camera absolute
Offset. Default 0.
Parameters:
_offset- Absolute Offset,
default 0
getBinning
public int
getBinning()
Get the current
camera binning.
Returns:
binning
setBinning
public void
setBinning(int _binning)
Set the camera
binning 1x1, 2x2, or 4x4
Parameters:
_binning- Binning: 1, 2 or
4.
getSpeed
public double
getSpeed()
Get the current
camera readout speed
Returns:
readout
speed
setSpeed
public void
setSpeed(double _speed)
Set camera readout
speed, in megaHertz
Parameters:
_speed- Readout speed,
MHz: 20, 10, 5 or 2.5
getCameraROI
public
java.awt.Rectangle getCameraROI()
Get the current
camera Region of Interest (ROI)
Returns:
ROI
rectangle
setCameraROI
public void
setCameraROI(java.awt.Rectangle roi)
Set camera Region of
Interest, ROI
Parameters:
roi- ROI
rectangle
clearCameraROI
public void
clearCameraROI()
Clear the camera
Region of Interest, ROI
isCoolerActive
public boolean
isCoolerActive()
Is camera cooler
active?
Returns:
Active or
not.
setCoolerActive
public void
setCoolerActive(boolean _coolerActive)
Set camera cooler
active
Parameters:
_coolerActive- true or
false
getDisplay
public
DisplayLiveCamera getDisplay()
Gets the live camera
display (a DisplayLiveCamera, which extends JFrame) Display
control
Returns:
DisplayLiveCamera
displayOpen
public void
displayOpen()