Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ApolloPanStitch App and Test Update #4164

Merged
merged 8 commits into from
Dec 8, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did we reduce this data? Running an ls -lah shows that each file is ~39MB, and it looks like the output is being put in the ISISTESTDATA area, so we're increasing data usage by 234MB.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The input reduce8.cub can be removed from the data area. We have to keep the eight ~39MB cubes and the new test output is being stored in the temp directory.

Copy link
Contributor

@AustinSanders AustinSanders Dec 7, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for being annoying, but why can't they be reduced? I guess I don't understand apollopanstitch well enough to understand why we can't downsample the cubes in the same way as other tests (i.e. map2map with lower resolution).

Copy link
Collaborator Author

@acpaquette acpaquette Dec 7, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The cubes are stitched together by "...find[ing] the centers of the fiducial marks along the image segments." (source) I believe that the actual image DNs are searched for these fiducial marks and reducing or modifying the images could potentially break this test case.

I brought this up last week during stand up and the consensus seemed to be to reduce the data footprint as easily as possible. The easiest thing to do is remove the stored output file (~240MB file) since we can test it in a gtest, so we reduce the data being used with minimal effort. I could look into reproducing the fiducial marks but that may take a while for a test case. I figured this was one of the few cases where using the full set of test data is worth the storage space.

"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());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just curious since I haven't seen unique_ptr be used before. Is there a benefit to using it over assigning a pointer in the usual way?

Copy link
Collaborator Author

@acpaquette acpaquette Dec 7, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this case, the unique pointer handles deleting the object when it goes out of scope and nothing else is pointing at it. It really just handles some quality of life features when it comes to managing memory.


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);
}