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.
Updating main.cpp and removed Makefile tests for explode conversion t…
…o callable app. Addresses DOI-USGS#5557.
- Loading branch information
1 parent
e7be575
commit 490041e
Showing
3 changed files
with
12 additions
and
66 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,63 +1,20 @@ | ||
#include "Isis.h" | ||
#include "ProcessByLine.h" | ||
#include "IException.h" | ||
#include "FileName.h" | ||
|
||
using namespace std; | ||
using namespace Isis; | ||
|
||
void CopyBand(Buffer &in, Buffer &out); | ||
/** This is free and unencumbered software released into the public domain. | ||
void IsisMain() { | ||
// Get the cube to explode | ||
Process p; | ||
Cube *icube = p.SetInputCube("FROM"); | ||
int samps = icube->sampleCount(); | ||
int lines = icube->lineCount(); | ||
int bands = icube->bandCount(); | ||
QString infile = icube->fileName(); | ||
|
||
// We the output filename so we can add attributes and extensions | ||
UserInterface &ui = Application::GetUserInterface(); | ||
QString outbase = ui.GetCubeName("TO"); | ||
CubeAttributeOutput &outatt = ui.GetOutputAttribute("TO"); | ||
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. **/ | ||
|
||
// Loop and extract each band | ||
for(int band = 1; band <= bands; band++) { | ||
int pband = icube->physicalBand(band); | ||
QString sband(toString(pband)); | ||
/* SPDX-License-Identifier: CC0-1.0 */ | ||
|
||
ProcessByLine p2; | ||
Progress *prog = p2.Progress(); | ||
prog->SetText("Exploding band " + sband); | ||
|
||
CubeAttributeInput inatt("+" + sband); | ||
p2.SetInputCube(infile, inatt); | ||
#include "Isis.h" | ||
|
||
QString outfile = outbase + ".band"; | ||
if(pband / 1000 == 0) { | ||
outfile += "0"; | ||
if(pband / 100 == 0) { | ||
outfile += "0"; | ||
if(pband / 10 == 0) { | ||
outfile += "0"; | ||
} | ||
} | ||
} | ||
outfile += sband + ".cub"; | ||
p2.SetOutputCube(outfile, outatt, samps, lines, 1); | ||
#include "explode.h" | ||
|
||
p2.StartProcess(CopyBand); | ||
p2.EndProcess(); | ||
} | ||
#include "Application.h" | ||
|
||
// Cleanup | ||
p.EndProcess(); | ||
} | ||
using namespace Isis; | ||
|
||
// Line processing routine | ||
void CopyBand(Buffer &in, Buffer &out) { | ||
for(int i = 0; i < in.size(); i++) { | ||
out[i] = in[i]; | ||
} | ||
void IsisMain() { | ||
UserInterface &ui = Application::GetUserInterface(); | ||
explode(ui); | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.