本文整理汇总了C++中ProcessByLine::StartProcess方法的典型用法代码示例。如果您正苦于以下问题:C++ ProcessByLine::StartProcess方法的具体用法?C++ ProcessByLine::StartProcess怎么用?C++ ProcessByLine::StartProcess使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ProcessByLine
的用法示例。
在下文中一共展示了ProcessByLine::StartProcess方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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();
}
示例2: 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;
}
}
示例3: 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;
}
示例4: 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();
}
示例5: 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();
}
示例6: 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();
}
示例7: IsisMain
void IsisMain() {
ProcessByLine p;
p.SetInputCube("NUMERATOR");
p.SetInputCube("DENOMINATOR");
p.SetOutputCube("TO");
p.StartProcess(ratio);
p.EndProcess();
}
示例8: 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();
}
示例9: 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();
}
示例10: 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;
}
示例11: 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();
}
示例12: 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();
}
示例13: 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();
}
示例14: IsisMain
void IsisMain() {
// We will be processing by line
ProcessByLine p;
// Setup the input and output cubes
p.SetInputCube("FROM");
p.SetOutputCube ("TO");
UserInterface &ui = Application::GetUserInterface();
// Which function is it to be?
string func = ui.GetString ("FUNCTION");
if (func == "COS") Function = COS;
if (func == "SIN") Function = SIN;
if (func == "TAN") Function = TAN;
if (func == "ACOS") Function = ACOS;
if (func == "ASIN") Function = ASIN;
if (func == "ATAN") Function = ATAN;
if (func == "INV") Function = INV;
if (func == "SQRT") Function = SQRT;
if (func == "POW10") Function = POW10;
if (func == "EXP") Function = EXP;
if (func == "XTOY") Function = XTOY;
if (func == "LOG10") Function = LOG10;
if (func == "LN") Function = LN;
if (func == "ABS") Function = ABS;
if (Function == XTOY) {
if (ui.WasEntered ("Y")) {
y = ui.GetDouble("Y");
}
else {
string message = "For the XTOY function, you must enter a value for y";
throw iException::Message(iException::User,message,_FILEINFO_);
}
}
// Start the processing
p.StartProcess(cubefunc);
if (bad != 0) {
PvlGroup results ("Results");
string message = "Invalid input pixels converted to Isis NULL values";
results += PvlKeyword ("Error", message);
results += PvlKeyword ("Count",bad);
Application::Log (results);
}
p.EndProcess();
}
示例15: IsisMain
void IsisMain () {
// Grab the file to import
UserInterface &ui = Application::GetUserInterface();
Filename in = ui.GetFilename("FROM");
Filename out = ui.GetFilename("TO");
// Make sure it is a Clementine EDR
bool projected;
try {
Pvl lab(in.Expanded());
projected = lab.HasObject("IMAGE_MAP_PROJECTION");
iString id;
id = (string)lab["DATA_SET_ID"];
id.ConvertWhiteSpace();
id.Compress();
id.Trim(" ");
if (id.find("CLEM") == string::npos) {
string msg = "Invalid DATA_SET_ID [" + id + "]";
throw iException::Message(iException::Pvl,msg,_FILEINFO_);
}
}
catch (iException &e) {
string msg = "Input file [" + in.Expanded() +
"] does not appear to be " +
"in Clementine EDR format";
throw iException::Message(iException::Io,msg, _FILEINFO_);
}
//Checks if in file is rdr
if( projected ) {
string msg = "[" + in.Name() + "] appears to be an rdr file.";
msg += " Use pds2isis.";
throw iException::Message(iException::User,msg, _FILEINFO_);
}
//Decompress the file
long int lines = 0;
long int samps = 0;
iString filename = in.Expanded();
pdsi = PDSR((char *)filename.c_str(),&lines,&samps);
ProcessByLine p;
CubeAttributeOutput cubeAtt("+unsignedByte+1.0:254.0");
Cube *ocube = p.SetOutputCube(ui.GetFilename("TO"), cubeAtt, pdsi->image_ncols, pdsi->image_nrows);
p.StartProcess (WriteLine);
TranslateLabels(in, ocube);
p.EndProcess ();
}