diff --git a/isis/src/cassini/apps/ciss2isis/ciss2isis.cpp b/isis/src/cassini/apps/ciss2isis/ciss2isis.cpp index 4a083b040e..f7996c9a8a 100644 --- a/isis/src/cassini/apps/ciss2isis/ciss2isis.cpp +++ b/isis/src/cassini/apps/ciss2isis/ciss2isis.cpp @@ -77,6 +77,7 @@ namespace Isis{ //SET PROGRESS TEXT, VALID MAXIMUM PIXEL VALUE, AND CREATE STRETCH IF NEEDED if(dataConversionType != "Table") { //Conversion Type is 12Bit or 8LSB, only save off overclocked pixels + validMax = 255; if(dataConversionType == "12Bit") { p.Progress()->SetText("Image was 12 bit. No conversion needed. \nSaving line prefix data..."); } @@ -85,6 +86,7 @@ namespace Isis{ } } else { //if ConversionType == Table, Use LUT to create stretch pairs for conversion + validMax = 4095; CreateStretchPairs(); // Pvl outputLabels; Pvl *outputLabel = ocube->label(); @@ -96,6 +98,14 @@ namespace Isis{ p.Progress()->SetText("Image was converted using 12-to-8 bit table. \nConverting prefix pixels back to 12 bit and saving line prefix data..."); } + Pvl inputLabel(in.expanded()); + if (inputLabel.hasKeyword("VALID_MAXIMUM")) { + PvlKeyword labelValidMax = inputLabel.findKeyword("VALID_MAXIMUM"); + if (labelValidMax[1] != "UNK") { + validMax = toInt(labelValidMax[1]); + } + } + p.StartProcess(); // Write line prefix data to table in output cube @@ -294,7 +304,6 @@ namespace Isis{ // initialize global variables dataConversionType = (QString) inst.findKeyword("DataConversionType"); - validMax = inputLabel.findKeyword("ValidMaximum")[1].toInt(); sumMode = inst.findKeyword("SummingMode"); compressionType = (QString) inst.findKeyword("CompressionType"); IString fsw((QString) inst.findKeyword("FlightSoftwareVersionId"));