Skip to content

Commit

Permalink
Modify framestitch to preserve tables and kernels
Browse files Browse the repository at this point in the history
  • Loading branch information
jessemapel committed Jun 22, 2022
1 parent 3053c2e commit 95b1fcf
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 13 deletions.
18 changes: 8 additions & 10 deletions isis/src/base/apps/framestitch/framestitch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ namespace Isis {
*/
void framestitch(UserInterface &ui) {
ProcessByBrick process;
process.PropagatePolygons(false);

// It is very important that the odd cube gets added first as later on
// we'll use frameNumber % 2 to index the input cube vector
Expand Down Expand Up @@ -151,12 +152,12 @@ namespace Isis {
}

int reducedFrameHeight = frameHeight - numLinesOverlap;

QString outCubeFile = ui.GetCubeName("TO");
Cube *outCube = process.SetOutputCube(
outCubeFile, CubeAttributeOutput(outCubeFile),
evenCube->sampleCount(), numFrames * reducedFrameHeight, evenCube->bandCount());

// If there's an even number of frames and the inputs are flipped, we have to
// swap even and odd because the first frame in the even cube is valid and the
// first frame in the odd cube is now all NULL.
Expand All @@ -172,8 +173,6 @@ namespace Isis {

// Processing setup
process.SetBrickSize(evenCube->sampleCount(), frameHeight, evenCube->bandCount());
process.PropagateTables(false);
process.PropagatePolygons(false);

// Put together the frames from the two input cubes. Note that we
// wipe a total of numLinesOverlap lines from each frame as we do
Expand All @@ -182,27 +181,26 @@ namespace Isis {

Brick buff(evenCube->sampleCount(), reducedFrameHeight, evenCube->bandCount(),
evenCube->pixelType());

// Set reading position
buff.SetBasePosition(1, frame * frameHeight + numLinesOverlap/2 + 1, 1);

int inIndex = frame % 2;
if (swapInputCubes)
inIndex = 1 - inIndex;

if (inIndex == 0)
if (inIndex == 0)
oddCube->read(buff);
else
evenCube->read(buff);

// Set writing position
buff.SetBasePosition(1, frame * reducedFrameHeight + 1, 1);

outCube->write(buff);
}

// Update the output label
outCube->deleteGroup("Kernels");
if (!outCube->hasGroup("Instrument")) {
outCube->putGroup(PvlGroup("Instrument"));
}
Expand Down Expand Up @@ -243,9 +241,9 @@ namespace Isis {
if (!outInst.hasKeyword("NumLinesOverlap"))
outInst.addKeyword(PvlKeyword("NumLinesOverlap"));
outInst["numLinesOverlap"].setValue(toString(numLinesOverlap));

process.EndProcess();

return;
}

Expand Down
6 changes: 3 additions & 3 deletions isis/src/base/apps/framestitch/framestitch.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
data as the first several rows of the next frame, reduntant
lines can be eliminated with the num_lines_overlap parameter.
This program is designed to be run before processing the
data in another software package as it removes the camera
information from the output <def link="Cube">cube</def>.
data in another software package and the output cube will not
produce a valid camera model for further processing in ISIS.
</p>
<p>
When many push frame images are ingested into ISIS, their frames are separated
Expand Down Expand Up @@ -149,7 +149,7 @@
</p>
<p>
If not entered, the program will assume the value 0. A value
of 2 or 4 works reasonably for LRO WAC images.
of 2 or 4 works reasonably for LRO WAC images.
</p>
</description>
<internalDefault>0</internalDefault>
Expand Down
1 change: 1 addition & 0 deletions isis/tests/FunctionalTestsFrameStitch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include "LineManager.h"
#include "SpecialPixel.h"
#include "Statistics.h"
#include "Table.h"

#include "TestUtilities.h"
#include "Fixtures.h"
Expand Down

0 comments on commit 95b1fcf

Please sign in to comment.