Loading isis/IsisPreferences +1 −0 Original line number Diff line number Diff line Loading @@ -176,6 +176,7 @@ Group = DataDirectory Near = $ISIS3DATA/near NewHorizons = $ISIS3DATA/newhorizons Odyssey = $ISIS3DATA/odyssey OsirisRex = $ISIS3DATA/../datalocal/osirisrex Rolo = $ISIS3DATA/rolo Rosetta = $ISIS3DATA/rosetta Smart1 = $ISIS3DATA/smart1 Loading isis/src/base/objs/ProcessImport/ProcessImport.cpp +80 −191 Original line number Diff line number Diff line Loading @@ -41,9 +41,6 @@ #include "PvlTokenizer.h" #include "SpecialPixel.h" //tjw //VAX Conversion #define EXPONENT_MASK ((char) 0x7F) Loading Loading @@ -86,7 +83,6 @@ namespace Isis { p_saveFileTrailer = false; p_vax_convert = false; p_fileHeader = NULL; p_fileTrailer = NULL; } Loading Loading @@ -123,9 +119,6 @@ namespace Isis { } } //tjw: /** * Determines if the VAX encoded pixel value is special or not Loading @@ -136,12 +129,8 @@ 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; Loading @@ -154,65 +143,38 @@ 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 Loading @@ -220,11 +182,8 @@ 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; Loading @@ -236,19 +195,14 @@ 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; Loading @@ -256,33 +210,37 @@ 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); } Loading @@ -298,8 +256,9 @@ 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); Loading @@ -308,9 +267,6 @@ namespace Isis { } /** * Sets the pixel type of the input file. * Loading @@ -322,7 +278,8 @@ 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::UnsignedWord) || (type == Isis::UnsignedByte) || (type == Isis::SignedInteger)) { p_pixelType = type; } else { Loading @@ -330,7 +287,7 @@ namespace Isis { Isis::PixelTypeName(type) + "]"; throw IException(IException::Programmer, msg, _FILEINFO_); } }; } void ProcessImport::SetSuffixPixelType(const Isis::PixelType type) { Loading @@ -343,7 +300,7 @@ namespace Isis { Isis::PixelTypeName(type) + "]"; throw IException(IException::Programmer, msg, _FILEINFO_); } }; } /** Loading @@ -360,20 +317,16 @@ 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_); } }; } /** Loading @@ -384,7 +337,7 @@ namespace Isis { */ void ProcessImport::SetByteOrder(const Isis::ByteOrder order) { p_byteOrder = order; }; } /** Loading @@ -410,13 +363,12 @@ 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_); } }; } /** Loading Loading @@ -446,7 +398,7 @@ namespace Isis { QString msg = "Illegal file trailer size [" + toString(bytes) + "]"; throw IException(IException::Programmer, msg, _FILEINFO_); } }; } /** Loading @@ -469,26 +421,18 @@ 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; }; } /** Loading Loading @@ -519,7 +463,7 @@ namespace Isis { QString msg = "Illegal data trailer size [" + toString(bytes) + "]"; throw IException(IException::Programmer, msg, _FILEINFO_); } }; } /** Loading @@ -544,13 +488,12 @@ namespace Isis { if (bytes >= 0) { p_dataPreBytes = bytes; } else { QString msg = "Illegal data prefix size [" + toString(bytes) + "]"; throw IException(IException::Programmer, msg, _FILEINFO_); } }; } /** Loading @@ -575,13 +518,12 @@ namespace Isis { if (bytes >= 0) { p_dataPostBytes = bytes; } else { QString msg = "Illegal data suffix size [" + toString(bytes) + "]"; throw IException(IException::Programmer, msg, _FILEINFO_); } }; } /** Loading @@ -608,7 +550,7 @@ namespace Isis { throw IException(IException::Programmer, msg, _FILEINFO_); } p_saveFileHeader = true; }; } /** Loading Loading @@ -636,7 +578,7 @@ namespace Isis { _FILEINFO_); } p_saveFileTrailer = true; }; } /** Loading Loading @@ -665,7 +607,7 @@ namespace Isis { _FILEINFO_); } p_saveDataHeader = true; }; } /** Loading Loading @@ -694,7 +636,7 @@ namespace Isis { _FILEINFO_); } p_saveDataTrailer = true; }; } /** Loading Loading @@ -722,7 +664,7 @@ namespace Isis { _FILEINFO_); } p_saveDataPre = true; }; } /** Loading Loading @@ -751,7 +693,7 @@ namespace Isis { _FILEINFO_); } p_saveDataPost = true; }; } /** Loading Loading @@ -828,7 +770,7 @@ namespace Isis { } QString msg = "File header was not saved. Use SaveFileHeader()."; throw IException(IException::Programmer, msg, _FILEINFO_); }; } /** Loading @@ -854,7 +796,7 @@ namespace Isis { } QString msg = "File trailer was not saved. Use SaveFileTrailer()"; throw IException(IException::Programmer, msg, _FILEINFO_); }; } /** Loading Loading @@ -882,7 +824,7 @@ namespace Isis { } QString msg = "Data header was not saved. Use SaveDataHeader()"; throw IException(IException::Programmer, msg, _FILEINFO_); }; } /** Loading Loading @@ -910,7 +852,7 @@ namespace Isis { } QString msg = "Data trailer was not saved. Use SaveDataTrailer()"; throw IException(IException::Programmer, msg, _FILEINFO_); }; } /** Loading Loading @@ -938,7 +880,7 @@ namespace Isis { } QString msg = "Data prefix was not saved. Use SaveDataPrefix()"; throw IException(IException::Programmer, msg, _FILEINFO_); }; } /** Loading Loading @@ -966,7 +908,7 @@ namespace Isis { } QString msg = "Data suffix was not saved. Use SaveDataSuffix()"; throw IException(IException::Programmer, msg, _FILEINFO_); }; } /** Loading @@ -978,11 +920,9 @@ 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 Loading @@ -990,15 +930,9 @@ 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; }; } /** Loading @@ -1007,7 +941,7 @@ namespace Isis { */ ProcessImport::Interleave ProcessImport::Organization() const { return p_organization; }; } /** Loading @@ -1018,7 +952,7 @@ namespace Isis { void ProcessImport::SetBase(const double base) { p_base.clear(); p_base.push_back(base); }; } /** Loading @@ -1028,7 +962,7 @@ namespace Isis { */ void ProcessImport::SetBase(const std::vector<double> base) { p_base = base; }; } /** Loading @@ -1039,7 +973,7 @@ namespace Isis { void ProcessImport::SetMultiplier(const double mult) { p_mult.clear(); p_mult.push_back(mult); }; } /** Loading @@ -1049,7 +983,7 @@ namespace Isis { */ void ProcessImport::SetMultiplier(const std::vector<double> mult) { p_mult = mult; }; } /** Loading Loading @@ -1078,7 +1012,7 @@ namespace Isis { SetLIS(lis, lis); SetHRS(hrs, hrs); SetHIS(his, his); }; } /** Loading Loading @@ -1288,6 +1222,10 @@ 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]; Loading @@ -1313,7 +1251,8 @@ 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) { else if (p_pixelType == Isis::UnsignedWord || p_pixelType == Isis::Double || p_pixelType == Isis::SignedInteger) { att.setPixelType(Isis::Real); } else { Loading Loading @@ -1407,8 +1346,6 @@ 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; Loading @@ -1431,9 +1368,6 @@ 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); Loading Loading @@ -1479,19 +1413,14 @@ 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 Loading Loading @@ -1526,7 +1455,6 @@ namespace Isis { throw IException(IException::Io, msg, _FILEINFO_); } // Get a line of data from the input file pos = fin.tellg(); fin.read(in, readBytes); Loading @@ -1542,37 +1470,34 @@ 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: //tjw: if(p_vax_convert) 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])) { Loading Loading @@ -1671,10 +1596,6 @@ namespace Isis { } /** * Function to process files stored as Band Interleaved by Line * Loading Loading @@ -1710,8 +1631,6 @@ 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); Loading @@ -1719,21 +1638,8 @@ 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 [" + Loading Loading @@ -1828,12 +1734,16 @@ 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: //tjw: if(p_vax_convert) 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); Loading Loading @@ -1879,7 +1789,6 @@ namespace Isis { throw IException(IException::Io, msg, _FILEINFO_); } // Save off the prefix bytes vector if (p_saveDataPre) { p_dataPre.push_back(tempPre); Loading Loading @@ -1927,7 +1836,6 @@ namespace Isis { // Close the file and clean up fin.close(); delete [] in; } Loading @@ -1943,7 +1851,6 @@ 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; Loading @@ -1965,8 +1872,6 @@ namespace Isis { } // Handle the file header //tjw streampos pos = fin.tellg(); if (p_saveFileHeader) { p_fileHeader = new char[p_fileHeaderBytes]; Loading @@ -1975,23 +1880,8 @@ 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 [" + Loading Loading @@ -2029,7 +1919,6 @@ 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) { Loading Loading @@ -2087,12 +1976,16 @@ 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: //tjw: if(p_vax_convert) 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); Loading Loading @@ -2410,8 +2303,4 @@ namespace Isis { return p_inFile; } } isis/src/base/objs/ProcessImport/ProcessImport.h +37 −34 Original line number Diff line number Diff line Loading @@ -139,29 +139,34 @@ 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. * * * 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. * @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}; enum VAXDataType { VAX_REAL, VAX_INT }; enum VAXSpecialPixel { VAX_MIN4, VAX_NULL4, VAX_LRS4, VAX_LIS4, VAX_HIS4, VAX_HRS4 }; ProcessImport(); virtual ~ProcessImport(); Loading @@ -176,6 +181,7 @@ namespace Isis { Isis::Cube *SetOutputCube(const QString ¶meter); virtual Isis::Cube *SetOutputCube(const QString &fname, Isis::CubeAttributeOutput &att); void SetPixelType(const Isis::PixelType type); /** * Returns the pixel type Loading @@ -184,6 +190,8 @@ namespace Isis { Isis::PixelType PixelType() { return p_pixelType; } void SetDimensions(const int ns, const int nl, const int nb); /** Loading @@ -194,6 +202,7 @@ namespace Isis { return p_ns; } /** * Returns the number of lines * @return The number of lines Loading @@ -202,6 +211,7 @@ namespace Isis { return p_nl; } /** * Returns the number of bands * @return The number of bands Loading @@ -210,6 +220,7 @@ namespace Isis { return p_nb; } void SetByteOrder(const Isis::ByteOrder order); /** Loading @@ -220,16 +231,12 @@ 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); Loading Loading @@ -276,6 +283,8 @@ namespace Isis { all bands is followed by the second pixel for all bands.*/ }; void SetOrganization(const ProcessImport::Interleave org); Interleave Organization() const; Loading @@ -295,6 +304,13 @@ 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); Loading @@ -305,16 +321,14 @@ namespace Isis { QString p_inFile; //!< Input file name Isis::PixelType p_pixelType; //!< Pixel type of input data //tjw Isis::PixelType p_suffixPixelType; //!< Pixel type of suffix data (for Galileo NIMS cubes) Isis::PixelType p_suffixPixelType; //!< The pixel type of the suffix data. 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 //tjw int p_suffixData; //!< Number of bytes past the file header bytes //!< where the suffix data bands are stored int p_suffixData; /**< The 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 Loading Loading @@ -358,10 +372,6 @@ 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 Loading Loading @@ -419,13 +429,6 @@ 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 isis/src/base/objs/ProcessImportFits/ProcessImportFits.cpp +3 −4 Original line number Diff line number Diff line Loading @@ -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 (0) is the first/main label. one (1) is the first * extension, ... * @param labelNumber FITS label number. Zero indicates the first/main label, one indicates the * first extension, etc... * */ void ProcessImportFits::setProcessFileStructure(int labelNumber) { Loading Loading @@ -325,8 +325,7 @@ namespace Isis { type = Isis::SignedWord; break; case 32: msg = "Signed 32 bit integer (int) pixel type is not supported at this time"; throw IException(IException::User, msg, _FILEINFO_); type = Isis::SignedInteger; break; case -32: type = Isis::Real; Loading isis/src/base/objs/ProcessImportFits/ProcessImportFits.h +3 −3 Original line number Diff line number Diff line Loading @@ -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 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. * */ Loading Loading
isis/IsisPreferences +1 −0 Original line number Diff line number Diff line Loading @@ -176,6 +176,7 @@ Group = DataDirectory Near = $ISIS3DATA/near NewHorizons = $ISIS3DATA/newhorizons Odyssey = $ISIS3DATA/odyssey OsirisRex = $ISIS3DATA/../datalocal/osirisrex Rolo = $ISIS3DATA/rolo Rosetta = $ISIS3DATA/rosetta Smart1 = $ISIS3DATA/smart1 Loading
isis/src/base/objs/ProcessImport/ProcessImport.cpp +80 −191 Original line number Diff line number Diff line Loading @@ -41,9 +41,6 @@ #include "PvlTokenizer.h" #include "SpecialPixel.h" //tjw //VAX Conversion #define EXPONENT_MASK ((char) 0x7F) Loading Loading @@ -86,7 +83,6 @@ namespace Isis { p_saveFileTrailer = false; p_vax_convert = false; p_fileHeader = NULL; p_fileTrailer = NULL; } Loading Loading @@ -123,9 +119,6 @@ namespace Isis { } } //tjw: /** * Determines if the VAX encoded pixel value is special or not Loading @@ -136,12 +129,8 @@ 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; Loading @@ -154,65 +143,38 @@ 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 Loading @@ -220,11 +182,8 @@ 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; Loading @@ -236,19 +195,14 @@ 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; Loading @@ -256,33 +210,37 @@ 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); } Loading @@ -298,8 +256,9 @@ 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); Loading @@ -308,9 +267,6 @@ namespace Isis { } /** * Sets the pixel type of the input file. * Loading @@ -322,7 +278,8 @@ 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::UnsignedWord) || (type == Isis::UnsignedByte) || (type == Isis::SignedInteger)) { p_pixelType = type; } else { Loading @@ -330,7 +287,7 @@ namespace Isis { Isis::PixelTypeName(type) + "]"; throw IException(IException::Programmer, msg, _FILEINFO_); } }; } void ProcessImport::SetSuffixPixelType(const Isis::PixelType type) { Loading @@ -343,7 +300,7 @@ namespace Isis { Isis::PixelTypeName(type) + "]"; throw IException(IException::Programmer, msg, _FILEINFO_); } }; } /** Loading @@ -360,20 +317,16 @@ 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_); } }; } /** Loading @@ -384,7 +337,7 @@ namespace Isis { */ void ProcessImport::SetByteOrder(const Isis::ByteOrder order) { p_byteOrder = order; }; } /** Loading @@ -410,13 +363,12 @@ 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_); } }; } /** Loading Loading @@ -446,7 +398,7 @@ namespace Isis { QString msg = "Illegal file trailer size [" + toString(bytes) + "]"; throw IException(IException::Programmer, msg, _FILEINFO_); } }; } /** Loading @@ -469,26 +421,18 @@ 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; }; } /** Loading Loading @@ -519,7 +463,7 @@ namespace Isis { QString msg = "Illegal data trailer size [" + toString(bytes) + "]"; throw IException(IException::Programmer, msg, _FILEINFO_); } }; } /** Loading @@ -544,13 +488,12 @@ namespace Isis { if (bytes >= 0) { p_dataPreBytes = bytes; } else { QString msg = "Illegal data prefix size [" + toString(bytes) + "]"; throw IException(IException::Programmer, msg, _FILEINFO_); } }; } /** Loading @@ -575,13 +518,12 @@ namespace Isis { if (bytes >= 0) { p_dataPostBytes = bytes; } else { QString msg = "Illegal data suffix size [" + toString(bytes) + "]"; throw IException(IException::Programmer, msg, _FILEINFO_); } }; } /** Loading @@ -608,7 +550,7 @@ namespace Isis { throw IException(IException::Programmer, msg, _FILEINFO_); } p_saveFileHeader = true; }; } /** Loading Loading @@ -636,7 +578,7 @@ namespace Isis { _FILEINFO_); } p_saveFileTrailer = true; }; } /** Loading Loading @@ -665,7 +607,7 @@ namespace Isis { _FILEINFO_); } p_saveDataHeader = true; }; } /** Loading Loading @@ -694,7 +636,7 @@ namespace Isis { _FILEINFO_); } p_saveDataTrailer = true; }; } /** Loading Loading @@ -722,7 +664,7 @@ namespace Isis { _FILEINFO_); } p_saveDataPre = true; }; } /** Loading Loading @@ -751,7 +693,7 @@ namespace Isis { _FILEINFO_); } p_saveDataPost = true; }; } /** Loading Loading @@ -828,7 +770,7 @@ namespace Isis { } QString msg = "File header was not saved. Use SaveFileHeader()."; throw IException(IException::Programmer, msg, _FILEINFO_); }; } /** Loading @@ -854,7 +796,7 @@ namespace Isis { } QString msg = "File trailer was not saved. Use SaveFileTrailer()"; throw IException(IException::Programmer, msg, _FILEINFO_); }; } /** Loading Loading @@ -882,7 +824,7 @@ namespace Isis { } QString msg = "Data header was not saved. Use SaveDataHeader()"; throw IException(IException::Programmer, msg, _FILEINFO_); }; } /** Loading Loading @@ -910,7 +852,7 @@ namespace Isis { } QString msg = "Data trailer was not saved. Use SaveDataTrailer()"; throw IException(IException::Programmer, msg, _FILEINFO_); }; } /** Loading Loading @@ -938,7 +880,7 @@ namespace Isis { } QString msg = "Data prefix was not saved. Use SaveDataPrefix()"; throw IException(IException::Programmer, msg, _FILEINFO_); }; } /** Loading Loading @@ -966,7 +908,7 @@ namespace Isis { } QString msg = "Data suffix was not saved. Use SaveDataSuffix()"; throw IException(IException::Programmer, msg, _FILEINFO_); }; } /** Loading @@ -978,11 +920,9 @@ 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 Loading @@ -990,15 +930,9 @@ 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; }; } /** Loading @@ -1007,7 +941,7 @@ namespace Isis { */ ProcessImport::Interleave ProcessImport::Organization() const { return p_organization; }; } /** Loading @@ -1018,7 +952,7 @@ namespace Isis { void ProcessImport::SetBase(const double base) { p_base.clear(); p_base.push_back(base); }; } /** Loading @@ -1028,7 +962,7 @@ namespace Isis { */ void ProcessImport::SetBase(const std::vector<double> base) { p_base = base; }; } /** Loading @@ -1039,7 +973,7 @@ namespace Isis { void ProcessImport::SetMultiplier(const double mult) { p_mult.clear(); p_mult.push_back(mult); }; } /** Loading @@ -1049,7 +983,7 @@ namespace Isis { */ void ProcessImport::SetMultiplier(const std::vector<double> mult) { p_mult = mult; }; } /** Loading Loading @@ -1078,7 +1012,7 @@ namespace Isis { SetLIS(lis, lis); SetHRS(hrs, hrs); SetHIS(his, his); }; } /** Loading Loading @@ -1288,6 +1222,10 @@ 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]; Loading @@ -1313,7 +1251,8 @@ 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) { else if (p_pixelType == Isis::UnsignedWord || p_pixelType == Isis::Double || p_pixelType == Isis::SignedInteger) { att.setPixelType(Isis::Real); } else { Loading Loading @@ -1407,8 +1346,6 @@ 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; Loading @@ -1431,9 +1368,6 @@ 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); Loading Loading @@ -1479,19 +1413,14 @@ 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 Loading Loading @@ -1526,7 +1455,6 @@ namespace Isis { throw IException(IException::Io, msg, _FILEINFO_); } // Get a line of data from the input file pos = fin.tellg(); fin.read(in, readBytes); Loading @@ -1542,37 +1470,34 @@ 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: //tjw: if(p_vax_convert) 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])) { Loading Loading @@ -1671,10 +1596,6 @@ namespace Isis { } /** * Function to process files stored as Band Interleaved by Line * Loading Loading @@ -1710,8 +1631,6 @@ 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); Loading @@ -1719,21 +1638,8 @@ 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 [" + Loading Loading @@ -1828,12 +1734,16 @@ 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: //tjw: if(p_vax_convert) 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); Loading Loading @@ -1879,7 +1789,6 @@ namespace Isis { throw IException(IException::Io, msg, _FILEINFO_); } // Save off the prefix bytes vector if (p_saveDataPre) { p_dataPre.push_back(tempPre); Loading Loading @@ -1927,7 +1836,6 @@ namespace Isis { // Close the file and clean up fin.close(); delete [] in; } Loading @@ -1943,7 +1851,6 @@ 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; Loading @@ -1965,8 +1872,6 @@ namespace Isis { } // Handle the file header //tjw streampos pos = fin.tellg(); if (p_saveFileHeader) { p_fileHeader = new char[p_fileHeaderBytes]; Loading @@ -1975,23 +1880,8 @@ 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 [" + Loading Loading @@ -2029,7 +1919,6 @@ 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) { Loading Loading @@ -2087,12 +1976,16 @@ 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: //tjw: if(p_vax_convert) 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); Loading Loading @@ -2410,8 +2303,4 @@ namespace Isis { return p_inFile; } }
isis/src/base/objs/ProcessImport/ProcessImport.h +37 −34 Original line number Diff line number Diff line Loading @@ -139,29 +139,34 @@ 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. * * * 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. * @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}; enum VAXDataType { VAX_REAL, VAX_INT }; enum VAXSpecialPixel { VAX_MIN4, VAX_NULL4, VAX_LRS4, VAX_LIS4, VAX_HIS4, VAX_HRS4 }; ProcessImport(); virtual ~ProcessImport(); Loading @@ -176,6 +181,7 @@ namespace Isis { Isis::Cube *SetOutputCube(const QString ¶meter); virtual Isis::Cube *SetOutputCube(const QString &fname, Isis::CubeAttributeOutput &att); void SetPixelType(const Isis::PixelType type); /** * Returns the pixel type Loading @@ -184,6 +190,8 @@ namespace Isis { Isis::PixelType PixelType() { return p_pixelType; } void SetDimensions(const int ns, const int nl, const int nb); /** Loading @@ -194,6 +202,7 @@ namespace Isis { return p_ns; } /** * Returns the number of lines * @return The number of lines Loading @@ -202,6 +211,7 @@ namespace Isis { return p_nl; } /** * Returns the number of bands * @return The number of bands Loading @@ -210,6 +220,7 @@ namespace Isis { return p_nb; } void SetByteOrder(const Isis::ByteOrder order); /** Loading @@ -220,16 +231,12 @@ 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); Loading Loading @@ -276,6 +283,8 @@ namespace Isis { all bands is followed by the second pixel for all bands.*/ }; void SetOrganization(const ProcessImport::Interleave org); Interleave Organization() const; Loading @@ -295,6 +304,13 @@ 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); Loading @@ -305,16 +321,14 @@ namespace Isis { QString p_inFile; //!< Input file name Isis::PixelType p_pixelType; //!< Pixel type of input data //tjw Isis::PixelType p_suffixPixelType; //!< Pixel type of suffix data (for Galileo NIMS cubes) Isis::PixelType p_suffixPixelType; //!< The pixel type of the suffix data. 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 //tjw int p_suffixData; //!< Number of bytes past the file header bytes //!< where the suffix data bands are stored int p_suffixData; /**< The 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 Loading Loading @@ -358,10 +372,6 @@ 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 Loading Loading @@ -419,13 +429,6 @@ 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
isis/src/base/objs/ProcessImportFits/ProcessImportFits.cpp +3 −4 Original line number Diff line number Diff line Loading @@ -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 (0) is the first/main label. one (1) is the first * extension, ... * @param labelNumber FITS label number. Zero indicates the first/main label, one indicates the * first extension, etc... * */ void ProcessImportFits::setProcessFileStructure(int labelNumber) { Loading Loading @@ -325,8 +325,7 @@ namespace Isis { type = Isis::SignedWord; break; case 32: msg = "Signed 32 bit integer (int) pixel type is not supported at this time"; throw IException(IException::User, msg, _FILEINFO_); type = Isis::SignedInteger; break; case -32: type = Isis::Real; Loading
isis/src/base/objs/ProcessImportFits/ProcessImportFits.h +3 −3 Original line number Diff line number Diff line Loading @@ -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 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. * */ Loading