Official websites use .gov
A .gov website belongs to an official government organization in the United States.

Secure .gov websites use HTTPS
A lock ( ) or https:// means you’ve safely connected to the .gov website. Share sensitive information only on official, secure websites.

Isis 3 Programmer Reference
Process.cpp
1
5
6/* SPDX-License-Identifier: CC0-1.0 */
7#include <sstream>
8#include <fstream>
9
10#include <QSet>
11
12#include "SessionLog.h"
13#include "Process.h"
14#include "FileName.h"
15#include "Message.h"
16#include "IException.h"
17#include "IString.h"
18#include "Preference.h"
19#include "Application.h"
20#include "History.h"
21#include "OriginalLabel.h"
22#include "LineManager.h"
23
24using namespace std;
25namespace Isis {
26
27
30 m_ownedCubes = NULL;
31
33 p_progress->SetText("Working");
34 p_propagateLabels = true;
35 p_propagateTables = true;
37 p_propagateHistory = true;
39
41 }
42
45 EndProcess();
46 delete p_progress;
47
48 delete m_ownedCubes;
49 m_ownedCubes = NULL;
50 }
51
52
68 Isis::Cube *Process::SetInputCube(const QString &fname,
69 const Isis::CubeAttributeInput &att,
70 int requirements) {
71 Isis::Cube *cube = new Isis::Cube;
72 if(att.bands().size() != 0) {
73 vector<QString> lame = att.bands();
74 cube->setVirtualBands(lame);
75 }
76
77 try {
78 if(requirements & Isis::ReadWrite) {
79 cube->open(fname, "rw");
80 }
81 else {
82 // Make sure attributes don't get processed twice
83 cube->open(FileName(fname).expanded());
84 }
85 }
86 catch(IException &e) {
87 delete cube;
88 throw;
89 }
90
91 CheckRequirements(cube, requirements);
92
93 // Everything is good so save the cube on the stack
94 AddInputCube(cube);
95 return cube;
96 }
97
98
100 * Set the InputCube vector to an opened Cube which was dynamically allocated.
101 * This is used if there already exists a valid opened cube
102 *
103 * @author Sharmila Prasad (5/7/2011)
104 *
105 * @param inCube - Pointer to input Cube
106 *
107 * @param requirements Requirements to check that the input cube meets.
108 * See CheckRequirements().
109 */
110 void Process::SetInputCube(Isis::Cube *inCube, const int requirements)
111 {
112 if(inCube != NULL && inCube->isOpen()) {
113 CheckRequirements(inCube, requirements);
114 AddInputCube(inCube, false);
115 }
116 else {
117 QString message = "Input cube does not exist";
118 throw IException(IException::User, message, _FILEINFO_);
119 }
120 }
121
122
139 Isis::Cube *Process::SetInputCube(const QString &parameter,
140 const int requirements) {
141 QString fname = Application::GetUserInterface().GetCubeName(parameter);
143 return SetInputCube(FileName(fname).expanded(), att, requirements);
144 }
145
146
163 Isis::Cube *Process::SetOutputCube(const QString &parameter) {
164 // Make sure we have an input cube to get a default size from
165 if(InputCubes.size() == 0) {
166 QString message = "No input images have been selected ... therefore";
167 message += "the output image size can not be determined";
168 throw IException(IException::Programmer, message, _FILEINFO_);
169 }
170
171 int nl = InputCubes[0]->lineCount();
172 int ns = InputCubes[0]->sampleCount();
173 int nb = InputCubes[0]->bandCount();
174 return SetOutputCube(parameter, ns, nl, nb);
175 }
176
177
197 // Make sure we have an input cube to get a default size from
198 if(InputCubes.size() == 0) {
199 QString message = "No input images have been selected ... therefore";
200 message += "the output image size can not be determined";
201 throw IException(IException::Programmer, message, _FILEINFO_);
202 }
203
204 int nl = InputCubes[0]->lineCount();
205 int ns = InputCubes[0]->sampleCount();
206 int nb = InputCubes[0]->bandCount();
207 return SetOutputCubeStretch(parameter, ns, nl, nb, ui);
208 }
209
210
219 * this routine would allocate the file output.cub with size
220 * specified by the first opened input cube. The output pixel
221 * type will be propagated from the first loaded input cube or
222 * will use the value in the application XML file for
223 * pixelType.
225 * @param ns Number of samples to allocate
227 * @param nl Number of lines to allocate
229 * @param nb Number of bands to allocate
230 *
231 * @throws Isis::iException::Message
232 */
233 Isis::Cube *Process::SetOutputCube(const QString &parameter, const int ns,
234 const int nl, const int nb) {
235 // Make sure we have good dimensions
236 if((ns <= 0) || (nl <= 0) || (nb <= 0)) {
237 ostringstream message;
238 message << "Invalid cube size specifications [ns=" << ns << ",nl=" << nl
239 << ",nb=" << nb << "]";
240 throw IException(IException::Programmer, message.str().c_str(), _FILEINFO_);
241 }
242 QString fname;
244 fname = Application::GetUserInterface().GetCubeName(parameter);
246 return SetOutputCube(fname, atts, ns, nl, nb);
247}
248
249
275Isis::Cube *Process::SetOutputCubeStretch(const QString &parameter, const int ns,
276 const int nl, const int nb, UserInterface *ui) {
277 // Make sure we have good dimensions
278 if((ns <= 0) || (nl <= 0) || (nb <= 0)) {
279 ostringstream message;
280 message << "Invalid cube size specifications [ns=" << ns << ",nl=" << nl
281 << ",nb=" << nb << "]";
282 throw IException(IException::Programmer, message.str().c_str(), _FILEINFO_);
283 }
284 QString fname;
286 if(ui==nullptr){
287 fname = Application::GetUserInterface().GetCubeName(parameter);
289 }
290 else{
291 fname = ui->GetCubeName(parameter);
292 atts = ui->GetOutputAttribute(parameter);
293 }
294 return SetOutputCube(fname, atts, ns, nl, nb);
295}
296
297
315 Isis::Cube *Process::SetOutputCube(const QString &fname,
316 const Isis::CubeAttributeOutput &att,
317 const int ns, const int nl,
318 const int nb) {
319 // Make sure we have good dimensions
320 if ((ns <= 0) || (nl <= 0) || (nb <= 0)) {
321 ostringstream message;
322 message << "Invalid cube size specifications [ns=" << ns << ",nl=" << nl
323 << ",nb=" << nb << "]";
324 throw IException(IException::Programmer, message.str().c_str(), _FILEINFO_);
325 }
326
327 // Setup the cube
328 Isis::Cube *cube = new Isis::Cube;
329 try {
330 cube->setDimensions(ns, nl, nb);
331 cube->setByteOrder(att.byteOrder());
332
333 // If we have an input cube and the user did not specify an output format
334 // propagate the input cubes format to the output cube
335 if(InputCubes.size() > 0 && att.propagateFileFormat()) {
336 cube->setFormat(InputCubes[0]->format());
337 }
338 else {
339 cube->setFormat(att.fileFormat());
340 }
341
342 cube->setLabelsAttached(att.labelAttachment());
343 if (att.propagatePixelType()) {
344 if(InputCubes.size() > 0) {
345 cube->setPixelType(InputCubes[0]->pixelType());
346 }
347 else {
348 QString msg = "You told me to propagate PixelType from input to output";
349 msg += " cube but there are no input cubes loaded";
350 throw IException(IException::Programmer, msg, _FILEINFO_);
351 }
352 }
353 else {
354 cube->setPixelType(att.pixelType());
355 }
356
357 if(att.propagateMinimumMaximum()) {
358 if(cube->pixelType() == Isis::Real) {
359 cube->setBaseMultiplier(0.0, 1.0);
360 }
361 else if(InputCubes.size() == 0) {
362 QString msg = "You told me to propagate base/multiplier from input to output";
363 msg += " cube but there are no input cubes loaded";
364 throw IException(IException::Programmer, msg, _FILEINFO_);
365 }
366 else if(cube->pixelType() >= InputCubes[0]->pixelType()) {
367 double base = InputCubes[0]->base();
368 double mult = InputCubes[0]->multiplier();
369 cube->setBaseMultiplier(base, mult);
370 }
371 else if((cube->pixelType() != Isis::Real) &&
372 (cube->pixelType() != Isis::UnsignedByte) &&
373 (cube->pixelType() != Isis::UnsignedWord) &&
374 (cube->pixelType() != Isis::SignedWord) &&
375 (cube->pixelType() != Isis::UnsignedInteger) &&
376 (cube->pixelType() != Isis::SignedInteger)) {
377 QString msg = "Looks like your refactoring to add different pixel types";
378 msg += " you'll need to make changes here";
379 throw IException(IException::Programmer, msg, _FILEINFO_);
380 }
381 else {
382 QString msg = "You've chosen to reduce your output PixelType for [" +
383 fname + "] you must specify the output pixel range too";
384 throw IException(IException::User, msg, _FILEINFO_);
385 }
386 }
387 else {
388 // Not propagating so either the user entered or the programmer did
389 cube->setMinMax(att.minimum(), att.maximum());
390 }
391
392 if(InputCubes.size() > 0) {
393 int needLabBytes = InputCubes[0]->labelSize(true) + (1024 * 6);
394 if(needLabBytes > cube->labelSize()) {
395 cube->setLabelSize(needLabBytes);
396 }
397 }
398
399 // Allocate the cube
400 cube->create(fname);
401
402 // Transfer labels from the first input cube
403 if((p_propagateLabels) && (InputCubes.size() > 0)) {
404 Isis::PvlObject &incube =
405 InputCubes[0]->label()->findObject("IsisCube");
406 Isis::PvlObject &outcube = cube->label()->findObject("IsisCube");
407 for(int i = 0; i < incube.groups(); i++) {
408 outcube.addGroup(incube.group(i));
409 }
410
411 if (InputCubes[0]->label()->hasObject("NaifKeywords")) {
412 cube->label()->addObject(
413 InputCubes[0]->label()->findObject("NaifKeywords"));
414 }
415 }
416
417 // Transfer tables from the first input cube
418 if((p_propagateTables) && (InputCubes.size() > 0)) {
419 Isis::Pvl &inlab = *InputCubes[0]->label();
420 for(int i = 0; i < inlab.objects(); i++) {
421 if(inlab.object(i).isNamed("Table") || inlab.object(i).isNamed("String")) {
422 Isis::Blob t((QString)inlab.object(i)["Name"], inlab.object(i).name());
423 InputCubes[0]->read(t);
424 cube->write(t);
425 }
426 }
427 }
428
429 // Transfer blobs from the first input cube
430 if((p_propagatePolygons) && (InputCubes.size() > 0)) {
431 Isis::Pvl &inlab = *InputCubes[0]->label();
432 for(int i = 0; i < inlab.objects(); i++) {
433 if(inlab.object(i).isNamed("Polygon")) {
434 Isis::Blob t((QString)inlab.object(i)["Name"], inlab.object(i).name());
435 InputCubes[0]->read(t);
436 cube->write(t);
437 }
438 }
439 }
440
441 // Transfer original label from the first input cube
442 if((p_propagateOriginalLabel) && (InputCubes.size() > 0)) {
443 Isis::Pvl &inlab = *InputCubes[0]->label();
444 for(int i = 0; i < inlab.objects(); i++) {
445 if(inlab.object(i).isNamed("OriginalLabel")) {
446 Isis::OriginalLabel ol = InputCubes[0]->readOriginalLabel(inlab.object(i)["Name"]);
447 cube->write(ol);
448 }
449 }
450 }
451
452 // Transfer history from the first input cube
453 WriteHistory(*cube);
454 }
455 catch (IException &e) {
456 delete cube;
457 throw;
458 }
459 // Everything is fine so save the cube on the stack
460 AddOutputCube(cube);
461 return cube;
462 }
463
464
474
475
481 ClearCubes();
482 }
483
484
485 void Process::AddInputCube(Cube *cube, bool owned) {
486 InputCubes.push_back(cube);
487 if (owned) m_ownedCubes->insert(cube);
488 }
489
490
491 void Process::AddOutputCube(Cube *cube, bool owned) {
492 OutputCubes.push_back(cube);
493 if (owned) m_ownedCubes->insert(cube);
494 }
495
496
522 void Process::CheckRequirements(const Cube *cube, int requirements) {
523 // Test for same size or one in all dimensions
524 if(requirements & Isis::AllMatchOrOne) {
525 if(InputCubes.size() > 0) {
526 if(cube->lineCount() != 1) {
527 if(cube->lineCount() != InputCubes[0]->lineCount()) {
528 QString message = "The number of lines in the secondary input cubes must match";
529 message += " the primary input cube or be exactly one";
530 throw IException(IException::User, message, _FILEINFO_);
531 }
532 }
533
534 if(cube->sampleCount() != 1) {
535 if(cube->sampleCount() != InputCubes[0]->sampleCount()) {
536 QString message = "The number of samples in the secondary input cubes must match";
537 message += " the primary input cube or be exactly one";
538 throw IException(IException::User, message, _FILEINFO_);
539 }
540 }
541 if(cube->bandCount() != 1) {
542 if(cube->bandCount() != InputCubes[0]->bandCount()) {
543 QString message = "The number of bands in the secondary input cubes must match";
544 message += " the primary input cube or be exactly one";
545 throw IException(IException::User, message, _FILEINFO_);
546 }
547 }
548
549 // Do not do a spatial match if this flag was set
550 requirements = requirements & !Isis::SpatialMatch;
551 }
552 }
553
554 // Test for size match if requested
555 if(requirements & Isis::SizeMatch) {
556 if(InputCubes.size() > 0) {
557 if(cube->lineCount() != InputCubes[0]->lineCount()) {
558 QString message = "The number of lines in the input cubes must match";
559 throw IException(IException::User, message, _FILEINFO_);
560 }
561 if(cube->sampleCount() != InputCubes[0]->sampleCount()) {
562 QString message = "The number of samples in the input cubes must match";
563 throw IException(IException::User, message, _FILEINFO_);
564 }
565 if(cube->bandCount() != InputCubes[0]->bandCount()) {
566 QString message = "The number of bands in the input cubes must match";
567 throw IException(IException::User, message, _FILEINFO_);
568 }
569 }
570 }
571
572 // Test for spatial match if requested
573 if(requirements & Isis::SpatialMatch) {
574 if(InputCubes.size() > 0) {
575 if(cube->lineCount() != InputCubes[0]->lineCount()) {
576 QString message = "The number of lines in the input cubes must match";
577 throw IException(IException::User, message, _FILEINFO_);
578 }
579 if(cube->sampleCount() != InputCubes[0]->sampleCount()) {
580 QString message = "The number of samples in the input cubes must match";
581 throw IException(IException::User, message, _FILEINFO_);
582 }
583 }
584 }
585
586 // Test for one band
587 if(requirements & Isis::OneBand) {
588 if(cube->bandCount() != 1) {
589 QString message = "Input cube [" + cube->fileName() + "] must have one band";
590 throw IException(IException::User, message, _FILEINFO_);
591 }
592 }
593
594 // Test for same bands or one band
595 if(requirements & Isis::BandMatchOrOne) {
596 if(cube->bandCount() != 1) {
597 if(InputCubes.size() > 0) {
598 if(cube->bandCount() != InputCubes[0]->bandCount()) {
599 QString message = "The number of bands in the secondary input cubes must match";
600 message += " the primary input cube or be exactly one";
601 throw IException(IException::User, message, _FILEINFO_);
602 }
603 }
604 }
605 }
606 }
607
608
613 // Close the cubes
616 m_ownedCubes->clear();
617 }
618
619
624 // Close the cubes
625 for (unsigned int i = 0; i < InputCubes.size(); i++) {
626 if (m_ownedCubes->contains(InputCubes[i])) {
627 InputCubes[i]->close();
628 delete InputCubes[i];
629 }
630 }
631 InputCubes.clear();
632 }
633
634
639 // Close the cubes
640 for (unsigned int i = 0; i < OutputCubes.size(); i++) {
641 if (m_ownedCubes->contains(OutputCubes[i])) {
642 OutputCubes[i]->close();
643 delete OutputCubes[i];
644 }
645 }
646 OutputCubes.clear();
647 }
648
649
661 void Process::PropagateLabels(const bool prop) {
662 p_propagateLabels = prop;
663 }
664
665
673 void Process::PropagateLabels(const QString &cube) {
674 // Open the Pvl file
675 Isis::Pvl inLabels(cube);
676
677 // Loop for each output cube
678 for(int i = 0; i < (int)OutputCubes.size(); i++) {
679 Isis::PvlObject &inCubeLabels = inLabels.findObject("IsisCube");
680
681 Isis::Pvl &outLabels(*OutputCubes[i]->label());
682 Isis::PvlObject &outCubeLabels = outLabels.findObject("IsisCube");
683
684 for(int g = 0; g < inCubeLabels.groups(); g++) {
685 outCubeLabels.addGroup(inCubeLabels.group(g));
686 }
687
688 if (inLabels.hasObject("NaifKeywords")) {
689 outLabels.addObject(inLabels.findObject("NaifKeywords"));
690 }
691 }
692 }
693
694
702 void Process::PropagateTables(const bool prop) {
703 p_propagateTables = prop;
704 }
705
706
723 void Process::PropagateTables(const QString &fromName, const QList<QString> &tableNames) {
724 Cube *fromCube = new Isis::Cube;
725 fromCube->open(fromName);
726 const Pvl *fromLabels = fromCube->label();
727
728 for (unsigned int i = 0; i < OutputCubes.size(); i++) {
729 for (int j = 0; j < fromLabels->objects(); j++) {
730 const PvlObject &object = fromLabels->object(j);
731
732 if (object.isNamed("Table")) {
733 if (tableNames.isEmpty() || tableNames.contains(object["Name"])) {
734 Blob table((QString) object["Name"], object.name());
735 fromCube->read(table);
736 OutputCubes[i]->write(table);
737 }
738 }
739 }
740 }
741 fromCube->close();
742 delete fromCube;
743 }
744
745
753 void Process::PropagatePolygons(const bool prop) {
754 p_propagatePolygons = prop;
755 }
756
757
764 void Process::PropagateHistory(const bool prop) {
765 p_propagateHistory = prop;
766 }
767
768
776 void Process::PropagateOriginalLabel(const bool prop) {
778 }
779
780
797 QString Process::MissionData(const QString &mission, const QString &file,
798 bool highestVersion) {
799 Isis::PvlGroup &dataDir = Isis::Preference::Preferences().findGroup("DataDirectory");
800 QString dir = dataDir[mission];
801
802 // See if the data directory is installed
803 Isis::FileName installed(dir);
804 if(!installed.fileExists()) {
805 QString message = "Data directory for mission [" + mission + "] " +
806 "is not installed at your site";
807 throw IException(IException::Io, message, _FILEINFO_);
808 }
809
810 Isis::FileName expanded(dir + "/" + file);
811 // Highest version checks if the file exists, if we
812 // do not ask for the highest version, then we need to check
813 // if the file exists
814 if (highestVersion) {
815 expanded = expanded.highestVersion();
816 }
817 else {
818 if (!expanded.fileExists()) {
819 QString message = "The file [" + expanded.original() + "] " +
820 "cannot be found under [" + mission + "]";
821 throw IException(IException::Io, message, _FILEINFO_);
822 }
823 }
824 return expanded.expanded();
825 }
826
827
833 bool addedHist = false;
834 if(InputCubes.size() > 0) {
835 Isis::Pvl & inlab = *InputCubes[0]->label();
836 for(int i = 0; i < inlab.objects(); i++) {
837 if(inlab.object(i).isNamed("History") && Isis::iApp != NULL) {
838 QString histBlobName = (QString)inlab.object(i)["Name"];
839 History h = InputCubes[0]->readHistory(histBlobName);
840 h.AddEntry();
841 cube.write(h, histBlobName);
842 addedHist = true;
843 }
844 }
845 }
846
847 if(!addedHist && Isis::iApp != NULL) {
848 Isis::History h = cube.readHistory();
849 h.AddEntry();
850
851 cube.write(h);
852 }
853 }
854 }
855
856
868 for(unsigned cubeNum = 0; cubeNum < InputCubes.size(); cubeNum++) {
869 Cube *cube = InputCubes[cubeNum];
870
871 // Construct a line buffer manager and a statistics object
872 Isis::LineManager line(*cube);
873 Isis::Statistics *cubeStats = new Isis::Statistics();
874
875 int bandStart = 1;
876 int bandStop = cube->bandCount();
877 int maxSteps = cube->lineCount() * cube->bandCount();
878
879 QString cubeNumStr = toString(cubeNum + 1);
880 QString totalCubes = toString((int)InputCubes.size());
881 QString msg = "Calculating statistics for cube " + cubeNumStr + " of " + totalCubes;
882
883 Isis::Progress progress;
884 progress.SetText(msg);
885 progress.SetMaximumSteps(maxSteps);
886 progress.CheckStatus();
887
888 // Loop and get the statistics for a good minimum/maximum
889 vector<Statistics *> allBandStats;
890 for(int useBand = bandStart; useBand <= bandStop; useBand++) {
891 Isis::Statistics *bandStats = new Isis::Statistics();
892
893 for(int i = 1; i <= cube->lineCount(); i++) {
894 line.SetLine(i, useBand);
895 cube->read(line);
896 bandStats->AddData(line.DoubleBuffer(), line.size());
897 cubeStats->AddData(line.DoubleBuffer(), line.size());
898 progress.CheckStatus();
899 }
900
901 allBandStats.push_back(bandStats);
902 }
903
904 p_bandStats.push_back(allBandStats);
905 p_cubeStats.push_back(cubeStats);
906 }
907 }
908
909} // end namespace isis
static UserInterface & GetUserInterface()
Returns the UserInterface object.
int size() const
Returns the total number of pixels in the shape buffer.
Definition Buffer.h:97
double * DoubleBuffer() const
Returns the value of the shape buffer.
Definition Buffer.h:138
Manipulate and parse attributes of input cube filenames.
std::vector< QString > bands() const
Return a vector of the input bands specified.
Manipulate and parse attributes of output cube filenames.
double minimum() const
Return the output cube attribute minimum.
ByteOrder byteOrder() const
Return the byte order as an Isis::ByteOrder.
double maximum() const
Return the output cube attribute maximum.
bool propagateFileFormat() const
Return true if the file format is to be propagated from an input cube.
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.
Cube::Format fileFormat() const
Return the file format an Cube::Format.
PixelType pixelType() const
Return the pixel type as an Isis::PixelType.
IO Handler for Isis Cubes.
Definition Cube.h:168
void setPixelType(PixelType pixelType)
Used prior to the Create method, this will specify the output pixel type.
Definition Cube.cpp:1540
void setFormat(Format format)
Used prior to the Create method, this will specify the format of the cube, either band,...
Definition Cube.cpp:1502
int lineCount() const
Definition Cube.cpp:2008
void setDimensions(int ns, int nl, int nb)
Used prior to the Create method to specify the size of the cube.
Definition Cube.cpp:1450
int sampleCount() const
Definition Cube.cpp:2081
bool isOpen() const
Test if a cube file has been opened/created.
Definition Cube.cpp:189
void setBaseMultiplier(double base, double mult)
Used prior to the Create method, this will specify the base and multiplier for converting 8-bit/16-bi...
Definition Cube.cpp:1384
void setMinMax(double min, double max)
Used prior to the Create method, this will compute a good base and multiplier value given the minimum...
Definition Cube.cpp:1401
void create(const QString &cfile)
This method will create an isis cube for writing.
Definition Cube.cpp:426
void open(const QString &cfile, QString access="r")
This method will try to open a file as either a cube or geotiff in either read or read/write.
Definition Cube.cpp:792
PixelType pixelType() const
Definition Cube.cpp:2032
void setVirtualBands(const QList< QString > &vbands)
This allows the programmer to specify a subset of bands to work with.
Definition Cube.cpp:1557
void read(Blob &blob, const std::vector< PvlKeyword > keywords=std::vector< PvlKeyword >()) const
This method will read data from the specified Blob object.
Definition Cube.cpp:1043
void setLabelSize(int labelBytes)
Used prior to the Create method, this will allocate a specific number of bytes in the label area for ...
Definition Cube.cpp:1527
virtual QString fileName() const
Returns the opened cube's filename.
Definition Cube.cpp:1837
void write(Blob &blob, bool overwrite=true)
This method will write a blob of data (e.g.
Definition Cube.cpp:1219
void close(bool remove=false)
Closes the cube and updates the labels.
Definition Cube.cpp:272
History readHistory(const QString &name="IsisCube") const
Read the History from the Cube.
Definition Cube.cpp:1095
int labelSize(bool actual=false) const
Returns the number of bytes used by the label.
Definition Cube.cpp:1987
void setLabelsAttached(LabelAttachment attached)
Use prior to calling create, this sets whether or not to use separate label and data files.
Definition Cube.cpp:1514
virtual int bandCount() const
Returns the number of virtual bands for the cube.
Definition Cube.cpp:1646
Pvl * label() const
Returns a pointer to the IsisLabel object associated with the cube.
Definition Cube.cpp:1975
void setByteOrder(ByteOrder byteOrder)
Used prior to the Create method, this will specify the byte order of pixels, either least or most sig...
Definition Cube.cpp:1435
void AddEntry()
Adds History PvlObject.
Definition History.cpp:56
Buffer manager, for moving through a cube in lines.
Definition LineManager.h:39
bool SetLine(const int line, const int band=1)
Positions the buffer at the requested line and returns a status indicator if the set was succesful or...
Read and store original labels.
void PropagateLabels(const bool prop)
This method allows the programmer to turn on/off the propagation of labels from the 1st input cube to...
Definition Process.cpp:661
bool p_propagatePolygons
Flag indicating if blobs are be propagated to output cubes.
Definition Process.h:157
virtual void EndProcess()
End the processing sequence and cleans up by closing cubes, freeing memory, etc.
Definition Process.cpp:471
void PropagateHistory(const bool prop)
This method allows the programmer to propagate history to the output cube (default is true)
Definition Process.cpp:764
bool p_propagateOriginalLabel
Flag indicating if original lable is to be propagated to output cubes.
Definition Process.h:165
bool p_propagateLabels
Flag indicating if labels are be propagated to output cubes.
Definition Process.h:149
std::vector< std::vector< Isis::Statistics * > > p_bandStats
Holds the calculated statistics for each band separately of every input cubei after the CalculateStat...
Definition Process.h:172
virtual ~Process()
Destroys the Process Object. It will close all opened cubes.
Definition Process.cpp:44
std::vector< Isis::Statistics * > p_cubeStats
Holds the calculated statistics for every band together of every input cubei after the CalculateStati...
Definition Process.h:179
void PropagateOriginalLabel(const bool prop)
This method allows the programmer to propagate original labels to the output cube (default is true)
Definition Process.cpp:776
Process()
Constructs a Process Object.
Definition Process.cpp:29
std::vector< Isis::Cube * > InputCubes
A vector of pointers to opened Cube objects.
Definition Process.h:185
QString MissionData(const QString &mission, const QString &file, bool highestVersion=false)
This method reads the mission specific data directory from the user preference file,...
Definition Process.cpp:797
void PropagateTables(const bool prop)
This method allows the programmer to propagate input tables to the output cube (default is true)
Definition Process.cpp:702
void WriteHistory(Cube &cube)
Writes out the History blob to the cube.
Definition Process.cpp:831
virtual Isis::Cube * SetOutputCubeStretch(const QString &parameter, UserInterface *ui=nullptr)
Allocates a user-specified output cube whose size matches the first input cube.
Definition Process.cpp:196
QSet< Isis::Cube * > * m_ownedCubes
A list of cubes owned by this instant.
Definition Process.h:199
bool p_propagateHistory
Flag indicating if history is to be propagated to output cubes.
Definition Process.h:161
Isis::Progress * p_progress
Pointer to a Progress object.
Definition Process.h:145
virtual Isis::Cube * SetOutputCube(const QString &parameter)
Allocates a user-specified output cube whose size matches the first input cube.
Definition Process.cpp:163
std::vector< Isis::Cube * > OutputCubes
A vector of pointers to allocated Cube objects.
Definition Process.h:191
void CalculateStatistics()
Calculates and stores off statistics on every band of every cube added to this process via the SetInp...
Definition Process.cpp:867
void CheckRequirements(const Cube *cube, const int requirements)
Checks to make sure the input cube meets the inputted requirements.
Definition Process.cpp:522
virtual Isis::Cube * SetInputCube(const QString &parameter, const int requirements=0)
Opens an input cube specified by the user and verifies requirements are met.
Definition Process.cpp:139
void PropagatePolygons(const bool prop)
This method allows the programmer to propagate input blobs to the output cube (default is true)
Definition Process.cpp:753
void ClearInputCubes()
Close owned input cubes from the list and clear the list.
Definition Process.cpp:623
bool p_propagateTables
Flag indicating if tables are be propagated to output cubes.
Definition Process.h:153
void ClearOutputCubes()
Close owned output cubes from the list and clear the list.
Definition Process.cpp:638
void ClearCubes()
Close owned cubes from the list and clear the list.
Definition Process.cpp:612
virtual void Finalize()
Cleans up by closing cubes and freeing memory for owned cubes.
Definition Process.cpp:480
Program progress reporter.
Definition Progress.h:42
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
This class is used to accumulate statistics on double arrays.
Definition Statistics.h:93
void AddData(const double *data, const unsigned int count)
Add an array of doubles to the accumulators and counters.
Command Line and Xml loader, validation, and access.
Isis::CubeAttributeInput & GetInputAttribute(const QString &paramName)
Gets the attributes for an input cube.
Definition IsisAml.cpp:2056
QString GetCubeName(const QString &paramName, QString extension="") const
Retrieves of a value for a parameter of type "cubename".
Definition IsisAml.cpp:722
Isis::CubeAttributeOutput & GetOutputAttribute(const QString &paramName)
Gets the attributes for an output cube.
Definition IsisAml.cpp:2102
This is free and unencumbered software released into the public domain.
This is free and unencumbered software released into the public domain.
Definition Process.h:16
This is free and unencumbered software released into the public domain.
Definition Apollo.h:16
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.