7#include "ProcessImport.h"
14#include "Application.h"
15#include "BoxcarCachingAlgorithm.h"
18#include "CubeAttribute.h"
19#include "IException.h"
21#include "JP2Decoder.h"
22#include "LineManager.h"
26#include "SpecialPixel.h"
27#include "UserInterface.h"
29#define EXPONENT_MASK ((char) 0x7F)
69 p_vax_convert =
false;
92 for(
unsigned int j = 0; j <
p_dataPre.size(); j++) {
94 for(
unsigned int i = 0; i < temp.size(); i++)
delete [] temp[i];
97 for(
unsigned int j = 0; j <
p_dataPost.size(); j++) {
99 for(
unsigned int i = 0; i < temp.size(); i++)
delete [] temp[i];
119 unsigned int VAX_NULL = 0xFFFFFFFF;
120 unsigned int VAX_MIN = 0xFFEFFFFF;
121 unsigned int VAX_LRS = 0xFFFEFFFF;
122 unsigned int VAX_LIS = 0xFFFDFFFF;
123 unsigned int VAX_HIS = 0xFFFCFFFF;
124 unsigned int VAX_HRS = 0xFFFBFFFF;
128 memcpy(&x, vax,
sizeof(
unsigned int));
132 n = memcmp(&VAX_NULL, &x,
sizeof(
unsigned int));
133 if (n == 0)
return true;
136 n = memcmp(&VAX_LRS, &x,
sizeof(
unsigned int));
137 if (n == 0)
return true;
140 n = memcmp(&VAX_LIS, &x,
sizeof(
unsigned int));
141 if (n == 0)
return true;
144 n = memcmp(&VAX_HIS, &x,
sizeof(
unsigned int));
145 if (n == 0)
return true;
148 n = memcmp(&VAX_HRS, &x,
sizeof(
unsigned int));
149 if (n == 0)
return true;
152 n = memcmp(&VAX_MIN, &x,
sizeof(
unsigned int));
153 if (n == 0)
return true;
174 bool swap_bytes =
false;
175 bool swap_words =
true;
181 Isis::ByteOrder out_order;
183 unsigned int *oli, *ili;
187 if ( Isis::IsLsb() ) {
189 out_order = Isis::Lsb;
193 out_order = Isis::Msb;
196 if (in_order != out_order) {
200 oli = (
unsigned int * ) ibuf;
201 ili = (
unsigned int * ) ibuf;
208 return Isis::LOW_INSTR_SAT8;
212 return Isis::LOW_REPR_SAT8;
216 return Isis::HIGH_INSTR_SAT8;
220 return Isis::HIGH_REPR_SAT8;
224 return Isis::VALID_MIN8;
229 *oli = (*ili <<16) | (*ili >> 16);
232 osi = (
unsigned short* ) oli;
237 osi[0] = (osi[0] >> 8 ) | (osi[0] << 8);
238 osi[1] = (osi[1] >> 8 ) | (osi[1] << 8);
242 oci = (
char *) &osi[exp_word];
244 if ( (oci[exp_byte] & EXPONENT_MASK) != exp_mask) {
245 oci[exp_byte] += exp_adjust;
248 result = *(
float *)oli;
249 dresult =
static_cast<double>(result);
265 if ((type == Isis::Double) || (type == Isis::Real) || (type == Isis::SignedWord) ||
266 (type == Isis::UnsignedWord) || (type == Isis::UnsignedByte) ||
267 (type == Isis::SignedInteger) || type==Isis::UnsignedInteger) {
271 QString msg =
"Unsupported pixel type [" +
272 Isis::PixelTypeName(type) +
"]";
273 throw IException(IException::Programmer, msg, _FILEINFO_);
277 void ProcessImport::SetSuffixPixelType(
const Isis::PixelType type) {
279 if ((type == Isis::Double) || (type == Isis::Real) || (type == Isis::SignedWord) ||
280 (type == Isis::UnsignedWord) || (type == Isis::UnsignedByte)) {
284 QString msg =
"Unsupported pixel type [" +
285 Isis::PixelTypeName(type) +
"]";
286 throw IException(IException::Programmer, msg, _FILEINFO_);
304 if (ns > 0 && nl > 0 && nb > 0) {
310 QString msg =
"Illegal dimension [" +
toString(ns) +
", " +
312 throw IException(IException::Programmer, msg, _FILEINFO_);
353 QString msg =
"Illegal file header size [" +
toString(bytes) +
"]";
354 throw IException(IException::Programmer, msg, _FILEINFO_);
383 QString msg =
"Illegal file trailer size [" +
toString(bytes) +
"]";
384 throw IException(IException::Programmer, msg, _FILEINFO_);
412 QString msg =
"Illegal data header size [" +
toString(bytes) +
"]";
413 throw IException(IException::Programmer, msg, _FILEINFO_);
418 void ProcessImport::SetSuffixOffset(
int samples,
int lines,
int coreBands,
int itemBytes) {
448 QString msg =
"Illegal data trailer size [" +
toString(bytes) +
"]";
449 throw IException(IException::Programmer, msg, _FILEINFO_);
478 QString msg =
"Illegal data prefix size [" +
toString(bytes) +
"]";
479 throw IException(IException::Programmer, msg, _FILEINFO_);
508 QString msg =
"Illegal data suffix size [" +
toString(bytes) +
"]";
509 throw IException(IException::Programmer, msg, _FILEINFO_);
533 QString msg =
"File header bytes equals 0. There is nothing to save. "
534 "Use SetFileHeaderBytes() first.";
535 throw IException(IException::Programmer, msg, _FILEINFO_);
560 QString msg =
"File trailer bytes equals 0. There is nothing to save. "
561 "Use SetFileTrailerBytes() first.";
562 throw IException(IException::Programmer, msg,
589 QString msg =
"Data header bytes equals 0. There is nothing to save. "
590 "Use SetDataHeaderBytes() first.";
591 throw IException(IException::Programmer, msg,
618 QString msg =
"Data trailer bytes equals 0. There is nothing to save. "
619 "Use SetDataTrailerBytes() first.";
620 throw IException(IException::Programmer, msg,
646 QString msg =
"Data prefix bytes equals 0. There is nothing to save. "
647 "Use SetDataPrefixBytes() first.";
648 throw IException(IException::Programmer, msg,
675 QString msg =
"Data suffix bytes equals 0. There is nothing to save. "
676 "Use SetDataSuffixBytes() first.";
677 throw IException(IException::Programmer, msg,
756 QString msg =
"File header was not saved. Use SaveFileHeader().";
757 throw IException(IException::Programmer, msg, _FILEINFO_);
782 QString msg =
"File trailer was not saved. Use SaveFileTrailer()";
783 throw IException(IException::Programmer, msg, _FILEINFO_);
810 QString msg =
"Data header was not saved. Use SaveDataHeader()";
811 throw IException(IException::Programmer, msg, _FILEINFO_);
838 QString msg =
"Data trailer was not saved. Use SaveDataTrailer()";
839 throw IException(IException::Programmer, msg, _FILEINFO_);
866 QString msg =
"Data prefix was not saved. Use SaveDataPrefix()";
867 throw IException(IException::Programmer, msg, _FILEINFO_);
894 QString msg =
"Data suffix was not saved. Use SaveDataSuffix()";
895 throw IException(IException::Programmer, msg, _FILEINFO_);
919 p_vax_convert = vax_convert;
993 const double lis,
const double hrs,
1099 if (pixelMin == DBL_MAX || pixelMax == -DBL_MAX)
return;
1104 (pixelMin < p_null_min && pixelMax >
p_null_max))) {
1106 QString msg =
"The " + pixelName +
" range [" +
toString(pixelMin) +
1107 "," +
toString(pixelMax) +
"] overlaps the NULL range [" +
1109 throw IException(IException::User, msg, _FILEINFO_);
1115 (pixelMin < p_lrs_min && pixelMax >
p_lrs_max))) {
1116 QString msg =
"The " + pixelName +
" range [" +
toString(pixelMin) +
1117 "," +
toString(pixelMax) +
"] overlaps the LRS range [" +
1119 throw IException(IException::User, msg, _FILEINFO_);
1125 (pixelMin < p_lis_min && pixelMax >
p_lis_max))) {
1126 QString msg =
"The " + pixelName +
" range [" +
toString(pixelMin) +
1127 "," +
toString(pixelMax) +
"] overlaps the LIS range [" +
1129 throw IException(IException::User, msg, _FILEINFO_);
1135 (pixelMin < p_hrs_min && pixelMax >
p_hrs_max))) {
1136 QString msg =
"The " + pixelName +
" range [" +
toString(pixelMin) +
1137 "," +
toString(pixelMax) +
"] overlaps the HRS range [" +
1139 throw IException(IException::User, msg, _FILEINFO_);
1145 (pixelMin < p_his_min && pixelMax >
p_his_max))) {
1146 QString msg =
"The " + pixelName +
" range [" +
toString(pixelMin) +
1147 "," +
toString(pixelMax) +
"] overlaps the HIS range [" +
1149 throw IException(IException::User, msg, _FILEINFO_);
1167 if (pixel <= p_null_max && pixel >=
p_null_min) {
1170 else if (pixel <= p_hrs_max && pixel >=
p_hrs_min) {
1171 return Isis::HIGH_REPR_SAT8;
1173 else if (pixel <= p_lrs_max && pixel >=
p_lrs_min) {
1174 return Isis::LOW_REPR_SAT8;
1176 else if (pixel <= p_his_max && pixel >=
p_his_min) {
1177 return Isis::HIGH_INSTR_SAT8;
1179 else if (pixel <= p_lis_max && pixel >=
p_lis_min) {
1180 return Isis::LOW_INSTR_SAT8;
1203 min = Isis::VALID_MIN4;
1204 max = Isis::VALID_MAX4;
1207 min = Isis::IVALID_MIN4;
1208 max = Isis::IVALID_MAX4;
1212 min = Isis::VALID_MINUI4;
1213 max = Isis::VALID_MAXUI4;
1228 QString msg =
"Unsupported pixel type [" +
1230 throw IException(IException::Programmer, msg, _FILEINFO_);
1316 +
"] is not in a supported organization.";
1317 throw IException(IException::Programmer, msg, _FILEINFO_);
1345 QString msg =
"File [" +
p_inFile +
"] is not in a supported organization.";
1346 throw IException(IException::Programmer, msg, _FILEINFO_);
1365 readBytes = readBytes *
p_ns;
1366 char *in =
new char [readBytes];
1370 tok = tok.toUpper();
1376 QString inFileName(inFile.expanded());
1377 fin.open(inFileName.toLatin1().data(), ios::in | ios::binary);
1378 if (!fin.is_open()) {
1379 QString msg =
"Cannot open input file [" +
p_inFile +
"]";
1380 throw IException(IException::Io, msg, _FILEINFO_);
1384 streampos pos = fin.tellg();
1396 QString msg =
"Cannot read file [" +
p_inFile +
"]. Position [" +
1397 toString((
int)pos) +
"]. Byte count [" +
1399 throw IException(IException::Io, msg, _FILEINFO_);
1405 if (funct != NULL) {
1417 for(
int band = 0; band <
p_nb; band++) {
1441 QString msg =
"Cannot read file [" +
p_inFile +
"]. Position [" +
1442 toString((
int)pos) +
"]. Byte count [" +
1444 throw IException(IException::Io, msg, _FILEINFO_);
1448 vector<char *> tempPre, tempPost;
1451 for(
int line = 0; line <
p_nl; line++) {
1465 QString msg =
"Cannot read file [" +
p_inFile +
"]. Position [" +
1466 toString((
int)pos) +
"]. Byte count [" +
1468 throw IException(IException::Io, msg, _FILEINFO_);
1473 fin.read(in, readBytes);
1475 QString msg =
"Cannot read file [" +
p_inFile +
"]. Position [" +
1476 toString((
int)pos) +
"]. Byte count [" +
1478 throw IException(IException::Io, msg, _FILEINFO_);
1483 for(
int samp = 0; samp <
p_ns; samp++) {
1485 case Isis::UnsignedByte:
1486 (*out)[samp] = (double)((
unsigned char *)in)[samp];
1488 case Isis::UnsignedWord:
1492 case Isis::SignedWord:
1493 (*out)[samp] = (double)swapper.
ShortInt((
short int *)in+samp);
1495 case Isis::SignedInteger:
1496 (*out)[samp] = (double)swapper.
Int((
int *)in+samp);
1499 case Isis::UnsignedInteger:
1500 (*out)[samp] = (double)swapper.
Uint32_t((
unsigned int *)in+samp);
1507 (*out)[samp] = (double)swapper.
Float((
float *)in+samp);
1511 (*out)[samp] = (double)swapper.
Double((
double *)in+samp);
1519 if (Isis::IsValidPixel((*out)[samp])) {
1520 (*out)[samp] = mult * ((*out)[samp]) + base;
1524 if (funct == NULL) {
1550 QString msg =
"Cannot read file [" +
p_inFile +
"]. Position [" +
1551 toString((
int)pos) +
"]. Byte count [" +
1553 throw IException(IException::Io, msg, _FILEINFO_);
1581 QString msg =
"Cannot read file [" +
p_inFile +
"]. Position [" +
1582 toString((
int)pos) +
"]. Byte count [" +
1584 throw IException(IException::Io, msg, _FILEINFO_);
1592 fin.seekg(0, ios_base::end);
1593 streampos e = fin.tellg();
1601 QString msg =
"Cannot read file [" +
p_inFile +
"]. Position [" +
1602 toString((
int)pos) +
"]. Byte count [" +
1604 throw IException(IException::Io, msg, _FILEINFO_);
1629 readBytes = readBytes *
p_ns;
1630 char *in =
new char [readBytes];
1634 tok = tok.toUpper();
1640 QString inFileName(inFile.expanded());
1641 fin.open(inFileName.toLatin1().data(), ios::in | ios::binary);
1642 if (!fin.is_open()) {
1643 QString msg =
"Cannot open input file [" +
p_inFile +
"]";
1644 throw IException(IException::Io, msg, _FILEINFO_);
1648 streampos pos = fin.tellg();
1661 QString msg =
"Cannot read file [" +
p_inFile +
"]. Position [" +
1662 toString((
int)pos) +
"]. Byte count [" +
1664 throw IException(IException::Io, msg, _FILEINFO_);
1670 if (funct != NULL) {
1684 for(
int line = 0; line <
p_nl; line++) {
1686 for(
int band = 0; band <
p_nb; band++) {
1700 QString msg =
"Cannot read file [" +
p_inFile +
"]. Position [" +
1701 toString((
int)pos) +
"]. Byte count [" +
1703 throw IException(IException::Io, msg, _FILEINFO_);
1707 vector<char *> tempPre, tempPost;
1721 QString msg =
"Cannot read file [" +
p_inFile +
"]. Position [" +
1722 toString((
int)pos) +
"]. Byte count [" +
1724 throw IException(IException::Io, msg, _FILEINFO_);
1730 fin.read(in, readBytes);
1732 QString msg =
"Cannot read file [" +
p_inFile +
"]. Position [" +
1733 toString((
int)pos) +
"]. Byte count [" +
1735 throw IException(IException::Io, msg, _FILEINFO_);
1740 for(
int samp = 0; samp <
p_ns; samp++) {
1742 case Isis::UnsignedByte:
1743 (*out)[samp] = (double)((
unsigned char *)in)[samp];
1745 case Isis::UnsignedWord:
1749 case Isis::SignedWord:
1750 (*out)[samp] = (double)swapper.
ShortInt((
short int *)in+samp);
1752 case Isis::SignedInteger:
1753 (*out)[samp] = (double)swapper.
Int((
int *)in+samp);
1755 case Isis::UnsignedInteger:
1756 (*out)[samp] = (double)swapper.
Uint32_t((
unsigned int *)in+samp);
1763 (*out)[samp] = (double)swapper.
Float((
float *)in+samp);
1767 (*out)[samp] = (double)swapper.
Double((
double *)in+samp);
1776 if (Isis::IsValidPixel((*out)[samp])) {
1777 (*out)[samp] = mult * ((*out)[samp]) + base;
1781 if (funct == NULL) {
1804 QString msg =
"Cannot read file [" +
p_inFile +
"]. Position [" +
1805 toString((
int)pos) +
"]. Byte count [" +
1807 throw IException(IException::Io, msg, _FILEINFO_);
1824 QString msg =
"Cannot read file [" +
p_inFile +
"]. Position [" +
1825 toString((
int)pos) +
"]. Byte count [" +
1827 throw IException(IException::Io, msg, _FILEINFO_);
1837 fin.seekg(0, ios_base::end);
1838 streampos e = fin.tellg();
1846 QString msg =
"Cannot read file [" +
p_inFile +
"]. Position [" +
1847 toString((
int)pos) +
"]. Byte count [" +
1849 throw IException(IException::Io, msg, _FILEINFO_);
1874 tok = tok.toUpper();
1880 QString inFileName(inFile.expanded());
1881 fin.open(inFileName.toLatin1().data(), ios::in | ios::binary);
1882 if (!fin.is_open()) {
1883 QString msg =
"Cannot open input file [" +
p_inFile +
"]";
1884 throw IException(IException::Io, msg, _FILEINFO_);
1888 streampos pos = fin.tellg();
1900 QString msg =
"Cannot read file [" +
p_inFile +
"]. Position [" +
1901 toString((
int)pos) +
"]. Byte count [" +
1903 throw IException(IException::Io, msg, _FILEINFO_);
1911 if (funct != NULL) {
1924 int readBytes =
p_ns * sampleBytes;
1925 char *in =
new char [readBytes];
1928 for(
int line = 0; line <
p_nl; line++) {
1931 QString msg =
"Cannot read file [" +
p_inFile +
"]. Position [" +
1932 toString((
int)pos) +
"]. Byte count [" +
1934 throw IException(IException::Io, msg, _FILEINFO_);
1938 vector<char *> tempPre, tempPost;
1942 QString msg =
"Cannot read file [" +
p_inFile +
"]. Position [" +
1943 toString((
int)pos) +
"]. Byte count [" +
1945 throw IException(IException::Io, msg, _FILEINFO_);
1950 fin.read(in, readBytes);
1952 QString msg =
"Cannot read file [" +
p_inFile +
"]. Position [" +
1953 toString((
int)pos) +
"]. Byte count [" +
1955 throw IException(IException::Io, msg, _FILEINFO_);
1959 for(
int band = 0; band <
p_nb; band++) {
1975 for(
int samp = 0; samp <
p_ns; samp++) {
1978 case Isis::UnsignedByte:
1979 (*out)[osamp] = (double)((
unsigned char *)in)[bufferIndex];
1981 case Isis::UnsignedWord:
1985 case Isis::SignedWord:
1986 (*out)[osamp] = (double)swapper.
ShortInt(&in[bufferIndex]);
1988 case Isis::SignedInteger:
1989 (*out)[samp] = (double)swapper.
Int(&in[bufferIndex]);
1991 case Isis::UnsignedInteger:
1992 (*out)[samp] = (double)swapper.
Uint32_t(&in[bufferIndex]);
1999 (*out)[osamp] = (double)swapper.
Float(&in[bufferIndex]);
2003 (*out)[osamp] = (double)swapper.
Double(&in[bufferIndex]);
2010 (*out)[osamp] =
TestPixel((*out)[osamp]);
2012 if (Isis::IsValidPixel((*out)[osamp])) {
2013 (*out)[osamp] = mult * ((*out)[osamp]) + base;
2018 if (funct == NULL) {
2031 for(
int samp = 0; samp <
p_ns; samp++) {
2034 tempPre.push_back(samplePrefix);
2040 for(
int samp = 0; samp <
p_ns; samp++) {
2044 tempPost.push_back(sampleSuffix);
2052 QString msg =
"Cannot read file [" +
p_inFile +
"]. Position [" +
2053 toString((
int)pos) +
"]. Byte count [" +
2055 throw IException(IException::Io, msg, _FILEINFO_);
2070 QString msg =
"Cannot read file [" +
p_inFile +
"]. Position [" +
2071 toString((
int)pos) +
"]. Byte count [" +
2073 throw IException(IException::Io, msg, _FILEINFO_);
2083 fin.seekg(0, ios_base::end);
2084 streampos e = fin.tellg();
2092 QString msg =
"Cannot read file [" +
p_inFile +
"]. Position [" +
2093 toString((
int)pos) +
"]. Byte count [" +
2095 throw IException(IException::Io, msg, _FILEINFO_);
2132 p_ns = JP2_decoder->GetSampleDimension();
2133 p_nl = JP2_decoder->GetLineDimension();
2134 p_nb = JP2_decoder->GetBandDimension();
2140 int endsamp = startsamp +
p_ns;
2141 int readBytes = sizeofpixel *
p_ns *
p_nb
2143 char **in =
new char* [
p_nb];
2144 for(
int i = 0; i <
p_nb; i++) {
2145 in[i] =
new char [readBytes];
2151 if (funct != NULL) {
2163 for(
int line = 0; line <
p_nl; line++) {
2165 JP2_decoder->
Read((
unsigned char **)in);
2168 JP2_decoder->
Read((
short int **)in);
2171 for(
int band = 0; band <
p_nb; band++) {
2184 vector<char *> tempPre, tempPost;
2195 for(
int samp = startsamp; samp < endsamp; samp++) {
2197 case Isis::UnsignedByte:
2198 (*out)[samp] = (double)((
unsigned char *)in[band])[samp];
2200 case Isis::UnsignedWord:
2201 (*out)[samp] = (double)((
unsigned short int *)in[band])[samp];
2203 case Isis::SignedWord:
2204 (*out)[samp] = (double)((
short int *)in[band])[samp];
2213 if (Isis::IsValidPixel((*out)[samp])) {
2214 (*out)[samp] = mult * ((*out)[samp]) + base;
2218 if (funct == NULL) {
2266 void ProcessImport::AddLabel(Isis::Pvl &label) {
2271 output->Find(
"IsisCube");
2272 output->Insert(label);
2281 void ProcessImport::AddImportLabel(Isis::Pvl &importLab) {
2286 output->Find(
"IsisCube");
2287 output->addObject(
"ImportLabel");
2288 output->Insert(importLab);
2303 if (!Isis::FileName(file).fileExists()) {
2304 QString msg =
"File [" + file +
"] does not exist";
2305 throw IException(IException::User, msg, _FILEINFO_);
2320 QString msg =
"No input file has been set";
2321 throw IException(IException::Programmer, msg, _FILEINFO_);
static UserInterface & GetUserInterface()
Returns the UserInterface object.
This algorithm is designed for applications that jump around between a couple of spots in the cube wi...
Buffer for containing a three dimensional section of an image.
Buffer for reading and writing cube data.
Manipulate and parse attributes of output cube filenames.
bool propagateMinimumMaximum() const
Return true if the min/max are to be propagated from an input cube.
bool propagatePixelType() const
Return true if the pixel type is to be propagated from an input cube.
void setMinimum(double min)
Set the output cube attribute minimum.
void setMaximum(double max)
Set the output cube attribute maximum.
void setPixelType(PixelType type)
Set the pixel type to that given by the parameter.
IO Handler for Isis Cubes.
float Float(void *buf)
Swaps a floating point value.
short int ShortInt(void *buf)
Swaps a short integer value.
int Int(void *buf)
Swaps a 4 byte integer value.
double Double(void *buf)
Swaps a double precision value.
uint32_t Uint32_t(void *buf)
Swaps a 32bit unsigned integer.
unsigned short int UnsignedShortInt(void *buf)
Swaps an unsigned short integer value.
void OpenFile()
Open the JPEG2000 file.
void Read(unsigned char **inbuf)
Read data from JP2 file containing 8-bit data.
Buffer manager, for moving through a cube in lines.
Process()
Constructs a Process Object.
Isis::Progress * p_progress
Pointer to a Progress object.
virtual Isis::Cube * SetOutputCube(const QString ¶meter)
Allocates a user-specified output cube whose size matches the first input cube.
std::vector< Isis::Cube * > OutputCubes
A vector of pointers to allocated Cube objects.
void SetVAXConvert(const bool vax_convert)
Sets the VAX flag of the input cube.
virtual void StartProcess()
Process the input file and write it to the output.
char * p_fileHeader
The file header.
ProcessImport::Interleave p_organization
The format of the input file.
double p_lis_min
The pixel value which is the lower bound of LIS data.
bool p_saveDataPost
Flag indicating whether to save the data suffix or not.
bool p_saveDataTrailer
Flag indicating whether to save the data trailer or not.
Isis::PixelType p_pixelType
Pixel type of input data.
void SetPixelType(const Isis::PixelType type)
Sets the pixel type of the input file.
void SetFileHeaderBytes(const int bytes)
This method sets the number of bytes in the header of a file.
bool p_saveDataPre
Flag indicating whether to save the data prefix or not.
std::vector< char * > DataTrailer()
This method returns a pointer to the data trailer.
double p_null_max
The pixel value which is the upper bound of NULL data.
ProcessImport()
Constructs an Import object.
void SaveDataPrefix()
This method marks the data prefix to be saved.
void SaveDataTrailer()
This method marks the data block trailers to be saved.
int FileHeaderBytes() const
This method returns the number of file header bytes.
void SetOrganization(const ProcessImport::Interleave org)
Sets the organization of the input cube.
char * FileTrailer()
This method returns a pointer to the file trailer.
void SetDataPrefixBytes(const int bytes)
This method sets the number of bytes at the beginning of each data record of a file.
int DataTrailerBytes() const
This method returns the number of data trailer bytes.
std::vector< double > p_base
An array containing the core base for each band.
QString p_inFile
Input file name.
void SetLIS(const double lis_min, const double lis_max)
Sets the range that will be considered Isis::Null.
int p_ns
Number of samples.
void SetHRS(const double hrs_min, const double hrs_max)
Sets the range that will be considered Isis::Null.
int p_suffixData
The number of bytes past the file header bytes where the suffix data bands are stored.
void SetSpecialValues(const double null, const double lrs, const double lis, const double hrs, const double his)
Sets a mapping of input pixel values to output special pixel values.
std::vector< std::vector< char * > > p_dataPost
The data suffix.
void SetNull(const double null_min, const double null_max)
Sets the range that will be considered Isis::Null.
void SetInputFile(const QString &file)
Sets the name of the input file to be read in the import StartProcess method and verifies its existan...
void SetMultiplier(const double mult)
Sets the core multiplier of the input cube.
void SetDataHeaderBytes(const int bytes)
This method sets the number of bytes in the header of each datablock of a file.
std::vector< double > p_mult
An array containing the core multiplier for each band.
std::vector< char * > p_dataTrailer
The data trailer.
void ProcessBip(void funct(Isis::Buffer &out)=NULL)
Function to process files stored as Band Interleaved by Pixel.
double p_his_min
The pixel value which is the lower bound of HIS data.
double p_lis_max
The pixel value which is the upper bound of LIS data.
Isis::Cube * SetOutputCube(const QString ¶meter)
Create the output file.
void SaveFileTrailer()
This method marks the file trailer to be saved.
bool p_saveDataHeader
Flag indicating whether to save the data header or not.
bool p_saveFileHeader
Flag indicating whether to save the file header or not.
int FileTrailerBytes() const
This method returns the number of file trailer bytes.
double p_lrs_max
The pixel value which is the upper bound of LRS data.
void CheckPixelRange(QString pixelName, double min, double max)
Checks the special pixel range of the given against all other special pixel value ranges,...
double p_hrs_max
The pixel value which is the upper bound of HRS data.
void ProcessJp2(void funct(Isis::Buffer &out)=NULL)
Function to process files containing compressed JPEG2000 data (which is always BSQ but is processed a...
int p_dataTrailerBytes
Number of bytes of non-image data after the image data of each data block, such as band trailer data ...
void SetLRS(const double lrs_min, const double lrs_max)
Sets the range that will be considered Isis::Null.
std::vector< std::vector< char * > > p_dataPre
The data prefix.
double p_lrs_min
The pixel value which is the lower bound of LRS data.
int DataPrefixBytes() const
This method returns the number of data prefix bytes.
double p_null_min
The pixel value which is the lower bound of NULL data.
double p_hrs_min
The pixel value which is the lower bound of HRS data.
int p_fileTrailerBytes
The number of bytes of non-image data at the end of a file.
Isis::PixelType p_suffixPixelType
The pixel type of the suffix data.
bool p_saveFileTrailer
Flag indicating whether to save the file trailer or not.
Interleave Organization() const
Gets the organization of the input cube.
double VAXConversion(void *ibuf)
Conversion routine which translates VAX_REAL to IEEE_REAL.
void SetFileTrailerBytes(const int bytes)
This method sets the number of bytes in the trailer of a file.
void SetDataTrailerBytes(const int bytes)
This method sets the number of bytes in the trailer of each datablock of a file.
std::vector< std::vector< char * > > DataSuffix()
This method returns a pointer to the data suffix.
QString InputFile()
Sets the name of the input file to be read in the import StartProcess method and verifies its existan...
std::vector< char * > p_dataHeader
The data header.
int DataSuffixBytes() const
This method returns the number of data duffix bytes.
void SaveDataHeader()
This method marks the data block headers to be saved.
void SetByteOrder(const Isis::ByteOrder order)
Sets the byte order of the input file.
void ProcessBil(void funct(Isis::Buffer &out)=NULL)
Function to process files stored as Band Interleaved by Line.
double p_his_max
The pixel value which is the upper bound of HIS data.
virtual ~ProcessImport()
Destroys the Import object.
std::vector< std::vector< char * > > DataPrefix()
This method returns a pointer to the data prefix.
void ProcessBsq(void funct(Isis::Buffer &out)=NULL)
Process the import data as a band sequential file.
void SetHIS(const double his_min, const double his_max)
Sets the range that will be considered Isis::Null.
Interleave
This enum includes how the document should be read: by BSQ, BIL, BIP, JP2, or InterleaveUndefined.
@ BIL
Band Interleaved By Line Format (i.e.
@ BIP
Band Interleaved By Pixel Format (i.e.
@ JP2
Jpeg 2000 Format (always band sequential).
@ BSQ
Band Sequential Format (i.e.
std::vector< char * > DataHeader()
This method returns a pointer to the data header.
void SetDataSuffixBytes(const int bytes)
This method sets the number of bytes at the end of each data record of a file.
char * FileHeader()
This method returns a pointer to the file header.
void SetBase(const double base)
Sets the core base of the input cube.
double TestPixel(const double pixel)
Tests the pixel.
Isis::ByteOrder p_byteOrder
Byte order of data.
void SetAttributes(CubeAttributeOutput &att)
Given a CubeAttributeOutput object, set min/max to propagate if propagating min/max attributes was re...
int p_dataPreBytes
Number of bytes of non-image data preceding each data record, such as line prefix data in a band sequ...
int p_dataPostBytes
Number of bytes of non-image data following each data record, such as line suffix data in a band sequ...
char * p_fileTrailer
The file trailer.
void SaveFileHeader()
This method marks the file header to be saved.
void SaveDataSuffix()
This method marks the data suffix to be saved.
int p_dataHeaderBytes
Number of bytes of non-image data after the file header and before the image data of each data block,...
void SetDimensions(const int ns, const int nl, const int nb)
Sets the physical size of the input cube.
int DataHeaderBytes() const
This method returns the number of data header bytes.
int p_fileHeaderBytes
The number of bytes of non-image data at the beginning of a file.
bool IsVAXSpecial(unsigned int *vax, VAXSpecialPixel pix)
Determines if the VAX encoded pixel value is special or not.
Command Line and Xml loader, validation, and access.
QString GetCubeName(const QString ¶mName, QString extension="") const
Retrieves of a value for a parameter of type "cubename".
Isis::CubeAttributeOutput & GetOutputAttribute(const QString ¶mName)
Gets the attributes for an output cube.
This is free and unencumbered software released into the public domain.
QString toString(const LinearAlgebra::Vector &vector, int precision)
A global function to format LinearAlgebra::Vector as a QString with the given precision.
Namespace for the standard library.