Commit a151dcf3 authored by Summer Stapleton's avatar Summer Stapleton
Browse files

Merge branch 'dev' of github.com:USGS-Astrogeology/ISIS3 into dev

parents 15b4c7c3 fa759849
Loading
Loading
Loading
Loading
+65 −73
Original line number Diff line number Diff line
@@ -3,22 +3,22 @@
<application name="isis2std" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://isis.astrogeology.usgs.gov/Schemas/Application/application.xsd">

  <brief>
    Exports a cube to a PNG, BMP, GIF, TIFF, JPEG, or JPEG 2000
    Exports a cube to PNG, BMP, TIFF, JPEG, or JPEG 2000
  </brief>

  <description>
    <p>
      This program exports an ISIS cube to one of several popular standard image
      formats.  The current supported formats are BMP,  GIF, JPEG, JP2, PNG, and TIFF.  
      formats.  The current supported formats are BMP, JPEG, JP2, PNG, and TIFF.
    </p>
    <p>
      This program uses TrollTech's version of the Qt Library to export BMP, 
      GIF and JPEG formatted output images. For these format types, due to limitations of Qt, the
      input file size must not exceed 2 gigabytes and the only valid output bit type is 8BIT. 
      This program uses TrollTech's version of the Qt Library to export BMP
      and JPEG formatted output images. For these format types, due to limitations of Qt, the
      input file size must not exceed 2 gigabytes and the only valid output bit type is 8-bit.
    </p>
    <p>
      The JPEG2000 (JP2) and TIFF formats do not depend on the Qt library.  These formats do not
      have the 2 GB limitation for input files and the output bit type may be 8BIT, U16BIT or S16BIT.
      have the 2 GB limitation for input files and the output bit type may be 8-bit, U16-bit or S16-bit.
      For these formats, the writing routines output are streamed lines from the cube, and little
      of the image is held in memory at any one time, therefore increasing the processing speed to
      convert the file.  It is recommended that large images are exported to JP2  or TIFF format.
@@ -36,7 +36,7 @@
    <p>
      In addition, if the cube has Mapping labels, the program will produce a world file for use
      in Arc and/or other GIS packages.  The file will have an extension that uses the first and
      last letters for the image extention and a "w". For example, .tif produces a world file 
      last letters for the image extension and a "w". For example, .tif produces a world file
      extension of .tfw.
    </p>
    <p>
@@ -118,7 +118,10 @@
    <change name="Jeffrey Covington" date="2015-02-12">
      Changed default compression of TIFF format images to no compression. Added COMPRESSION parameter to
      choose the compression algorithm for TIFF format images. Fixes #1745
      
    </change>
    <change name="Kaitlyn Lee" date="2018-02-08">
      Removed the option to export as a GIF because Qt does not support GIF
      exports. Fixes #1667.
    </change>
  </history>
  <category>
@@ -149,7 +152,7 @@
        </brief>
        <description>
          Use this parameter to select the filename and band to export. For
          example, file.cub+5 will select band 5
          example, file.cub+5 will select band 5.
        </description>
        <filter>
          *.cub
@@ -164,7 +167,7 @@
        </brief>
        <description>
          Use this parameter to select the filename and band to export. For
          example, file.cub+5 will select band 5
          example, file.cub+5 will select band 5.
        </description>
        <filter>
          *.cub
@@ -179,7 +182,7 @@
        </brief>
        <description>
          Use this parameter to select the filename and band to export. For
          example, file.cub+5 will select band 5
          example, file.cub+5 will select band 5.
        </description>
        <filter>
          *.cub
@@ -194,7 +197,7 @@
        </brief>
        <description>
          Use this parameter to select the filename and band to export. For
          example, file.cub+5 will select band 5
          example, file.cub+5 will select band 5.
        </description>
        <filter>
          *.cub
@@ -209,7 +212,7 @@
        </brief>
        <description>
          Use this parameter to select the filename and band to export. For
          example, file.cub+5 will select band 5
          example, file.cub+5 will select band 5.
        </description>
        <filter>
          *.cub
