Loading [MathJax]/jax/output/NativeMML/config.js
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 cube->setFormat(att.fileFormat());
333 cube->setLabelsAttached(att.labelAttachment() == AttachedLabel);
334 if(att.propagatePixelType()) {
335 if(InputCubes.size() > 0) {
336 cube->setPixelType(InputCubes[0]->pixelType());
337 }
338 else {
339 QString msg = "You told me to propagate PixelType from input to output";
340 msg += " cube but there are no input cubes loaded";
341 throw IException(IException::Programmer, msg, _FILEINFO_);
342 }
343 }
344 else {
345 cube->setPixelType(att.pixelType());
346 }
347
348 if(att.propagateMinimumMaximum()) {
349 if(cube->pixelType() == Isis::Real) {
350 cube->setBaseMultiplier(0.0, 1.0);
351 }
352 else if(InputCubes.size() == 0) {
353 QString msg = "You told me to propagate base/multiplier from input to output";
354 msg += " cube but there are no input cubes loaded";
355 throw IException(IException::Programmer, msg, _FILEINFO_);
356 }
357 else if(cube->pixelType() >= InputCubes[0]->pixelType()) {
358 double base = InputCubes[0]->base();
359 double mult = InputCubes[0]->multiplier();
360 cube->setBaseMultiplier(base, mult);
361 }
362 else if((cube->pixelType() != Isis::Real) &&
363 (cube->pixelType() != Isis::UnsignedByte) &&
364 (cube->pixelType() != Isis::UnsignedWord) &&
365 (cube->pixelType() != Isis::SignedWord) &&
366 (cube->pixelType() != Isis::UnsignedInteger) &&
367 (cube->pixelType() != Isis::SignedInteger)) {
368 QString msg = "Looks like your refactoring to add different pixel types";
369 msg += " you'll need to make changes here";
370 throw IException(IException::Programmer, msg, _FILEINFO_);
371 }
372 else {
373 QString msg = "You've chosen to reduce your output PixelType for [" +
374 fname + "] you must specify the output pixel range too";
375 throw IException(IException::User, msg, _FILEINFO_);
376 }
377 }
378 else {
379 // Not propagating so either the user entered or the programmer did
380 cube->setMinMax(att.minimum(), att.maximum());
381 }
382
383 if(InputCubes.size() > 0) {
384 int needLabBytes = InputCubes[0]->labelSize(true) + (1024 * 6);
385 if(needLabBytes > cube->labelSize()) {
386 cube->setLabelSize(needLabBytes);
387 }
388 }
389
390 // Allocate the cube
391 cube->create(fname);
392
393 // Transfer labels from the first input cube
394 if((p_propagateLabels) && (InputCubes.size() > 0)) {
395 Isis::PvlObject &incube =
396 InputCubes[0]->label()->findObject("IsisCube");
397 Isis::PvlObject &outcube = cube->label()->findObject("IsisCube");
398 for(int i = 0; i < incube.groups(); i++) {
399 outcube.addGroup(incube.group(i));
400 }
401
402 if (InputCubes[0]->label()->hasObject("NaifKeywords")) {
403 cube->label()->addObject(
404 InputCubes[0]->label()->findObject("NaifKeywords"));
405 }
406 }
407
408 // Transfer tables from the first input cube
409 if((p_propagateTables) && (InputCubes.size() > 0)) {
410 Isis::Pvl &inlab = *InputCubes[0]->label();
411 for(int i = 0; i < inlab.objects(); i++) {
412 if(inlab.object(i).isNamed("Table")) {
413 Isis::Blob t((QString)inlab.object(i)["Name"], inlab.object(i).name());
414 InputCubes[0]->read(t);
415 cube->write(t);
416 }
417 }
418 }
419
420 // Transfer blobs from the first input cube
421 if((p_propagatePolygons) && (InputCubes.size() > 0)) {
422 Isis::Pvl &inlab = *InputCubes[0]->label();
423 for(int i = 0; i < inlab.objects(); i++) {
424 if(inlab.object(i).isNamed("Polygon")) {
425 Isis::Blob t((QString)inlab.object(i)["Name"], inlab.object(i).name());
426 InputCubes[0]->read(t);
427 cube->write(t);
428 }
429 }
430 }
431
432 // Transfer tables from the first input cube
433 if((p_propagateOriginalLabel) && (InputCubes.size() > 0)) {
434 Isis::Pvl &inlab = *InputCubes[0]->label();
435 for(int i = 0; i < inlab.objects(); i++) {
436 if(inlab.object(i).isNamed("OriginalLabel")) {
437 Isis::OriginalLabel ol = InputCubes[0]->readOriginalLabel(inlab.object(i)["Name"]);
438 cube->write(ol);
439 }
440 }
441 }
442
443 // Transfer history from the first input cube
444 WriteHistory(*cube);
445 }
446 catch (IException &e) {
447 delete cube;
448 throw;
449 }
450 // Everything is fine so save the cube on the stack
451 AddOutputCube(cube);
452 return cube;
453 }
454
455
465
466
472 ClearCubes();
473 }
474
475
476 void Process::AddInputCube(Cube *cube, bool owned) {
477 InputCubes.push_back(cube);
478 if (owned) m_ownedCubes->insert(cube);
479 }
480
481
482 void Process::AddOutputCube(Cube *cube, bool owned) {
483 OutputCubes.push_back(cube);
484 if (owned) m_ownedCubes->insert(cube);
485 }
486
487
513 void Process::CheckRequirements(const Cube *cube, int requirements) {
514 // Test for same size or one in all dimensions
515 if(requirements & Isis::AllMatchOrOne) {
516 if(InputCubes.size() > 0) {
517 if(cube->lineCount() != 1) {
518 if(cube->lineCount() != InputCubes[0]->lineCount()) {
519 QString message = "The number of lines in the secondary input cubes must match";
520 message += " the primary input cube or be exactly one";
521 throw IException(IException::User, message, _FILEINFO_);
522 }
523 }
524
525 if(cube->sampleCount() != 1) {
526 if(cube->sampleCount() != InputCubes[0]->sampleCount()) {
527 QString message = "The number of samples in the secondary input cubes must match";
528 message += " the primary input cube or be exactly one";
529 throw IException(IException::User, message, _FILEINFO_);
530 }
531 }
532 if(cube->bandCount() != 1) {
533 if(cube->bandCount() != InputCubes[0]->bandCount()) {
534 QString message = "The number of bands in the secondary input cubes must match";
535 message += " the primary input cube or be exactly one";
536 throw IException(IException::User, message, _FILEINFO_);
537 }
538 }
539
540 // Do not do a spatial match if this flag was set
541 requirements = requirements & !Isis::SpatialMatch;
542 }
543 }
544
545 // Test for size match if requested
546 if(requirements & Isis::SizeMatch) {
547 if(InputCubes.size() > 0) {
548 if(cube->lineCount() != InputCubes[0]->lineCount()) {
549 QString message = "The number of lines in the input cubes must match";
550 throw IException(IException::User, message, _FILEINFO_);
551 }
552 if(cube->sampleCount() != InputCubes[0]->sampleCount()) {
553 QString message = "The number of samples in the input cubes must match";
554 throw IException(IException::User, message, _FILEINFO_);
555 }
556 if(cube->bandCount() != InputCubes[0]->bandCount()) {
557 QString message = "The number of bands in the input cubes must match";
558 throw IException(IException::User, message, _FILEINFO_);
559 }
560 }
561 }
562
563 // Test for spatial match if requested
564 if(requirements & Isis::SpatialMatch) {
565 if(InputCubes.size() > 0) {
566 if(cube->lineCount() != InputCubes[0]->lineCount()) {
567 QString message = "The number of lines in the input cubes must match";
568 throw IException(IException::User, message, _FILEINFO_);
569 }
570 if(cube->sampleCount() != InputCubes[0]->sampleCount()) {
571 QString message = "The number of samples in the input cubes must match";
572 throw IException(IException::User, message, _FILEINFO_);
573 }
574 }
575 }
576
577 // Test for one band
578 if(requirements & Isis::OneBand) {
579 if(cube->bandCount() != 1) {
580 QString message = "Input cube [" + cube->fileName() + "] must have one band";
581 throw IException(IException::User, message, _FILEINFO_);
582 }
583 }
584
585 // Test for same bands or one band
586 if(requirements & Isis::BandMatchOrOne) {
587 if(cube->bandCount() != 1) {
588 if(InputCubes.size() > 0) {
589 if(cube->bandCount() != InputCubes[0]->bandCount()) {
590 QString message = "The number of bands in the secondary input cubes must match";
591 message += " the primary input cube or be exactly one";
592 throw IException(IException::User, message, _FILEINFO_);
593 }
594 }
595 }
596 }
597 }
598
599
604 // Close the cubes
607 m_ownedCubes->clear();
608 }
609
610
615 // Close the cubes
616 for (unsigned int i = 0; i < InputCubes.size(); i++) {
617 if (m_ownedCubes->contains(InputCubes[i])) {
618 InputCubes[i]->close();
619 delete InputCubes[i];
620 }
621 }
622 InputCubes.clear();
623 }
624
625
630 // Close the cubes
631 for (unsigned int i = 0; i < OutputCubes.size(); i++) {
632 if (m_ownedCubes->contains(OutputCubes[i])) {
633 OutputCubes[i]->close();
634 delete OutputCubes[i];
635 }
636 }
637 OutputCubes.clear();
638 }
639
640
652 void Process::PropagateLabels(const bool prop) {
653 p_propagateLabels = prop;
654 }
655
656
664 void Process::PropagateLabels(const QString &cube) {
665 // Open the Pvl file
666 Isis::Pvl inLabels(cube);
667
668 // Loop for each output cube
669 for(int i = 0; i < (int)OutputCubes.size(); i++) {
670 Isis::PvlObject &inCubeLabels = inLabels.findObject("IsisCube");
671
672 Isis::Pvl &outLabels(*OutputCubes[i]->label());
673 Isis::PvlObject &outCubeLabels = outLabels.findObject("IsisCube");
674
675 for(int g = 0; g < inCubeLabels.groups(); g++) {
676 outCubeLabels.addGroup(inCubeLabels.group(g));
677 }
678
679 if (inLabels.hasObject("NaifKeywords")) {
680 outLabels.addObject(inLabels.findObject("NaifKeywords"));
681 }
682 }
683 }
684
685
693 void Process::PropagateTables(const bool prop) {
694 p_propagateTables = prop;
695 }
696
697
714 void Process::PropagateTables(const QString &fromName, const QList<QString> &tableNames) {
715 Cube *fromCube = new Isis::Cube;
716 fromCube->open(fromName);
717 const Pvl *fromLabels = fromCube->label();
718
719 for (unsigned int i = 0; i < OutputCubes.size(); i++) {
720 for (int j = 0; j < fromLabels->objects(); j++) {
721 const PvlObject &object = fromLabels->object(j);
722
723 if (object.isNamed("Table")) {
724 if (tableNames.isEmpty() || tableNames.contains(object["Name"])) {
725 Blob table((QString) object["Name"], object.name());
726 fromCube->read(table);
727 OutputCubes[i]->write(table);
728 }
729 }
730 }
731 }
732 fromCube->close();
733 delete fromCube;
734 }
735
736
744 void Process::PropagatePolygons(const bool prop) {
745 p_propagatePolygons = prop;
746 }
747
748
755 void Process::PropagateHistory(const bool prop) {
756 p_propagateHistory = prop;
757 }
758
759
767 void Process::PropagateOriginalLabel(const bool prop) {
769 }
770
771
788 QString Process::MissionData(const QString &mission, const QString &file,
789 bool highestVersion) {
790 Isis::PvlGroup &dataDir = Isis::Preference::Preferences().findGroup("DataDirectory");
791 QString dir = dataDir[mission];
792
793 // See if the data directory is installed
794 Isis::FileName installed(dir);
795 if(!installed.fileExists()) {
796 QString message = "Data directory for mission [" + mission + "] " +
797 "is not installed at your site";
798 throw IException(IException::Io, message, _FILEINFO_);
799 }
800
801 Isis::FileName expanded(dir + "/" + file);
802 // Highest version checks if the file exists, if we
803 // do not ask for the highest version, then we need to check
804 // if the file exists
805 if (highestVersion) {
806 expanded = expanded.highestVersion();
807 }
808 else {
809 if (!expanded.fileExists()) {
810 QString message = "The file [" + expanded.original() + "] " +
811 "cannot be found under [" + mission + "]";
812 throw IException(IException::Io, message, _FILEINFO_);
813 }
814 }
815 return expanded.expanded();
816 }
817
818
824 bool addedHist = false;
825 if(InputCubes.size() > 0) {
826 Isis::Pvl & inlab = *InputCubes[0]->label();
827 for(int i = 0; i < inlab.objects(); i++) {
828 if(inlab.object(i).isNamed("History") && Isis::iApp != NULL) {
829 QString histBlobName = (QString)inlab.object(i)["Name"];
830 History h = InputCubes[0]->readHistory(histBlobName);
831 h.AddEntry();
832 cube.write(h, histBlobName);
833 addedHist = true;
834 }
835 }
836 }
837
838 if(!addedHist && Isis::iApp != NULL) {
839 Isis::History h = cube.readHistory();
840 h.AddEntry();
841
842 cube.write(h);
843 }
844 }
845 }
846
847
859 for(unsigned cubeNum = 0; cubeNum < InputCubes.size(); cubeNum++) {
860 Cube *cube = InputCubes[cubeNum];
861
862 // Construct a line buffer manager and a statistics object
863 Isis::LineManager line(*cube);
864 Isis::Statistics *cubeStats = new Isis::Statistics();
865
866 int bandStart = 1;
867 int bandStop = cube->bandCount();
868 int maxSteps = cube->lineCount() * cube->bandCount();
869
870 QString cubeNumStr = toString(cubeNum + 1);
871 QString totalCubes = toString((int)InputCubes.size());
872 QString msg = "Calculating statistics for cube " + cubeNumStr + " of " + totalCubes;
873
874 Isis::Progress progress;
875 progress.SetText(msg);
876 progress.SetMaximumSteps(maxSteps);
877 progress.CheckStatus();
878
879 // Loop and get the statistics for a good minimum/maximum
880 vector<Statistics *> allBandStats;
881 for(int useBand = bandStart; useBand <= bandStop; useBand++) {
882 Isis::Statistics *bandStats = new Isis::Statistics();
883
884 for(int i = 1; i <= cube->lineCount(); i++) {
885 line.SetLine(i, useBand);
886 cube->read(line);
887 bandStats->AddData(line.DoubleBuffer(), line.size());
888 cubeStats->AddData(line.DoubleBuffer(), line.size());
889 progress.CheckStatus();
890 }
891
892 allBandStats.push_back(bandStats);
893 }
894
895 p_bandStats.push_back(allBandStats);
896 p_cubeStats.push_back(cubeStats);
897 }
898 }
899
900} // 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 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:1317
void setFormat(Format format)
Used prior to the Create method, this will specify the format of the cube, either band,...
Definition Cube.cpp:1279
int lineCount() const
Definition Cube.cpp:1767
void setLabelsAttached(bool attached)
Use prior to calling create, this sets whether or not to use separate label and data files.
Definition Cube.cpp:1291
void setDimensions(int ns, int nl, int nb)
Used prior to the Create method to specify the size of the cube.
Definition Cube.cpp:1230
int sampleCount() const
Definition Cube.cpp:1840
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:1164
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:1181
void create(const QString &cfile)
This method will create an isis cube for writing.
Definition Cube.cpp:416
void open(const QString &cfile, QString access="r")
This method will open an existing isis cube for reading or reading/writing.
Definition Cube.cpp:629
PixelType pixelType() const
Definition Cube.cpp:1791
void setVirtualBands(const QList< QString > &vbands)
This allows the programmer to specify a subset of bands to work with.
Definition Cube.cpp:1334
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:820
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:1304
virtual QString fileName() const
Returns the opened cube's filename.
Definition Cube.cpp:1596
void write(Blob &blob, bool overwrite=true)
This method will write a blob of data (e.g.
Definition Cube.cpp:984
void close(bool remove=false)
Closes the cube and updates the labels.
Definition Cube.cpp:262
History readHistory(const QString &name="IsisCube") const
Read the History from the Cube.
Definition Cube.cpp:860
int labelSize(bool actual=false) const
Returns the number of bytes used by the label.
Definition Cube.cpp:1746
virtual int bandCount() const
Returns the number of virtual bands for the cube.
Definition Cube.cpp:1423
Pvl * label() const
Returns a pointer to the IsisLabel object associated with the cube.
Definition Cube.cpp:1734
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:1215
File name manipulation and expansion.
Definition FileName.h:100
bool fileExists() const
Returns true if the file exists; false otherwise.
Definition FileName.cpp:449
QString expanded() const
Returns a QString of the full file name including the file path, excluding the attributes.
Definition FileName.cpp:196
FileName highestVersion() const
Searches the directory specified in the file name for the highest version of the file name.
Definition FileName.cpp:313
QString original() const
Returns the full file name including the file path.
Definition FileName.cpp:212
void AddEntry()
Adds History PvlObject.
Definition History.cpp:56
Isis exception class.
Definition IException.h:91
@ User
A type of error that could only have occurred due to a mistake on the user's part (e....
Definition IException.h:126
@ Programmer
This error is for when a programmer made an API call that was illegal.
Definition IException.h:146
@ Io
A type of error that occurred when performing an actual I/O operation.
Definition IException.h:155
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:652
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:462
void PropagateHistory(const bool prop)
This method allows the programmer to propagate history to the output cube (default is true)
Definition Process.cpp:755
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:767
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:788
void PropagateTables(const bool prop)
This method allows the programmer to propagate input tables to the output cube (default is true)
Definition Process.cpp:693
void WriteHistory(Cube &cube)
Writes out the History blob to the cube.
Definition Process.cpp:822
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:858
void CheckRequirements(const Cube *cube, const int requirements)
Checks to make sure the input cube meets the inputted requirements.
Definition Process.cpp:513
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:744
void ClearInputCubes()
Close owned input cubes from the list and clear the list.
Definition Process.cpp:614
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:629
void ClearCubes()
Close owned cubes from the list and clear the list.
Definition Process.cpp:603
virtual void Finalize()
Cleans up by closing cubes and freeing memory for owned cubes.
Definition Process.cpp:471
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
bool isNamed(const QString &match) const
Returns whether the given string is equal to the container name or not.
QString name() const
Returns the container name.
Contains multiple PvlContainers.
Definition PvlGroup.h:41
Container for cube-like labels.
Definition Pvl.h:119
Contains Pvl Groups and Pvl Objects.
Definition PvlObject.h:61
PvlGroup & group(const int index)
Return the group at the specified index.
bool hasObject(const QString &name) const
Returns a boolean value based on whether the object exists in the current PvlObject or not.
Definition PvlObject.h:323
int groups() const
Returns the number of groups contained.
Definition PvlObject.h:75
PvlObjectIterator findObject(const QString &name, PvlObjectIterator beg, PvlObjectIterator end)
Find the index of object with a specified name, between two indexes.
Definition PvlObject.h:274
int objects() const
Returns the number of objects.
Definition PvlObject.h:219
PvlObject & object(const int index)
Return the object at the specified index.
void addObject(const PvlObject &object)
Add a PvlObject.
Definition PvlObject.h:307
void addGroup(const Isis::PvlGroup &group)
Add a group to the object.
Definition PvlObject.h:186
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:2059
QString GetCubeName(const QString &paramName, QString extension="") const
Retrieves of a value for a parameter of type "cubename".
Definition IsisAml.cpp:724
Isis::CubeAttributeOutput & GetOutputAttribute(const QString &paramName)
Gets the attributes for an output cube.
Definition IsisAml.cpp:2105
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(bool boolToConvert)
Global function to convert a boolean to a string.
Definition IString.cpp:211
@ AttachedLabel
The input label is embedded in the image file.
Namespace for the standard library.