Commit 96f25004 authored by Jeannie Backer's avatar Jeannie Backer
Browse files

Merged ProcessImport, ProcessImportFits, SpecialPixel changes from prior...

Merged ProcessImport, ProcessImportFits, SpecialPixel changes from prior branch to allow import of 4byte SignedInteger images.

git-svn-id: http://subversion.wr.usgs.gov/repos/prog/isis3/branches/osirisrex_2016-04-19@6698 41f8697f-d340-4b68-9986-7bafba869bb8
parent 08f1b1cf
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -176,7 +176,6 @@ Group = DataDirectory
  Near         = $ISIS3DATA/near
  NewHorizons  = $ISIS3DATA/newhorizons
  Odyssey      = $ISIS3DATA/odyssey
  OsirisRex    = $ISIS3DATA/../datalocal/osirisrex
  Rolo         = $ISIS3DATA/rolo
  Rosetta      = $ISIS3DATA/rosetta
  Smart1       = $ISIS3DATA/smart1
+191 −80
Original line number Diff line number Diff line
@@ -41,6 +41,9 @@
#include "PvlTokenizer.h"
#include "SpecialPixel.h"


//tjw
//VAX Conversion
#define EXPONENT_MASK ((char) 0x7F)


@@ -83,6 +86,7 @@ namespace Isis {
    p_saveFileTrailer = false;
    p_vax_convert = false;


    p_fileHeader = NULL;
    p_fileTrailer = NULL;
  }
@@ -119,6 +123,9 @@ namespace Isis {
    }
  }

