-
Notifications
You must be signed in to change notification settings - Fork 171
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
gllssi2isis Original Label Fix #3226
Merged
+45
−61
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
d415371
Allowed writting of residuals when value is zero to controlnet pvl
acpaquette d90e56a
Merge branch 'dev' of https://github.com/USGS-Astrogeology/ISIS3 into…
acpaquette 3a6975f
Updated ControlNetVersioner unit test
acpaquette da361fc
Fixed pvl labels original pvl labels not being written to the resulti…
acpaquette aabdb80
Merge branch 'dev' of https://github.com/USGS-Astrogeology/ISIS3 into…
acpaquette fd7ab53
Updated docstrings and history for updated methods
acpaquette cc1ba4d
Removed the need to set the output cube pixel type
acpaquette a265340
Reverted proceeimport changes
acpaquette 415e661
Set the dimensions in the process before processing
acpaquette 3be6073
Added missing 1 in a history record
acpaquette d648113
Reverted and applied a more appropriate fix
acpaquette 7c7a93f
Used outfile obtained at the beginning of the program
acpaquette a6ea2c5
Added history comment to app xml
acpaquette File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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 |
---|---|---|
|
@@ -5,6 +5,7 @@ | |
#include "IException.h" | ||
#include "iTime.h" | ||
#include "ProcessImportPds.h" | ||
#include "OriginalLabel.h" | ||
#include "UserInterface.h" | ||
|
||
#include <cstdio> | ||
|
@@ -14,9 +15,6 @@ | |
#include <QFile> | ||
|
||
|
||
|
||
|
||
|
||
using namespace std; | ||
using namespace Isis; | ||
bool summed; | ||
|
@@ -28,25 +26,19 @@ void translateLabels(Pvl &pdsLabel, Cube *ocube); | |
void fixPvl(QString fileName); | ||
|
||
void IsisMain() { | ||
|
||
//initialize globals | ||
summed = false; | ||
summedOutput = NULL; | ||
// Grab the file to import | ||
ProcessImportPds p; | ||
UserInterface &ui = Application::GetUserInterface(); | ||
FileName inFile = ui.GetFileName("FROM"); | ||
FileName out = ui.GetFileName("TO"); | ||
|
||
|
||
FileName outFile = ui.GetFileName("TO"); | ||
|
||
// Apply a fix to the gallileo pds labels so they can be read | ||
fixPvl(inFile.toString()); | ||
|
||
|
||
|
||
|
||
// Make sure it is a Galileo SSI image | ||
|
||
Pvl lab(inFile.expanded()); | ||
|
||
//Checks if in file is rdr | ||
|
@@ -102,35 +94,34 @@ void IsisMain() { | |
Pvl pdsLabel; | ||
p.SetPdsFile(inFile.expanded(), "", pdsLabel); | ||
|
||
//Set up the output file | ||
Cube *ocube; | ||
|
||
// If summed handle the image similarly to pds2isis | ||
// with an extra translation step | ||
if (!summed) { | ||
ocube = p.SetOutputCube("TO"); | ||
Cube *ocube = p.SetOutputCube("TO"); | ||
p.StartProcess(); | ||
translateLabels(pdsLabel, ocube); | ||
p.EndProcess(); | ||
} | ||
else { | ||
// Otherwise the dimensions of the cube need to be cut in half before | ||
// processsing. Since we didn't set the output cube we need to take care | ||
// of writting the original label ourselves | ||
summedOutput = new Cube(); | ||
summedOutput->setDimensions(p.Samples() / 2, p.Lines() / 2, p.Bands()); | ||
summedOutput->setPixelType(p.PixelType()); | ||
summedOutput->create(ui.GetFileName("TO")); | ||
p.StartProcess(translateData); | ||
ocube = summedOutput; | ||
} | ||
summedOutput->create(outFile.expanded()); | ||
|
||
translateLabels(pdsLabel, ocube); | ||
p.EndProcess(); | ||
p.StartProcess(translateData); | ||
translateLabels(pdsLabel, summedOutput); | ||
|
||
if (summed) { | ||
OriginalLabel ol(Pvl(inFile.expanded())); | ||
summedOutput->write(ol); | ||
summedOutput->close(); | ||
delete summedOutput; | ||
} | ||
|
||
return; | ||
} | ||
|
||
|
||
|
||
/** | ||
* This fixes a problem with some of the Pvl files where a comment | ||
* was left open. If the file has this error, the comment is closed | ||
|
@@ -141,9 +132,6 @@ void IsisMain() { | |
* being checked | ||
* | ||
*/ | ||
|
||
|
||
|
||
void fixPvl(QString fileName){ | ||
|
||
QFile pvlFile; | ||
|
@@ -174,15 +162,7 @@ void fixPvl(QString fileName){ | |
|
||
} | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
void translateData(Buffer &inData) { | ||
void translateData(Isis::Buffer &inData) { | ||
summedOutput->write(inData); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could this be replaced with ocube to get rid of summedOutput altogether? |
||
} | ||
|
||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this used anywhere?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will make a change to use it