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

Std2isis gtests #4172

Merged
merged 5 commits into from
Dec 9, 2020
Merged
Show file tree
Hide file tree
Changes from 2 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
32 changes: 4 additions & 28 deletions isis/src/base/apps/std2isis/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,35 +5,11 @@
#include "ImageImporter.h"
#include "UserInterface.h"

using namespace Isis;
#include "std2isis.h"

using namespace Isis;

void IsisMain() {
UserInterface &ui = Application::GetUserInterface();

FileName inputName = ui.GetFileName("FROM");
ImageImporter *importer = ImageImporter::fromFileName(inputName);

// Explicitly set band dimension if a specific color mode is desired
IString mode = ui.GetString("MODE");
if (mode != "AUTO") {
int bands = mode == "GRAYSCALE" ? 1 : mode == "ARGB" ? 4 : 3;
importer->setBands(bands);
}

// Set special pixel ranges
if (ui.GetBoolean("SETNULLRANGE"))
importer->setNullRange(ui.GetDouble("NULLMIN"), ui.GetDouble("NULLMAX"));
if (ui.GetBoolean("SETHRSRANGE"))
importer->setHrsRange(ui.GetDouble("HRSMIN"), ui.GetDouble("HRSMAX"));
if (ui.GetBoolean("SETLRSRANGE"))
importer->setLrsRange(ui.GetDouble("LRSMIN"), ui.GetDouble("LRSMAX"));

// Import the image
FileName outputName = ui.GetFileName("TO");
CubeAttributeOutput &att = ui.GetOutputAttribute("TO");
importer->import(outputName, att);

delete importer;
}

std2isis(ui);
}
36 changes: 36 additions & 0 deletions isis/src/base/apps/std2isis/std2isis.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#include <QString>

#include "ImageImporter.h"
#include "UserInterface.h"

#include "std2isis.h"

namespace Isis {
void std2isis(UserInterface &ui) {
FileName inputName = ui.GetFileName("FROM");
ImageImporter *importer = ImageImporter::fromFileName(inputName);

// Explicitly set band dimension if a specific color mode is desired
IString mode = ui.GetString("MODE");
if (mode != "AUTO") {
int bands = mode == "GRAYSCALE" ? 1 : mode == "ARGB" ? 4 : 3;
importer->setBands(bands);
}

// Set special pixel ranges
if (ui.GetBoolean("SETNULLRANGE"))
importer->setNullRange(ui.GetDouble("NULLMIN"), ui.GetDouble("NULLMAX"));
if (ui.GetBoolean("SETHRSRANGE"))
importer->setHrsRange(ui.GetDouble("HRSMIN"), ui.GetDouble("HRSMAX"));
if (ui.GetBoolean("SETLRSRANGE"))
importer->setLrsRange(ui.GetDouble("LRSMIN"), ui.GetDouble("LRSMAX"));

// Import the image
FileName outputName = ui.GetFileName("TO");
CubeAttributeOutput &att = ui.GetOutputAttribute("TO");
importer->import(outputName, att);

delete importer;
}

}
11 changes: 11 additions & 0 deletions isis/src/base/apps/std2isis/std2isis.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#ifndef std2isis_h
#define std2isis_h

#include "Cube.h"
Kelvinrr marked this conversation as resolved.
Show resolved Hide resolved
#include "UserInterface.h"

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

#endif
4 changes: 0 additions & 4 deletions isis/src/base/apps/std2isis/tsts/Makefile

This file was deleted.

8 changes: 0 additions & 8 deletions isis/src/base/apps/std2isis/tsts/argb/Makefile

This file was deleted.

8 changes: 0 additions & 8 deletions isis/src/base/apps/std2isis/tsts/default/Makefile

This file was deleted.

8 changes: 0 additions & 8 deletions isis/src/base/apps/std2isis/tsts/grayscale/Makefile

This file was deleted.

12 changes: 0 additions & 12 deletions isis/src/base/apps/std2isis/tsts/jpeg2000/Makefile

This file was deleted.

10 changes: 0 additions & 10 deletions isis/src/base/apps/std2isis/tsts/special/Makefile

This file was deleted.

10 changes: 0 additions & 10 deletions isis/src/base/apps/std2isis/tsts/tiff/Makefile

This file was deleted.

Loading