Skip to content

Commit

Permalink
ApolloPanStitch App and Test Update (#4164)
Browse files Browse the repository at this point in the history
* Updated apollopanstitcher app format

* Fixed typo

* Updated setoutputcube for ProcessMosaic

* Initial stab at the apollopanstitcher gtest

* Updated test name

* Updated file name

* Updated test and removed redundant ui access

* Removed old test makefiles
  • Loading branch information
acpaquette authored Dec 8, 2020
1 parent 3f64c29 commit 72f3d10
Show file tree
Hide file tree
Showing 8 changed files with 850 additions and 813 deletions.
787 changes: 787 additions & 0 deletions isis/src/apollo/apps/apollopanstitcher/apollopanstitcher.cpp

Large diffs are not rendered by default.

11 changes: 11 additions & 0 deletions isis/src/apollo/apps/apollopanstitcher/apollopanstitcher.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#ifndef apollopanstitcher_h
#define apollopanstitcher_h

#include "Pvl.h"
#include "UserInterface.h"

namespace Isis{
extern void apolloPanStitcher(UserInterface &ui);
}

#endif
788 changes: 4 additions & 784 deletions isis/src/apollo/apps/apollopanstitcher/main.cpp

Large diffs are not rendered by default.

4 changes: 0 additions & 4 deletions isis/src/apollo/apps/apollopanstitcher/tsts/Makefile

This file was deleted.

24 changes: 0 additions & 24 deletions isis/src/apollo/apps/apollopanstitcher/tsts/default/Makefile

This file was deleted.

6 changes: 5 additions & 1 deletion isis/src/base/objs/ProcessMosaic/ProcessMosaic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -707,6 +707,11 @@ namespace Isis {
* @throws IException::Message
*/
Cube *ProcessMosaic::SetOutputCube(const QString &psParameter) {
return SetOutputCube(psParameter, Application::GetUserInterface());
}

Cube *ProcessMosaic::SetOutputCube(const QString &psParameter, UserInterface &ui) {
QString fname = ui.GetFileName(psParameter);

// Make sure there is only one output cube
if (OutputCubes.size() > 0) {
Expand All @@ -718,7 +723,6 @@ namespace Isis {
// (e.g., "TO") and the cube size from an input cube
Cube *cube = new Cube;
try {
QString fname = Application::GetUserInterface().GetFileName(psParameter);
cube->open(fname, "rw");
}
catch (IException &) {
Expand Down
1 change: 1 addition & 0 deletions isis/src/base/objs/ProcessMosaic/ProcessMosaic.h
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,7 @@ namespace Isis {
// ProcessMosaic objects and child objects, unless redifined in the
// child class
Isis::Cube *SetOutputCube(const QString &psParameter);
Isis::Cube *SetOutputCube(const QString &psParameter, UserInterface &ui);

void SetBandBinMatch(bool enforceBandBinMatch);

Expand Down
42 changes: 42 additions & 0 deletions isis/tests/FunctionalTestsApolloPanStitcher.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#include <QTemporaryDir>
#include <memory>

#include "apollopanstitcher.h"
#include "Fixtures.h"
#include "Pvl.h"
#include "PvlGroup.h"
#include "TestUtilities.h"
#include "Histogram.h"
#include "Endian.h"
#include "PixelType.h"

#include "gtest/gtest.h"
#include "gmock/gmock.h"

#include "Fixtures.h"

using namespace Isis;

static QString APP_XML = FileName("$ISISROOT/bin/xml/apollopanstitcher.xml").expanded();

TEST_F(TempTestingFiles, FunctionalTestsApolloPanStitcherDefault) {
QVector<QString> args = {"file_base=$ISISTESTDATA/isis/src/apollo/apps/apollopanstitcher/tsts/default/input/AS15_P_0177R10",
"to=" + tempDir.path() + "/reduced8.cub",
"microns=50"};

UserInterface options(APP_XML, args);
try {
apolloPanStitcher(options);
}
catch (IException &e) {
FAIL() << "Unable to stitcher apollo images: " << e.toString().toStdString().c_str() << std::endl;
}
Cube outputCube(options.GetFileName("TO"));

std::unique_ptr<Histogram> hist (outputCube.histogram());

EXPECT_DOUBLE_EQ(hist->Average(), 53214.457630315941);
EXPECT_DOUBLE_EQ(hist->Sum(), 3243279908182.748);
EXPECT_EQ(hist->ValidPixels(), 60947345);
EXPECT_DOUBLE_EQ(hist->StandardDeviation(), 20175.877734537076);
}

0 comments on commit 72f3d10

Please sign in to comment.