9#include "SpecialPixel.h"
134 subArea.UpdateLabel(
mInCube, pOutCube, resultsGrp);
147 int readLine = (int)(
mdLine + 0.5);
176 if(out.Line() == 1 && out.Band() == 1) {
189 mdNpts2[osamp] = 0.0;
200 for(
int osamp = 0; osamp < out.size(); osamp++) {
201 while((
double)isamp <= mdIncTab[osamp]) {
204 mdSum[osamp] += (*m_iPortal)[isamp-1];
205 mdNpts[osamp] += 1.0;
210 double sdel = (double) isamp - mdIncTab[osamp];
214 mdSum[osamp] += (*m_iPortal)[isamp-1] * (1.0 - sdel);
215 mdNpts[osamp] += (1.0 - sdel);
217 mdSum[osamp+1] += (*m_iPortal)[isamp-1] * sdel;
218 mdNpts[osamp+1] += sdel;
230 double ldel = (double)
mdLine - rline;
231 double ldel2 = 1.0 - ldel;
234 while(isamp <= mdIncTab[osamp]) {
236 mdSum[osamp] += (*m_iPortal)[isamp-1] * ldel2;
237 mdNpts[osamp] += ldel2;
238 mdSum2[osamp] += (*m_iPortal)[isamp-1] * ldel;
239 mdNpts2[osamp] += ldel;
244 double sdel = (double) isamp - mdIncTab[osamp];
247 mdSum[osamp] += (*m_iPortal)[isamp-1] * (1.0 - sdel) * ldel2;
248 mdNpts[osamp] += (1.0 - sdel) * ldel2;
250 mdSum[osamp+1] += (*m_iPortal)[isamp-1] * sdel * ldel2;
251 mdNpts[osamp+1] += sdel * ldel2;
253 mdSum2[osamp] += (*m_iPortal)[isamp-1] * (1.0 - sdel) * ldel;
254 mdNpts2[osamp] += (1.0 - sdel) * ldel;
256 mdSum2[osamp+1] += (*m_iPortal)[isamp-1] * sdel * ldel;
257 mdNpts2[osamp+1] += sdel * ldel;
268 out[osamp] = mdSum[osamp] / mdNpts[osamp];
272 out[osamp] = (*m_iPortal)[(int)(mdIncTab[osamp] + 0.5) - 1];
278 mdSum[osamp] = mdSum2[osamp];
279 mdNpts[osamp] = mdNpts2[osamp];
281 mdNpts2[osamp] = 0.0;
291 mdNpts2[osamp] = 0.0;
void operator()(Isis::Buffer &out) const
Operator () overload.
double mdValidPer
Valid Percentage.
QString msReplaceMode
Replace Mode (scale/total)
Buffer for reading and writing cube data.
IO Handler for Isis Cubes.
PixelType pixelType() const
void read(Blob &blob, const std::vector< PvlKeyword > keywords=std::vector< PvlKeyword >()) const
This method will read data from the specified Blob object.
virtual int bandCount() const
Returns the number of virtual bands for the cube.
void operator()(Isis::Buffer &out) const
Operator () overload.
Buffer for containing a two dimensional section of an image.
void SetPosition(const double sample, const double line, const int band)
Sets the line and sample position of the buffer.
Contains multiple PvlContainers.
A single keyword-value pair.
double mdSampleScale
Sample scale.
int miInputSamples
Input Samples.
int miEndSample
Input end sample.
int miStartSample
Input start sample.
int miInputLines
Input Lines.
Reduce(Isis::Cube *pInCube, const double sampleScale, const double lineScale)
Constructor.
int miStartLine
Input start line.
int miEndLine
Input end line.
double mdLineScale
Line scale.
Isis::PvlGroup UpdateOutputLabel(Isis::Cube *pOutCube)
Create label for the reduced output image.
int miBandIndex
Band Index.
int miOutputSamples
Output Samples.
int miOutputLines
Output Lines.
void setInputBoundary(int startSample, int endSample, int startLine, int endLine)
Parameters to input image sub area.
int miInputBands
Input Bands.
Isis::Cube * mInCube
Input image.
Isis::Portal * m_iPortal
Input portal.
Apply corrections to a cube label for subarea extraction.
void SetSubArea(const int orignl, const int origns, const int sl, const int ss, const int el, const int es, const double linc, const double sinc)
Defines the subarea.
This is free and unencumbered software released into the public domain.
QString toString(bool boolToConvert)
Global function to convert a boolean to a string.
bool IsValidPixel(const double d)
Returns if the input pixel is valid.
const double Null
Value for an Isis Null pixel.
Namespace for the standard library.