CamAcq JavaDoc
edu.mbl.jif.camera.camacq
Class CamAcq
java.lang.Object
  edu.mbl.jif.camera.camacq.CamAcq
graphic
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.
graphic
Field Summary
static int
DEPTH_BYTE
           
static int
DEPTH_SHORT
           
 
Method Summary
 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
applicationDidInit ()
          Notification from Application that initialization has completed.
 void
applicationExiting ()
          Notification from the Application that it is exiting.
 boolean
canApplicationExit ()
          Called by Application when exiting to assure complete shutdown.
 void
cancel()
          Cancel any pending operations
 void
captureImageToStack ()
          Acquire an image and append it to the current ImagePlus stack.
 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
captureSequenceToStack ()
          Capture a series into an ImageJ Stack using the current settings.
 void
captureSingleImage (java.lang.Object imageArray)
           
 void
captureStackFinish ()
           
 void
captureStackFinish (java.lang.String name)
          Finish the capture of an ImageStack Saves the file, updates the scale, and displays the window.
 void
captureToImagePlus ()
           
 long
captureToImagePlus (ImagePlus iPlus)
           
 boolean
checkDirOK(java.lang.String path)
          Check to see that a directory exists
 void
clearCameraROI ()
          Clear the camera Region of Interest, ROI
 void
closeCamera()
          Close the camera and driver.
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
displayOpen()
          Open the live camera display.
 void
displayResume ()
          Resume streaming to the the live display.
 void
displaySuspend ()
          Suspend streaming to the the live display.
 void
finishAcq()
           
 java.lang.String
getAcqParms()
           
 boolean
getAddParms()
           
 int
getBinning()
          Get the current camera binning.
 CameraInterface
getCamera()
          Get the camera.
 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
getExposure()
          Get current camera exposure setting
 double
getExposureMax ()
          Get minimum allowable camera exposure setting
 double
getExposureMin ()
          Get minimum allowable camera exposure setting
 int
getFileCounter ()
          Gets the value of the file counter for file naming
 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
getImageDirectory ()
          Get image date path/directory
 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.
static CamAcq
getInstance()
          Returns the instance of CamAcq.
 double
getInterval()
          Get time interval for sequence
 int
getMultiFrame ()
          Get number of exposures for Multi-frame acquisition Acquisition control
 int
getOffset()
          Get the current camera offset (absolute)
 java.awt.Rectangle
getSelectedROI ()
          ROI currently selected in display.
 double
getSpeed()
          Get the current camera readout speed
 int
getWidth()
          Get current width of image returned from camera.
 boolean
isAutoSave()
           
 boolean
isAveraging()
          Is averaging set for multi-frame acquisition.
 boolean
isCameraOpen ()
          Is the camera open?
 boolean
isCoolerActive ()
          Is camera cooler active?
 boolean
isMirrorImage ()
          Is Mirroring enabled?
 boolean
isPutOnDesk()
           
 boolean
isROISelected ()
          Is a ROI selected in the live display.
 void
listAllParameters ()
          List all parameters
 java.lang.String
makeFilename ()
          Creates a new filename for an image based on currently selected naming scheme.
 ImagePlus
newCaptureStackByte ()
          Creates a new ImagePlus with 2 slices in preparation for image capture.
 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
putInImagePlus (java.lang.Object imageArray, long acqTime)
           
 void
recordMsg(java.lang.String s)
           
 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
setCoolerActive (boolean _coolerActive)
          Set camera cooler active
 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
setImagePlusForCapture (ImagePlus _imgPlus)
          Make the specified ImagePlus the destination for acquired image.
 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
setRecordToFile (java.lang.String file)
           
 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
setupSequence (int _numImages, double _interval)
           
 void
setupSequence (int _numImages, double _interval, int _initDelay)
           
 void
showParameters ()
          Show parameters...
 void
startAcq()
           
 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
 