@@ -303,13 +306,13 @@
        <brief>Format of output image</brief>
        <description>
          This parameter is used to select the output format.  It can be one of
          PNG, BMP, JPEG, TIF, GIF, or JP2.  Note that not all formats may be
          PNG, BMP, JPEG, TIF, or JP2.  Note that not all formats may be
          available.  It will depend on your installation of the Qt libraries.
          <p>
          In addition, if the cube has Mapping labels, the program will produce
          a world file for use in Arc and/or other GIS packages. The file will
          have an extension that uses the first and last letters for the image
          extention and a "w". For example, .tif produces a world file extension of .tfw.
          extension and a "w". For example, .tif produces a world file extension of .tfw.
          </p>
        </description>

@@ -336,17 +339,6 @@
              <item>COMPRESSION</item>
            </exclusions>
          </option>
          <option value="GIF">
            <brief>Output image will be GIF</brief>
            <description>
              The output image is in GIF (Graphics Interchange Format) format. The default 
              extension for this format is "gif."
            </description>
            <exclusions>
              <item>BITTYPE</item>
              <item>COMPRESSION</item>
            </exclusions>
          </option>
          <option value="TIFF">
            <brief>Output image will be TIFF</brief>
            <description>
@@ -400,7 +392,7 @@
        <brief>Bit type of output file</brief>
        <description>
          This parameter allows the userPackBits is also known as Macintosh RLE. to set the bit type of the output image.
          Some FORMAT values will only allow 8BIT outputs.
          Some FORMAT values will only allow 8-bit outputs.
          16 bit signed (-32767=black, 32768=white)
        </description>
        <list>
@@ -693,7 +685,7 @@
      </brief>
      <description>
        This example creates an output TIFF format file from 3 bands of an ISIS cube, designated
        red, green, and blue using a linear stretch and 8 bit output type. A histogram is created 
        red, green, and blue using a linear stretch and 8-bit output type. A histogram is created
        from the input values.  Using this histogram, we determine the minimum value to be any DN
        in the bottom 0.2% of the data. These DNs will be set to black in the output. Similarly,
        the maximum value is any DN in the top 99.8% of the data and these DNs will be set to white.
@@ -715,7 +707,7 @@
            <description>
              This image show the graphical user interface for this program.
            </description>
            <thumbnail height="200" width="142" src="assets/thumbs/isis2stdGUI.jpg" caption="isis2std with RGB input and 8BIT output"/>
            <thumbnail height="200" width="142" src="assets/thumbs/isis2stdGUI.jpg" caption="isis2std with RGB input and 8-bit output"/>
          </image>
        </guiInterface>
      </guiInterfaces>
@@ -768,7 +760,7 @@
            Output image.
          </brief>
          <description>
            The 8 bit output image, in TIFF format, created using the input red, green, and blue channels.
            The 8-bit output image, in TIFF format, created using the input red, green, and blue channels.
          </description>
          <thumbnail height="150" width="200" src="assets/thumbs/rgbTIFFoutput.jpg" caption="The color output image."/>
          <parameterName>TO</parameterName>
