Source
//# Copyright (C) 2005
//# Associated Universities, Inc. Washington DC, USA.
//#
//# This library is free software; you can redistribute it and/or modify it
//# under the terms of the GNU Library General Public License as published by
//# the Free Software Foundation; either version 2 of the License, or (at your
//# option) any later version.
//#
//# This library is distributed in the hope that it will be useful, but WITHOUT
//# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
//# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
//# License for more details.
//#
//# You should have received a copy of the GNU Library General Public License
//# along with this library; if not, write to the Free Software Foundation,
//# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
//#
//# Correspondence concerning AIPS++ should be addressed as follows:
//# Internet email: aips2-request@nrao.edu.
//# Postal address: AIPS++ Project Office
//# National Radio Astronomy Observatory
//# 520 Edgemont Road
//# Charlottesville, VA 22903-2475 USA
//#
namespace casacore{
template <class T> class ImageInterface;
}
namespace casa {
class MomentCollapseThreadRadio;
class ThresholdingBinPlotDialog;
class Converter;
template <class T> class ImageMoments;
class CollapseResult {
public:
CollapseResult( const casacore::String& outputName, bool tmp, std::shared_ptr<casacore::ImageInterface<float>> img );
casacore::String getOutputFileName() const {
return outputFileName;
}
bool isTemporaryOutput() const {
return temporary;
}
std::shared_ptr<casacore::ImageInterface<float> > getImage() const {
return image;
}
private:
casacore::String outputFileName;
bool temporary;
std::shared_ptr<casacore::ImageInterface<float> > image;
};
//Note: ImageMomentsProgressMonitor is an interface that provides this class
//with updates concerning the progress of the moment calculation task.
/**
* Responsible for running the collapse algorithm in
* the background so that we don't freeze the GUI.
*/
class MomentCollapseThreadRadio : public QThread, public ImageMomentsProgressMonitor {
Q_OBJECT
public:
MomentCollapseThreadRadio( ImageMoments<float>* imageAnalysis );
bool isSuccess() const;
void setChannelStr( casacore::String str );
void setMomentNames( const casacore::Vector<QString>& momentNames );
void setOutputFileName( QString name );
casacore::String getErrorMessage() const;
std::vector<CollapseResult> getResults() const;
void setData(const casacore::Vector<int>& moments, const int axis,
const casacore::Vector<casacore::String>& method,