Isis 3 Programmer Reference
ProcessByBrick.h
1 #ifndef ProcessByBrick_h
2 #define ProcessByBrick_h
3 
8 /* SPDX-License-Identifier: CC0-1.0 */
9 #include <functional>
10 #include <QtConcurrentMap>
11 #include <QTime>
12 
13 #include "Brick.h"
14 #include "Buffer.h"
15 #include "Cube.h"
16 #include "Process.h"
17 #include "Progress.h"
18 
19 namespace Isis {
81  class ProcessByBrick : public Process {
82  public:
85 
87  virtual ~ProcessByBrick();
88 
89  enum IOCubes{InPlace,
90  InputOutput,
91  InputOutputList};
92 
93  enum ProcessingDirection {
94  LinesFirst,
95  BandsFirst
96  };
97 
99  Cube *SetInputCube(const QString &parameter,
100  int requirements = 0);
101 
102  Cube *SetInputCube(const QString &fname,
103  const CubeAttributeInput &att,
104  int requirements = 0);
105 
106  virtual void SetBricks(IOCubes cn);
107  void VerifyCubes(IOCubes cn);
108 
109  void SetBrickSize(int ns, int nl, int nb);
110 
111  void SetInputBrickSize(int ns, int nl, int nb);
112  void SetInputBrickSize(int ns, int nl, int nb, int cube);
113 
114  void SetOutputBrickSize(int ns, int nl, int nb);
115  void SetOutputBrickSize(int ns, int nl, int nb, int cube);
116 
117  // Overload the SetOutputCube() method to allow the user to pass in the
118  // file name and attributes without the lines and samples.
119  // Any other calls to this method will use the prototypes found in the
120  //process class due to the using statement below.
122  virtual Cube *SetOutputCube(const QString &fname,
123  const CubeAttributeOutput &att);
124 
125  void SetProcessingDirection(ProcessingDirection direction);
126  ProcessingDirection GetProcessingDirection();
127 
128  void SetOutputRequirements(int outputRequirements);
129  void SetWrap(bool wrap);
130  bool Wraps();
131 
132  using Isis::Process::StartProcess; // make parents virtual function visable
133  virtual void StartProcess(void funct(Buffer &in));
134  virtual void StartProcess(std::function<void(Buffer &in)> funct );
135  virtual void StartProcess(std::function<void(Buffer &in, Buffer &out)> funct);
136  virtual void StartProcess(void funct(Buffer &in, Buffer &out));
137  virtual void StartProcess(void funct(std::vector<Buffer *> &in,
138  std::vector<Buffer *> &out));
139  void EndProcess();// Depricated. Please use Finalize
140  void Finalize();
141 
142 
163  template <typename Functor> void ProcessCubeInPlace(
164  const Functor & functor, bool threaded = true) {
165  Cube *cube = NULL;
166  Brick *brick = NULL;
167 
168  bool haveInput = PrepProcessCubeInPlace(&cube, &brick);
169  bool writeOutput = (!haveInput) || (cube->isReadWrite());
170 
171  ProcessCubeInPlaceFunctor<Functor> wrapperFunctor(
172  cube, brick, haveInput, writeOutput, functor);
173 
174  RunProcess(wrapperFunctor, brick->Bricks(), threaded);
175 
176  delete brick;
177  }
178 
179 
200  template <typename Functor> void ProcessCube(const Functor & functor,
201  bool threaded = true) {
202  Brick *inputCubeData = NULL;
203  Brick *outputCubeData = NULL;
204 
205  int numBricks = PrepProcessCube(&inputCubeData, &outputCubeData);
206 
207  ProcessCubeFunctor<Functor> wrapperFunctor(InputCubes[0], inputCubeData,
208  OutputCubes[0], outputCubeData, functor);
209 
210  RunProcess(wrapperFunctor, numBricks, threaded);
211 
212  delete inputCubeData;
213  delete outputCubeData;
214  }
215 
216 
239  template <typename Functor> void ProcessCubes(const Functor & functor,
240  bool threaded = true) {
241  std::vector<Brick *> inputCubeData;
242  std::vector<Brick *> outputCubeData;
243 
244  std::vector<Buffer *> inputCubeDataParents;
245  std::vector<Buffer *> outputCubeDataParents;
246 
247  int numBricks = PrepProcessCubes(
248  inputCubeDataParents, outputCubeDataParents,
249  inputCubeData, outputCubeData);
250 
251  ProcessCubesFunctor<Functor> wrapperFunctor(InputCubes, inputCubeData,
252  OutputCubes, outputCubeData, Wraps(), functor);
253 
254  RunProcess(wrapperFunctor, numBricks, threaded);
255 
256  for(unsigned int i = 0; i < inputCubeData.size(); i++) {
257  delete inputCubeData[i];
258  }
259 
260  for(unsigned int i = 0; i < outputCubeData.size(); i++) {
261  delete outputCubeData[i];
262  }
263  }
264 
265 
266  private:
279  template <typename Functor>
280  void RunProcess(const Functor &wrapperFunctor,
281  int numSteps, bool threaded) {
282  ProcessIterator begin(0);
283  ProcessIterator end(numSteps);
284 
285  p_progress->SetMaximumSteps(numSteps);
287 
288  int threadCount = QThreadPool::globalInstance()->maxThreadCount();
289  if (threaded && threadCount > 1) {
290  QFuture<void> result = QtConcurrent::mapped(begin, end,
291  wrapperFunctor);
292  BlockingReportProgress(result);
293  }
294  else {
295  while (begin != end) {
296  wrapperFunctor(*begin);
297  ++begin;
299  }
300  }
301  }
302 
303 
318  template <typename T>
320  public std::unary_function<const int &, void *> {
321  public:
338  const Brick *templateBrick,
339  bool readInput, bool writeOutput,
340  const T &processingFunctor) :
341  m_cube(cube),
342  m_templateBrick(templateBrick),
343  m_readInput(readInput),
344  m_writeOutput(writeOutput),
345  m_processingFunctor(processingFunctor) {
346  }
347 
348 
355  m_cube(other.m_cube),
357  m_readInput(other.m_readInput),
360  }
361 
362 
367  m_cube = NULL;
368  m_templateBrick = NULL;
369  }
370 
371 
378  void *operator()(const int &brickPosition) const {
379  Brick cubeData(*m_templateBrick);
380  cubeData.setpos(brickPosition);
381 
382  if (m_readInput)
383  m_cube->read(cubeData);
384 
385  m_processingFunctor(cubeData);
386 
387  if (m_writeOutput)
388  m_cube->write(cubeData);
389 
390  return NULL;
391  }
392 
393 
402  const ProcessCubeInPlaceFunctor &rhs) {
403  m_cube = rhs.m_cube;
405 
406  m_readInput = rhs.m_readInput;
408 
410 
411  return *this;
412  }
413 
414  private:
423 
426  };
427 
428 
442  template <typename T>
444  public std::unary_function<const int &, void *> {
445  public:
462  const Brick *inputTemplateBrick,
463  Cube *outputCube,
464  const Brick *outputTemplateBrick,
465  const T &processingFunctor) :
466  m_inputCube(inputCube),
467  m_inputTemplateBrick(inputTemplateBrick),
468  m_outputCube(outputCube),
469  m_outputTemplateBrick(outputTemplateBrick),
470  m_processingFunctor(processingFunctor) {
471  }
472 
473 
480  m_inputCube(other.m_inputCube),
482  m_outputCube(other.m_outputCube),
485  }
486 
487 
492  m_inputTemplateBrick = NULL;
493  m_outputTemplateBrick = NULL;
494  }
495 
496 
503  void *operator()(const int &brickPosition) const {
504  Brick inputCubeData(*m_inputTemplateBrick);
505  Brick outputCubeData(*m_outputTemplateBrick);
506 
507  inputCubeData.setpos(brickPosition);
508  outputCubeData.setpos(brickPosition);
509 
510  m_inputCube->read(inputCubeData);
511 
512  m_processingFunctor(inputCubeData, outputCubeData);
513 
514  m_outputCube->write(outputCubeData);
515 
516  return NULL;
517  }
518 
519 
528  m_inputCube = rhs.m_inputCube;
530 
533 
535 
536  return *this;
537  }
538 
539  private:
544 
549 
552  };
553 
554 
569  template <typename T>
571  public std::unary_function<const int &, void *> {
572  public:
592  ProcessCubesFunctor(std::vector<Cube *> &inputCubes,
593  std::vector<Brick *> &inputTemplateBricks,
594  std::vector<Cube *> &outputCubes,
595  std::vector<Brick *> &outputTemplateBricks,
596  bool wraps,
597  const T &processingFunctor) :
598  m_inputCubes(inputCubes),
599  m_inputTemplateBricks(inputTemplateBricks),
600  m_outputCubes(outputCubes),
601  m_outputTemplateBricks(outputTemplateBricks),
602  m_wraps(wraps),
603  m_processingFunctor(processingFunctor) {
604  }
605 
606 
613  m_inputCubes(other.m_inputCubes),
617  m_wraps(other.m_wraps),
619  }
620 
621 
626  }
627 
628 
635  void *operator()(const int &brickPosition) const {
636  QPair< std::vector<Buffer *>, std::vector<Buffer *> > functorBricks;
637 
638  for (int i = 0; i < (int)m_inputTemplateBricks.size(); i++) {
639  Brick *inputBrick = new Brick(*m_inputTemplateBricks[i]);
640  functorBricks.first.push_back(inputBrick);
641 
642  if (m_wraps) {
643  inputBrick->setpos(brickPosition % inputBrick->Bricks());
644  }
645  else {
646  inputBrick->setpos(brickPosition);
647  }
648 
649  if (i != 0 &&
650  functorBricks.first.size() &&
651  inputBrick->Band() != functorBricks.first[0]->Band() &&
652  m_inputCubes[i]->bandCount() != 1) {
653  inputBrick->SetBaseBand(functorBricks.first[0]->Band());
654  }
655 
656  m_inputCubes[i]->read(*inputBrick);
657  }
658 
659  for (int i = 0; i < (int)m_outputTemplateBricks.size(); i++) {
660  Brick *outputBrick = new Brick(*m_outputTemplateBricks[i]);
661  functorBricks.second.push_back(outputBrick);
662  outputBrick->setpos(brickPosition);
663  }
664 
665  // Pass them to the application function
666  m_processingFunctor(functorBricks.first, functorBricks.second);
667 
668  // And copy them into the output cubes
669  for (int i = 0; i < (int)functorBricks.second.size(); i++) {
670  m_outputCubes[i]->write(*functorBricks.second[i]);
671  delete functorBricks.second[i];
672  }
673 
674  for (int i = 0; i < (int)functorBricks.first.size(); i++) {
675  delete functorBricks.first[i];
676  }
677 
678  return NULL;
679  }
680 
681 
692 
695 
696  m_wraps = rhs.m_wraps;
697 
699 
700  return *this;
701  }
702 
703  private:
705  std::vector<Cube *> m_inputCubes;
710  std::vector<Brick *> &m_inputTemplateBricks;
711 
713  std::vector<Cube *> m_outputCubes;
718  std::vector<Brick *> &m_outputTemplateBricks;
719 
721  bool m_wraps;
722 
725  };
726 
727 
728  void BlockingReportProgress(QFuture<void> &future);
729  std::vector<int> CalculateMaxDimensions(std::vector<Cube *> cubes) const;
730  bool PrepProcessCubeInPlace(Cube **cube, Brick **bricks);
731  int PrepProcessCube(Brick **ibrick, Brick **obrick);
732  int PrepProcessCubes(std::vector<Buffer *> & ibufs,
733  std::vector<Buffer *> & obufs,
734  std::vector<Brick *> & imgrs,
735  std::vector<Brick *> & omgrs);
736 
737 
747  class ProcessIterator : public std::iterator<
748  std::forward_iterator_tag, int> {
749  public:
750  ProcessIterator(int position);
751  ProcessIterator(const ProcessIterator &other);
752  virtual ~ProcessIterator();
753 
755 
762  bool operator==(const ProcessIterator &rhs) {
763  return (m_currentPosition == rhs.m_currentPosition);
764  }
765 
772  bool operator!=(const ProcessIterator &rhs) {
773  return !(*this == rhs);
774  }
775 
776 
782  void swap(ProcessIterator &other) {
783  std::swap(m_currentPosition, other.m_currentPosition);
784  }
785 
786 
794  ProcessIterator copy(rhs);
795  swap(copy);
796  return *this;
797  }
798 
799 
804  int operator*() const {
805  return m_currentPosition;
806  }
807 
808  private:
811  };
812 
813  private:
814  bool p_reverse;
823  int p_outputRequirements;
824 
825 
826  std::vector<int> p_inputBrickSamples;
828  std::vector<int> p_inputBrickLines;
830  std::vector<int> p_inputBrickBands;
832  std::vector<int> p_outputBrickSamples;
834  std::vector<int> p_outputBrickLines;
836  std::vector<int> p_outputBrickBands;
842  };
843 
844 };
845 
846 #endif
Isis::ProcessByBrick::ProcessCubeFunctor::m_outputTemplateBrick
const Brick * m_outputTemplateBrick
An example brick for the output parameter to m_processingFunctor.
Definition: ProcessByBrick.h:548
Isis::BufferManager::setpos
bool setpos(BigInt map)
Sets the position of the shape in the cube.
Definition: BufferManager.cpp:219
Isis::Process::InputCubes
std::vector< Isis::Cube * > InputCubes
A vector of pointers to opened Cube objects.
Definition: Process.h:185
Isis::ProcessByBrick::ProcessCubeInPlaceFunctor::m_processingFunctor
const T & m_processingFunctor
The functor which does the work/arbitrary calculations.
Definition: ProcessByBrick.h:425
Isis::ProcessByBrick::ProcessCubesFunctor::operator=
ProcessCubesFunctor & operator=(const ProcessCubesFunctor &rhs)
Assignment of these objects is fully supported.
Definition: ProcessByBrick.h:689
Isis::ProcessByBrick::SetInputBrickSize
void SetInputBrickSize(int ns, int nl, int nb)
Sets the size of all input bricks.
Definition: ProcessByBrick.cpp:241
Isis::ProcessByBrick::ProcessCubesFunctor::m_wraps
bool m_wraps
Wrap smaller cubes back to the beginning?
Definition: ProcessByBrick.h:721
Isis::ProcessByBrick::ProcessCubeInPlaceFunctor::operator()
void * operator()(const int &brickPosition) const
Do the work for one position in a cube.
Definition: ProcessByBrick.h:378
Isis::Progress::CheckStatus
void CheckStatus()
Checks and updates the status.
Definition: Progress.cpp:105
Isis::ProcessByBrick::ProcessCubeInPlaceFunctor
Process a cube in place (one input/zero output or zero input/one output or one cube that acts both as...
Definition: ProcessByBrick.h:320
Isis::ProcessByBrick::VerifyCubes
void VerifyCubes(IOCubes cn)
Verifies the dimensions of the input/output cubes.
Definition: ProcessByBrick.cpp:120
Isis::ProcessByBrick::ProcessCubesFunctor::operator()
void * operator()(const int &brickPosition) const
Do the work for one position in a cube.
Definition: ProcessByBrick.h:635
Isis::ProcessByBrick::ProcessIterator::swap
void swap(ProcessIterator &other)
Exception-safe swap method.
Definition: ProcessByBrick.h:782
Isis::ProcessByBrick::ProcessIterator::m_currentPosition
int m_currentPosition
The current iterator's position/value.
Definition: ProcessByBrick.h:810
Isis::Cube::read
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:807
Isis::Progress::SetMaximumSteps
void SetMaximumSteps(const int steps)
This sets the maximum number of steps in the process.
Definition: Progress.cpp:85
Isis::ProcessByBrick::PrepProcessCubeInPlace
bool PrepProcessCubeInPlace(Cube **cube, Brick **bricks)
Prepare and check to run "function" parameter for StartProcess(void funct(Buffer &in)) and StartProce...
Definition: ProcessByBrick.cpp:779
Isis::ProcessByBrick::ProcessCubeFunctor::~ProcessCubeFunctor
virtual ~ProcessCubeFunctor()
Destructor.
Definition: ProcessByBrick.h:491
Isis::ProcessByBrick::ProcessCubesFunctor::m_outputCubes
std::vector< Cube * > m_outputCubes
The output cubes for writing data to.
Definition: ProcessByBrick.h:713
Isis::ProcessByBrick::ProcessCubeFunctor::ProcessCubeFunctor
ProcessCubeFunctor(Cube *inputCube, const Brick *inputTemplateBrick, Cube *outputCube, const Brick *outputTemplateBrick, const T &processingFunctor)
Construct a ProcessCubeFunctor.
Definition: ProcessByBrick.h:461
Isis::Process::OutputCubes
std::vector< Isis::Cube * > OutputCubes
A vector of pointers to allocated Cube objects.
Definition: Process.h:191
Isis::Process
Base class for all cube processing derivatives.
Definition: Process.h:143
Isis::ProcessByBrick::SetOutputCube
virtual Cube * SetOutputCube(const QString &fname, const CubeAttributeOutput &att)
Create the output file.
Definition: ProcessByBrick.cpp:364
Isis::ProcessByBrick::SetInputCube
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:136
Isis::ProcessByBrick::ProcessCubesFunctor
Create an arbitrary number of output cubes given an arbitrary number of input cubes (these counts can...
Definition: ProcessByBrick.h:571
Isis::CubeAttributeOutput
Manipulate and parse attributes of output cube filenames.
Definition: CubeAttribute.h:473
Isis::ProcessByBrick::ProcessCubeInPlaceFunctor::ProcessCubeInPlaceFunctor
ProcessCubeInPlaceFunctor(Cube *cube, const Brick *templateBrick, bool readInput, bool writeOutput, const T &processingFunctor)
Construct a ProcessCubeInPlaceFunctor.
Definition: ProcessByBrick.h:337
Isis::ProcessByBrick::p_wrapOption
bool p_wrapOption
Indicates whether the brick manager will wrap.
Definition: ProcessByBrick.h:817
Isis::ProcessByBrick::~ProcessByBrick
virtual ~ProcessByBrick()
Destroys the ProcessByBrick object.
Definition: ProcessByBrick.cpp:35
Isis::ProcessByBrick::ProcessIterator::operator*
int operator*() const
Convert this iterator into a position.
Definition: ProcessByBrick.h:804
Isis::ProcessByBrick::ProcessCubeInPlaceFunctor::ProcessCubeInPlaceFunctor
ProcessCubeInPlaceFunctor(const ProcessCubeInPlaceFunctor &other)
Copy construction of these objects is fully supported.
Definition: ProcessByBrick.h:354
Isis::ProcessByBrick::ProcessCubesFunctor::~ProcessCubesFunctor
virtual ~ProcessCubesFunctor()
Destructor.
Definition: ProcessByBrick.h:625
Isis::ProcessByBrick::RunProcess
void RunProcess(const Functor &wrapperFunctor, int numSteps, bool threaded)
This method runs the given wrapper functor numSteps times with or without threading,...
Definition: ProcessByBrick.h:280
Isis::ProcessByBrick::ProcessCubeInPlaceFunctor::m_readInput
bool m_readInput
Should we read from the cube before processing.
Definition: ProcessByBrick.h:420
Isis::ProcessByBrick::ProcessCubesFunctor::ProcessCubesFunctor
ProcessCubesFunctor(std::vector< Cube * > &inputCubes, std::vector< Brick * > &inputTemplateBricks, std::vector< Cube * > &outputCubes, std::vector< Brick * > &outputTemplateBricks, bool wraps, const T &processingFunctor)
Construct a ProcessCubesFunctor.
Definition: ProcessByBrick.h:592
Isis::ProcessByBrick::p_inputBrickSamples
std::vector< int > p_inputBrickSamples
Number of samples in the input bricks.
Definition: ProcessByBrick.h:826
Isis::Process::StartProcess
virtual void StartProcess(void funct())
In the base class, this method will invoked a user-specified function exactly one time.
Definition: Process.h:213
Isis::Brick
Buffer for containing a three dimensional section of an image.
Definition: Brick.h:45
Isis::ProcessByBrick::ProcessIterator::operator++
ProcessIterator & operator++()
Increment the process iterator to the next position.
Definition: ProcessByBrick.cpp:1082
Isis::ProcessByBrick::p_inputBrickSizeSet
bool p_inputBrickSizeSet
Indicates whether the brick size has been set.
Definition: ProcessByBrick.h:818
Isis::ProcessByBrick::ProcessCubeInPlaceFunctor::m_templateBrick
const Brick * m_templateBrick
A brick with the right dimensions, pixel type, etc. for processing.
Definition: ProcessByBrick.h:418
Isis::ProcessByBrick::ProcessCubeFunctor::operator=
ProcessCubeFunctor & operator=(const ProcessCubeFunctor &rhs)
Assignment of these objects is fully supported.
Definition: ProcessByBrick.h:527
Isis::ProcessByBrick::ProcessCubeInPlace
void ProcessCubeInPlace(const Functor &functor, bool threaded=true)
Operate over a single cube (either input or output).
Definition: ProcessByBrick.h:163
Isis::ProcessByBrick::SetOutputBrickSize
void SetOutputBrickSize(int ns, int nl, int nb)
Sets the size of all output bricks.
Definition: ProcessByBrick.cpp:300
Isis::Brick::Bricks
int Bricks()
Returns the number of Bricks in the cube.
Definition: Brick.h:168
Isis::ProcessByBrick::SetBrickSize
void SetBrickSize(int ns, int nl, int nb)
Sets the input and output bricks sizes to the given number of samples, lines, and bands.
Definition: ProcessByBrick.cpp:225
Isis::Buffer
Buffer for reading and writing cube data.
Definition: Buffer.h:53
Isis::ProcessByBrick::ProcessCubeInPlaceFunctor::m_writeOutput
bool m_writeOutput
Should we write to the output cube after processing.
Definition: ProcessByBrick.h:422
Isis::ProcessByBrick::SetWrap
void SetWrap(bool wrap)
This wrapping option only applys when there are two or more input cubes.
Definition: ProcessByBrick.cpp:409
Isis::ProcessByBrick::ProcessCubeFunctor::operator()
void * operator()(const int &brickPosition) const
Do the work for one position in a cube.
Definition: ProcessByBrick.h:503
Isis::ProcessByBrick::p_outputBrickLines
std::vector< int > p_outputBrickLines
Number of lines in the output bricks.
Definition: ProcessByBrick.h:834
Isis::ProcessByBrick::PrepProcessCube
int PrepProcessCube(Brick **ibrick, Brick **obrick)
Prepare and check to run "function" parameter for StartProcess(void funct(Buffer &in,...
Definition: ProcessByBrick.cpp:846
Isis::ProcessByBrick::CalculateMaxDimensions
std::vector< int > CalculateMaxDimensions(std::vector< Cube * > cubes) const
Calculates the maximum dimensions of all the cubes and returns them in a vector where position 0 is t...
Definition: ProcessByBrick.cpp:737
Isis::ProcessByBrick::ProcessCube
void ProcessCube(const Functor &functor, bool threaded=true)
Operate over a single input cube creating a separate output cube.
Definition: ProcessByBrick.h:200
Isis::ProcessByBrick::p_inputBrickLines
std::vector< int > p_inputBrickLines
Number of lines in the input bricks.
Definition: ProcessByBrick.h:828
Isis::Cube::isReadWrite
bool isReadWrite() const
Test if the opened cube is read-write, that is read and write operations should succeed if this is tr...
Definition: Cube.cpp:235
Isis::ProcessByBrick
Process cubes by brick.
Definition: ProcessByBrick.h:81
Isis::Process::SetInputCube
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:136
Isis::ProcessByBrick::p_reverse
bool p_reverse
Use the reverse option for constructing the Buffer objects when the Processing Direction is changed f...
Definition: ProcessByBrick.h:814
Isis::ProcessByBrick::ProcessIterator::ProcessIterator
ProcessIterator(int position)
Initialize a process iterator given a position.
Definition: ProcessByBrick.cpp:1053
Isis::ProcessByBrick::ProcessCubes
void ProcessCubes(const Functor &functor, bool threaded=true)
Operate over an arbitrary number of input cubes given an arbitrary number of output cubes.
Definition: ProcessByBrick.h:239
Isis::ProcessByBrick::ProcessCubesFunctor::m_inputCubes
std::vector< Cube * > m_inputCubes
The input cubes for reading data from.
Definition: ProcessByBrick.h:705
Isis::ProcessByBrick::ProcessCubeFunctor::m_processingFunctor
const T & m_processingFunctor
The functor which does the work/arbitrary calculations.
Definition: ProcessByBrick.h:551
Isis::ProcessByBrick::ProcessCubeFunctor::m_inputCube
Cube * m_inputCube
The cube to read from for the input brick data.
Definition: ProcessByBrick.h:541
Isis::Cube
IO Handler for Isis Cubes.
Definition: Cube.h:167
Isis::ProcessByBrick::StartProcess
virtual void StartProcess(void funct(Buffer &in))
Starts the systematic processing of the input cube by moving an arbitrary shaped brick through the cu...
Definition: ProcessByBrick.cpp:437
Isis::ProcessByBrick::ProcessIterator::~ProcessIterator
virtual ~ProcessIterator()
Destructor.
Definition: ProcessByBrick.cpp:1072
Isis::ProcessByBrick::ProcessByBrick
ProcessByBrick()
Constructs a ProcessByBrick object.
Definition: ProcessByBrick.cpp:16
Isis::ProcessByBrick::ProcessIterator
This class is designed to iterate over all brick positions in a cube.
Definition: ProcessByBrick.h:748
Isis::ProcessByBrick::p_inputBrickBands
std::vector< int > p_inputBrickBands
Number of bands in the input bricks.
Definition: ProcessByBrick.h:830
Isis::Process::SetOutputCube
virtual Isis::Cube * SetOutputCube(const QString &parameter)
Allocates a user-specified output cube whose size matches the first input cube.
Definition: Process.cpp:160
Isis::Buffer::Band
int Band(const int index=0) const
Returns the band position associated with a shape buffer index.
Definition: Buffer.cpp:162
Isis::ProcessByBrick::Wraps
bool Wraps()
Returns true if the wrapping option is enabled.
Definition: ProcessByBrick.cpp:419
Isis::ProcessByBrick::Finalize
void Finalize()
Cleans up by closing cubes and freeing memory.
Definition: ProcessByBrick.cpp:679
Isis::ProcessByBrick::ProcessCubesFunctor::ProcessCubesFunctor
ProcessCubesFunctor(const ProcessCubesFunctor &other)
Copy construction of these objects is fully supported.
Definition: ProcessByBrick.h:612
Isis::ProcessByBrick::p_outputBrickSamples
std::vector< int > p_outputBrickSamples
Number of samples in the output bricks.
Definition: ProcessByBrick.h:832
Isis::ProcessByBrick::ProcessCubeFunctor::m_outputCube
Cube * m_outputCube
The cube to write to with the output of m_processingFunctor.
Definition: ProcessByBrick.h:546
Isis::ProcessByBrick::p_outputBrickBands
std::vector< int > p_outputBrickBands
Number of bands in the output bricks.
Definition: ProcessByBrick.h:836
QPair
This is free and unencumbered software released into the public domain.
Definition: CubeIoHandler.h:23
Isis::ProcessByBrick::ProcessIterator::operator=
ProcessIterator & operator=(const ProcessIterator &rhs)
Assignment of these iterators is fully supported.
Definition: ProcessByBrick.h:793
Isis::ProcessByBrick::ProcessIterator::operator!=
bool operator!=(const ProcessIterator &rhs)
Compare inequality of two iterator positions.
Definition: ProcessByBrick.h:772
Isis::ProcessByBrick::ProcessIterator::operator==
bool operator==(const ProcessIterator &rhs)
Compare equality of two iterator positions.
Definition: ProcessByBrick.h:762
Isis::ProcessByBrick::ProcessCubeInPlaceFunctor::~ProcessCubeInPlaceFunctor
virtual ~ProcessCubeInPlaceFunctor()
Destructor.
Definition: ProcessByBrick.h:366
Isis::Cube::write
void write(Blob &blob, bool overwrite=true)
This method will write a blob of data (e.g.
Definition: Cube.cpp:971
Isis::ProcessByBrick::SetProcessingDirection
void SetProcessingDirection(ProcessingDirection direction)
Set the direction the data will be read, either all lines in a single band proceeding to the next ban...
Definition: ProcessByBrick.cpp:380
Isis::CubeAttributeInput
Manipulate and parse attributes of input cube filenames.
Definition: CubeAttribute.h:381
Isis::ProcessByBrick::ProcessCubeFunctor
Create an output cube given one input cube.
Definition: ProcessByBrick.h:444
Isis::Process::p_progress
Isis::Progress * p_progress
Pointer to a Progress object.
Definition: Process.h:145
Isis::ProcessByBrick::ProcessCubesFunctor::m_inputTemplateBricks
std::vector< Brick * > & m_inputTemplateBricks
Template bricks for reading input data.
Definition: ProcessByBrick.h:710
Isis::ProcessByBrick::BlockingReportProgress
void BlockingReportProgress(QFuture< void > &future)
This method blocks until the future reports that it is finished.
Definition: ProcessByBrick.cpp:691
Isis::ProcessByBrick::ProcessCubeFunctor::m_inputTemplateBrick
const Brick * m_inputTemplateBrick
An example brick for the input parameter to m_processingFunctor.
Definition: ProcessByBrick.h:543
Isis::ProcessByBrick::ProcessCubesFunctor::m_processingFunctor
const T & m_processingFunctor
The functor which does the work/arbitrary calculations.
Definition: ProcessByBrick.h:724
Isis::ProcessByBrick::ProcessCubeInPlaceFunctor::operator=
ProcessCubeInPlaceFunctor & operator=(const ProcessCubeInPlaceFunctor &rhs)
Assignment of these objects is fully supported.
Definition: ProcessByBrick.h:401
Isis::Brick::SetBaseBand
void SetBaseBand(const int start_band)
This method is used to set the base band position of the shape buffer.
Definition: Brick.h:148
Isis::ProcessByBrick::ProcessCubeFunctor::ProcessCubeFunctor
ProcessCubeFunctor(const ProcessCubeFunctor &other)
Copy construction of these objects is fully supported.
Definition: ProcessByBrick.h:479
Isis::ProcessByBrick::ProcessCubesFunctor::m_outputTemplateBricks
std::vector< Brick * > & m_outputTemplateBricks
Template bricks for writing output data.
Definition: ProcessByBrick.h:718
Isis::ProcessByBrick::EndProcess
void EndProcess()
End the processing sequence and cleans up by closing cubes, freeing memory, etc.
Definition: ProcessByBrick.cpp:669
Isis::ProcessByBrick::GetProcessingDirection
ProcessingDirection GetProcessingDirection()
Returns the direction the data will be read, either all lines in a single band proceeding to the next...
Definition: ProcessByBrick.cpp:393
Isis
This is free and unencumbered software released into the public domain.
Definition: Apollo.h:16
Isis::ProcessByBrick::ProcessCubeInPlaceFunctor::m_cube
Cube * m_cube
The cube we're I/O'ing on.
Definition: ProcessByBrick.h:416
Isis::ProcessByBrick::PrepProcessCubes
int PrepProcessCubes(std::vector< Buffer * > &ibufs, std::vector< Buffer * > &obufs, std::vector< Brick * > &imgrs, std::vector< Brick * > &omgrs)
Prepare and check to run "function" parameter for StartProcess(void funct(vector<Buffer *> &in,...
Definition: ProcessByBrick.cpp:938
Isis::ProcessByBrick::p_outputBrickSizeSet
bool p_outputBrickSizeSet
Indicates whether the brick size has been set.
Definition: ProcessByBrick.h:820