+19 −21
Original line number Diff line number Diff line
@@ -117,6 +117,10 @@ QMap<QString, FileName> sortFramelets(FileName frameletListFile) {
 *
 * @param frameletList A list of the framelet cubes to stitch together
 * @param frameFileName The file name of the output frame cube
 *
 * @internal
 *   @history 2018-02-15 Adam Goins - Modified stitchFrame to store the Archive
 *                           group for ingested framelets. Fixes #5333.
 */
void stitchFrame(QList<FileName> frameletList, FileName frameFileName) {
  // Create the frame cube based on the first framelet cube
@@ -130,22 +134,13 @@ void stitchFrame(QList<FileName> frameletList, FileName frameFileName) {
  frameCube.create( frameFileName.expanded() );

  // Setup the label for the new cube
  PvlGroup archGroup = firstFrameletCube.group("Archive");
  PvlGroup kernGroup = firstFrameletCube.group("Kernels");
  PvlGroup instGroup = firstFrameletCube.group("Instrument");
  PvlGroup bandBinGroup("BandBin");
  if ( instGroup.hasKeyword("Filter") ) {
    instGroup["Filter"].setValue("FULLCCD");
  }
  if ( archGroup.hasKeyword("ProductId") ) {
    archGroup.deleteKeyword("ProductId");
  }
  if ( archGroup.hasKeyword("FileName") ) {
    archGroup.deleteKeyword("FileName");
  }
  if ( archGroup.hasKeyword("Window_Count") ) {
    archGroup.deleteKeyword("Window_Count");
  }

  bandBinGroup += PvlKeyword("FilterName", "FULLCCD");

  // Setup Stitch group keywords
@@ -203,6 +198,10 @@ void stitchFrame(QList<FileName> frameletList, FileName frameFileName) {
    stitchGroup["FilterWidths"]    += frameletBandBin["Width"];
    stitchGroup["FilterIkCodes"]   += frameletBandBin["NaifIkCode"];

    PvlGroup archiveGroup = frameletCube->group("Archive");
    archiveGroup.setName("Archive" + QString(frameletBandBin["FilterName"]));
    frameCube.putGroup(archiveGroup);

    AlphaCube frameletAlphaCube(*frameletCube);
    stitchGroup["FilterStartSamples"] += toString(frameletAlphaCube.AlphaSample(0.0));
    stitchGroup["FilterSamples"]      += toString(frameletAlphaCube.BetaSamples());
@@ -226,7 +225,6 @@ void stitchFrame(QList<FileName> frameletList, FileName frameFileName) {
  // Finalize the frame cube label
  frameCube.putGroup(instGroup);
  frameCube.putGroup(kernGroup);
  frameCube.putGroup(archGroup);
  frameCube.putGroup(bandBinGroup);
  frameCube.putGroup(stitchGroup);
}
+3 −0
Original line number Diff line number Diff line
@@ -26,6 +26,9 @@
      Backward Compatibility Issue: Changed name from stitch to tgocassisstitch and
      changed output parameter name "TO" to "OUTPUTPREFIX."
    </change>
    <change name="Adam Goins" date="2018-02-15">
      Modified stitchFrame to store the Archive group for ingested framelets. Fixes #5333.
    </change>
  </history>

  <category>
+53 −27
Original line number Diff line number Diff line
@@ -30,6 +30,10 @@ using namespace Isis;
 *
 * @internal
 *   @history 2017-09-15 Kristin Berry - Original Version
 *
 *   @history 2018-02-15 Adam Goins - Modified unstitch to parse the archive group
 *                           from the stitched frame. Changed "Name" to "FilterName"
 *                           in bandBin group.
 */
struct FilterInfo : public PushFrameCameraCcdLayout::FrameletInfo {
  FilterInfo() : FrameletInfo(), m_wavelength(0), m_width(0) { }
@@ -75,13 +79,14 @@ void IsisMain() {
  PvlKeyword filterLines = inputLabel->findKeyword("FilterLines", PvlObject::Traverse);
  PvlKeyword filterWavelength = inputLabel->findKeyword("FilterCenters", PvlObject::Traverse);
  PvlKeyword filterWidth = inputLabel->findKeyword("FilterWidths", PvlObject::Traverse);

  for (int i = 0; i < filterKey.size(); i++) {
    g_frameletInfoList.append(FilterInfo(filterIkCodes[i].toInt(),
                              filterKey[i],
                              filterStartSamples[i].toInt(),
                              filterStartSamples[i].toDouble(),
                              filterStartLines[i].toDouble(),
                              filterSamples[i].toInt(),
                              filterLines[i].toInt(),
                              filterSamples[i].toDouble(),
                              filterLines[i].toDouble(),
                              filterWavelength[i].toDouble(),
                              filterWidth[i].toDouble()));
  }
@@ -151,16 +156,29 @@ void IsisMain() {
  for (int i = 0; i < g_outputCubes.size(); i++) {
    progress.CheckStatus();
    for (int j = 0; j < inputLabel->findObject("IsisCube").groups(); j++) {
      g_outputCubes[i]->putGroup(inputLabel->findObject("IsisCube").group(j));
      PvlGroup group = inputLabel->findObject("IsisCube").group(j);

      // The stitched frame has ArchiveRED, ArchiveNIR, ArchivePAN, and ArchiveBLU.
      // We won't add the archive group unless
      if ( group.name().contains("Archive") &&
           group.name() != "Archive" + g_frameletInfoList[i].m_filterName ) {
             continue;
           }

      g_outputCubes[i]->putGroup(group);

    }
    // Update the labels
    Pvl *frameletLabel = g_outputCubes[i]->label();
    frameletLabel->findGroup("Instrument", PvlObject::Traverse).addKeyword(PvlKeyword("Filter",
                                          g_frameletInfoList[i].m_filterName), PvlObject::Replace);

    // Sets the name from ArchiveRED (or NIR, BLU, PAN) to just "Archive" in the unstitched cube.
    frameletLabel->findGroup("Archive" + g_frameletInfoList[i].m_filterName, PvlObject::Traverse).setName("Archive");

    PvlGroup &bandBin = frameletLabel->findGroup("BandBin", PvlObject::Traverse);

    bandBin.addKeyword(PvlKeyword("Name", g_frameletInfoList[i].m_filterName), 
    bandBin.addKeyword(PvlKeyword("FilterName", g_frameletInfoList[i].m_filterName),
                                                PvlObject::Replace);
    bandBin.addKeyword(PvlKeyword("Center", toString(g_frameletInfoList[i].m_wavelength)));
    bandBin.addKeyword(PvlKeyword("Width", toString(g_frameletInfoList[i].m_width)));
@@ -209,21 +227,29 @@ void IsisMain() {
 * Separates each of the framelets of the input cube into their own separate output cube.
 *
 * @param in A reference to the input Buffer to process.
 * @internal
 *   @history 2018-02-09 Adam Goins - Modified the second operand of the if() statement
 *                           from in.Line() < [...] to inLine() <= [...] to write all lines
 *                           up to and including the last line. Fixes an error where the last lines
 *                           written would be a line of null pixel DN's.
 *
 *   @history 2018-02-14 Adam Goins - Modified the copying of the data in the buffer to include
 *                           the sample offset (m_startSample) for a cube.
 */
void unstitchFullFrame(Buffer &in) {
  for (int i=0; i < g_frameletInfoList.size(); i++) {

    if (in.Line() >= g_frameletInfoList[i].m_startLine
        && in.Line() < (g_frameletInfoList[i].m_startLine + g_frameletInfoList[i].m_lines)) {
        && in.Line() <= (g_frameletInfoList[i].m_startLine + g_frameletInfoList[i].m_lines)) {
      int outputCubeLineNumber = (in.Line()-1) % g_frameletInfoList[i].m_startLine + 1;
      LineManager mgr(*g_outputCubes[i]);
      mgr.SetLine(outputCubeLineNumber, 1);

      for (int j = 0; j < mgr.size(); j++) {
        mgr[j] = in[j];
        mgr[j] = in[j + g_frameletInfoList[i].m_startSample];
      }
      g_outputCubes[i]->write(mgr);
      return;
    }
  }
}
+16 −9
Original line number Diff line number Diff line
@@ -23,6 +23,13 @@
      but containing other '.'s  in the string to not strip off everything after the last period. For example, if the
      user inputs CAS-MCO-2016-11-22T16:10:43.505 as the OUTPUTPREFIX, now the 505 will now be retained.
    </change>
    <change name="Adam Goins" date="2018-02-15">
      Updated the application to include the sample offsets when processing lines from the stitched
      frame into output cubes.
    </change>
    <change name="Adam Goins" date="2018-02-15">
     Modified unstitchFrame to parse the Archive group for each framelet.
   </change>

  </history>

Loading