Isis Developer Reference
|
This class helps to call other Isis Applications in a Pipeline. More...
#include <Pipeline.h>
Public Member Functions | |
Pipeline (const QString &procAppName="") | |
This is the one and only Pipeline constructor. More... | |
~Pipeline () | |
This destroys the pipeline. More... | |
void | Prepare () |
This method is the core of the pipeline class. More... | |
void | Run () |
This method executes the pipeline. More... | |
void | SetInputFile (const char *inputParam) |
This method is used to set the original input file. More... | |
void | SetInputFile (const QString &inputParam) |
This method is used to set the original input file. More... | |
void | SetInputFile (const char *inputParam, const char *virtualBandsParam) |
This method is used to set the original input file. More... | |
void | SetInputFile (const QString &inputParam, const QString &virtualBandsParam) |
This method is used to set the original input file. More... | |
void | SetInputListFile (const char *inputParam) |
This method is used to set the original input files. More... | |
void | SetInputListFile (const QString &inputParam) |
This method is used to set the original input files. More... | |
void | SetInputFile (const FileName &inputFileName) |
This method is used to set the original input file. More... | |
void | SetInputListFile (const FileName &inputFileName) |
This method is used to set the original input files. More... | |
void | SetOutputFile (const char *outputParam) |
This method is used to set the final output file. More... | |
void | SetOutputFile (const QString &outputParam) |
This method is used to set the final output file. More... | |
void | SetOutputFile (const FileName &outputFile) |
This method is used to set the final output file. More... | |
void | SetOutputListFile (const char *outputFileNameParam) |
This method is used to set an output list file. More... | |
void | SetOutputListFile (const QString &outputFileNameParam) |
This method is used to set an output list file. More... | |
void | SetOutputListFile (const FileName &outputFileNameList) |
This method is used to set an output list file. More... | |
void | KeepTemporaryFiles (bool keep) |
Set whether or not to keep temporary files (files generated in the middle of the pipeline that are neither the original input nor the final output). More... | |
bool | KeepTemporaryFiles () |
Returns true if temporary files will not be deleted, false if they will. More... | |
void | AddPause () |
Add a pause to the pipeline. More... | |
void | AddToPipeline (const QString &appname) |
Add a new program to the pipeline. More... | |
void | AddToPipeline (const QString &appname, const QString &identifier) |
Add a new program to the pipeline. More... | |
PipelineApplication & | Application (const QString &identifier) |
This is an accessor to get a specific PipelineApplication. More... | |
PipelineApplication & | Application (const int &index) |
This is an accessor to get a specific PipelineApplication. More... | |
void | SetFirstApplication (const QString &appname) |
This method disables all applications up to this one. More... | |
void | SetLastApplication (const QString &appname) |
This method disables all applications after to this one. More... | |
QString | Name () const |
Returns the name of the pipeline. More... | |
int | Size () const |
Returns the number of applications in the pipeline. More... | |
QString | OriginalInput (unsigned int branch) |
Returns the initial input file for the pipeline. More... | |
int | OriginalInputSize () |
Returns the number of input files. More... | |
int | OriginalBranchesSize () |
Returns the total number of input branches Original branches = Number of input files * Number of branches. More... | |
std::vector< QString > | OriginalBranches () |
Returns the names of the original branches of the pipeline (input files * branches if any) More... | |
QString | FinalOutput (int branch=0, bool addModifiers=true) |
This gets the final output for the specified branch; this is necessary for the PipelineApplications to calculate the correct outputs to use. More... | |
QString | TemporaryFolder () |
This method returns the user's temporary folder for temporary files. More... | |
void | EnableAllApplications () |
This method re-enables all applications. More... | |
void | AddOriginalBranch (QString branch) |
Start off the branches directly from the pipeline. More... | |
void | SetContinue (bool pbFlag) |
Set the continue flag. More... | |
Friends | |
std::ostream & | operator<< (std::ostream &os, Pipeline &pipeline) |
This class helps to call other Isis Applications in a Pipeline.
This object works by creating a Pipeline and setting the initial input, final output of the Pipeline which are got from the user interface. Applications are added to the Pipeline and parameters relevant to the application are set using relevant APIs'.
The Pipeline will control the flow of calls to the different applications in the Pipeline in First In First Out fashion. Also the first and last application in the Pipeline can be explicitly set. Pipeline automatically calculates the input to an application from the output of the previous application.
The Pipeline branches automatically for a list file with multiple input files or user can explicitly create branches from the Pipeline directly or from any application in the Pipeline. The branches are required when an application generates multiple outputs. Branches may be disabled / enabled and the Pipeline will figure out the input for an application whose previous app in the same branch was disabled.
Parameters for an application in a branch can be set commonly for all branches or explicitly for a branch by specifiying the branch name.
Option continue allows the pipeline to proceed with the execution inspite of any exceptions encountered while running an application in the pipeline. If continue is not enabled, then on encountering an exception the pipeline exits.
Temporary files are created and will be deleted when explicitly set by the user.
The Pipeline calls cubeatt app inherently if virtual bands are true.
It is suggested that you "cout" this object in order to debug you're usage of the class.
Refer to Applications thmproc, mocproc, hidestripe, hiproc, hinoise2 for Pipeline usage.
Here's an example usage of this class:
Isis::Pipeline::Pipeline | ( | const QString & | procAppName = "" | ) |
This is the one and only Pipeline constructor.
This will initialize a pipeline object.
procAppName | This is an option parameter that gives the pipeline a name |
Isis::Pipeline::~Pipeline | ( | ) |
This destroys the pipeline.
|
inline |
Start off the branches directly from the pipeline.
branch | - Branch name to be added |
void Isis::Pipeline::AddPause | ( | ) |
Add a pause to the pipeline.
void Isis::Pipeline::AddToPipeline | ( | const QString & | appname | ) |
Add a new program to the pipeline.
This method must be called before calling Pipeline::Application(...) to access it. The string used to access this program will be the program's name.
appname | The name of the new application |
References _FILEINFO_, Isis::IException::Programmer, Isis::PipelineApplication::SetNext(), and Isis::PipelineApplication::SetPrevious().
void Isis::Pipeline::AddToPipeline | ( | const QString & | appname, |
const QString & | identifier | ||
) |
Add a new program to the pipeline.
This method must be called before calling Pipeline::Application(...) to access it. The string identifier will access this program.
appname | The name of the new application |
identifier | The program's identifier for when calling Pipeline::Application |
References _FILEINFO_, Isis::IException::Programmer, Isis::PipelineApplication::SetNext(), and Isis::PipelineApplication::SetPrevious().
PipelineApplication & Isis::Pipeline::Application | ( | const int & | index | ) |
This is an accessor to get a specific PipelineApplication.
This accessor is mainly in place for the output operator; it is not recommended.
index | The index of the pipeline application |
References _FILEINFO_, and Isis::IException::Programmer.
PipelineApplication & Isis::Pipeline::Application | ( | const QString & | identifier | ) |
This is an accessor to get a specific PipelineApplication.
This is the recommended accessor.
identifier | The identifier (usually name) of the application to access, such as "spiceinit" |
References _FILEINFO_, and Isis::IException::Programmer.
Referenced by Isis::operator<<().
void Isis::Pipeline::EnableAllApplications | ( | ) |
This method re-enables all applications.
This resets the effects of PipelineApplication::Disable, SetFirstApplication and SetLastApplication.
QString Isis::Pipeline::FinalOutput | ( | int | branch = 0 , |
bool | addModifiers = true |
||
) |
This gets the final output for the specified branch; this is necessary for the PipelineApplications to calculate the correct outputs to use.
branch | Branch index to get the final output for |
addModifiers | Whether or not to add the last name modifier |
References _FILEINFO_, Isis::FileName::baseName(), Isis::PipelineApplication::Enabled(), Isis::PipelineApplication::OutputBranches(), Isis::PipelineApplication::OutputExtension(), Isis::PipelineApplication::OutputNameModifier(), Isis::FileName::path(), Isis::PipelineApplication::Previous(), and Isis::IException::Programmer.
|
inline |
Returns true if temporary files will not be deleted, false if they will.
void Isis::Pipeline::KeepTemporaryFiles | ( | bool | keep | ) |
Set whether or not to keep temporary files (files generated in the middle of the pipeline that are neither the original input nor the final output).
keep | True means don't delete, false means delete. |
Referenced by Isis::operator<<().
|
inline |
Returns the name of the pipeline.
Referenced by Isis::operator<<().
|
inline |
Returns the names of the original branches of the pipeline (input files * branches if any)
Referenced by Isis::PipelineApplication::PipelineApplication().
|
inline |
Returns the total number of input branches Original branches = Number of input files * Number of branches.
|
inline |
Returns the initial input file for the pipeline.
branch | Branch of the original input to get the filename from |
|
inline |
Returns the number of input files.
void Isis::Pipeline::Prepare | ( | ) |
This method is the core of the pipeline class.
This method tells each PipelineApplication to learn about itself and calculate necessary filenames, execution calls, etc... Pipeline error checking happens in here, so if a Pipeline is invalid this method will throw the IException.
References _FILEINFO_, and Isis::IException::Programmer.
Referenced by Isis::operator<<().
void Isis::Pipeline::Run | ( | ) |
This method executes the pipeline.
When you're ready to start your proc program, call this method.
References Isis::Progress::CheckStatus(), Isis::Application::Name(), Isis::IException::print(), Isis::ProgramLauncher::RunIsisProgram(), Isis::Progress::SetMaximumSteps(), Isis::Progress::SetText(), and Isis::FileList::write().
|
inline |
Set the continue flag.
pbFlag | - true/false |
void Isis::Pipeline::SetFirstApplication | ( | const QString & | appname | ) |
This method disables all applications up to this one.
Effectively, the application specified becomes the first application. This is not a guarantee that the application specified is enabled, it only guarantees no applications before it will be run.
appname | The program to start with |
References _FILEINFO_, and Isis::IException::Programmer.
void Isis::Pipeline::SetInputFile | ( | const char * | inputParam | ) |
This method is used to set the original input file.
This file is the first program's input, and the virtual bands will be taken directly from this parameter.
inputParam | The parameter to get from the user interface that contains the input file |
void Isis::Pipeline::SetInputFile | ( | const char * | inputParam, |
const char * | virtualBandsParam | ||
) |
This method is used to set the original input file.
This file is the first program's input.
inputParam | The parameter to get from the user interface that contains the input file |
virtualBandsParam | The parameter to get from the user interface that contains the virtual bands list; internal default is supported. Empty string if no virtual bands parameter exists. |
void Isis::Pipeline::SetInputFile | ( | const FileName & | inputFile | ) |
This method is used to set the original input file.
No virtual bands will be read, and the inputFile parameter will be read as a path to a file instead of as a parameter.
inputParam | A filename object containing the location of the input file |
References Isis::FileName::original().
void Isis::Pipeline::SetInputFile | ( | const QString & | inputParam | ) |
This method is used to set the original input file.
This file is the first program's input, and the virtual bands will be taken directly from this parameter.
inputParam | The parameter to get from the user interface that contains the input file |
References IsisAml::GetFileName(), IsisAml::GetInputAttribute(), and Isis::Application::GetUserInterface().
void Isis::Pipeline::SetInputFile | ( | const QString & | inputParam, |
const QString & | virtualBandsParam | ||
) |
This method is used to set the original input file.
This file is the first program's input.
inputParam | The parameter to get from the user interface that contains the input file |
virtualBandsParam | The parameter to get from the user interface that contains the virtual bands list; internal default is supported. Empty string if no virtual bands parameter exists. |
References IsisAml::GetAsString(), Isis::Application::GetUserInterface(), and IsisAml::WasEntered().
void Isis::Pipeline::SetInputListFile | ( | const char * | inputParam | ) |
This method is used to set the original input files.
These files are the first program's input, a branch will be added for every line in the file, and the virtual bands will be taken directly from this parameter.
inputParam | The parameter to get from the user interface that contains the input file |
void Isis::Pipeline::SetInputListFile | ( | const FileName & | inputFileName | ) |
This method is used to set the original input files.
These files are the first program's input, a branch will be added for every line in the file.
inputParam | The filename of the list file contains the input files |
References Isis::FileName::expanded(), Isis::FileName::name(), and Isis::toString().
void Isis::Pipeline::SetInputListFile | ( | const QString & | inputParam | ) |
This method is used to set the original input files.
These files are the first program's input, a branch will be added for every line in the file, and the virtual bands will be taken directly from this parameter.
inputParam | The parameter to get from the user interface that contains the input file |
References IsisAml::GetFileName(), and Isis::Application::GetUserInterface().
void Isis::Pipeline::SetLastApplication | ( | const QString & | appname | ) |
This method disables all applications after to this one.
Effectively, the application specified becomes the last application. This is not a guarantee that the application specified is enabled, it only guarantees no applications after it will be run.
appname | The program to end with |
References _FILEINFO_, and Isis::IException::Programmer.
void Isis::Pipeline::SetOutputFile | ( | const char * | outputParam | ) |
This method is used to set the final output file.
If no programs generate output, the final output file will not be used. If the output file was not entered, one will be generated automatically and placed into the current working folder.
outputParam | The parameter to get from the user interface that contains the output file; internal default is supported. |
void Isis::Pipeline::SetOutputFile | ( | const FileName & | outputFile | ) |
This method is used to set the final output file.
If no programs generate output, the final output file will not be used. If the output file was not entered, one will be generated automatically and placed into the current working folder.
outputFile | The filename of the output file; NOT the parameter name. |
References Isis::FileName::expanded().
void Isis::Pipeline::SetOutputFile | ( | const QString & | outputParam | ) |
This method is used to set the final output file.
If no programs generate output, the final output file will not be used. If the output file was not entered, one will be generated automatically and placed into the current working folder.
outputParam | The parameter to get from the user interface that contains the output file; internal default is supported. |
References IsisAml::GetAsString(), Isis::Application::GetUserInterface(), and IsisAml::WasEntered().
void Isis::Pipeline::SetOutputListFile | ( | const char * | outputFileNameParam | ) |
This method is used to set an output list file.
Basically, this means the output filenames are specified in the list file. Internal defaults/automatic name calculations are supported.
outputFileNameList | Parameter name containing the path to the output list file |
void Isis::Pipeline::SetOutputListFile | ( | const FileName & | outputFileNameList | ) |
This method is used to set an output list file.
Basically, this means the output filenames are specified in the list file.
outputFileNameList | List file with output cube names |
References Isis::FileName::expanded().
void Isis::Pipeline::SetOutputListFile | ( | const QString & | outputFileNameParam | ) |
This method is used to set an output list file.
Basically, this means the output filenames are specified in the list file. Internal defaults/automatic name calculations are supported.
outputFileNameList | Parameter name containing the path to the output list file |
References IsisAml::GetFileName(), Isis::Application::GetUserInterface(), and IsisAml::WasEntered().
|
inline |
Returns the number of applications in the pipeline.
Referenced by Isis::operator<<().
QString Isis::Pipeline::TemporaryFolder | ( | ) |
This method returns the user's temporary folder for temporary files.
It's simply a conveinient accessor to the user's preferences.
References Isis::PvlObject::findGroup(), and Isis::Preference::Preferences().
|
friend |