Isis 3 Programmer Reference
ProcessExport.cpp
Go to the documentation of this file.
1 
22 #include <iostream>
23 #include <iomanip>
24 #include <QCryptographicHash>
25 #include <QString>
26 
27 #include "ProcessExport.h"
28 #include "Preference.h"
29 #include "IException.h"
30 #include "LineManager.h"
31 #include "BandManager.h"
32 #include "SpecialPixel.h"
33 #include "Histogram.h"
34 #include "Stretch.h"
35 #include "Application.h"
36 #include "EndianSwapper.h"
37 #include "Projection.h"
38 
39 using namespace std;
40 namespace Isis {
41 
43  ProcessExport::ProcessExport() : Isis::Process() {
44 
45  p_outputMinimum = 0.0;
46  p_outputMiddle = 0.5;
47  p_outputMaximum = 1.0;
48 
49  p_inputMinimum.clear();
50  p_inputMiddle.clear();
51  p_inputMaximum.clear();
52 
53  p_endianSwap = NULL;
54 
55  setFormat(BSQ);
56  SetOutputEndian(Isis::IsLsb() ? Isis::Lsb : Isis::Msb);
57  SetOutputType(Isis::Real);
58 
59  p_Null_Set = false;
60  p_Lis_Set = false;
61  p_Lrs_Set = false;
62  p_His_Set = false;
63  p_Hrs_Set = false;
64 
65  m_cryptographicHash = new QCryptographicHash(QCryptographicHash::Md5);
66  m_canGenerateChecksum = false;
67 
68  p_progress->SetText("Exporting");
69  }
70 
71 
74  if (p_endianSwap != NULL) {
75  delete p_endianSwap;
76  }
77  for (unsigned int i = 0; i < p_str.size(); i++) {
78  delete p_str[i];
79  }
80  p_str.clear();
81 
82  delete m_cryptographicHash;
83  }
84 
85 
108  void ProcessExport::SetInputRange(const double minimum, const double maximum) {
109  double middle = (minimum + maximum) / 2.0;
110  SetInputRange(minimum, middle, maximum);
111  }
112 
137  void ProcessExport::SetInputRange(const double minimum, const double maximum, const int index) {
138  double middle = (minimum + maximum) / 2.0;
139  SetInputRange(minimum, middle, maximum, index);
140  }
141 
168  void ProcessExport::SetInputRange(const double minimum, const double middle,
169  const double maximum) {
170  if (minimum >= middle) {
171  string message =
172  "minimum must be less than the middle [ProcessExport::SetInputRange]";
174  }
175  if (middle >= maximum) {
176  string message =
177  "middle must be less than the maximum [ProcessExport::SetInputRange]";
179  }
180  p_inputMinimum.clear();
181  p_inputMinimum.resize(InputCubes.size(), minimum);
182  p_inputMiddle.clear();
183  p_inputMiddle.resize(InputCubes.size(), middle);
184  p_inputMaximum.clear();
185  p_inputMaximum.resize(InputCubes.size(), maximum);
186  }
187 
216  void ProcessExport::SetInputRange(const double minimum, const double middle,
217  const double maximum, const int index) {
218  if (minimum >= middle) {
219  string message =
220  "minimum must be less than the middle [ProcessExport::SetInputRange]";
222  }
223  if (middle >= maximum) {
224  string message =
225  "middle must be less than the maximum [ProcessExport::SetInputRange]";
227  }
228  if (index >= (int)InputCubes.size() || index < 0) {
229  string message =
230  "index out of bounds";
232  }
233 
234  p_inputMinimum.resize(index + 1, minimum);
235  p_inputMiddle.resize(index + 1, middle);
236  p_inputMaximum.resize(index + 1, maximum);
237  p_inputMinimum[index] = minimum;
238  p_inputMiddle[index] = middle;
239  p_inputMaximum[index] = maximum;
240  }
241 
375  p_inputMinimum.clear();
376  p_inputMiddle.clear();
377  p_inputMaximum.clear();
378 
379  for (unsigned int i = 0; i < InputCubes.size(); i++) {
380  // Get the manual stretch parameters if needed
381  QString strType = Application::GetUserInterface().GetString("STRETCH");
382  if (strType == "MANUAL") {
383  p_inputMinimum.push_back(Application::GetUserInterface().GetDouble("MINIMUM"));
384  p_inputMaximum.push_back(Application::GetUserInterface().GetDouble("MAXIMUM"));
385 
386  p_inputMiddle.push_back(Isis::NULL8);
387  }
388 
389  // Or get the automatic parameters
390  else if (strType != "NONE") {
391  Isis::Histogram *hist = InputCubes[i]->histogram(0);
392  p_inputMinimum.push_back(hist->Percent(
393  Application::GetUserInterface().GetDouble("MINPERCENT")));
394  p_inputMaximum.push_back(hist->Percent(
395  Application::GetUserInterface().GetDouble("MAXPERCENT")));
396  p_inputMiddle.push_back(Isis::NULL8);
401 
402  if (strType == "PIECEWISE") {
403  p_inputMiddle[i] = hist->Median();
404 
405  // If the median is the min or max, back off to linear
406  if (p_inputMiddle[i] == p_inputMinimum[i] ||
407  p_inputMiddle[i] == p_inputMaximum[i]) {
408  p_inputMiddle[i] = Isis::NULL8;
409  }
410  }
411 
412  // Make sure the image isn't constant
413  if (p_inputMinimum[i] == p_inputMaximum[i]) {
414  p_inputMaximum[i] = p_inputMinimum[i] + 1.0;
415  if (strType == "PIECEWISE") p_inputMiddle[i] = p_inputMinimum[i] + 0.5;
416  }
417  }
418  }
419  }
420 
421 
422  bool ProcessExport::HasInputRange() const {
423  return p_inputMinimum.size() > 0;
424  }
425 
426 
428  double ProcessExport::GetInputMinimum(unsigned int n) const {
429  if (n >= p_inputMinimum.size())
431  "There is no input minimum for channel " + IString((int) n),
432  _FILEINFO_);
433 
434  return p_inputMinimum[n];
435  }
436 
437 
439  double ProcessExport::GetInputMaximum(unsigned int n) const {
440  if (n >= p_inputMaximum.size())
442  "There is no input maximum for channel " + IString((int) n),
443  _FILEINFO_);
444 
445  return p_inputMaximum[n];
446  }
447 
448 
464  void ProcessExport::SetOutputRange(const double minimum, const double maximum) {
465  if (minimum >= maximum) {
466  string message =
467  "minimum must be less than the maximum [ProcessExport::SetOutputRange]";
469  }
470 
471  p_outputMinimum = minimum;
472  p_outputMaximum = maximum;
474  }
475 
476 
486  void ProcessExport::SetOutputNull(const double value) {
487  p_Null = value;
488  p_Null_Set = true;
489  }
490 
491 
501  void ProcessExport::SetOutputLis(const double value) {
502  p_Lis = value;
503  p_Lis_Set = true;
504  }
505 
506 
516  void ProcessExport::SetOutputLrs(const double value) {
517  p_Lrs = value;
518  p_Lrs_Set = true;
519  }
520 
521 
531  void ProcessExport::SetOutputHis(const double value) {
532  p_His = value;
533  p_His_Set = true;
534  }
535 
536 
546  void ProcessExport::SetOutputHrs(const double value) {
547  p_Hrs = value;
548  p_Hrs_Set = true;
549  }
550 
551 
556  return p_Null_Set ? p_Null : p_outputMinimum;
557  }
558 
559 
564  return p_Lis_Set ? p_Lis : p_outputMinimum;
565  }
566 
567 
572  return p_Lrs_Set ? p_Lrs : p_outputMinimum;
573  }
574 
575 
580  return p_His_Set ? p_His : p_outputMaximum;
581  }
582 
583 
588  return p_Hrs_Set ? p_Hrs : p_outputMaximum;
589  }
590 
591 
619  p_pixelType = pixelIn;
620 
621  if (p_format < 0 || p_format > 3) {
622  string message =
623  "Format of the output file must be set prior to calling this method [ProcessExport::SetOutputType]";
625  }
626  if (pixelIn == Isis::UnsignedByte)
627  SetOutputRange((double)VALID_MIN1, (double)VALID_MAX1);
628  else if (pixelIn == Isis::UnsignedWord)
629  SetOutputRange((double)VALID_MINU2, (double)VALID_MAXU2);
630  else if (pixelIn == Isis::SignedWord)
631  SetOutputRange((double)VALID_MIN2, (double)VALID_MAX2);
632  else if (pixelIn == Isis::Real)
633  if (p_format == JP2) {
634  string message =
635  "Unsupported bit type for JP2 formatted files [ProcessExport::SetOutputType]";
637  }
638  else {
639  SetOutputRange(-DBL_MAX, DBL_MAX);
640  }
641  else {
642  string message =
643  "Unsupported bit type [ProcessExport::SetOutputType]";
645  }
646  }
647 
648 
659  void ProcessExport::SetOutputEndian(enum ByteOrder byteOrderIn) {
660  if (p_endianSwap != NULL) {
661  delete p_endianSwap;
662  }
663  p_endianType = byteOrderIn;
664  if (byteOrderIn == Isis::NoByteOrder) {
665  p_endianSwap = new EndianSwapper("NoByteOrder");
666  }
667  else if (byteOrderIn == Isis::Lsb) {
668  p_endianSwap = new EndianSwapper("LSB");
669  }
670  else if (byteOrderIn == Isis::Msb) {
671  p_endianSwap = new EndianSwapper("MSB");
672  }
673  }
674 
675 
684  m_canGenerateChecksum = flag;
685  }
686 
687 
695  return m_canGenerateChecksum;
696  }
697 
698 
705 
706  QString checksum;
707 
708  if (!m_canGenerateChecksum) {
709  QString msg = "Cannot generate a checksum. Call setGenerateChecksum(true) before startProcess";
711  }
712  else {
713  if (m_cryptographicHash == NULL) {
714  QString msg = "Unable to generate a checksum. Did you call startProcess?";
716  return checksum;
717  }
718 
719  checksum = m_cryptographicHash->result().toHex();
720  }
721 
722  return checksum;
723  }
724 
725 
737  if (InputCubes.size() < 1) {
738  string m = "You have not specified any input cubes";
740  }
741 
742  // TODO this really belongs here, but causes problems because of its
743  // coupling with an application User Interface that contains a STRETCH
744  // parameter
745  //if (!HasInputRange()) SetInputRange();
746 
747  // Construct a line buffer manager
748  if (p_format == BIP) {
749  p_progress->SetMaximumSteps((InputCubes[0]->sampleCount()) * (InputCubes[0]->lineCount()));
750  }
751  else {
752  p_progress->SetMaximumSteps((InputCubes[0]->lineCount()) * (InputCubes[0]->bandCount()));
753  }
754 
755 
756  // Setup a stretch object
757  p_str.clear();
758  for (unsigned int i = 0; i < InputCubes.size(); i++) {
759  p_str.push_back(new Stretch());
760  if (p_inputMinimum.size() > 0) {
762  p_str[i]->AddPair(p_inputMinimum[i], p_outputMinimum);
764  p_str[i]->AddPair(p_inputMiddle[i], p_outputMiddle);
765  }
766  p_str[i]->AddPair(p_inputMaximum[i], p_outputMaximum);
767  }
768  }
769 
770  p_str[i]->SetNull(OutputNull());
771  p_str[i]->SetLis(OutputLis());
772  p_str[i]->SetLrs(OutputLrs());
773  p_str[i]->SetHis(OutputHis());
774  p_str[i]->SetHrs(OutputHrs());
775  }
776 
778  return;
779  }
780 
781 
801  InitProcess();
802 
803  Isis::BufferManager *buff;
804  if (p_format == BSQ) {
805  buff = new Isis::LineManager(*InputCubes[0]);
806  }
807  else if (p_format == BIL || p_format == JP2) {
808  buff = new Isis::LineManager(*InputCubes[0], true);
809  }
810  else if (p_format == BIP) {
811  buff = new Isis::BandManager(*InputCubes[0]);
812  }
813  else {
814  string m = "Invalid storage order.";
816  }
817 
818  // Loop and let the app programmer fiddle with the buffers
819  for (buff->begin(); !buff->end(); buff->next()) {
820  // Read a line of data
821  InputCubes[0]->read(*buff);
822  // Stretch the pixels into the desired range
823  for (int i = 0; i < buff->size(); i++) {
824  (*buff)[i] = p_str[0]->Map((*buff)[i]);
825  }
826  // Invoke the user function
827  funct(*buff);
829  }
830  }
831 
832 
851  void ProcessExport::StartProcess(void funct(vector<Buffer *> &in)) {
852  int length = (p_format == BIP) ?
853  InputCubes[0]->bandCount() : InputCubes[0]->lineCount();
854 
855  // Loop and let the app programmer fiddle with the lines
856  vector<BufferManager *> imgrs = GetBuffers();
857  for (int k = 1; k <= length; k++) {
858  vector<Buffer *> ibufs;
859 
860  for (unsigned int j = 0; j < InputCubes.size(); j++) {
861  // Read a line of data
862  InputCubes[j]->read(*imgrs[j]);
863 
864  // Stretch the pixels into the desired range
865  for (int i = 0; i < InputCubes[0]->sampleCount(); i++)
866  (*imgrs[j])[i] = p_str[j]->Map((*imgrs[j])[i]);
867 
868  ibufs.push_back(imgrs[j]);
869  }
870 
871  // Invoke the user function
872  funct(ibufs);
873 
874  for (unsigned int i = 0; i < imgrs.size(); i++) imgrs[i]->next();
876  }
877  }
878 
879 
880  vector<BufferManager *> ProcessExport::GetBuffers() {
881  InitProcess();
882  vector<BufferManager *> imgrs;
883  if (p_format == BSQ) {
884  imgrs = GetBuffersBSQ();
885  }
886  else if (p_format == BIL || p_format == JP2) {
887  imgrs = GetBuffersBIL();
888  }
889  else if (p_format == BIP) {
890  imgrs = GetBuffersBIP();
891  }
892  else {
893  string m = "Invalid storage order.";
894  throw IException(IException::Programmer, m, _FILEINFO_);
895  }
896  return imgrs;
897  }
898 
899 
915  vector<BufferManager *> ProcessExport::GetBuffersBSQ() {
916  int samples = InputCubes[0]->sampleCount();
917  int lines = InputCubes[0]->lineCount();
918 
919  vector<BufferManager *> imgrs;
920  for (unsigned int i = 0; i < InputCubes.size(); i++) {
921  if ((InputCubes[i]->sampleCount() == samples) &&
922  (InputCubes[i]->lineCount() == lines)) {
923 
925  iline->begin();
926  imgrs.push_back(iline);
927  }
928  else {
929  string m = "All input cubes must have the same dimensions";
931  }
932  }
933 
934  return imgrs;
935  }
936 
937 
954  vector<BufferManager *> ProcessExport::GetBuffersBIL() {
955  int samples = InputCubes[0]->sampleCount();
956  int lines = InputCubes[0]->lineCount();
957 
958  vector<BufferManager *> imgrs;
959  for (unsigned int i = 0; i < InputCubes.size(); i++) {
960  if ((InputCubes[i]->sampleCount() == samples) &&
961  (InputCubes[i]->lineCount() == lines)) {
962 
963  Isis::LineManager *iline = new Isis::LineManager(*InputCubes[i], true);
964  iline->begin();
965  imgrs.push_back(iline);
966  }
967  else {
968  string m = "All input cubes must have the same dimensions";
970  }
971  }
972 
973  return imgrs;
974  }
975 
992  vector<BufferManager *> ProcessExport::GetBuffersBIP() {
993  int bands = InputCubes[0]->bandCount();
994  int samples = InputCubes[0]->sampleCount();
995 
996  vector<BufferManager *> imgrs;
997  for (unsigned int i = 0; i < InputCubes.size(); i++) {
998  if ((InputCubes[i]->bandCount() == bands) && (InputCubes[i]->sampleCount() == samples)) {
1000  iband->begin();
1001  imgrs.push_back(iband);
1002  }
1003  else {
1004  string m = "All input cubes must have the same dimensions";
1006  }
1007  }
1008 
1009  return imgrs;
1010  }
1011 
1012 
1013 
1014 
1027  void ProcessExport::StartProcess(std::ofstream &fout) {
1028  InitProcess();
1029 
1030  Isis::BufferManager *buff;
1031  if (p_format == BSQ) {
1032  buff = new Isis::LineManager(*InputCubes[0]);
1033  }
1034  else if (p_format == BIL) {
1035  buff = new Isis::LineManager(*InputCubes[0], true);
1036  }
1037  else if (p_format == BIP) {
1038  buff = new Isis::BandManager(*InputCubes[0]);
1039  }
1040  else {
1041  string m = "Output stream cannot be generated for requested storage order type.";
1043  }
1044 
1045  //This if is the changed one
1046  if (m_canGenerateChecksum) {
1047  // Loop for each line of data
1048  for (buff->begin(); !buff->end(); buff->next()) {
1049  // Read a line of data
1050  InputCubes[0]->read(*buff);
1051  QByteArray byteArray;
1052  // Stretch the pixels into the desired range
1053  for (int i = 0; i < buff->size(); i++) {
1054  (*buff)[i] = p_str[0]->Map((*buff)[i]);
1055  byteArray.append((*buff)[i]);
1056  }
1057  if (p_pixelType == Isis::UnsignedByte)
1058  isisOut8(*buff, fout);
1059  else if (p_pixelType == Isis::UnsignedWord)
1060  isisOut16u(*buff, fout);
1061  else if (p_pixelType == Isis::SignedWord)
1062  isisOut16s(*buff, fout);
1063  else if (p_pixelType == Isis::Real)
1064  isisOut32(*buff, fout);
1066  m_cryptographicHash->addData(byteArray);
1067  }
1068  }
1069  else {
1070  for (buff->begin(); !buff->end(); buff->next()) {
1071  // Read a line of data
1072  InputCubes[0]->read(*buff);
1073  // Stretch the pixels into the desired range
1074  for (int i = 0; i < buff->size(); i++) {
1075  (*buff)[i] = p_str[0]->Map((*buff)[i]);
1076  }
1077  if (p_pixelType == Isis::UnsignedByte)
1078  isisOut8(*buff, fout);
1079  else if (p_pixelType == Isis::UnsignedWord)
1080  isisOut16u(*buff, fout);
1081  else if (p_pixelType == Isis::SignedWord)
1082  isisOut16s(*buff, fout);
1083  else if (p_pixelType == Isis::Real)
1084  isisOut32(*buff, fout);
1086  }
1087  }
1088  delete buff;
1089  return;
1090  }
1091 
1092 
1109  void ProcessExport::isisOut8(Buffer &in, std::ofstream &fout) {
1110  char *out8 = new char[in.size()];
1111  for (int samp = 0; samp < in.size(); samp++) {
1112  double pixel = in[samp];
1113  if (pixel <= 0.0) {
1114  out8[samp] = 0;
1115  }
1116  else if (pixel >= 255.0) {
1117  out8[samp] = (char)255;
1118  }
1119  else {
1120  out8[samp] = (char)(in[samp] + 0.5); //Rounds
1121  }
1122  }
1123  fout.write(out8, in.size());
1124  delete[] out8;
1125  return;
1126  }
1127 
1128 
1146  void ProcessExport::isisOut16s(Buffer &in, std::ofstream &fout) {
1147  short *out16s = new short[in.size()];
1148  for (int samp = 0; samp < in.size(); samp++) {
1149  double pixel = in[samp];
1150  short tempShort;
1151  if (pixel <= -32768.0) {
1152  tempShort = (short)32768;
1153  tempShort = -1 * tempShort;
1154  }
1155  else if (pixel >= 32767.0) {
1156  tempShort = (short)32767;
1157  }
1158  else {
1159  //Rounds
1160  if (in[samp] < 0.0) {
1161  tempShort = (short)(in[samp] - 0.5);
1162  }
1163  else {
1164  tempShort = (short)(in[samp] + 0.5);
1165  }
1166  }
1167  void *p_swap = &tempShort;
1168  out16s[samp] = p_endianSwap->ShortInt(p_swap);
1169  }
1170  fout.write((char *)out16s, in.size() * 2);
1171  delete[] out16s;
1172  return;
1173  }
1174 
1175 
1193  void ProcessExport::isisOut16u(Buffer &in, std::ofstream &fout) {
1194  unsigned short *out16u = new unsigned short[in.size()];
1195  for (int samp = 0; samp < in.size(); samp++) {
1196  double pixel = in[samp];
1197  unsigned short tempShort;
1198  if (pixel <= 0.0) {
1199  tempShort = 0;
1200  }
1201  else if (pixel >= 65535.0) {
1202  tempShort = 65535;
1203  }
1204  else {
1205  tempShort = (unsigned short)(in[samp] + 0.5); //Rounds
1206  }
1207  unsigned short *p_swap = &tempShort;
1208  out16u[samp] = p_endianSwap->UnsignedShortInt(p_swap);
1209  }
1210 
1211  fout.write((char *)out16u, in.size() * 2);
1212  delete[] out16u;
1213  return;
1214  }
1215 
1216 
1233  void ProcessExport::isisOut32(Buffer &in, std::ofstream &fout) {
1234  int *out32 = new int[in.size()];
1235  for (int samp = 0; samp < in.size(); samp++) {
1236  double pixel = in[samp];
1237  float tempFloat;
1238  if (pixel <= -((double)FLT_MAX)) {
1239  tempFloat = -((double)FLT_MAX);
1240  }
1241  else if (pixel >= (double)FLT_MAX) {
1242  tempFloat = (double)FLT_MAX;
1243  }
1244  else {
1245  tempFloat = (double)in[samp];
1246  }
1247  void *p_swap = &tempFloat;
1248  out32[samp] = p_endianSwap->ExportFloat(p_swap);
1249  }
1250  fout.write((char *)out32, in.size() * 4);
1251  delete[] out32;
1252  return;
1253  }
1254 
1265  void ProcessExport::CreateWorldFile(const QString &worldFile) {
1266  try {
1267  Projection *proj = InputCubes[0]->projection();
1268  proj->SetWorld(1.0, 1.0);
1269  ofstream os;
1270  os.open(worldFile.toLatin1().data(), ios::out);
1271 
1272  // X resolution
1273  os << std::fixed << setprecision(15)
1274  << proj->Resolution() << endl;
1275  // scale and rotation
1276  os << 0.0 << endl;
1277  os << 0.0 << endl;
1278 
1279  // Y resolution
1280  os << std::fixed << setprecision(15)
1281  << -proj->Resolution() << endl;
1282 
1283  // Upper left x at pixel middle
1284  os << std::fixed << setprecision(15)
1285  << proj->XCoord() << endl;
1286 
1287  // Upper left y at pixel middle
1288  os << std::fixed << setprecision(15)
1289  << proj->YCoord() << endl;
1290 
1291  os.close();
1292  }
1293  catch(IException &e) {
1294  }
1295  }
1296 }
bool canGenerateChecksum()
Return if we can generate a checksum
Buffer for reading and writing cube data.
Definition: Buffer.h:69
virtual ~ProcessExport()
Destructor.
bool m_canGenerateChecksum
Flag to determine if a file checksum will be generated.
void SetMaximumSteps(const int steps)
This sets the maximum number of steps in the process.
Definition: Progress.cpp:101
void isisOut16s(Buffer &in, std::ofstream &fout)
Method for writing 16-bit signed pixel data to a file stream.
static UserInterface & GetUserInterface()
Returns the UserInterface object.
void SetOutputLis(const double value)
Set output special pixel value for LIS.
bool p_His_Set
Indicates whether p_His has been set (i.e.
void SetOutputHis(const double value)
Set output special pixel value for HIS.
void SetOutputNull(const double value)
Set output special pixel value for NULL.
std::vector< BufferManager * > GetBuffersBIL()
A single line of input data from each input cube will be passed to the line processing function...
Namespace for the standard library.
ByteOrder
Tests the current architecture for byte order.
Definition: Endian.h:59
ByteOrder p_endianType
The byte order of the output file.
bool p_Null_Set
Indicates whether p_Null has been set (i.e.
unsigned short int UnsignedShortInt(void *buf)
Swaps an unsigned short integer value.
ExportFormat p_format
Current storage order.
double p_His
The output value for pixels whose input DNs are High Instrument Saturation values.
std::vector< BufferManager * > GetBuffersBSQ()
A single line of input data from each input cube will be passed to the line processing function...
double Resolution() const
This method returns the resolution for mapping world coordinates into projection coordinates.
Definition: Projection.cpp:690
double XCoord() const
This returns the projection X provided SetGround, SetCoordinate, SetUniversalGround, or SetWorld returned with success.
Definition: Projection.cpp:402
double OutputHis()
Return the output special pixel value for HIS.
bool IsValidPixel(const double d)
Returns if the input pixel is valid.
Definition: SpecialPixel.h:238
void setCanGenerateChecksum(bool flag)
Set m_canGenerateChecksum which determines if we can generate a MD5 checksum on the image data...
double OutputNull()
Return the output special pixel value for NULL.
void isisOut8(Buffer &in, std::ofstream &fout)
Method for writing 8-bit unsigned pixel data to a file stream.
This error is for when a programmer made an API call that was illegal.
Definition: IException.h:162
void CheckStatus()
Checks and updates the status.
Definition: Progress.cpp:121
int size() const
Returns the total number of pixels in the shape buffer.
Definition: Buffer.h:113
PixelType
Enumerations for Isis Pixel Types.
Definition: PixelType.h:43
void CreateWorldFile(const QString &worldFile)
Create a standard world file for the input cube.
double OutputLrs()
Return the output special pixel value for LRS.
std::vector< double > p_inputMinimum
Minimum pixel value in the input cube to be mapped to the minimum value in the Buffer.
bool begin()
Moves the shape buffer to the first position.
double OutputHrs()
Return the output special pixel value for HRS.
Buffer manager, for moving through a cube in lines.
Definition: LineManager.h:55
void SetOutputRange(const double minimum, const double maximum)
Set output pixel range in Buffer.
Compressed JPEG2000.
Base class for Map Projections.
Definition: Projection.h:171
bool p_Lrs_Set
Indicates whether p_Lrs has been set (i.e.
EndianSwapper * p_endianSwap
Object to swap the endianness of the raw output to either MSB or LSB.
double p_Lrs
The output value for pixels whose input DNs are Low Representation Saturation values.
void SetOutputType(Isis::PixelType pixelIn)
Set output pixel bit type in Buffer.
double p_Null
The output value for pixels whose input DNs are Null values.
Container of a cube histogram.
Definition: Histogram.h:86
void SetText(const QString &text)
Changes the value of the text string reported just before 0% processed.
Definition: Progress.cpp:77
Manages a Buffer over a cube.
Definition: BufferManager.h:68
void SetInputRange()
Set input pixel range from user.
Pixel value mapper.
Definition: Stretch.h:72
double p_Hrs
The output value for pixels whose input DNs are High Representation Saturation values.
bool p_Lis_Set
Indicates whether p_Lis has been set (i.e.
double GetInputMinimum(unsigned int n=0) const
Get the valid minimum pixel value for the Nth input cube.
std::vector< double > p_inputMaximum
Maximum pixel value in the input cube to be mapped to the maximum value in the Buffer.
#define _FILEINFO_
Macro for the filename and line number.
Definition: IException.h:40
void SetOutputHrs(const double value)
Set output special pixel value for HRS.
bool next()
Moves the shape buffer to the next position.
void setFormat(ExportFormat format)
Sets the storage order of the output file.
bool IsLsb()
Return true if this host is an LSB first machine and false if it is not.
Definition: Endian.h:84
double Percent(const double percent) const
Computes and returns the value at X percent of the histogram.
Definition: Histogram.cpp:572
void isisOut32(Buffer &in, std::ofstream &fout)
Method for writing 32-bit signed floating point pixels data to a file stream.
Byte swapper.
Definition: EndianSwapper.h:55
double YCoord() const
This returns the projection Y provided SetGround, SetCoordinate, SetUniversalGround, or SetWorld returned with success.
Definition: Projection.cpp:415
virtual void StartProcess(void funct(Isis::Buffer &in))
This method invokes the process operation over a single input cube.
double GetDouble(const QString &paramName) const
Allows the retrieval of a value for a parameter of type "double".
Definition: IsisAml.cpp:907
QString checksum()
Generates a file checksum.
void InitProcess()
Convenience method that checks to make sure the user is only using valid input to the StartProcess me...
void Clear(const QString &paramName)
Clears the value(s) in the named parameter.
Definition: IsisAml.cpp:1868
double p_outputMinimum
Desired minimum pixel value in the Buffer.
bool end() const
Returns true if the shape buffer has accessed the end of the cube.
Buffer manager, for moving through a cube in bands.
Definition: BandManager.h:48
double p_outputMiddle
Middle pixel value (minimum+maximun)/2.0 in the Buffer.
double p_outputMaximum
Desired maximum pixel value in the Buffer.
Band interleaved by pixel.
bool SetWorld(const double x, const double y)
This method is used to set a world coordinate.
Definition: Projection.cpp:512
Isis::Progress * p_progress
Pointer to a Progress object.
Definition: Process.h:160
double GetInputMaximum(unsigned int n=0) const
Get the valid maximum pixel value for the Nth input cube.
Isis exception class.
Definition: IException.h:107
Band interleaved by line.
Adds specific functionality to C++ strings.
Definition: IString.h:181
bool p_Hrs_Set
Indicates whether p_Hrs has been set (i.e.
Namespace for ISIS/Bullet specific routines.
Definition: Apollo.h:31
int ExportFloat(void *buf)
Swaps a floating point value for Exporting.
short int ShortInt(void *buf)
Swaps a short integer value.
std::vector< BufferManager * > GetBuffersBIP()
A single band of input data from each input cube will be passed to the band processing function...
std::vector< double > p_inputMiddle
Middle pixel value in the input cube to be mapped to the (minimum+maximum)/2.0 value in the Buffer...
double OutputLis()
Return the output special pixel value for LIS.
void SetOutputLrs(const double value)
Set output special pixel value for LRS.
double Median() const
Returns the median.
Definition: Histogram.cpp:540
void isisOut16u(Buffer &in, std::ofstream &fout)
Method for writing 16-bit unsigned pixel data to a file stream.
PixelType p_pixelType
The bits per pixel of the output image.
QString GetString(const QString &paramName) const
Allows the retrieval of a value for a parameter of type "string".
Definition: IsisAml.cpp:708
Base class for all cube processing derivatives.
Definition: Process.h:158
void SetOutputEndian(enum ByteOrder endianness)
Set byte endianness of the output cube.
QCryptographicHash * m_cryptographicHash
A cryptographic hash that will generate an MD5 checksum of the image data.
void PutDouble(const QString &paramName, const double &value)
Allows the insertion of a value for a parameter of type "double".
Definition: IsisAml.cpp:377
double p_Lis
The output value for pixels whose input DNs are Low Instrument Saturation values. ...
Band sequential.
std::vector< Stretch * > p_str
Stretch object to ensure a reasonable range of pixel values in the output data.
std::vector< Isis::Cube * > InputCubes
A vector of pointers to opened Cube objects.
Definition: Process.h:200