Esempio n. 1
0
void oneInput(Isis::Buffer &b) {
 if ((b.Sample() == 1) && (b.Band() == 1)) {
   cout << "Testing one input cube ... " << endl;
   cout << "Buffer Samples:  " << b.SampleDimension() << endl;
   cout << "Buffer Lines:    " << b.LineDimension() << endl;
   cout << "Buffer Bands:    " << b.BandDimension() << endl;
   cout << endl;
 }
 cout << "Sample:  " << b.Sample() 
      << "  Line:  " << b.Line() 
      << "  Band:  " << b.Band() << endl;
}
Esempio n. 2
0
void oneInAndOut(Isis::Buffer &ib, Isis::Buffer &ob) {
  if((ib.Line() == 1) && (ib.Sample() == 1)) {
    cout << endl;
    cout << "Testing one input and output cube ... " << endl;
    cout << "Buffer Samples:  " << ib.size() << endl;
    cout << "Buffer Lines:    " << ib.LineDimension() << endl;
    cout << "Buffer Bands:    " << ib.BandDimension() << endl;
    cout << endl;
  }
  cout << "Sample:  " << ib.Sample()
       << "  Line:  " << ib.Line()
       << "  Band:  " << ib.Band() << endl;

  if((ib.Sample() != ob.Sample()) ||
      (ib.Line() != ob.Line()) ||
      (ib.Band() != ob.Band())) {
    cout << "Bogus error #1" << endl;
  }
}
Esempio n. 3
0
/** 
 * This method reads in the cube file line by line and prints 
 * out the DN value of each non-null pixel. 
 * 
 * @param in
 */
void writeAscii (Isis::Buffer &in) {
  bool notNull= false; 
  int index = in.size() - 1;
  for (int i=0; i<in.size(); i++) {
    if(in[index -i] > 0) {
      cout <<"Band: " << in.Band() << " DN: " << in[index -i] << " ";
      notNull = true;
    }   
  }
  if(notNull) {
    cout << std::endl;
  }
}
Esempio n. 4
0
void WriteOutput(Isis::Buffer &buf) {
  LineManager outLines(*outCube);

  if(lineInFile.size()) {
    for(int i = 0; i < outLines.size(); i++) {
      outLines[i] = Isis::Null;
    }

    while(!lineInFile[(buf.Line()+numLinesSkipped) % lineInFile.size()]) {
      outLines.SetLine(buf.Line() + numLinesSkipped, buf.Band());
      outCube->write(outLines);
      numLinesSkipped ++;
    }
  }

  outLines.SetLine(buf.Line() + numLinesSkipped, buf.Band());

  // outLines.Copy(buf); doesn't work because the raw buffers don't match
  for(int i = 0; i < outLines.size(); i++)
    outLines[i] = buf[i];

  outCube->write(outLines);
}
Esempio n. 5
0
void oneInAndOut (Isis::Buffer &ib, double &ob) {
	static bool firstTime = true;
  if (firstTime) {
    firstTime = false;
    cout << endl;
    cout << "Testing one input and output cube ... " << endl;
    cout << "Boxcar Samples:  " << ib.SampleDimension() << endl;
    cout << "Boxcar Lines:    " << ib.LineDimension() << endl;
    cout << "Boxcar Bands:    " << ib.BandDimension() << endl;
    cout << endl;
  }
  
  if (ib.Sample() < 1) {
    cout << "Top Left Sample:  " << ib.Sample() 
         << ", Top Left Line:  " << ib.Line() 
         << ", Top Left Band:  " << ib.Band() << endl;
  }
}
Esempio n. 6
0
void twoInAndOut (vector<Isis::Buffer *> &ib, vector<Isis::Buffer *> &ob) {
  static bool firstTime = true;
  if (firstTime) {
    firstTime = false;
    cout << "Testing two input and output cubes ... " << endl;
    cout << "Number of input cubes:   " << ib.size() << endl;
    cout << "Number of output cubes:  " << ob.size() << endl;
    cout << endl;
  }

  Isis::Buffer *inone = ib[0];
  Isis::Buffer *intwo = ib[1];
  Isis::Buffer *outone = ob[0];
  Isis::Buffer *outtwo = ob[1];
  
  cout << "Sample:  " << inone->Sample() << ":" << intwo->Sample() 
       << "  Line:  " << inone->Line() << ":" << intwo->Line()
       << "  Band:  " << inone->Band() << ":" << intwo->Band() << endl;

  if ((inone->Sample() != intwo->Sample()) || 
      (inone->Line() != intwo->Line())) {
    cout << "Bogus error #1" << endl;
  }

  if ((inone->Sample() != outone->Sample()) || 
      (inone->Line() != outone->Line()) ||
      (inone->Band() != outone->Band())) {
    cout << "Bogus error #2" << endl;
  }
  
  if ((outone->Sample() != outtwo->Sample()) || 
      (outone->Line() != outtwo->Line()) ||
      (outone->Band() != outtwo->Band())) {
    cout << "Bogus error #3" << endl;
  }
}