-
Notifications
You must be signed in to change notification settings - Fork 168
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* added std2isis tests * removed old tests * added unittests * removed image importer unittest * addressed comments
- Loading branch information
Kelvin Rodriguez
authored
Dec 9, 2020
1 parent
65aa14f
commit 5622f85
Showing
21 changed files
with
397 additions
and
134 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
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,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; | ||
} | ||
|
||
} |
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,10 @@ | ||
#ifndef std2isis_h | ||
#define std2isis_h | ||
|
||
#include "UserInterface.h" | ||
|
||
namespace Isis { | ||
extern void std2isis(UserInterface &ui); | ||
} | ||
|
||
#endif |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.