forked from DOI-USGS/ISIS3
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Noseam has been refactored to be callable. Makefile test has been con…
…verted to a gtest and removed. (DOI-USGS#5600) * Noseam has been refactored to be callable. Makefile test has been converted to a gtest and removed. Addresses DOI-USGS#5599. * Modifications to address gtest failures. Also added addtional input parameter error checking to ensure noseam exits prior to generation of temporary files. Finally modified gtests to remove the print.prt file if generated. Addresses DOI-USGS#5599.
- Loading branch information
1 parent
4f1ef70
commit 77c8ffb
Showing
7 changed files
with
315 additions
and
99 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,92 +1,20 @@ | ||
#include "Isis.h" | ||
#include "Application.h" | ||
#include "FileList.h" | ||
#include "Cube.h" | ||
#include "Preference.h" | ||
#include "ProgramLauncher.h" | ||
|
||
#include <iostream> | ||
#include <fstream> | ||
|
||
using namespace std; | ||
using namespace Isis; | ||
|
||
void IsisMain() { | ||
|
||
//Get user parameters | ||
UserInterface &ui = Application::GetUserInterface(); | ||
FileList cubes; | ||
cubes.read(ui.GetFileName("FROMLIST")); | ||
/** This is free and unencumbered software released into the public domain. | ||
int samples = ui.GetInteger("SAMPLES"); | ||
int lines = ui.GetInteger("LINES"); | ||
QString match = ui.GetAsString("MATCHBANDBIN"); | ||
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. **/ | ||
|
||
//Sets upt the pathName to be used for most application calls | ||
FileName inFile = cubes[0]; | ||
/* SPDX-License-Identifier: CC0-1.0 */ | ||
|
||
Pvl &pref = Preference::Preferences(); | ||
QString pathName = (QString)pref.findGroup("DataDirectory")["Temporary"] + "/"; | ||
|
||
/** | ||
* Creates a mosaic from the original images. It is placed here | ||
* so that the failure MATCHBANDBIN causes does not leave | ||
* highpasses cubes lying around! | ||
*/ | ||
QString parameters = "FROMLIST=" + ui.GetFileName("FROMLIST") + | ||
" MOSAIC=" + pathName + "OriginalMosaic.cub" + | ||
" MATCHBANDBIN=" + match; | ||
ProgramLauncher::RunIsisProgram("automos", parameters); | ||
|
||
//Creates the highpass cubes from the cubes FileList | ||
std::ofstream highPassList; | ||
highPassList.open("HighPassList.lis"); | ||
for(int i = 0; i < cubes.size(); i++) { | ||
inFile = cubes[i]; | ||
QString outParam = pathName + inFile.baseName() + "_highpass.cub"; | ||
parameters = "FROM=" + inFile.expanded() + | ||
" TO=" + outParam | ||
+ " SAMPLES=" + toString(samples) + " LINES=" + toString(lines); | ||
ProgramLauncher::RunIsisProgram("highpass", parameters); | ||
//Reads the just created highpass cube into a list file for automos | ||
highPassList << outParam << endl; | ||
} | ||
highPassList.close(); | ||
|
||
//Makes a mosaic out of the highpass cube filelist | ||
parameters = "FROMLIST=HighPassList.lis MOSAIC=" + pathName + "HighpassMosaic.cub" | ||
+ " MATCHBANDBIN=" + match; | ||
ProgramLauncher::RunIsisProgram("automos", parameters); | ||
|
||
//Does a lowpass on the original mosaic | ||
parameters = "FROM=" + pathName + "OriginalMosaic.cub" | ||
+ " TO=" + pathName + "LowpassMosaic.cub" | ||
+ " SAMPLES=" + toString(samples) + " LINES=" + toString(lines); | ||
ProgramLauncher::RunIsisProgram("lowpass", parameters); | ||
#include "Isis.h" | ||
|
||
//Finally combines the highpass and lowpass mosaics | ||
parameters = "FROM=" + pathName + "HighpassMosaic.cub" + | ||
" FROM2=" + pathName + "LowpassMosaic.cub" + | ||
" TO=" + ui.GetCubeName("TO") + | ||
" OPERATOR= add"; | ||
ProgramLauncher::RunIsisProgram("algebra", parameters); | ||
#include "noseam.h" | ||
|
||
//Will remove all of the temp files by default | ||
if(ui.GetBoolean("REMOVETEMP")) { | ||
QString file("HighPassList.lis"); | ||
remove(file.toLatin1().data()); | ||
file = pathName + "HighpassMosaic.cub"; | ||
remove(file.toLatin1().data()); | ||
file = pathName + "LowpassMosaic.cub"; | ||
remove(file.toLatin1().data()); | ||
file = pathName + "OriginalMosaic.cub"; | ||
remove(file.toLatin1().data()); | ||
#include "Application.h" | ||
|
||
for(int i = 0; i < cubes.size(); i++) { | ||
inFile = cubes[i]; | ||
file = pathName + inFile.baseName() + "_highpass.cub"; | ||
remove(file.toLatin1().data()); | ||
} | ||
} | ||
using namespace Isis; | ||
|
||
void IsisMain() { | ||
UserInterface &ui = Application::GetUserInterface(); | ||
noseam(ui); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/** 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 */ | ||
|
||
#ifndef noseam_h | ||
#define noseam_h | ||
|
||
#include "FileName.h" | ||
#include "UserInterface.h" | ||
|
||
namespace Isis{ | ||
extern void noseam(UserInterface &ui); | ||
extern void noseam(FileName &cubeListFileName, UserInterface &ui); | ||
} | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.