#include <casa/Exceptions/Error.h>
#include <casa/iostream.h>
#include <casa/sstream.h>
#include <casa/Arrays/Matrix.h>
#include <casa/Arrays/ArrayMath.h>
#include <casa/Arrays/ArrayLogical.h>
#include <casa/Logging.h>
#include <casa/Logging/LogIO.h>
#include <casa/Logging/LogMessage.h>
#include <casa/Logging/LogSink.h>
#include <casa/Logging/LogMessage.h>
#include <casa/OS/DirectoryIterator.h>
#include <casa/OS/File.h>
#include <casa/OS/Path.h>
#include <casa/OS/HostInfo.h>
#include <components/ComponentModels/GaussianDeconvolver.h>
#include <images/Images/TempImage.h>
#include <images/Images/PagedImage.h>
#include <imageanalysis/ImageAnalysis/CasaImageBeamSet.h>
#include <lattices/LatticeMath/LatticeMathUtil.h>
#include <ms/MeasurementSets/MSHistoryHandler.h>
#include <ms/MeasurementSets/MeasurementSet.h>
#include <synthesis/ImagerObjects/SIImageStore.h>
#include <synthesis/ImagerObjects/SDMaskHandler.h>
#include <synthesis/TransformMachines/StokesImageUtil.h>
#include <synthesis/TransformMachines/Utils.h>
#include <synthesis/ImagerObjects/SynthesisUtilMethods.h>
#include <images/Images/ImageRegrid.h>
#include <imageanalysis/ImageAnalysis/ImageStatsCalculator.h>
#include <sys/types.h>
#include <unistd.h>
using namespace std;
using namespace casacore;
namespace casa {
template <class T>
void openImage(const String& imagenamefull,std::shared_ptr<ImageInterface<T> >& imPtr )
{
LogIO logIO ( LogOrigin("SynthesisImager","openImage(name)") );
try
{
if (Table::isReadable(imagenamefull))
imPtr.reset( new PagedImage<T>( imagenamefull ) );
}
catch (AipsError &x)
{
logIO << "Error in reading image \"" << imagenamefull << "\"" << LogIO::EXCEPTION;
}
}