Isis 3 Programmer Reference
ProcessExport.cpp
1
6/* SPDX-License-Identifier: CC0-1.0 */
7#include <iostream>
8#include <iomanip>
9#include <QCryptographicHash>
10#include <QString>
11
12#include "ProcessExport.h"
13#include "Preference.h"
14#include "IException.h"
15#include "LineManager.h"
16#include "BandManager.h"
17#include "SpecialPixel.h"
18#include "Histogram.h"
19#include "Stretch.h"
20#include "Application.h"
21#include "EndianSwapper.h"
22#include "Projection.h"
23
24using namespace std;
25namespace Isis {
26
29
30 p_outputMinimum = 0.0;
31 p_outputMiddle = 0.5;
32 p_outputMaximum = 1.0;
33
34 p_inputMinimum.clear();
35 p_inputMiddle.clear();
36 p_inputMaximum.clear();
37
38 p_endianSwap = NULL;
39
41 SetOutputEndian(Isis::IsLsb() ? Isis::Lsb : Isis::Msb);
42 SetOutputType(Isis::Real);
43
44 p_Null_Set = false;
45 p_Lis_Set = false;
46 p_Lrs_Set = false;
47 p_His_Set = false;
48 p_Hrs_Set = false;
49
50 m_cryptographicHash = new QCryptographicHash(QCryptographicHash::Md5);
52
53 p_progress->SetText("Exporting");
54 }
55
56
59 if (p_endianSwap != NULL) {
60 delete p_endianSwap;
61 }
62 for (unsigned int i = 0; i < p_str.size(); i++) {
63 delete p_str[i];
64 }
65 p_str.clear();
66
68 }
69
70
93 void ProcessExport::SetInputRange(const double minimum, const double maximum) {
94 double middle = (minimum + maximum) / 2.0;
95 SetInputRange(minimum, middle, maximum);
96 }
97
122 void ProcessExport::SetInputRange(const double minimum, const double maximum, const int index) {
123 double middle = (minimum + maximum) / 2.0;
124 SetInputRange(minimum, middle, maximum, index);
125 }
153 void ProcessExport::SetInputRange(const double minimum, const double middle,
154 const double maximum) {
155 if (minimum >= middle) {
156 string message =
157 "minimum must be less than the middle [ProcessExport::SetInputRange]";
158 throw IException(IException::Programmer, message, _FILEINFO_);
159 }
160 if (middle >= maximum) {
161 string message =
162 "middle must be less than the maximum [ProcessExport::SetInputRange]";
163 throw IException(IException::Programmer, message, _FILEINFO_);
164 }
165 p_inputMinimum.clear();
166 p_inputMinimum.resize(InputCubes.size(), minimum);
167 p_inputMiddle.clear();
168 p_inputMiddle.resize(InputCubes.size(), middle);
169 p_inputMaximum.clear();
170 p_inputMaximum.resize(InputCubes.size(), maximum);
171 }
172
201 void ProcessExport::SetInputRange(const double minimum, const double middle,
202 const double maximum, const int index) {
203 if (minimum >= middle) {
204 string message =
205 "minimum must be less than the middle [ProcessExport::SetInputRange]";
206 throw IException(IException::Programmer, message, _FILEINFO_);
207 }
208 if (middle >= maximum) {
209 string message =
210 "middle must be less than the maximum [ProcessExport::SetInputRange]";
211 throw IException(IException::Programmer, message, _FILEINFO_);
212 }
213 if (index >= (int)InputCubes.size() || index < 0) {
214 string message =
215 "index out of bounds";
216 throw IException(IException::Programmer, message, _FILEINFO_);
217 }
218
219 p_inputMinimum.resize(index + 1, minimum);
220 p_inputMiddle.resize(index + 1, middle);
221 p_inputMaximum.resize(index + 1, maximum);
222 p_inputMinimum[index] = minimum;
223 p_inputMiddle[index] = middle;
224 p_inputMaximum[index] = maximum;
225 }
226
362
364 p_inputMinimum.clear();
365 p_inputMiddle.clear();
366 p_inputMaximum.clear();
367
368 for (unsigned int i = 0; i < InputCubes.size(); i++) {
369 // Get the manual stretch parameters if needed
370 QString strType = ui.GetString("STRETCH");
371 if (strType == "MANUAL") {
372 p_inputMinimum.push_back(ui.GetDouble("MINIMUM"));
373 p_inputMaximum.push_back(ui.GetDouble("MAXIMUM"));
374
375 p_inputMiddle.push_back(Isis::NULL8);
376 }
377
378 // Or get the automatic parameters
379 else if (strType != "NONE") {
380 Isis::Histogram *hist = InputCubes[i]->histogram(0);
381 p_inputMinimum.push_back(hist->Percent(
382 ui.GetDouble("MINPERCENT")));
383 p_inputMaximum.push_back(hist->Percent(
384 ui.GetDouble("MAXPERCENT")));
385 p_inputMiddle.push_back(Isis::NULL8);
386 ui.Clear("MINIMUM");
387 ui.Clear("MAXIMUM");
388 ui.PutDouble("MINIMUM", p_inputMinimum[i]);
389 ui.PutDouble("MAXIMUM", p_inputMaximum[i]);
390
391 if (strType == "PIECEWISE") {
392 p_inputMiddle[i] = hist->Median();
393
394 // If the median is the min or max, back off to linear
395 if (p_inputMiddle[i] == p_inputMinimum[i] ||
396 p_inputMiddle[i] == p_inputMaximum[i]) {
397 p_inputMiddle[i] = Isis::NULL8;
398 }
399 }
400
401 // Make sure the image isn't constant
402 if (p_inputMinimum[i] == p_inputMaximum[i]) {
403 p_inputMaximum[i] = p_inputMinimum[i] + 1.0;
404 if (strType == "PIECEWISE") p_inputMiddle[i] = p_inputMinimum[i] + 0.5;
405 }
406 }
407 }
408 }
409
410
411
412 bool ProcessExport::HasInputRange() const {
413 return p_inputMinimum.size() > 0;
414 }
415
416
418 double ProcessExport::GetInputMinimum(unsigned int n) const {
419 if (n >= p_inputMinimum.size())
421 "There is no input minimum for channel " + IString((int) n),
422 _FILEINFO_);
423
424 return p_inputMinimum[n];
425 }
426
427
429 double ProcessExport::GetInputMaximum(unsigned int n) const {
430 if (n >= p_inputMaximum.size())
432 "There is no input maximum for channel " + IString((int) n),
433 _FILEINFO_);
434
435 return p_inputMaximum[n];
436 }
437
438
454 void ProcessExport::SetOutputRange(const double minimum, const double maximum) {
455 if (minimum >= maximum) {
456 string message =
457 "minimum must be less than the maximum [ProcessExport::SetOutputRange]";
458 throw IException(IException::Programmer, message, _FILEINFO_);
459 }
460
461 p_outputMinimum = minimum;
462 p_outputMaximum = maximum;
464 }
465
466
476 void ProcessExport::SetOutputNull(const double value) {
477 p_Null = value;
478 p_Null_Set = true;
479 }
480
481
491 void ProcessExport::SetOutputLis(const double value) {
492 p_Lis = value;
493 p_Lis_Set = true;
494 }
495
496
506 void ProcessExport::SetOutputLrs(const double value) {
507 p_Lrs = value;
508 p_Lrs_Set = true;
509 }
510
511
521 void ProcessExport::SetOutputHis(const double value) {
522 p_His = value;
523 p_His_Set = true;
524 }
525
526
536 void ProcessExport::SetOutputHrs(const double value) {
537 p_Hrs = value;
538 p_Hrs_Set = true;
539 }
540
541
548
549
555 }
556
557
563 }
564
565
571 }
572
573
579 }
580
581
609 p_pixelType = pixelIn;
610
611 if (p_format < 0 || p_format > 3) {
612 string message =
613 "Format of the output file must be set prior to calling this method [ProcessExport::SetOutputType]";
614 throw IException(IException::Programmer, message, _FILEINFO_);
615 }
616 if (pixelIn == Isis::UnsignedByte)
617 SetOutputRange((double)VALID_MIN1, (double)VALID_MAX1);
618 else if (pixelIn == Isis::UnsignedWord)
619 SetOutputRange((double)VALID_MINU2, (double)VALID_MAXU2);
620 else if (pixelIn == Isis::SignedWord)
621 SetOutputRange((double)VALID_MIN2, (double)VALID_MAX2);
622 else if (pixelIn == Isis::Real)
623 if (p_format == JP2) {
624 string message =
625 "Unsupported bit type for JP2 formatted files [ProcessExport::SetOutputType]";
626 throw IException(IException::Programmer, message, _FILEINFO_);
627 }
628 else {
629 SetOutputRange(-DBL_MAX, DBL_MAX);
630 }
631 else {
632 string message =
633 "Unsupported bit type [ProcessExport::SetOutputType]";
634 throw IException(IException::Programmer, message, _FILEINFO_);
635 }
636 }
637
638
650 if (p_endianSwap != NULL) {
651 delete p_endianSwap;
652 }
653 p_endianType = byteOrderIn;
654 if (byteOrderIn == Isis::NoByteOrder) {
655 p_endianSwap = new EndianSwapper("NoByteOrder");
656 }
657 else if (byteOrderIn == Isis::Lsb) {
658 p_endianSwap = new EndianSwapper("LSB");
659 }
660 else if (byteOrderIn == Isis::Msb) {
661 p_endianSwap = new EndianSwapper("MSB");
662 }
663 }
664
665
676
677
687
688
695
696 QString checksum;
697
699 QString msg = "Cannot generate a checksum. Call setGenerateChecksum(true) before startProcess";
700 throw IException(IException::Programmer, msg, _FILEINFO_);
701 }
702 else {
703 if (m_cryptographicHash == NULL) {
704 QString msg = "Unable to generate a checksum. Did you call startProcess?";
705 throw IException(IException::Programmer, msg, _FILEINFO_);
706 return checksum;
707 }
708
709 checksum = m_cryptographicHash->result().toHex();
710 }
711
712 return checksum;
713 }
714
715
727 if (InputCubes.size() < 1) {
728 string m = "You have not specified any input cubes";
729 throw IException(IException::Programmer, m, _FILEINFO_);
730 }
731
732 // TODO this really belongs here, but causes problems because of its
733 // coupling with an application User Interface that contains a STRETCH
734 // parameter
735 //if (!HasInputRange()) SetInputRange();
736
737 // Construct a line buffer manager
738 if (p_format == BIP) {
739 p_progress->SetMaximumSteps((InputCubes[0]->sampleCount()) * (InputCubes[0]->lineCount()));
740 }
741 else {
742 p_progress->SetMaximumSteps((InputCubes[0]->lineCount()) * (InputCubes[0]->bandCount()));
743 }
744
745
746 // Setup a stretch object
747 p_str.clear();
748 for (unsigned int i = 0; i < InputCubes.size(); i++) {
749 p_str.push_back(new Stretch());
750 if (p_inputMinimum.size() > 0) {
752 p_str[i]->AddPair(p_inputMinimum[i], p_outputMinimum);
754 p_str[i]->AddPair(p_inputMiddle[i], p_outputMiddle);
755 }
756 p_str[i]->AddPair(p_inputMaximum[i], p_outputMaximum);
757 }
758 }
759
760 p_str[i]->SetNull(OutputNull());
761 p_str[i]->SetLis(OutputLis());
762 p_str[i]->SetLrs(OutputLrs());
763 p_str[i]->SetHis(OutputHis());
764 p_str[i]->SetHrs(OutputHrs());
765 }
766
768 return;
769 }
770
771
791 InitProcess();
792
794 if (p_format == BSQ) {
795 buff = new Isis::LineManager(*InputCubes[0]);
796 }
797 else if (p_format == BIL || p_format == JP2) {
798 buff = new Isis::LineManager(*InputCubes[0], true);
799 }
800 else if (p_format == BIP) {
801 buff = new Isis::BandManager(*InputCubes[0]);
802 }
803 else {
804 string m = "Invalid storage order.";
805 throw IException(IException::Programmer, m, _FILEINFO_);
806 }
807
808 // Loop and let the app programmer fiddle with the buffers
809 for (buff->begin(); !buff->end(); buff->next()) {
810 // Read a line of data
811 InputCubes[0]->read(*buff);
812 // Stretch the pixels into the desired range
813 for (int i = 0; i < buff->size(); i++) {
814 (*buff)[i] = p_str[0]->Map((*buff)[i]);
815 }
816 // Invoke the user function
817 funct(*buff);
819 }
820 }
821
822
841 void ProcessExport::StartProcess(void funct(vector<Buffer *> &in)) {
842 int length = (p_format == BIP) ?
843 InputCubes[0]->bandCount() : InputCubes[0]->lineCount();
844
845 // Loop and let the app programmer fiddle with the lines
846 vector<BufferManager *> imgrs = GetBuffers();
847 for (int k = 1; k <= length; k++) {
848 vector<Buffer *> ibufs;
849
850 for (unsigned int j = 0; j < InputCubes.size(); j++) {
851 // Read a line of data
852 InputCubes[j]->read(*imgrs[j]);
853
854 // Stretch the pixels into the desired range
855 for (int i = 0; i < InputCubes[0]->sampleCount(); i++)
856 (*imgrs[j])[i] = p_str[j]->Map((*imgrs[j])[i]);
857
858 ibufs.push_back(imgrs[j]);
859 }
860
861 // Invoke the user function
862 funct(ibufs);
863
864 for (unsigned int i = 0; i < imgrs.size(); i++) imgrs[i]->next();
866 }
867 }
868
869
870 vector<BufferManager *> ProcessExport::GetBuffers() {
871 InitProcess();
872 vector<BufferManager *> imgrs;
873 if (p_format == BSQ) {
874 imgrs = GetBuffersBSQ();
875 }
876 else if (p_format == BIL || p_format == JP2) {
877 imgrs = GetBuffersBIL();
878 }
879 else if (p_format == BIP) {
880 imgrs = GetBuffersBIP();
881 }
882 else {
883 string m = "Invalid storage order.";
884 throw IException(IException::Programmer, m, _FILEINFO_);
885 }
886 return imgrs;
887 }
888
889
905 vector<BufferManager *> ProcessExport::GetBuffersBSQ() {
906 int samples = InputCubes[0]->sampleCount();
907 int lines = InputCubes[0]->lineCount();
908
909 vector<BufferManager *> imgrs;
910 for (unsigned int i = 0; i < InputCubes.size(); i++) {
911 if ((InputCubes[i]->sampleCount() == samples) &&
912 (InputCubes[i]->lineCount() == lines)) {
913
915 iline->begin();
916 imgrs.push_back(iline);
917 }
918 else {
919 string m = "All input cubes must have the same dimensions";
920 throw IException(IException::Programmer, m, _FILEINFO_);
921 }
922 }
923
924 return imgrs;
925 }
926
927
944 vector<BufferManager *> ProcessExport::GetBuffersBIL() {
945 int samples = InputCubes[0]->sampleCount();
946 int lines = InputCubes[0]->lineCount();
947
948 vector<BufferManager *> imgrs;
949 for (unsigned int i = 0; i < InputCubes.size(); i++) {
950 if ((InputCubes[i]->sampleCount() == samples) &&
951 (InputCubes[i]->lineCount() == lines)) {
952
953 Isis::LineManager *iline = new Isis::LineManager(*InputCubes[i], true);
954 iline->begin();
955 imgrs.push_back(iline);
956 }
957 else {
958 string m = "All input cubes must have the same dimensions";
959 throw IException(IException::Programmer, m, _FILEINFO_);
960 }
961 }
962
963 return imgrs;
964 }
965
982 vector<BufferManager *> ProcessExport::GetBuffersBIP() {
983 int bands = InputCubes[0]->bandCount();
984 int samples = InputCubes[0]->sampleCount();
985
986 vector<BufferManager *> imgrs;
987 for (unsigned int i = 0; i < InputCubes.size(); i++) {
988 if ((InputCubes[i]->bandCount() == bands) && (InputCubes[i]->sampleCount() == samples)) {
990 iband->begin();
991 imgrs.push_back(iband);
992 }
993 else {
994 string m = "All input cubes must have the same dimensions";
995 throw IException(IException::Programmer, m, _FILEINFO_);
996 }
997 }
998
999 return imgrs;
1000 }
1001
1002
1003
1004
1017 void ProcessExport::StartProcess(std::ofstream &fout) {
1018 InitProcess();
1019
1020 Isis::BufferManager *buff;
1021 if (p_format == BSQ) {
1022 buff = new Isis::LineManager(*InputCubes[0]);
1023 }
1024 else if (p_format == BIL) {
1025 buff = new Isis::LineManager(*InputCubes[0], true);
1026 }
1027 else if (p_format == BIP) {
1028 buff = new Isis::BandManager(*InputCubes[0]);
1029 }
1030 else {
1031 string m = "Output stream cannot be generated for requested storage order type.";
1032 throw IException(IException::Programmer, m, _FILEINFO_);
1033 }
1034
1035 //This if is the changed one
1037 // Loop for each line of data
1038 for (buff->begin(); !buff->end(); buff->next()) {
1039 // Read a line of data
1040 InputCubes[0]->read(*buff);
1041 QByteArray byteArray;
1042 // Stretch the pixels into the desired range
1043 for (int i = 0; i < buff->size(); i++) {
1044 (*buff)[i] = p_str[0]->Map((*buff)[i]);
1045 byteArray.append((*buff)[i]);
1046 }
1047 if (p_pixelType == Isis::UnsignedByte)
1048 isisOut8(*buff, fout);
1049 else if (p_pixelType == Isis::UnsignedWord)
1050 isisOut16u(*buff, fout);
1051 else if (p_pixelType == Isis::SignedWord)
1052 isisOut16s(*buff, fout);
1053 else if (p_pixelType == Isis::Real)
1054 isisOut32(*buff, fout);
1056 m_cryptographicHash->addData(byteArray);
1057 }
1058 }
1059 else {
1060 for (buff->begin(); !buff->end(); buff->next()) {
1061 // Read a line of data
1062 InputCubes[0]->read(*buff);
1063 // Stretch the pixels into the desired range
1064 for (int i = 0; i < buff->size(); i++) {
1065 (*buff)[i] = p_str[0]->Map((*buff)[i]);
1066 }
1067 if (p_pixelType == Isis::UnsignedByte)
1068 isisOut8(*buff, fout);
1069 else if (p_pixelType == Isis::UnsignedWord)
1070 isisOut16u(*buff, fout);
1071 else if (p_pixelType == Isis::SignedWord)
1072 isisOut16s(*buff, fout);
1073 else if (p_pixelType == Isis::Real)
1074 isisOut32(*buff, fout);
1076 }
1077 }
1078 delete buff;
1079 return;
1080 }
1081
1082
1099 void ProcessExport::isisOut8(Buffer &in, std::ofstream &fout) {
1100 char *out8 = new char[in.size()];
1101 for (int samp = 0; samp < in.size(); samp++) {
1102 double pixel = in[samp];
1103 if (pixel <= 0.0) {
1104 out8[samp] = 0;
1105 }
1106 else if (pixel >= 255.0) {
1107 out8[samp] = (char)255;
1108 }
1109 else {
1110 out8[samp] = (char)(in[samp] + 0.5); //Rounds
1111 }
1112 }
1113 fout.write(out8, in.size());
1114 delete[] out8;
1115 return;
1116 }
1117
1118
1136 void ProcessExport::isisOut16s(Buffer &in, std::ofstream &fout) {
1137 short *out16s = new short[in.size()];
1138 for (int samp = 0; samp < in.size(); samp++) {
1139 double pixel = in[samp];
1140 short tempShort;
1141 if (pixel <= -32768.0) {
1142 tempShort = (short)32768;
1143 tempShort = -1 * tempShort;
1144 }
1145 else if (pixel >= 32767.0) {
1146 tempShort = (short)32767;
1147 }
1148 else {
1149 //Rounds
1150 if (in[samp] < 0.0) {
1151 tempShort = (short)(in[samp] - 0.5);
1152 }
1153 else {
1154 tempShort = (short)(in[samp] + 0.5);
1155 }
1156 }
1157 void *p_swap = &tempShort;
1158 out16s[samp] = p_endianSwap->ShortInt(p_swap);
1159 }
1160 fout.write((char *)out16s, in.size() * 2);
1161 delete[] out16s;
1162 return;
1163 }
1164
1165
1183 void ProcessExport::isisOut16u(Buffer &in, std::ofstream &fout) {
1184 unsigned short *out16u = new unsigned short[in.size()];
1185 for (int samp = 0; samp < in.size(); samp++) {
1186 double pixel = in[samp];
1187 unsigned short tempShort;
1188 if (pixel <= 0.0) {
1189 tempShort = 0;
1190 }
1191 else if (pixel >= 65535.0) {
1192 tempShort = 65535;
1193 }
1194 else {
1195 tempShort = (unsigned short)(in[samp] + 0.5); //Rounds
1196 }
1197 unsigned short *p_swap = &tempShort;
1198 out16u[samp] = p_endianSwap->UnsignedShortInt(p_swap);
1199 }
1200
1201 fout.write((char *)out16u, in.size() * 2);
1202 delete[] out16u;
1203 return;
1204 }
1205
1206
1223 void ProcessExport::isisOut32(Buffer &in, std::ofstream &fout) {
1224 int *out32 = new int[in.size()];
1225 for (int samp = 0; samp < in.size(); samp++) {
1226 double pixel = in[samp];
1227 float tempFloat;
1228 if (pixel <= -((double)FLT_MAX)) {
1229 tempFloat = -((double)FLT_MAX);
1230 }
1231 else if (pixel >= (double)FLT_MAX) {
1232 tempFloat = (double)FLT_MAX;
1233 }
1234 else {
1235 tempFloat = (double)in[samp];
1236 }
1237 void *p_swap = &tempFloat;
1238 out32[samp] = p_endianSwap->ExportFloat(p_swap);
1239 }
1240 fout.write((char *)out32, in.size() * 4);
1241 delete[] out32;
1242 return;
1243 }
1244
1255 void ProcessExport::CreateWorldFile(const QString &worldFile) {
1256 try {
1257 Projection *proj = InputCubes[0]->projection();
1258 proj->SetWorld(1.0, 1.0);
1259 ofstream os;
1260 os.open(worldFile.toLatin1().data(), ios::out);
1261
1262 // X resolution
1263 os << std::fixed << setprecision(15)
1264 << proj->Resolution() << endl;
1265 // scale and rotation
1266 os << 0.0 << endl;
1267 os << 0.0 << endl;
1268
1269 // Y resolution
1270 os << std::fixed << setprecision(15)
1271 << -proj->Resolution() << endl;
1272
1273 // Upper left x at pixel middle
1274 os << std::fixed << setprecision(15)
1275 << proj->XCoord() << endl;
1276
1277 // Upper left y at pixel middle
1278 os << std::fixed << setprecision(15)
1279 << proj->YCoord() << endl;
1280
1281 os.close();
1282 }
1283 catch(IException &e) {
1284 }
1285 }
1286}
static UserInterface & GetUserInterface()
Returns the UserInterface object.
Buffer manager, for moving through a cube in bands.
Definition BandManager.h:33
Buffer for reading and writing cube data.
Definition Buffer.h:53
Manages a Buffer over a cube.
short int ShortInt(void *buf)
Swaps a short integer value.
unsigned short int UnsignedShortInt(void *buf)
Swaps an unsigned short integer value.
int ExportFloat(void *buf)
Swaps a floating point value for Exporting.
Container of a cube histogram.
Definition Histogram.h:74
double Median() const
Returns the median.
Isis exception class.
Definition IException.h:91
@ Programmer
This error is for when a programmer made an API call that was illegal.
Definition IException.h:146
Adds specific functionality to C++ strings.
Definition IString.h:165
Buffer manager, for moving through a cube in lines.
Definition LineManager.h:39
double OutputNull()
Return the output special pixel value for NULL.
void InitProcess()
Convenience method that checks to make sure the user is only using valid input to the StartProcess me...
double p_Lis
The output value for pixels whose input DNs are Low Instrument Saturation values.
ExportFormat p_format
Current storage order.
std::vector< Stretch * > p_str
Stretch object to ensure a reasonable range of pixel values in the output data.
double OutputHis()
Return the output special pixel value for HIS.
double OutputLrs()
Return the output special pixel value for LRS.
bool p_Null_Set
Indicates whether p_Null has been set (i.e.
std::vector< BufferManager * > GetBuffersBSQ()
A single line of input data from each input cube will be passed to the line processing function.
QCryptographicHash * m_cryptographicHash
A cryptographic hash that will generate an MD5 checksum of the image data.
QString checksum()
@description Generates a file checksum.
void SetOutputHrs(const double value)
Set output special pixel value for HRS.
void CreateWorldFile(const QString &worldFile)
Create a standard world file for the input cube.
void SetOutputLrs(const double value)
Set output special pixel value for LRS.
double OutputLis()
Return the output special pixel value for LIS.
std::vector< BufferManager * > GetBuffersBIP()
A single band of input data from each input cube will be passed to the band processing function.
double p_outputMinimum
Desired minimum pixel value in the Buffer.
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.
void setCanGenerateChecksum(bool flag)
@description Set m_canGenerateChecksum which determines if we can generate a MD5 checksum on the imag...
bool p_His_Set
Indicates whether p_His has been set (i.e.
void SetOutputNull(const double value)
Set output special pixel value for NULL.
double GetInputMinimum(unsigned int n=0) const
Get the valid minimum pixel value for the Nth input cube.
void isisOut8(Buffer &in, std::ofstream &fout)
Method for writing 8-bit unsigned pixel data to a file stream.
std::vector< BufferManager * > GetBuffersBIL()
A single line of input data from each input cube will be passed to the line processing function.
void isisOut16u(Buffer &in, std::ofstream &fout)
Method for writing 16-bit unsigned pixel data to a file stream.
double p_outputMaximum
Desired maximum pixel value in the Buffer.
bool p_Lrs_Set
Indicates whether p_Lrs has been set (i.e.
void isisOut32(Buffer &in, std::ofstream &fout)
Method for writing 32-bit signed floating point pixels data to a file stream.
double OutputHrs()
Return the output special pixel value for HRS.
bool p_Hrs_Set
Indicates whether p_Hrs has been set (i.e.
bool m_canGenerateChecksum
Flag to determine if a file checksum will be generated.
std::vector< double > p_inputMaximum
Maximum pixel value in the input cube to be mapped to the maximum value in the Buffer.
void SetOutputType(Isis::PixelType pixelIn)
Set output pixel bit type in Buffer.
void isisOut16s(Buffer &in, std::ofstream &fout)
Method for writing 16-bit signed pixel data to a file stream.
void SetOutputLis(const double value)
Set output special pixel value for LIS.
void SetOutputEndian(enum ByteOrder endianness)
Set byte endianness of the output cube.
virtual void StartProcess(void funct(Isis::Buffer &in))
This method invokes the process operation over a single input cube.
void SetInputRange()
Set input pixel range from user.
bool canGenerateChecksum()
@description Return if we can generate a checksum
@ JP2
Compressed JPEG2000.
@ BSQ
Band sequential.
@ BIL
Band interleaved by line.
@ BIP
Band interleaved by pixel.
ProcessExport()
Constructs an Export object.
bool p_Lis_Set
Indicates whether p_Lis has been set (i.e.
double p_Lrs
The output value for pixels whose input DNs are Low Representation Saturation values.
double p_Null
The output value for pixels whose input DNs are Null values.
PixelType p_pixelType
The bits per pixel of the output image.
ByteOrder p_endianType
The byte order of the output file.
void setFormat(ExportFormat format)
Sets the storage order of the output file.
double p_outputMiddle
Middle pixel value (minimum+maximun)/2.0 in the Buffer.
virtual ~ProcessExport()
Destructor.
double GetInputMaximum(unsigned int n=0) const
Get the valid maximum pixel value for the Nth input cube.
void SetOutputRange(const double minimum, const double maximum)
Set output pixel range in Buffer.
EndianSwapper * p_endianSwap
Object to swap the endianness of the raw output to either MSB or LSB.
double p_His
The output value for pixels whose input DNs are High Instrument Saturation values.
void SetOutputHis(const double value)
Set output special pixel value for HIS.
std::vector< double > p_inputMinimum
Minimum pixel value in the input cube to be mapped to the minimum value in the Buffer.
double p_Hrs
The output value for pixels whose input DNs are High Representation Saturation values.
Base class for all cube processing derivatives.
Definition Process.h:143
std::vector< Isis::Cube * > InputCubes
A vector of pointers to opened Cube objects.
Definition Process.h:185
Isis::Progress * p_progress
Pointer to a Progress object.
Definition Process.h:145
void SetMaximumSteps(const int steps)
This sets the maximum number of steps in the process.
Definition Progress.cpp:85
void SetText(const QString &text)
Changes the value of the text string reported just before 0% processed.
Definition Progress.cpp:61
void CheckStatus()
Checks and updates the status.
Definition Progress.cpp:105
Base class for Map Projections.
Definition Projection.h:155
virtual bool SetWorld(const double x, const double y)
This method is used to set a world coordinate.
Pixel value mapper.
Definition Stretch.h:58
Command Line and Xml loader, validation, and access.
ByteOrder
Tests the current architecture for byte order.
Definition Endian.h:42
This is free and unencumbered software released into the public domain.
Definition Apollo.h:16
bool IsLsb()
Return true if this host is an LSB first machine and false if it is not.
Definition Endian.h:67
bool IsValidPixel(const double d)
Returns if the input pixel is valid.
PixelType
Enumerations for Isis Pixel Types.
Definition PixelType.h:27
Namespace for the standard library.