#ifndef SPECFITSETTINGSWIDGETRADIO_QO_H
#define SPECFITSETTINGSWIDGETRADIO_QO_H
#include <QWidget>
#include <QProgressDialog>
#include <ui/ui_SpecFitSettingsWidgetRadio.h>
#include <display/QtPlotter/ProfileTaskFacilitator.h>
#include <display/QtPlotter/GaussianEstimateDialog.qo.h>
#include <casa/Containers/Record.h>
#include <display/Display/DisplayCoordinateSystem.h>
namespace casa {
class ImageProfileFitter;
class SpectralList;
class SpectralElement;
class SpecFit;
class SpecFitThread;
class SpecFitSettingsWidgetRadio : public QWidget, public ProfileTaskFacilitator {
Q_OBJECT
public:
SpecFitSettingsWidgetRadio(QWidget *parent = 0);
~SpecFitSettingsWidgetRadio();
void setUnits( QString units );
void setDisplayYUnits( const QString& units );
void setImageYUnits( const QString& units );
void setCurveName( const QString& curveName );
void addCurveName( const QString& curveName );
void setRange(double start, double end );
void reset();
void pixelsChanged( int pixX, int pixY );
signals:
void gaussEstimateCountChanged( int count );
private slots:
void polyFitChanged( int state );
void gaussCountChanged( int count );
void fitRatioChanged( int count );
void clean();
void specLineFit();
void setOutputLogFile();
void viewOutputLogFile();
void saveOutputChanged( int state );
void specFitEstimateSpecified(double xValue,double yValue, bool centerPeak);
void fitDone( bool newData = true );
void cancelFit();
void specifyGaussianEstimates();
void gaussianEstimatesChanged();
private:
bool _constructFitter( std::shared_ptr<const casacore::ImageInterface<float> >& image,
const casacore::String& region, const casacore::Record* const ®ionPtr, const casacore::String& box,
const casacore::String& chans, const casacore::String& stokes, const casacore::String& mask, const int axis,
const casacore::uInt ngauss, const SpectralList& spectralList );
void setEstimateValue( int row, int col, double val );
bool isValidEstimate( QString& peakStr, QString& centerStr,
QString& fwhmStr, QString& fixedStr, int rowIndex );
SpectralList buildSpectralList( int nGauss, bool& validList );
bool isValidFitSpecification( int gaussCount, bool polyFit );