PCMRegistration Class Reference

#include <R3D/ImageProcessing/Registration/PCMRegistration.h>

List of all members.


Detailed Description

This is the master controller for the Image Registration process that uses the Phase Correlation Method (Cross Correlation using FFT) to find the 2D translation of a fixed and moving image.

Author:
Michael A. Jackson for BlueQuartz Software
Date:
June 20, 2009
Version:
1.0


Public Member Functions

 PCMRegistration (const std::string &mxaFileName, const std::string &dataRecordName, const std::string &logFilename, int maxThreads, int sliceStart, int sliceEnd)
 Constructor.
virtual void run ()
 This is the main entry point for this class to begin the running of the code.
void setDebug (bool dbg)
 Sets a flag so that more detailed process information is output.
virtual void setSliceBoundaries (int sliceStart, int sliceEnd)
 Sets the starting and ending (inclusive) indices of the slices to aligned.
virtual PCMRegistrationTable::Pointer createNewRegistrationTable (IDataFile::Pointer dataFile)
 Method will initialize a new Hint Table object.
virtual void updateRegistrationTable (IDataFile::Pointer dataFile, PCMRegistrationTable::Pointer table)
 Updates a StitchDataTable with newly initialized StitchData pointers for slices that were not found in an existing file.
virtual void threadIsComplete (PCMRegistrationThread *thread, PCMRegistrationData::Pointer stitcherData)
 Called when a thread has completed its operations.
virtual int readImageData (R3DSliceInfo::Pointer sliceInfo, int fftDim, PCMRegistrationData::Pointer regData, unsigned char *&localBuffer)
 Reads the image data from an HDF5/MXA file.
virtual void debugOutput (const std::string &threadName, const std::string &str)
 Delivers a message to the selected output device.
int getImageInfo (hid_t fileId, const std::string &datasetName, hsize_t *cols, hsize_t *rows, hsize_t *planes, std::string &interlace, hssize_t *npals, std::string &attrValSubclass)
 Gets information about an image stored in an HDF5/MXA file.
std::string getMXAFileName ()
 Returns the name of the mxa file that is being used.
std::string getDataRecordName ()
 returns the name of the DataRecord being used
void setHintTableFileName (const std::string &fn)
 Sets the filename to use for the hint table.
std::string getHintTableFileName ()
 Returns the name of the hint file being used.
PCMRegistrationTable::Pointer getHintTablePtr ()
 Returns the R3DRegistrationStats table that is being used.
PCMRegistrationTable::Pointer initPCMRegistrationTable ()
 Initializes the Registration Table.

Protected Member Functions

void _updateAsAlignedValues ()
 This method will take all the values stored in the hint table and update the 'AsAligned' values of each Data Records in the MXA file so that stitching operations will correctly produce a mosaic image.


Constructor & Destructor Documentation

PCMRegistration::PCMRegistration ( const std::string &  mxaFileName,
const std::string &  dataRecordName,
const std::string &  logFilename,
int  maxThreads,
int  sliceStart,
int  sliceEnd 
)

Constructor.

Parameters:
mxaFileName The path to the MXA Data file holding the data to be registered
dataRecordName The name of the data record to perform the registration on
logFilename The name/path of a file to use for logging.
maxThreads The maximum number of threads to use for the registration
sliceStart The first slice to register
sliceEnd The last slice to register
Returns:


Member Function Documentation

void PCMRegistration::run (  )  [virtual]

This is the main entry point for this class to begin the running of the code.

The code is multi-threaded by design.

void PCMRegistration::setDebug ( bool  dbg  ) 

Sets a flag so that more detailed process information is output.

Parameters:
dbg True to have more detailed process output delivered to the selected output device.

void PCMRegistration::setSliceBoundaries ( int  sliceStart,
int  sliceEnd 
) [virtual]

Sets the starting and ending (inclusive) indices of the slices to aligned.

Parameters:
sliceStart The starting slice
sliceEnd The ending slice

PCMRegistrationTable::Pointer PCMRegistration::createNewRegistrationTable ( IDataFile::Pointer  dataFile  )  [virtual]

Method will initialize a new Hint Table object.

Parameters:
dataFile The MXA Datafile

void PCMRegistration::updateRegistrationTable ( IDataFile::Pointer  dataFile,
PCMRegistrationTable::Pointer  table 
) [virtual]

Updates a StitchDataTable with newly initialized StitchData pointers for slices that were not found in an existing file.

This can happen if the user asks for a wider slice range than what is stored in the hint file.

Parameters:
dataFile The MXA Data File
table The TileAlignmentTable object

void PCMRegistration::threadIsComplete ( PCMRegistrationThread thread,
PCMRegistrationData::Pointer  stitcherData 
) [virtual]

Called when a thread has completed its operations.

Parameters:
thread The completed Thread
stitcherData The TileAlignmentData pointer

int PCMRegistration::readImageData ( R3DSliceInfo::Pointer  sliceInfo,
int  fftDim,
PCMRegistrationData::Pointer  regData,
unsigned char *&  localBuffer 
) [virtual]

Reads the image data from an HDF5/MXA file.

Parameters:
sliceInfo The Zeiss Slice Info Object
fftDim The dimension of the FFT, or basically the size of the image to read from the mxa file
regData The RegistrationData object for this class
localBuffer Preallocated uchar buffer
Returns:
Negative value on error

void PCMRegistration::debugOutput ( const std::string &  threadName,
const std::string &  str 
) [virtual]

Delivers a message to the selected output device.

Parameters:
threadName The name of the thread delivering the message
str The message to deliver

int PCMRegistration::getImageInfo ( hid_t  fileId,
const std::string &  datasetName,
hsize_t *  cols,
hsize_t *  rows,
hsize_t *  planes,
std::string &  interlace,
hssize_t *  npals,
std::string &  attrValSubclass 
)

Gets information about an image stored in an HDF5/MXA file.

Parameters:
fileId The HDF5 fileid value
datasetName The path to the data set
cols The number of columns (width) of the image (Output variable)
rows The number of rows (height) of the image (Output variable)
planes The number of color channels in the image (Output variable)
interlace Are the color channels interlaced? (Output variable)
npals The color palette (Output variable)
attrValSubclass The Attribute value subclass to be filled in. (Output variable)
Returns:

std::string PCMRegistration::getMXAFileName (  )  [inline]

Returns the name of the mxa file that is being used.

Returns:

std::string PCMRegistration::getDataRecordName (  )  [inline]

returns the name of the DataRecord being used

Returns:

void PCMRegistration::setHintTableFileName ( const std::string &  fn  )  [inline]

Sets the filename to use for the hint table.

Parameters:
fn The filename for the hint table

std::string PCMRegistration::getHintTableFileName (  )  [inline]

Returns the name of the hint file being used.

Returns:

PCMRegistrationTable::Pointer PCMRegistration::getHintTablePtr (  )  [inline]

Returns the R3DRegistrationStats table that is being used.

Returns:

void PCMRegistration::_updateAsAlignedValues (  )  [protected]

This method will take all the values stored in the hint table and update the 'AsAligned' values of each Data Records in the MXA file so that stitching operations will correctly produce a mosaic image.

WARNING: This method should ONLY be called from another method where the mutex has been locked otherwise havoc will probably ensue in your HDF5 file. This method is exclusively called from the 'threadFinished' method and nowhere else.


The documentation for this class was generated from the following files:
Generated on Fri Aug 28 14:04:33 2009 for R3DImageTools by  doxygen 1.5.2