Resampler.h

Go to the documentation of this file.
00001 /*
00002  * The information in this file is
00003  * Copyright(c) 2007 Ball Aerospace & Technologies Corporation
00004  * and is subject to the terms and conditions of the
00005  * GNU Lesser General Public License Version 2.1
00006  * The license text is available from   
00007  * http://www.gnu.org/licenses/lgpl.html
00008  */
00009 
00010 #ifndef RESAMPLER_H
00011 #define RESAMPLER_H
00012 
00013 /**
00014  *  Resamples data based on wavelength values.
00015  *
00016  *  The Resampler class provides the capability to resample data from one
00017  *  set of wavelengths to another.  When the resampler is executed, the
00018  *  resampling algorithm is the current algorithm selected in the user options.
00019  *
00020  *  To use the Resampler, PlugIns should create a PlugInResource
00021  *  with Resampler::ResamplerPlugInName() as its input argument.
00022  *
00023  *  @code
00024  *  PlugInResource pPlugIn(Resampler::ResamplerPlugInName());
00025  *  Resampler* pResampler = dynamic_cast<Resampler*>(pPlugIn.get());
00026  *  @endcode
00027  */
00028 class Resampler
00029 {
00030 public:
00031    /**
00032     *  Resamples data to a set of given wavelengths.
00033     *
00034     *  @param   fromData
00035     *           The data values to resample.
00036     *  @param   toData
00037     *           This vector is populated with the resampled data values.
00038     *  @param   fromWavelengths
00039     *           The wavelength values that correspond with the given data values
00040     *           to resample.
00041     *  @param   toWavelengths
00042     *           The wavelength values to which to resample the data values.
00043     *  @param   toFwhm
00044     *           The full width half max values corresponding to the wavelength
00045     *           values to which to resample the data values.  If this vector is
00046     *           empty, a default value is used as defined in the user options.
00047     *  @param   toBands
00048     *           This vector is populated with the zero-based index values corresponding
00049     *           to the positions in the destination wavelengths vector to which 
00050     *           data values were actually resampled.
00051     *  @param   errorMessage
00052     *           This string is populated with an error message if the resampling
00053     *           fails.
00054     *
00055     *  @return  TRUE if the data was successfully resampled, otherwise FALSE.
00056     */
00057    virtual bool execute(const std::vector<double>& fromData, std::vector<double>& toData,
00058       const std::vector<double>& fromWavelengths, const std::vector<double>& toWavelengths, 
00059       const std::vector<double>& toFwhm, std::vector<int>& toBands, std::string& errorMessage) = 0;
00060 };
00061 
00062 #endif

Software Development Kit - Opticks 4.9.0 Build 16218