//tjw:



  /**
   * Determines if the VAX encoded pixel value is special or not
@@ -129,8 +136,12 @@ namespace Isis {
   *         type matches that pointed to by vax.  Returns false
   *         otherwise.
   */


  bool ProcessImport::IsVAXSpecial(unsigned int *vax, VAXSpecialPixel pix){



     unsigned int VAX_NULL = 0xFFFFFFFF;
     unsigned int VAX_MIN  = 0xFFEFFFFF;
     unsigned int VAX_LRS  = 0xFFFEFFFF;
@@ -143,38 +154,65 @@ namespace Isis {
     memcpy(&x,vax,sizeof(unsigned int));

     switch(pix) {

        case VAX_NULL4:
            n=memcmp(&VAX_NULL,&x,sizeof(unsigned int));
        if (n == 0) return true;
            if (n==0){    
                return true;

      }
        break;

        case VAX_LRS4:
            n=memcmp(&VAX_LRS,&x,sizeof(unsigned int));
        if (n == 0) return true;
            if (n==0){

                return true;
      }
        break;

        case VAX_LIS4:
            n=memcmp(&VAX_LIS,&x,sizeof(unsigned int));
        if (n == 0) return true;
            if (n==0) {

                return true;
      }
        break;

        case VAX_HIS4:
            n=memcmp(&VAX_HIS,&x,sizeof(unsigned int));
        if (n == 0) return true;
            if (n==0){

                return true;
      }
        break;

        case VAX_HRS4:
            n=memcmp(&VAX_HRS,&x,sizeof(unsigned int));
        if (n == 0) return true;
            if (n==0){

              return true;
      }
        break;

        case VAX_MIN4:
            n=memcmp(&VAX_MIN,&x,sizeof(unsigned int));
        if (n == 0) return true;
        if (n==0){

            return true;
        }
        break;

        default:
            return false;

      }

    return false;

 }

  //tjw

  /**
   * Conversion routine which translates VAX_REAL to IEEE_REAL
@@ -182,8 +220,11 @@ namespace Isis {
   * @param ibuf Memory buffer of input data to be converted
   * @return double the converted value
   */

  double ProcessImport::VAXConversion(void *ibuf) {



       float result;
       double dresult;
       bool swap_bytes = false;
@@ -195,14 +236,19 @@ namespace Isis {
       Isis::ByteOrder in_order = p_byteOrder;
       Isis::ByteOrder out_order;


       unsigned int *oli, *ili;   //4-byte buffer io ptrs
       unsigned short *osi;       //2-byte buffer io ptrs
       char *oci;                 //1-byte buffer io ptrs

       if ( Isis::IsLsb() ) {

           exp_byte  = 1;
           out_order = Isis::Lsb;

       }

       //Byte order = MSB
       else {
           exp_byte = 0;
           out_order = Isis::Msb;
@@ -210,37 +256,33 @@ namespace Isis {

       if (in_order != out_order) {
           swap_bytes =true;

       }

       oli = (unsigned int * ) ibuf;
       ili = (unsigned int * ) ibuf;

    if (IsVAXSpecial(oli, ProcessImport::VAX_NULL4) ) {
       if (IsVAXSpecial(oli,ProcessImport::VAX_NULL4) )
         return Isis::NULL8;
    }

    if (IsVAXSpecial(oli, ProcessImport::VAX_LIS4) ) {
       if (IsVAXSpecial(oli,ProcessImport::VAX_LIS4) )
         return Isis::LOW_INSTR_SAT8;
    }

    if (IsVAXSpecial(oli, ProcessImport::VAX_LRS4) ) {
       if (IsVAXSpecial(oli,ProcessImport::VAX_LRS4) )
         return Isis::LOW_REPR_SAT8;
    }

    if (IsVAXSpecial(oli, ProcessImport::VAX_HIS4) ) {
       if (IsVAXSpecial(oli,ProcessImport::VAX_HIS4) )
         return Isis::HIGH_INSTR_SAT8;
    }

    if (IsVAXSpecial(oli, ProcessImport::VAX_HRS4) ) {
       if (IsVAXSpecial(oli,ProcessImport::VAX_HRS4) )
         return Isis::HIGH_REPR_SAT8;
    }

    if (IsVAXSpecial(oli, ProcessImport::VAX_MIN4) ) {
       if (IsVAXSpecial(oli,ProcessImport::VAX_MIN4) )
         return Isis::VALID_MIN8;
    }

       //test for word swapping
      if (swap_words) {

          *oli = (*ili <<16) | (*ili >> 16);
      }

@@ -256,9 +298,8 @@ namespace Isis {
       //Isolate the exponent and do the conversion
       oci = (char *) &osi[exp_word];

    if ( (oci[exp_byte] & EXPONENT_MASK) != exp_mask) {
       if ( (oci[exp_byte] & EXPONENT_MASK) != exp_mask)
           oci[exp_byte] += exp_adjust;
    }

       result = *(float *)oli;
       dresult = static_cast<double>(result);
@@ -267,6 +308,9 @@ namespace Isis {
   }





  /**
   * Sets the pixel type of the input file.
   *
@@ -278,8 +322,7 @@ namespace Isis {
  void ProcessImport::SetPixelType(const Isis::PixelType type) {

    if ((type == Isis::Double) || (type == Isis::Real) || (type == Isis::SignedWord) ||
        (type == Isis::UnsignedWord) || (type == Isis::UnsignedByte) ||
        (type == Isis::SignedInteger)) {
        (type == Isis::UnsignedWord) || (type == Isis::UnsignedByte)) {
      p_pixelType = type;
    }
    else {
@@ -287,7 +330,7 @@ namespace Isis {
                   Isis::PixelTypeName(type) + "]";
      throw IException(IException::Programmer, msg, _FILEINFO_);
    }
  }
  };

  void ProcessImport::SetSuffixPixelType(const Isis::PixelType type) {

@@ -300,7 +343,7 @@ namespace Isis {
                   Isis::PixelTypeName(type) + "]";
      throw IException(IException::Programmer, msg, _FILEINFO_);
    }
  }
  };


  /**
@@ -317,16 +360,20 @@ namespace Isis {
   */
  void ProcessImport::SetDimensions(const int ns, const int nl, const int nb) {
    if (ns > 0 && nl > 0 && nb > 0) {


      p_ns = ns;
      p_nl = nl;
      p_nb = nb;


    }
    else {
      QString msg = "Illegal dimension [" + toString(ns) + ", " +
                   toString(nl) + ", " + toString(nb) + "]";
      throw IException(IException::Programmer, msg, _FILEINFO_);
    }
  }
  };


  /**
@@ -337,7 +384,7 @@ namespace Isis {
   */
  void ProcessImport::SetByteOrder(const Isis::ByteOrder order) {
    p_byteOrder = order;
  }
  };


  /**
@@ -363,12 +410,13 @@ namespace Isis {
  void ProcessImport::SetFileHeaderBytes(const int bytes) {
    if (bytes >= 0) {
      p_fileHeaderBytes = bytes;

    }
    else {
      QString msg = "Illegal file header size [" + toString(bytes) + "]";
      throw IException(IException::Programmer, msg, _FILEINFO_);
    }
  }
  };


  /**
@@ -398,7 +446,7 @@ namespace Isis {
      QString msg = "Illegal file trailer size [" + toString(bytes) + "]";
      throw IException(IException::Programmer, msg, _FILEINFO_);
    }
  }
  };


  /**
@@ -421,18 +469,26 @@ namespace Isis {
   */
  void ProcessImport::SetDataHeaderBytes(const int bytes) {
    if (bytes >= 0) {

      p_dataHeaderBytes = bytes;

    }
    else {
      QString msg = "Illegal data header size [" + toString(bytes) + "]";
      throw IException(IException::Programmer, msg, _FILEINFO_);
    }
  }
  };


  void ProcessImport::SetSuffixOffset(int samples,int lines, int coreBands,int itemBytes){


        p_suffixData = samples*lines*coreBands*itemBytes;
  }




  };


  /**
@@ -463,7 +519,7 @@ namespace Isis {
      QString msg = "Illegal data trailer size [" + toString(bytes) + "]";
      throw IException(IException::Programmer, msg, _FILEINFO_);
    }
  }
  };


  /**
@@ -488,12 +544,13 @@ namespace Isis {

    if (bytes >= 0) {
      p_dataPreBytes = bytes;

    }
    else {
      QString msg = "Illegal data prefix size [" + toString(bytes) + "]";
      throw IException(IException::Programmer, msg, _FILEINFO_);
    }
  }
  };


  /**
@@ -518,12 +575,13 @@ namespace Isis {

    if (bytes >= 0) {
      p_dataPostBytes = bytes;

    }
    else {
      QString msg = "Illegal data suffix size [" + toString(bytes) + "]";
      throw IException(IException::Programmer, msg, _FILEINFO_);
    }
  }
  };


  /**
@@ -550,7 +608,7 @@ namespace Isis {
      throw IException(IException::Programmer, msg, _FILEINFO_);
    }
    p_saveFileHeader = true;
  }
  };


  /**
@@ -578,7 +636,7 @@ namespace Isis {
                                _FILEINFO_);
    }
    p_saveFileTrailer = true;
  }
  };


  /**
@@ -607,7 +665,7 @@ namespace Isis {
                                _FILEINFO_);
    }
    p_saveDataHeader = true;
  }
  };


  /**
@@ -636,7 +694,7 @@ namespace Isis {
                                _FILEINFO_);
    }
    p_saveDataTrailer = true;
  }
  };


  /**
@@ -664,7 +722,7 @@ namespace Isis {
                                _FILEINFO_);
    }
    p_saveDataPre = true;
  }
  };


  /**
@@ -693,7 +751,7 @@ namespace Isis {
                                _FILEINFO_);
    }
    p_saveDataPost = true;
  }
  };


  /**
@@ -770,7 +828,7 @@ namespace Isis {
    }
    QString msg = "File header was not saved.  Use SaveFileHeader().";
    throw IException(IException::Programmer, msg, _FILEINFO_);
  }
  };


  /**
@@ -796,7 +854,7 @@ namespace Isis {
    }
    QString msg = "File trailer was not saved.  Use SaveFileTrailer()";
    throw IException(IException::Programmer, msg, _FILEINFO_);
  }
  };


  /**
@@ -824,7 +882,7 @@ namespace Isis {
    }
    QString msg = "Data header was not saved.  Use SaveDataHeader()";
    throw IException(IException::Programmer, msg, _FILEINFO_);
  }
  };


  /**
@@ -852,7 +910,7 @@ namespace Isis {
    }
    QString msg = "Data trailer was not saved.  Use SaveDataTrailer()";
    throw IException(IException::Programmer, msg, _FILEINFO_);
  }
  };


  /**
@@ -880,7 +938,7 @@ namespace Isis {
    }
    QString msg = "Data prefix was not saved.  Use SaveDataPrefix()";
    throw IException(IException::Programmer, msg, _FILEINFO_);
  }
  };


  /**
@@ -908,7 +966,7 @@ namespace Isis {
    }
    QString msg = "Data suffix was not saved.  Use SaveDataSuffix()";
    throw IException(IException::Programmer, msg, _FILEINFO_);
  }
  };


  /**
@@ -920,9 +978,11 @@ namespace Isis {
   */
  void ProcessImport::SetOrganization(const ProcessImport::Interleave org) {
    p_organization = org;
  }

  };


  //tjw:
  /**
   * Sets the VAX flag of the input cube.  If true, then the core pixel type of
   * the input cube is VAX, and VAX conversion routines need to be run to
@@ -930,9 +990,15 @@ namespace Isis {
   *
   * @param vax_convert Flag indicating whether or not to run VAX conersion methods
   */



  void ProcessImport::SetVAXConvert(const bool vax_convert){


      p_vax_convert = vax_convert;
  }

  };


  /**
@@ -941,7 +1007,7 @@ namespace Isis {
   */
  ProcessImport::Interleave ProcessImport::Organization() const {
    return p_organization;
  }
  };


  /**
@@ -952,7 +1018,7 @@ namespace Isis {
  void ProcessImport::SetBase(const double base) {
    p_base.clear();
    p_base.push_back(base);
  }
  };


  /**
@@ -962,7 +1028,7 @@ namespace Isis {
   */
  void ProcessImport::SetBase(const std::vector<double> base) {
    p_base = base;
  }
  };


  /**
@@ -973,7 +1039,7 @@ namespace Isis {
  void ProcessImport::SetMultiplier(const double mult) {
    p_mult.clear();
    p_mult.push_back(mult);
  }
  };


  /**
@@ -983,7 +1049,7 @@ namespace Isis {
   */
  void ProcessImport::SetMultiplier(const std::vector<double> mult) {
    p_mult = mult;
  }
  };


  /**
@@ -1012,7 +1078,7 @@ namespace Isis {
    SetLIS(lis, lis);
    SetHRS(hrs, hrs);
    SetHIS(his, his);
  }
  };


  /**
@@ -1222,10 +1288,6 @@ namespace Isis {
        min = Isis::VALID_MIN4;
        max = Isis::VALID_MAX4;
      }
      else if (p_pixelType == Isis::SignedInteger) {
        min = Isis::IVALID_MIN4;
        max = Isis::IVALID_MAX4;
      }
      else if (p_pixelType == Isis::SignedWord) {
        min = Isis::VALID_MIN2 * p_mult[0] + p_base[0];
        max = Isis::VALID_MAX2 * p_mult[0] + p_base[0];
@@ -1251,8 +1313,7 @@ namespace Isis {
      if ((p_base.size() > 1) || (p_mult.size() > 1)) {
        att.setPixelType(Isis::Real);
      }
      else if (p_pixelType == Isis::UnsignedWord || p_pixelType == Isis::Double ||
               p_pixelType == Isis::SignedInteger) {
      else if (p_pixelType == Isis::UnsignedWord || p_pixelType == Isis::Double) {
        att.setPixelType(Isis::Real);
      }
      else {
@@ -1346,6 +1407,8 @@ namespace Isis {
   *             Position[]. Byte count[]"
   */
  void ProcessImport::ProcessBsq(void funct(Isis::Buffer &out)) {


   // Figure out the number of bytes to read for a single line
    int readBytes = Isis::SizeOf(p_pixelType);
    readBytes = readBytes * p_ns;
@@ -1368,6 +1431,9 @@ namespace Isis {

    // Handle the file header
    streampos pos = fin.tellg();
    //tjw


    if (p_saveFileHeader) {
      p_fileHeader = new char[p_fileHeaderBytes];
      fin.read(p_fileHeader, p_fileHeaderBytes);
@@ -1413,14 +1479,19 @@ namespace Isis {
        mult = p_mult[0];
      }


      // Handle any data headers (e.g., the data at the beginning of each band)
      pos = fin.tellg();
      if (p_saveDataHeader) {
        p_dataHeader.push_back(new char[p_dataHeaderBytes]);
        fin.read(p_dataHeader.back(), p_dataHeaderBytes);

      }
      else {
        //cout << p_suffixData << endl;
        fin.seekg(p_dataHeaderBytes, ios_base::cur);


       }

      // Check the last io
@@ -1455,6 +1526,7 @@ namespace Isis {
          throw IException(IException::Io, msg, _FILEINFO_);
        }


        // Get a line of data from the input file
        pos = fin.tellg();
        fin.read(in, readBytes);
@@ -1470,34 +1542,37 @@ namespace Isis {
        for(int samp = 0; samp < p_ns; samp++) {
          switch(p_pixelType) {
            case Isis::UnsignedByte:
              //cout << "UnsignedByte" << endl;
              (*out)[samp] = (double)((unsigned char *)in)[samp];
              break;
            case Isis::UnsignedWord:
              //cout << "Unsigned word."<< endl;
              (*out)[samp] =
                (double)swapper.UnsignedShortInt((unsigned short int *)in+samp);
              break;
            case Isis::SignedWord:
            //cout << "Signed Word." << endl;
              (*out)[samp] = (double)swapper.ShortInt((short int *)in+samp);
              break;
            case Isis::SignedInteger:
              (*out)[samp] = (double)swapper.Int((int *)in+samp);
              break;
            case Isis::Real:
              if(p_vax_convert) {
              //tjw:
              if(p_vax_convert)
                (*out)[samp]= VAXConversion( (float *)in+samp );
              }
              else {
              else
                (*out)[samp] = (double)swapper.Float((float *)in+samp);
              }

              break;
            case Isis::Double:
              //cout << "Double"  << endl;
              (*out)[samp] = (double)swapper.Double((double *)in+samp);
              break;


            default:
              break;
          }


          (*out)[samp] = TestPixel((*out)[samp]);

          if (Isis::IsValidPixel((*out)[samp])) {
@@ -1596,6 +1671,10 @@ namespace Isis {
  }






  /**
   * Function to process files stored as Band Interleaved by Line
   *
@@ -1631,6 +1710,8 @@ namespace Isis {
    // Handle the file header
    streampos pos = fin.tellg();



    if (p_saveFileHeader) {
      p_fileHeader = new char[p_fileHeaderBytes];
      fin.read(p_fileHeader, p_fileHeaderBytes);
@@ -1638,8 +1719,21 @@ namespace Isis {
    }
    else {
        fin.seekg(p_fileHeaderBytes+p_suffixData, ios_base::beg);
        //fin.seekg(p_fileHeaderBytes, ios_base::beg);
    }


#if 0
    if (p_saveFileHeader) {
      p_fileHeader = new char[p_fileHeaderBytes];
      fin.read(p_fileHeader, p_fileHeaderBytes);
    }
    else {
      fin.seekg(p_fileHeaderBytes, ios_base::beg);
    }
#endif


    // Check the last io
    if (!fin.good()) {
      QString msg = "Cannot read file [" + p_inFile + "]. Position [" +
@@ -1734,16 +1828,12 @@ namespace Isis {
            case Isis::SignedWord:
              (*out)[samp] = (double)swapper.ShortInt((short int *)in+samp);
              break;
            case Isis::SignedInteger:
              (*out)[samp] = (double)swapper.Int((int *)in+samp);
              break;
            case Isis::Real:
              if(p_vax_convert) {
              //tjw:
              if(p_vax_convert)
                (*out)[samp]= VAXConversion( (float *)in+samp );
              }
              else {
              else
                (*out)[samp] = (double)swapper.Float((float *)in+samp);
              }
              break;
            case Isis::Double:
              (*out)[samp] = (double)swapper.Double((double *)in+samp);
@@ -1789,6 +1879,7 @@ namespace Isis {
          throw IException(IException::Io, msg, _FILEINFO_);
        }


        // Save off the prefix bytes vector
        if (p_saveDataPre) {
          p_dataPre.push_back(tempPre);
@@ -1836,6 +1927,7 @@ namespace Isis {
    // Close the file and clean up
    fin.close();
    delete [] in;

  }


@@ -1851,6 +1943,7 @@ namespace Isis {
   */
  void ProcessImport::ProcessBip(void funct(Isis::Buffer &out)) {


    // Figure out the number of bytes to read for a single line
    int readBytes = Isis::SizeOf(p_pixelType);
    readBytes = readBytes * p_ns * p_nb;
@@ -1872,6 +1965,8 @@ namespace Isis {
    }

    // Handle the file header

    //tjw
    streampos pos = fin.tellg();
    if (p_saveFileHeader) {
      p_fileHeader = new char[p_fileHeaderBytes];
@@ -1880,8 +1975,23 @@ namespace Isis {
    }
    else {
        fin.seekg(p_fileHeaderBytes+p_suffixData, ios_base::beg);
        //fin.seekg(p_fileHeaderBytes, ios_base::beg);
    }



#if 0

    if (p_saveFileHeader) {
      p_fileHeader = new char[p_fileHeaderBytes];
      fin.read(p_fileHeader, p_fileHeaderBytes);
    }
    else {
      fin.seekg(p_fileHeaderBytes, ios_base::beg);
    }

#endif

    // Check the last io
    if (!fin.good()) {
      QString msg = "Cannot read file [" + p_inFile + "]. Position [" +
@@ -1919,6 +2029,7 @@ namespace Isis {
      // Space for storing prefix and suffix data pointers
      vector<char *> tempPre, tempPost;


      // Handle any line prefix bytes
      pos = fin.tellg();
      if (p_saveDataPre) {
@@ -1976,16 +2087,12 @@ namespace Isis {
            case Isis::SignedWord:
              (*out)[osamp] = (double)swapper.ShortInt((short int *)in+samp);
              break;
            case Isis::SignedInteger:
              (*out)[samp] = (double)swapper.Int((int *)in+samp);
              break;
            case Isis::Real:
              if(p_vax_convert) {
              //tjw:
              if(p_vax_convert)
                (*out)[osamp]= VAXConversion( (float *)in+samp );
              }
              else {
              else
                (*out)[osamp] = (double)swapper.Float((float *)in+samp);
              }
              break;
            case Isis::Double:
              (*out)[osamp] = (double)swapper.Double((double *)in+samp);
@@ -2303,4 +2410,8 @@ namespace Isis {
    return p_inFile;
  }


}


+34 −37
Original line number Diff line number Diff line
@@ -139,34 +139,29 @@ namespace Isis {
   *                           documentation. Changed parameter name from
   *                           "parameter" to "fname" in SetOutputCube() method.
   *                           References #1248.
   *   @history 2015-01-15 Sasha Brownsberger - Added virtual keyword to several functions
   *                           to ensure successful inheritance between Process and its
   *                           child classes. Added virtual keyword to destructor. References #2215.
   *   @history 2015-01-15 Sasha Brownsberger - Added virtual keyword to several 
   *                                            functions to ensure successful 
   *                                            inheritance between Process and its
   *                                            child classes.  Added virtual keyword
   *                                            to destructor.  References #2215.
   *
   * *                                            to destructor.  References #2215.
   *   @history 2016-02-23 Tyler Wilson - Added VAXConversion(...) and IsVAXSpecial(...) routines
   *                        for importing Galileo NIMS qubs which were originally saved in
   *                        VAX format.  Also added SetSuffixOffset for reading suffix
   *                        band data from NIMS cubes. References #2368.
   *   @history 2016-04-20 Jeannie Backer - Merged Janet Barret's changes to handle SignedInteger
   *                           imports. Brought code closer to coding standards.
   *
   *
   */
  class ProcessImport : public Isis::Process {
    public:
      enum VAXDataType { 
        VAX_REAL,  
        VAX_INT
      };


      enum VAXSpecialPixel { 
        VAX_MIN4,
        VAX_NULL4,
        VAX_LRS4,
        VAX_LIS4,
        VAX_HIS4,
        VAX_HRS4
      };



  class ProcessImport : public Isis::Process {
    public:
      enum VAXDataType {VAX_REAL, VAX_INT};
      enum VAXSpecialPixel { VAX_MIN4,VAX_NULL4,VAX_LRS4,VAX_LIS4,VAX_HIS4,VAX_HRS4};

      ProcessImport();
      virtual ~ProcessImport();
@@ -181,7 +176,6 @@ namespace Isis {
      Isis::Cube *SetOutputCube(const QString &parameter);
      virtual Isis::Cube *SetOutputCube(const QString &fname,
                                Isis::CubeAttributeOutput &att);

      void SetPixelType(const Isis::PixelType type);
      /**
       * Returns the pixel type
@@ -190,8 +184,6 @@ namespace Isis {
      Isis::PixelType PixelType() {
        return p_pixelType;
      }


      void SetDimensions(const int ns, const int nl, const int nb);

      /**
@@ -202,7 +194,6 @@ namespace Isis {
        return p_ns;
      }


      /**
       * Returns the number of lines
       * @return The number of lines
@@ -211,7 +202,6 @@ namespace Isis {
        return p_nl;
      }


      /**
       * Returns the number of bands
       * @return The number of bands
@@ -220,7 +210,6 @@ namespace Isis {
        return p_nb;
      }


      void SetByteOrder(const Isis::ByteOrder order);

      /**
@@ -231,12 +220,16 @@ namespace Isis {
        return p_byteOrder;
      }


      //tjw:  VAX_REAL -> IEEE_REAL

      bool IsVAXSpecial(unsigned int *vax,VAXSpecialPixel pix);
      double VAXConversion(void *ibuf);
      void SetSuffixOffset(int samples,int lines, int coreBands,int itemBytes);
      void SetSuffixPixelType(const Isis::PixelType type);
      void SetVAXConvert(const bool vax_convert);


      void SetFileHeaderBytes(const int bytes);
      void SetFileTrailerBytes(const int bytes);
      void SetDataHeaderBytes(const int bytes);
@@ -283,8 +276,6 @@ namespace Isis {
                                  all bands is followed by the second pixel for 
                                  all bands.*/
      };


      void SetOrganization(const ProcessImport::Interleave org);
      Interleave Organization() const;

@@ -304,13 +295,6 @@ namespace Isis {

      double TestPixel(const double pixel);

      void ProcessBsq(void funct(Isis::Buffer &out) = NULL);
      void ProcessBil(void funct(Isis::Buffer &out) = NULL);
      void ProcessBip(void funct(Isis::Buffer &out) = NULL);
      void ProcessJp2(void funct(Isis::Buffer &out) = NULL);

      void CheckPixelRange(QString pixelName, double min, double max);

#if 0
      void AddImportLabel(Isis::Pvl &importLab);
      void AddLabel(Isis::Pvl &label);
@@ -321,14 +305,16 @@ namespace Isis {
      QString p_inFile;        //!< Input file name
      Isis::PixelType p_pixelType; //!< Pixel type of input data

      Isis::PixelType p_suffixPixelType; //!< The pixel type of the suffix data.
      //tjw
      Isis::PixelType p_suffixPixelType; //!< Pixel type of suffix data (for Galileo NIMS cubes)
      int p_ns;                    //!< Number of samples
      int p_nl;                    //!< Number of lines
      int p_nb;                    //!< Number of bands
      Isis::ByteOrder p_byteOrder; //!< Byte order of data

      int p_suffixData;             /**< The number of bytes past the file header bytes
                                         where the suffix data bands are stored.*/
      //tjw
      int p_suffixData;            //!< Number of bytes past the file header bytes
                                    //!< where the suffix data bands are stored


      int p_fileHeaderBytes;       /**< The number of bytes of non-image data at
@@ -372,6 +358,10 @@ namespace Isis {
      std::vector<std::vector<char *> >p_dataPost; //!< The data suffix
      char *p_fileTrailer;                         //!< The file trailer



      //tjw

      bool p_vax_convert;

      ProcessImport::Interleave p_organization; /**< The format of the input 
@@ -429,6 +419,13 @@ namespace Isis {
      double p_lis_max;     /**< The pixel value which is the upper bound of LIS
                                 data. All pixels between this value and the min
                                 will be converted to the Isis LIS value.*/

      void ProcessBsq(void funct(Isis::Buffer &out) = NULL);
      void ProcessBil(void funct(Isis::Buffer &out) = NULL);
      void ProcessBip(void funct(Isis::Buffer &out) = NULL);
      void ProcessJp2(void funct(Isis::Buffer &out) = NULL);

      void CheckPixelRange(QString pixelName, double min, double max);
  };
};
#endif
+4 −3
Original line number Diff line number Diff line
@@ -294,8 +294,8 @@ namespace Isis {
   * (DataPrefixBytes + DataSuffixByte) / PixelSize is subtracted from the number of samples before 
   * the output file is created. 
   *  
   * @param labelNumber FITS label number. Zero indicates the first/main label, one indicates the 
   *                    first extension, etc...
   * @param labelNumber FITS label number. zero (0) is the first/main label. one (1) is the first 
   * extension, ... 
   * 
   */
  void ProcessImportFits::setProcessFileStructure(int labelNumber) {
@@ -325,7 +325,8 @@ namespace Isis {
        type = Isis::SignedWord;
        break;
      case 32:
        type = Isis::SignedInteger;
        msg = "Signed 32 bit integer (int) pixel type is not supported at this time";
        throw IException(IException::User, msg, _FILEINFO_);
        break;
      case -32:
        type = Isis::Real;
+3 −3
Original line number Diff line number Diff line
@@ -42,9 +42,9 @@ namespace Isis {
   * @internal
   *   @history 2014-06-06 Stuart Sides - Added ability to read and process the FITS extension
   *   @history 2015-01-15 Sasha Brownsberger - Made destructor virtual.  References #2215.
   *   @history 2015-06-02 Kristin Berry - Added error for use of unsupported BIP organization.
   *   @history 2016-04-20 Jeannie Backer - Merged Janet Barret's changes to handle SignedInteger
   *                           imports. Brought code closer to coding standards.
   *   @history 2015-06-02 Kristin Berry - Added error for use of
   *                                  unsupported BIP
   *                                  organization.
   *             
   */

Loading