Select Git revision
noseam.cpp 4.98 KiB
/** This is free and unencumbered software released into the public domain.
The authors of ISIS do not claim copyright on the contents of this file.
For more details about the LICENSE terms and the AUTHORS, you will
find files of those names at the top level of this repository. **/
/* SPDX-License-Identifier: CC0-1.0 */
#include "noseam.h"
#include <iostream>
#include <fstream>
//#include "automos.h"
#include "FileList.h"
#include "FileName.h"
#include "Cube.h"
#include "Preference.h"
#include "ProgramLauncher.h"
using namespace std;
namespace Isis {
/**
* Noseam creates a mosaic from a list of input cubes using an
* algorithm that minimizes seams.
*
* @param ui UserInterface object containing parameters
*/
void noseam(UserInterface &ui) {
// Get Filename with list of cubes to mosaic
FileName cubeListFileName(ui.GetFileName("FROMLIST"));
std::cout << "***going to run 2nd noseam method\n";
return noseam(cubeListFileName, ui);
}
/**
* Noseam creates a mosaic from a list of input cubes using an
* algorithm that minimizes seams.
*
* @param cubeListFileName Filename with list of cubes to mosaic
* @param ui UserInterface object containing parameters
*/
void noseam(FileName &cubeListFileName, UserInterface &ui) {
// Boxcar samples and lines must be odd and 1 or greater
int samples;
if (ui.WasEntered("SAMPLES")) {
samples = ui.GetInteger("SAMPLES");
if (samples < 1 || samples % 2 == 0) {
string msg = "Value for [SAMPLES] must be odd and greater or equal to 1.";
throw IException(IException::User, msg, _FILEINFO_);
}
}
else {
string msg = "Parameter [SAMPLES] must be entered.";
throw IException(IException::User, msg, _FILEINFO_);
}
int lines;
if (ui.WasEntered("LINES")) {
lines = ui.GetInteger("LINES");
if (lines < 1 || lines % 2 == 0) {
string msg = "Value for [LINES] must be odd and greater or equal to 1.";
throw IException(IException::User, msg, _FILEINFO_);