本文整理汇总了C++中ProcessByLine::EndProcess方法的典型用法代码示例。如果您正苦于以下问题:C++ ProcessByLine::EndProcess方法的具体用法?C++ ProcessByLine::EndProcess怎么用?C++ ProcessByLine::EndProcess使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ProcessByLine
的用法示例。
在下文中一共展示了ProcessByLine::EndProcess方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: IsisMain
void IsisMain() {
latLonGrid = NULL;
// We will be processing by line
ProcessByLine p;
Cube *icube = p.SetInputCube("FROM");
UserInterface &ui = Application::GetUserInterface();
string mode = ui.GetString("MODE");
outline = ui.GetBoolean("OUTLINE");
inputSamples = icube->Samples();
inputLines = icube->Lines();
// Line & sample based grid
if(mode == "IMAGE") {
p.SetOutputCube ("TO");
baseLine = ui.GetInteger("BASELINE");
baseSample = ui.GetInteger("BASESAMPLE");
lineInc = ui.GetInteger("LINC");
sampleInc = ui.GetInteger("SINC");
p.StartProcess(imageGrid);
p.EndProcess();
}
// Lat/Lon based grid
else {
CubeAttributeOutput oatt("+32bit");
p.SetOutputCube (ui.GetFilename("TO"), oatt, icube->Samples(),
icube->Lines(), icube->Bands());
baseLat = ui.GetDouble("BASELAT");
baseLon = ui.GetDouble("BASELON");
latInc = ui.GetDouble("LATINC");
lonInc = ui.GetDouble("LONINC");
UniversalGroundMap *gmap = new UniversalGroundMap(*icube);
latLonGrid = new GroundGrid(gmap, icube->Samples(), icube->Lines());
Progress progress;
progress.SetText("Calculating Grid");
latLonGrid->CreateGrid(baseLat, baseLon, latInc, lonInc, &progress);
p.StartProcess(groundGrid);
p.EndProcess();
delete latLonGrid;
latLonGrid = NULL;
delete gmap;
gmap = NULL;
}
}
示例2: main
int main(int argc, char *argv[]) {
Preference::Preferences(true);
cout << setprecision(9);
try {
FileName fromList("FromList.lst");
QString holdList = "HoldList.lst";
cout << "UnitTest for Equalization" << endl;
HiEqualization equalizer(fromList.toString());
equalizer.addHolds(holdList);
equalizer.calculateStatistics();
// Open input cube
FileList imageList(fromList);
for (int i = 0; i < imageList.size(); i++) {
ProcessByLine p;
CubeAttributeInput att;
QString inp = imageList[i].toString();
Cube *inputCube = p.SetInputCube(inp, att);
TestFunctor func(&equalizer, inputCube->lineCount(), i);
p.ProcessCubeInPlace(func, false);
p.EndProcess();
}
}
catch (IException &e) {
e.print();
}
}
示例3: IsisMain
void IsisMain() {
// Create a process by line object
ProcessByLine p;
// Get the value to put in the cube
UserInterface &ui = Application::GetUserInterface();
QString pixels = ui.GetString("PIXELS");
double value = Null;
if(pixels == "NULL") {
value = NULL8;
}
else if(pixels == "LIS") {
value = LOW_INSTR_SAT8;
}
else if(pixels == "LRS") {
value = LOW_REPR_SAT8;
}
else if(pixels == "HIS") {
value = HIGH_INSTR_SAT8;
}
else if(pixels == "HRS") {
value = HIGH_REPR_SAT8;
}
else {
value = ui.GetDouble("VALUE");
}
// Need to pick good min/maxs to ensure the user's value
// doesn't get saturated
CubeAttributeOutput &att = ui.GetOutputAttribute("TO");
if(IsValidPixel(value)) {
if(value == 0.0) {
att.setMinimum(value);
att.setMaximum(value + 1.0);
}
if(value < 0.0) {
att.setMinimum(value);
att.setMaximum(-value);
}
else {
att.setMinimum(-value);
att.setMaximum(value);
}
}
else {
att.setMinimum(0.0);
att.setMaximum(1.0);
}
// Get the size of the cube and create the cube
int samps = ui.GetInteger("SAMPLES");
int lines = ui.GetInteger("LINES");
int bands = ui.GetInteger("BANDS");
p.SetOutputCube(ui.GetFileName("TO"), att, samps, lines, bands);
// Make the cube
p.ProcessCubeInPlace(ConstantValueFunctor(value), false);
p.EndProcess();
}
示例4: fileLab
/**
* Set the output cube to specified file name and specified input images
* and output attributes and lat,lons
*/
Isis::Cube *ProcessMapMosaic::SetOutputCube(const QString &inputFile,
double xmin, double xmax, double ymin, double ymax,
double slat, double elat, double slon, double elon, int nbands,
CubeAttributeOutput &oAtt, const QString &mosaicFile) {
Pvl fileLab(inputFile);
PvlGroup &mapping = fileLab.findGroup("Mapping", Pvl::Traverse);
mapping["UpperLeftCornerX"] = toString(xmin);
mapping["UpperLeftCornerY"] = toString(ymax);
mapping.addKeyword(PvlKeyword("MinimumLatitude", toString(slat)), Pvl::Replace);
mapping.addKeyword(PvlKeyword("MaximumLatitude", toString(elat)), Pvl::Replace);
mapping.addKeyword(PvlKeyword("MinimumLongitude", toString(slon)), Pvl::Replace);
mapping.addKeyword(PvlKeyword("MaximumLongitude", toString(elon)), Pvl::Replace);
Projection *firstProj = ProjectionFactory::CreateFromCube(fileLab);
int samps = (int)(ceil(firstProj->ToWorldX(xmax) - firstProj->ToWorldX(xmin)) + 0.5);
int lines = (int)(ceil(firstProj->ToWorldY(ymin) - firstProj->ToWorldY(ymax)) + 0.5);
delete firstProj;
if (p_createMosaic) {
Pvl newMap;
newMap.addGroup(mapping);
// Initialize the mosaic
CubeAttributeInput inAtt;
ProcessByLine p;
p.SetInputCube(inputFile, inAtt);
p.PropagateHistory(false);
p.PropagateLabels(false);
p.PropagateTables(false);
p.PropagatePolygons(false);
p.PropagateOriginalLabel(false);
// If track set, create the origin band
if (GetTrackFlag()) {
nbands += 1;
}
// For average priority, get the new band count
else if (GetImageOverlay() == AverageImageWithMosaic) {
nbands *= 2;
}
Cube *ocube = p.SetOutputCube(mosaicFile, oAtt, samps, lines, nbands);
p.Progress()->SetText("Initializing mosaic");
p.ClearInputCubes();
p.StartProcess(ProcessMapMosaic::FillNull);
// CreateForCube created some keywords in the mapping group that needs to be added
ocube->putGroup(newMap.findGroup("Mapping", Pvl::Traverse));
p.EndProcess();
}
Cube *mosaicCube = new Cube();
mosaicCube->open(mosaicFile, "rw");
mosaicCube->addCachingAlgorithm(new UniqueIOCachingAlgorithm(2));
AddOutputCube(mosaicCube);
return mosaicCube;
}
示例5: IsisMain
void IsisMain() {
// Create a process by line object
ProcessByLine p;
// Get the size of the cube
Cube *icube = p.SetInputCube("FROM");
// Open output text file
UserInterface &ui = Application::GetUserInterface();
QString to = ui.GetFileName("TO", "txt");
fout.open(to.toAscii().data());
// Print header if needed
if(ui.GetBoolean("HEADER")) {
fout << "Input Cube: " << icube->fileName() << endl;
fout << "Samples:Lines:Bands: " << icube->sampleCount() << ":" <<
icube->lineCount() << ":" << icube->bandCount() << endl;
}
// List the cube
p.StartProcess(isis2ascii);
p.EndProcess();
fout.close();
}
示例6: IsisMain
void IsisMain() {
// We will be processing by line
ProcessByLine p;
// Set up the input cube and get camera information
Cube *icube = p.SetInputCube("FROM");
// Create the output cube
Cube *ocube = p.SetOutputCube("TO");
// Set up the user interface
UserInterface &ui = Application::GetUserInterface();
// Get the name of the parameter file
Pvl par(ui.GetFileName("PHOPAR"));
auto_ptr<Hillier> photom = auto_ptr<Hillier> (new Hillier(par, *icube));
pho = photom.get();
// Start the processing
p.StartProcess(hillier);
PvlGroup photo("Photometry");
pho->Report(photo);
ocube->putGroup(photo);
Application::Log(photo);
p.EndProcess();
}
示例7: IsisMain
void IsisMain() {
// We will be processing by line
ProcessByLine p;
// Setup the input and get the camera model
icube = p.SetInputCube("FROM");
cam = icube->Camera();
// Create the output cube
p.SetOutputCube ("TO");
// Get the trim angles
UserInterface &ui = Application::GetUserInterface();
minPhase = ui.GetDouble ("MINPHASE");
maxPhase = ui.GetDouble ("MAXPHASE");
minEmission = ui.GetDouble ("MINEMISSION");
maxEmission = ui.GetDouble ("MAXEMISSION");
minIncidence = ui.GetDouble ("MININCIDENCE");
maxIncidence = ui.GetDouble ("MAXINCIDENCE");
// Start the processing
lastBand = 0;
p.StartProcess(photrim);
p.EndProcess();
}
示例8: IsisMain
void IsisMain() {
// We will be processing by line
ProcessByLine p;
// Setup the input and output files
UserInterface &ui = Application::GetUserInterface();
// Setup the input and output cubes
p.SetInputCube("FROM1");
if (ui.WasEntered ("FROM2")) p.SetInputCube("FROM2");
p.SetOutputCube ("TO");
// Get the coefficients
Isisa = ui.GetDouble ("A");
Isisb = ui.GetDouble ("B");
Isisc = ui.GetDouble ("C");
Isisd = ui.GetDouble ("D");
Isise = ui.GetDouble ("E");
// Start the processing based on the operator
string op = ui.GetString ("OPERATOR");
if (op == "ADD" ) p.StartProcess(add);
if (op == "SUBTRACT") p.StartProcess(sub);
if (op == "MULTIPLY") p.StartProcess(mult);
if (op == "DIVIDE") p.StartProcess(div);
if (op == "UNARY") p.StartProcess(unary);
// Cleanup
p.EndProcess();
}
示例9: IsisMain
void IsisMain() {
ProcessByLine p;
p.SetInputCube("NUMERATOR");
p.SetInputCube("DENOMINATOR");
p.SetOutputCube("TO");
p.StartProcess(ratio);
p.EndProcess();
}
示例10: IsisMain
void IsisMain() {
UserInterface &ui = Application::GetUserInterface();
tempFiles.clear();
specificEnergyCorrections.clear();
sampleBasedDarkCorrections.clear();
lineBasedDarkCorrections.clear();
solarRemoveCoefficient = 1.0;
iof = (ui.GetString("UNITS") == "IOF");
calibInfo = PvlGroup("Results");
ProcessByLine p;
Cube *icube = p.SetInputCube("FROM");
bool isVims = true;
try {
isVims = (icube->label()->findGroup("Instrument",
Pvl::Traverse)["InstrumentId"][0] == "VIMS");
}
catch(IException &e) {
isVims = false;
}
if(!isVims) {
QString msg = "The input cube [" + QString(ui.GetAsString("FROM")) + "] is not a Cassini VIMS cube";
throw IException(IException::User, msg, _FILEINFO_);
}
if(icube->label()->findObject("IsisCube").hasGroup("AlphaCube")) {
QString msg = "The input cube [" + QString(ui.GetAsString("FROM")) + "] has had its dimensions modified and can not be calibrated";
throw IException(IException::User, msg, _FILEINFO_);
}
// done first since it's likely to cause an error if one exists
calculateSolarRemove(icube, &p);
if(ui.GetBoolean("DARK"))
calculateDarkCurrent(icube);
chooseFlatFile(icube, &p);
calculateSpecificEnergy(icube);
calibInfo += PvlKeyword("OutputUnits", ((iof) ? "I/F" : "Specific Energy"));
Application::Log(calibInfo);
p.SetOutputCube("TO");
p.StartProcess(calibrate);
p.EndProcess();
for(unsigned int i = 0; i < tempFiles.size(); i++) {
QFile::remove(tempFiles[i]);
}
tempFiles.clear();
}
示例11: IsisMain
void IsisMain () {
ProcessByLine p;
Cube *icube = p.SetInputCube("FROM");
cam = icube->Camera();
maxinc = Application::GetUserInterface().GetDouble("MAXINC");
p.SetOutputCube("TO");
p.StartProcess(divide);
p.EndProcess();
}
示例12: IException
/**
* Set the output cube to specified file name and specified input images
* and output attributes and lat,lons
*/
Isis::Cube *ProcessMapMosaic::SetOutputCube(const QString &inputFile, PvlGroup mapping,
CubeAttributeOutput &oAtt, const QString &mosaicFile) {
if (OutputCubes.size() != 0) {
QString msg = "You can only specify one output cube and projection";
throw IException(IException::Programmer, msg, _FILEINFO_);
}
if (mapping.hasKeyword("UpperLeftCornerX"))
mapping.deleteKeyword("UpperLeftCornerX");
if (mapping.hasKeyword("UpperLeftCornerY"))
mapping.deleteKeyword("UpperLeftCornerY");
if (p_createMosaic) {
Pvl newMap;
newMap.addGroup(mapping);
int samps, lines, bands;
delete ProjectionFactory::CreateForCube(newMap, samps, lines, false);
// Initialize the mosaic
ProcessByLine p;
CubeAttributeInput inAtt(inputFile);
Cube *propCube = p.SetInputCube(inputFile, inAtt);
bands = propCube->bandCount();
// If track set, create the origin band
if (GetTrackFlag()) {
bands += 1;
}
// For average priority, get the new band count
else if (GetImageOverlay() == AverageImageWithMosaic) {
bands *= 2;
}
p.PropagateHistory(false);
p.PropagateLabels(false);
Cube *ocube = p.SetOutputCube(mosaicFile, oAtt, samps, lines, bands);
p.Progress()->SetText("Initializing mosaic");
p.ClearInputCubes();
p.StartProcess(ProcessMapMosaic::FillNull);
// CreateForCube created some keywords in the mapping group that needs to be added
ocube->putGroup(newMap.findGroup("Mapping", Pvl::Traverse));
p.EndProcess();
}
Cube *mosaicCube = new Cube();
AddOutputCube(mosaicCube);
mosaicCube->open(mosaicFile, "rw");
mosaicCube->addCachingAlgorithm(new UniqueIOCachingAlgorithm(2));
return mosaicCube;
}
示例13: IsisMain
void IsisMain() {
ProcessByLine p;
// Setup the input and output cubes
p.SetInputCube("FROM");
p.SetInputCube("MATCH");
p.SetOutputCube("TO");
p.StartProcess(specadd);
p.EndProcess();
}
示例14: IsisMain
void IsisMain() {
// We will be processing by line
ProcessByLine p;
// Setup the input and output cubes
p.SetInputCube("FROM");
p.SetOutputCube("TO");
// Start the processing
p.StartProcess(mirror);
p.EndProcess();
}
示例15: IsisMain
void IsisMain() {
// Setup the input and output cubes
ProcessByLine p; // used for getting histograms from input cubes
Cube *icube = p.SetInputCube("FROM", Isis::OneBand);
p.SetOutputCube ("TO");
// Histogram parameters
UserInterface &ui = Application::GetUserInterface();
double minimum = ui.GetDouble("MINPER");
double maximum = ui.GetDouble("MAXPER");
int increment = ui.GetInteger("INCREMENT");
// Histograms from input cubes
Histogram *from = icube->Histogram();
Histogram *match = icube->Histogram();
double fromMin = from->Percent(minimum);
double fromMax = from->Percent(maximum);
int fromBins = from->Bins();
double data[fromBins];
double slope = (fromMax - fromMin) / (fromBins - 1);
// Set "match" to have the same data range and number of bins as "to"
match->SetBins(fromBins);
match->SetValidRange(fromMin, fromMax);
for (int i = 0; i < fromBins; i++) {
data[i] = fromMin + (slope * i);
}
match->AddData(data, fromBins);
stretch.ClearPairs();
double lastPer = from->Percent(minimum);
stretch.AddPair(lastPer, match->Percent(minimum));
for (double i = increment+minimum; i < maximum; i += increment) {
double curPer = from->Percent(i);
if (lastPer < curPer) {
if(abs(lastPer - curPer) > DBL_EPSILON) {
stretch.AddPair(curPer, match->Percent(i));
lastPer = curPer;
}
}
}
double curPer = from->Percent(maximum);
if (lastPer < curPer && abs(lastPer - curPer) > DBL_EPSILON) {
stretch.AddPair(curPer, match->Percent(maximum));
}
// Start the processing
p.StartProcess(remap);
p.EndProcess();
}