Skip to content

Commit

Permalink
Update calls to GetFileName with get GetCubeName (#4779)
Browse files Browse the repository at this point in the history
* Update calls to getfilename with get getcubename

* revert some file/cube changes

* typo

* filename cubename fixes
  • Loading branch information
scsides authored Feb 28, 2022
1 parent 7fbd849 commit be1fb81
Show file tree
Hide file tree
Showing 201 changed files with 418 additions and 419 deletions.
2 changes: 1 addition & 1 deletion isis/src/apollo/apps/apollo2isis/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ void IsisMain() {
p.SetPdsFile(inFile.expanded(), "", pdsLabel);

QString filename = FileName(ui.GetFileName("FROM")).baseName();
FileName toFile = ui.GetFileName("TO");
FileName toFile = ui.GetCubeName("TO");

apollo = new Apollo(filename);

Expand Down
2 changes: 1 addition & 1 deletion isis/src/apollo/apps/apollocal/apollocal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ namespace Isis {


void apollocal(UserInterface &ui) {
Cube cube(ui.GetFileName("FROM"), "r");
Cube cube(ui.GetCubeName("FROM"), "r");
apollocal(&cube, ui);
}

Expand Down
2 changes: 1 addition & 1 deletion isis/src/apollo/apps/apollofindrx/apollofindrx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ namespace Isis {
double GoodnessOfFit = 1.0;

void apollofindrx(UserInterface &ui) {
Cube *cube = new Cube(ui.GetFileName("FROM"), "rw");
Cube *cube = new Cube(ui.GetCubeName("FROM"), "rw");
apollofindrx(cube, ui);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -725,7 +725,7 @@ namespace Isis {
//define an output cube
outputC.setDimensions(int(maxS), int(maxL), 1);
outputC.setPixelType(panC[0]->pixelType()); //set pixel type
tempString = ui.GetFileName("TO");
tempString = ui.GetCubeName("TO");
outputC.create(tempString);
outputC.close(); //closing the output cube so that it can be opened by the mosaic process
ProcessMosaic mosaic;
Expand Down
8 changes: 5 additions & 3 deletions isis/src/apollo/apps/apolloremrx/apolloremrx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,18 @@ namespace Isis {

void cpy(Buffer &in, Buffer &out);


void apolloremrx(UserInterface &ui) {
Cube cube;
CubeAttributeInput inAtt = ui.GetInputAttribute("FROM");
if (inAtt.bands().size() != 0) {
cube.setVirtualBands(inAtt.bands());
}
cube.open(ui.GetFileName("FROM"));
cube.open(ui.GetCubeName("FROM"));
apolloremrx(&cube, ui);
}


void apolloremrx(Cube *info, UserInterface &ui) {
int dim;
bool resvalid;
Expand Down Expand Up @@ -68,7 +70,7 @@ namespace Isis {
status = "Removed";

CubeAttributeOutput &att = ui.GetOutputAttribute("TO");
p.SetOutputCube(ui.GetFileName("TO"), att);
p.SetOutputCube(ui.GetCubeName("TO"), att);

// Start the processing
p.StartProcess(cpy);
Expand All @@ -77,7 +79,7 @@ namespace Isis {
dim = apollo.ReseauDimension();

// Get other user entered options
QString out = ui.GetFileName("TO");
QString out = ui.GetCubeName("TO");
resvalid = ui.GetBoolean("RESVALID");
action = ui.GetString("ACTION");

Expand Down
18 changes: 9 additions & 9 deletions isis/src/base/apps/appjit/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@ void IsisMain() {

int ifile = 0;
// Make sure the master file is included in the input file list
while(ifile < (int) list.size() && list[ifile].toString() != FileName(ui.GetFileName("MASTER")).expanded()) {
while(ifile < (int) list.size() && list[ifile].toString() != FileName(ui.GetCubeName("MASTER")).expanded()) {
ifile++;
}

if(ifile >= list.size()) {
QString msg = "The master file, [" + FileName(ui.GetFileName("MASTER")).expanded() + " is not included in " +
"the input list file " + ui.GetFileName("FROMLIST") + "]";
QString msg = "The master file, [" + FileName(ui.GetCubeName("MASTER")).expanded() + " is not included in " +
"the input list file " + ui.GetCubeName("FROMLIST") + "]";
throw IException(IException::User, msg, _FILEINFO_);
}

Expand All @@ -55,7 +55,7 @@ void IsisMain() {
try {
// Open the master cube
Cube cube;
cube.open(ui.GetFileName("MASTER"), "rw");
cube.open(ui.GetCubeName("MASTER"), "rw");

//check for existing polygon, if exists delete it
if(cube.label()->hasObject("Polygon")) {
Expand All @@ -65,7 +65,7 @@ void IsisMain() {
// Get the camera
Camera *cam = cube.camera();
if(cam->DetectorMap()->LineRate() == 0.0) {
QString msg = "[" + ui.GetFileName("MASTER") + "] is not a line scan camera image";
QString msg = "[" + ui.GetCubeName("MASTER") + "] is not a line scan camera image";
throw IException(IException::User, msg, _FILEINFO_);
}

Expand Down Expand Up @@ -127,12 +127,12 @@ void IsisMain() {

cube.putGroup(kernels);
cube.close();
gp += PvlKeyword("StatusMaster", ui.GetFileName("MASTER") + ": camera pointing updated");
gp += PvlKeyword("StatusMaster", ui.GetCubeName("MASTER") + ": camera pointing updated");

// Apply the dejittered pointing to the rest of the files
step2 = true;
for(int ifile = 0; ifile < list.size(); ifile++) {
if(list[ifile].toString() != ui.GetFileName("MASTER")) {
if(list[ifile].toString() != ui.GetCubeName("MASTER")) {
// Open the cube
cube.open(list[ifile].toString(), "rw");
//check for existing polygon, if exists delete it
Expand All @@ -142,7 +142,7 @@ void IsisMain() {
// Get the camera and make sure it is a line scan camera
Camera *cam = cube.camera();
if(cam->DetectorMap()->LineRate() == 0.0) {
QString msg = "[" + ui.GetFileName("FROM") + "] is not a line scan camera";
QString msg = "[" + ui.GetCubeName("FROM") + "] is not a line scan camera";
throw IException(IException::User, msg, _FILEINFO_);
}
// Write out the pointing cache as a table
Expand All @@ -168,7 +168,7 @@ void IsisMain() {
catch(IException &e) {
QString msg;
if(!step2) {
msg = "Unable to fit pointing for [" + ui.GetFileName("MASTER") + "]";
msg = "Unable to fit pointing for [" + ui.GetCubeName("MASTER") + "]";
}
else {
msg = "Unable to update pointing for nonMaster file(s)";
Expand Down
6 changes: 3 additions & 3 deletions isis/src/base/apps/ascii2isis/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ void IsisMain() {
ProcessByLine p;


p.SetOutputCube(ui.GetFileName("TO"), att, ns, nl, nb);
p.SetOutputCube(ui.GetCubeName("TO"), att, ns, nl, nb);
p.StartProcess(ascii2isis);
p.EndProcess();
}
Expand All @@ -87,15 +87,15 @@ void IsisMain() {


// Set Special Pixel ranges
p.SetOutputCube(ui.GetFileName("TO"), att, ns, nl, nb);
p.SetOutputCube(ui.GetCubeName("TO"), att, ns, nl, nb);
p.StartProcess(ascii2isis);
p.EndProcess();
}
if (order == "BIP") {
ProcessBySpectra p(Isis::ProcessBySpectra::PerPixel);


p.SetOutputCube(ui.GetFileName("TO"), att, ns, nl, nb);
p.SetOutputCube(ui.GetCubeName("TO"), att, ns, nl, nb);
p.StartProcess(ascii2isis);
p.EndProcess();
}
Expand Down
4 changes: 2 additions & 2 deletions isis/src/base/apps/automos/automos.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@ namespace Isis {
m.SetOutputCube(list,
ui.GetDouble("MINLAT"), ui.GetDouble("MAXLAT"),
ui.GetDouble("MINLON"), ui.GetDouble("MAXLON"),
oAtt, ui.GetFileName("MOSAIC"));
oAtt, ui.GetCubeName("MOSAIC"));
}
else {
m.SetOutputCube(list, oAtt, ui.GetFileName("MOSAIC"));
m.SetOutputCube(list, oAtt, ui.GetCubeName("MOSAIC"));
}

m.SetHighSaturationFlag(ui.GetBoolean("HIGHSATURATION"));
Expand Down
4 changes: 2 additions & 2 deletions isis/src/base/apps/bandnorm/bandnorm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ namespace Isis {
const QString &delimiters = " ");

void bandnorm(UserInterface &ui) {
Cube icube(ui.GetFileName("FROM"), "r");
Cube icube(ui.GetCubeName("FROM"), "r");
bandnorm(&icube, ui);
}

Expand Down Expand Up @@ -110,7 +110,7 @@ namespace Isis {
}

// Setup the output file and apply the correction
p.SetOutputCube(ui.GetFileName("TO"), ui.GetOutputAttribute("TO"), icube->sampleCount(), icube->lineCount(), icube->bandCount());
p.SetOutputCube(ui.GetCubeName("TO"), ui.GetOutputAttribute("TO"), icube->sampleCount(), icube->lineCount(), icube->bandCount());
p.StartProcess(normalize);

// Cleanup
Expand Down
4 changes: 2 additions & 2 deletions isis/src/base/apps/barscale/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ void IsisMain() {
// projection information
Process p;
Cube icube;
icube.open(ui.GetFileName("FROM") );
icube.open(ui.GetCubeName("FROM") );

// Determine where in image to get resolution from and get it
int numSamps = icube.sampleCount();
Expand Down Expand Up @@ -441,7 +441,7 @@ void IsisMain() {
lblStr = lblStr + " " + unitStr;
painter.drawText(rightDisplayRect, lblStr);

QString inFile = ui.GetFileName("FROM");
QString inFile = ui.GetCubeName("FROM");
QString outFile = ui.GetFileName("TO");
FileName tmpBarFile = FileName::createTempFile("barscale.tif");
QString scaleTif = tmpBarFile.expanded();
Expand Down
1 change: 1 addition & 0 deletions isis/src/base/apps/bit2bit/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ void IsisMain(){


if(ui.GetBoolean("STATS")) { //! Run extended statistics
// The TO parameter is a filename not a cubename, so we can ignore the command line attributes
Cube* ocubeptr = p.SetOutputCube (ui.GetFileName("TO"),outputProperties,
cubeptr->sampleCount(),cubeptr->lineCount(),
cubeptr->bandCount());
Expand Down
6 changes: 3 additions & 3 deletions isis/src/base/apps/cam2cam/cam2cam.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ namespace Isis {
*/
void cam2cam(UserInterface &ui) {
Cube *icube = new Cube();
icube->open(ui.GetFileName("FROM"));
icube->open(ui.GetCubeName("FROM"));
Cube *mcube = new Cube();
mcube->open(ui.GetFileName("MATCH"));
mcube->open(ui.GetCubeName("MATCH"));
return cam2cam(icube, mcube, ui);
}

Expand All @@ -47,7 +47,7 @@ namespace Isis {

ProcessRubberSheet m;
m.SetInputCube(mcube);
Cube *ocube = m.SetOutputCube(ui.GetFileName("TO"), ui.GetOutputAttribute("TO"),
Cube *ocube = m.SetOutputCube(ui.GetCubeName("TO"), ui.GetOutputAttribute("TO"),
mcube->sampleCount(), mcube->lineCount(), mcube->bandCount());

// Set up the default reference band to the middle of the cube
Expand Down
8 changes: 4 additions & 4 deletions isis/src/base/apps/cam2map/cam2map.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ namespace Isis {
if (inAtt.bands().size() != 0) {
icube.setVirtualBands(inAtt.bands());
}
icube.open(ui.GetFileName("FROM"));
icube.open(ui.GetCubeName("FROM"));

// Get the map projection file provided by the user
Pvl userMap;
Expand All @@ -52,7 +52,7 @@ namespace Isis {

// Make sure it is not the sky
if (incam->target()->isSky()) {
QString msg = "The image [" + ui.GetFileName("FROM") +
QString msg = "The image [" + ui.GetCubeName("FROM") +
"] is targeting the sky, use skymap instead.";
throw IException(IException::User, msg, _FILEINFO_);
}
Expand Down Expand Up @@ -218,7 +218,7 @@ namespace Isis {
}

else if (ui.GetString("LONSEAM") == "ERROR") {
QString msg = "The image [" + ui.GetFileName("FROM") + "] crosses the " +
QString msg = "The image [" + ui.GetCubeName("FROM") + "] crosses the " +
"longitude seam";
throw IException(IException::User, msg, _FILEINFO_);
}
Expand Down Expand Up @@ -256,7 +256,7 @@ namespace Isis {
PvlGroup cleanMapping = outmap->Mapping();

// Allocate the output cube and add the mapping labels
QString fname = ui.GetFileName("TO");
QString fname = ui.GetCubeName("TO");
Isis::CubeAttributeOutput &atts = ui.GetOutputAttribute("TO");
Cube *ocube = p.SetOutputCube(fname, atts, samples, lines, icube->bandCount());

Expand Down
4 changes: 2 additions & 2 deletions isis/src/base/apps/cam2map/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ void loadMapRes() {
//Helper function to get camera resolution.
void loadCameraRes() {
UserInterface &ui = Application::GetUserInterface();
QString file = ui.GetFileName("FROM");
QString file = ui.GetCubeName("FROM");

// Open the input cube, get the camera object, and the cam map projection
Cube c;
Expand Down Expand Up @@ -157,7 +157,7 @@ void loadMapRange() {
//Helper function to load camera range.
void loadCameraRange() {
UserInterface &ui = Application::GetUserInterface();
QString file = ui.GetFileName("FROM");
QString file = ui.GetCubeName("FROM");

// Get the map projection file provided by the user
Pvl userMap;
Expand Down
2 changes: 1 addition & 1 deletion isis/src/base/apps/caminfo/caminfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ namespace Isis{
cubeFile.setVirtualBands(inAtt.bands());
}

cubeFile.open(ui.GetFileName("FROM"), "r");
cubeFile.open(ui.GetCubeName("FROM"), "r");
caminfo(&cubeFile, ui);
}

Expand Down
2 changes: 1 addition & 1 deletion isis/src/base/apps/campt/campt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ namespace Isis{
void writePoints(const UserInterface &ui, QList<PvlGroup*> camPoints, Pvl *log);

void campt(UserInterface &ui, Pvl *log) {
Cube *cube = new Cube(ui.GetFileName("FROM"), "r");
Cube *cube = new Cube(ui.GetCubeName("FROM"), "r");
campt(cube, ui, log);
}

Expand Down
4 changes: 2 additions & 2 deletions isis/src/base/apps/camrange/camrange.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ using namespace Isis;
namespace Isis {

void camrange(UserInterface &ui, Pvl *log) {
Cube *cube = new Cube( ui.GetFileName("FROM"), "r");
Cube *cube = new Cube( ui.GetCubeName("FROM"), "r");
camrange(cube, ui, log);
}

Expand All @@ -32,7 +32,7 @@ namespace Isis {
cam->radii(radii);
Target *camTarget = cam->target();
PvlGroup target("Target");
target += PvlKeyword("From", ui.GetFileName("FROM"));
target += PvlKeyword("From", ui.GetCubeName("FROM"));
target += PvlKeyword("TargetName", camTarget->name());
target += PvlKeyword("RadiusA", toString(radii[0].meters()), "meters");
target += PvlKeyword("RadiusB", toString(radii[1].meters()), "meters");
Expand Down
2 changes: 1 addition & 1 deletion isis/src/base/apps/camstats/camstats.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ namespace Isis {
Process p;

CubeAttributeInput cai;
Cube *icube = p.SetInputCube(ui.GetFileName("FROM"), cai, ReadWrite);
Cube *icube = p.SetInputCube(ui.GetCubeName("FROM"), cai, ReadWrite);
camstats(icube, ui, log);

p.EndProcess();
Expand Down
2 changes: 1 addition & 1 deletion isis/src/base/apps/camtrim/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ void IsisMain() {
// Make sure the cube isn't projected (i.e. level 2). If it is, the user
// should be using maptrim instead of this program.
if (icube->hasGroup("Mapping")) {
IString msg = "Input cube [" + ui.GetFileName("FROM") + "] is level 2 "
IString msg = "Input cube [" + ui.GetCubeName("FROM") + "] is level 2 "
"(projected). This application is only designed to operate on level 1 "
"(non-projected) cubes. Please use maptrim instead";
throw IException(IException::User, msg, _FILEINFO_);
Expand Down
2 changes: 1 addition & 1 deletion isis/src/base/apps/cathist/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ void IsisMain() {

// Get user entered file name & mode
UserInterface &ui = Application::GetUserInterface();
FileName fromfile(ui.GetFileName("FROM"));
FileName fromfile(ui.GetCubeName("FROM"));
QString mode = ui.GetString("MODE");

FileName tofile;
Expand Down
2 changes: 1 addition & 1 deletion isis/src/base/apps/catlab/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ void IsisMain() {

// Get filename provided by the user
UserInterface &ui = Application::GetUserInterface();
QString file = ui.GetFileName("FROM");
QString file = ui.GetCubeName("FROM");

// Extract label from file
Pvl label(file);
Expand Down
2 changes: 1 addition & 1 deletion isis/src/base/apps/catoriglab/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ void IsisMain() {

// Get user entered file name & mode
UserInterface &ui = Application::GetUserInterface();
QString file = ui.GetFileName("FROM");
QString file = ui.GetCubeName("FROM");

Pvl fromLabel(file);
if ( fromLabel.hasObject("OriginalLabel") ) {
Expand Down
4 changes: 2 additions & 2 deletions isis/src/base/apps/center/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ void IsisMain() {
}
double sTrans = sMiddle - csamp;
double lTrans = lMiddle - cline;
QString params = "from=" + ui.GetFileName("FROM") +
" to=" + ui.GetFileName("TO") +
QString params = "from=" + ui.GetCubeName("FROM") +
" to=" + ui.GetCubeName("TO") +
" strans=" + toString(sTrans) +
" ltrans=" + toString(lTrans) +
" interp=" + ui.GetString("INTERP");
Expand Down
Loading

0 comments on commit be1fb81

Please sign in to comment.