Field Detail
DEPTH_BYTE
public static final int DEPTH_BYTE
See Also:
graphic
DEPTH_SHORT
public static final int DEPTH_SHORT
See Also:
Method Detail
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
graphic
applicationDidInit
public void applicationDidInit()
Notification from Application that initialization has completed. For implementation of ApplicationListener.
graphic
canApplicationExit
public boolean canApplicationExit()
Called by Application when exiting to assure complete shutdown. For implementation of ApplicationListener.
Returns:
Gives the Application permission to exit.
graphic
applicationExiting
public void applicationExiting()
Notification from the Application that it is exiting. For implementation of ApplicationListener.
graphic
isCameraOpen
public boolean isCameraOpen()
Is the camera open?
Returns:
Is camera open
graphic
getCamera
public CameraInterface getCamera()
Get the camera.
Returns:
Camera attached to CamAcq
graphic
closeCamera
public void closeCamera()
Close the camera and driver.
graphic
getWidth
public int getWidth()
Get current width of image returned from camera.
Returns:
image width
graphic
getHeight
public int getHeight()
Get current height of image returned from camera.
Returns:
image height
graphic
getExposure
public double getExposure()
Get current camera exposure setting
Returns:
exposure
graphic
setExposureStream
public void setExposureStream(double _exposure)
Set camera exposure time (in microseconds) for the camera when streaming
Parameters:
_exposure- exposure
graphic
setExposureAcq
public void setExposureAcq(double _exposure)
Set the exposure time (milliseconds) for the camera for image acquisition
Parameters:
_exposure- exposure
graphic
setExposure
public void setExposure(double _exposure)
Set the exposure time (milliseconds) for the camera
Parameters:
_exposure- exposure time
graphic
getExposureMin
public double getExposureMin()
Get minimum allowable camera exposure setting
Returns:
minimum exposure
graphic
getExposureMax
public double getExposureMax()
Get minimum allowable camera exposure setting
Returns:
maximum exposure
graphic
getGain
public double getGain()
Get the current camera gain.
Returns:
Normalized Gain. Expressed in micro units
graphic
setGainSteam
public void setGainSteam(float _gain)
Set the current camera gain for streaming.
Parameters:
_gain- Normalized gain
graphic
setGainAcq
public void setGainAcq(float _gain)
Set the current camera gain for acquisition.
Parameters:
_gain- Normalized gain
graphic
setGain
public void setGain(float _gain)
Set camera gain, normalized (for acq.)
Parameters:
_gain- Normalized gain >=1.0
graphic
getOffset
public int getOffset()
Get the current camera offset (absolute)
Returns:
Absolute offset
graphic
setOffset
public void setOffset(int _offset)
Set camera absolute Offset. Default 0.
Parameters:
_offset- Absolute Offset, default 0
graphic
getBinning
public int getBinning()
Get the current camera binning.
Returns:
binning
graphic
setBinning
public void setBinning(int _binning)
Set the camera binning 1x1, 2x2, or 4x4
Parameters:
_binning- Binning: 1, 2 or 4.
graphic
getSpeed
public double getSpeed()
Get the current camera readout speed
Returns:
readout speed
graphic
setSpeed
public void setSpeed(double _speed)
Set camera readout speed, in megaHertz
Parameters:
_speed- Readout speed, MHz: 20, 10, 5 or 2.5
graphic
getCameraROI
public java.awt.Rectangle getCameraROI()
Get the current camera Region of Interest (ROI)
Returns:
ROI rectangle
graphic
setCameraROI
public void setCameraROI(java.awt.Rectangle roi)
Set camera Region of Interest, ROI
Parameters:
roi- ROI rectangle
graphic
clearCameraROI
public void clearCameraROI()
Clear the camera Region of Interest, ROI
graphic
isCoolerActive
public boolean isCoolerActive()
Is camera cooler active?
Returns:
Active or not.
graphic
setCoolerActive
public void setCoolerActive(boolean _coolerActive)
Set camera cooler active
Parameters:
_coolerActive- true or false
graphic
getDisplay
public DisplayLiveCamera getDisplay()
Gets the live camera display (a DisplayLiveCamera, which extends JFrame) Display control
Returns:
DisplayLiveCamera
graphic
displayOpen
public void displayOpen()