ISIS Core Library 0.7.2 (api 3.0.0)
|
#include <io_application.hpp>
Public Member Functions | |
bool | autoload (bool exitOnError=false) |
Load data into the input list of the Application using the internal ParameterMap. | |
bool | autowrite (Image out_image, bool exitOnError=false) |
Write data using the internal ParameterMap. | |
bool | autowrite (std::list< data::Image > out_images, bool exitOnError=false) |
Image | fetchImage () |
Get the next image from the input. | |
template<typename TYPE > | |
TypedImage< TYPE > | fetchImageAs (bool copy=true) |
Get the next image from the input. | |
virtual bool | init (int argc, char **argv, bool exitOnError=true) |
Initializes the programm parameter map using argc/argv. | |
IOApplication (const char name[], bool have_input=true, bool have_output=true) | |
virtual void | printHelp (bool withHidden=false) const |
Virtual function to display a short help text. | |
virtual | ~IOApplication () |
Static Public Member Functions | |
static void | addInput (util::ParameterMap ¶meters, bool needed=true, const std::string &suffix="", const std::string &desc="") |
Add input parameters to the given ParameterMap. | |
static void | addOutput (util::ParameterMap ¶meters, bool needed=true, const std::string &suffix="", const std::string &desc="") |
Add output parameters to the given ParameterMap. | |
static bool | autoload (const util::ParameterMap ¶meters, std::list< Image > &images, bool exitOnError=false, const std::string &suffix="", boost::shared_ptr< util::ConsoleFeedback > feedback=boost::shared_ptr< util::ConsoleFeedback >()) |
Load images using parameters from the given ParameterMap. | |
static bool | autowrite (const util::ParameterMap ¶meters, Image out_image, bool exitOnError=false, const std::string &suffix="", boost::shared_ptr< util::ConsoleFeedback > feedback=boost::shared_ptr< util::ConsoleFeedback >()) |
Write images using parameters from the given ParameterMap. | |
static bool | autowrite (const util::ParameterMap ¶meters, std::list< Image > out_images, bool exitOnError=false, const std::string &suffix="", boost::shared_ptr< util::ConsoleFeedback > feedback=boost::shared_ptr< util::ConsoleFeedback >()) |
Data Fields | |
std::list< data::Image > | images |
Protected Member Functions | |
virtual boost::shared_ptr < util::MessageHandlerBase > | getLogHandler (std::string module, isis::LogLevel level) const |
Definition at line 32 of file io_application.hpp.
isis::data::IOApplication::IOApplication | ( | const char | name[], |
bool | have_input = true , |
||
bool | have_output = true |
||
) |
Definition at line 35 of file io_application.cpp.
isis::data::IOApplication::~IOApplication | ( | ) | [virtual] |
Definition at line 50 of file io_application.cpp.
void isis::data::IOApplication::addInput | ( | util::ParameterMap & | parameters, |
bool | needed = true , |
||
const std::string & | suffix = "" , |
||
const std::string & | desc = "" |
||
) | [static] |
Add input parameters to the given ParameterMap.
This adds the usual parameter for image input (used by autoload( const util::ParameterMap &, std::list< Image >&, bool, const std::string &, boost::shared_ptr< util::ConsoleFeedback > ) ) to the given ParameterMap. The parameters are:
-in
the filename or path to load from-rf
to override the file suffix used to select the plugin used for reading-rdialect
selects a special dialect used for reading parameters | the ParameterMap the parameters should be added to |
needed | if true, the -in parameter is marked as needed (init will fail, if this is not set) |
suffix | text to be appended to the parameters above (eg. "1" here results in "-in1" etc.) to distinguish multiple inputs |
desc | a specific description of this particular input parameters (will be used in the help-output) |
Definition at line 69 of file io_application.cpp.
void isis::data::IOApplication::addOutput | ( | util::ParameterMap & | parameters, |
bool | needed = true , |
||
const std::string & | suffix = "" , |
||
const std::string & | desc = "" |
||
) | [static] |
Add output parameters to the given ParameterMap.
This adds the usual parameters for image output to the given ParameterMap. The parameters are:
-out
the filename to write to-wf
to override the file suffix used to select the plugin used for writing-wdialect
selects a special dialect used for writing-repn
selects a data type used for writing-scale_mode
selects the scaling strategy when converting data type for writing parameters | the ParameterMap the parameters should be added to |
needed | if true, the -out parameter is marked as needed (init will fail, if this is not set) |
suffix | text to be appended to the parameters above (eg. "1" here results in "-out1" etc.) to distinguish multiple outputs |
desc | a specific description of this particular output parameters (will be used in the help-output) |
Definition at line 93 of file io_application.cpp.
bool isis::data::IOApplication::autoload | ( | const util::ParameterMap & | parameters, |
std::list< Image > & | images, | ||
bool | exitOnError = false , |
||
const std::string & | suffix = "" , |
||
boost::shared_ptr< util::ConsoleFeedback > | feedback = boost::shared_ptr< util::ConsoleFeedback >() |
||
) | [static] |
Load images using parameters from the given ParameterMap.
These program parameters should be the same as set by addInput().
parameters | the ParameterMap the parameters should be taken from |
images | an image list to store the red images |
exitOnError | terminate the application if there was an error reading the data |
suffix | the same suffix used for addInput() |
feedback | if given, the util::ConsoleFeedback object will be used to display reading progress if possible |
Definition at line 168 of file io_application.cpp.
bool isis::data::IOApplication::autoload | ( | bool | exitOnError = false | ) |
Load data into the input list of the Application using the internal ParameterMap.
This is the default loading function, it is calling autoload( const util::ParameterMap &, std::list< Image >&, bool, const std::string &, boost::shared_ptr< util::ConsoleFeedback > ) with the ParameterMap of the application and stores the loaded image in its input list (see fetchImage and fetchImageAs).
Definition at line 163 of file io_application.cpp.
bool isis::data::IOApplication::autowrite | ( | Image | out_image, |
bool | exitOnError = false |
||
) |
Write data using the internal ParameterMap.
Uses autowrite(const util::ParameterMap &, Image, bool, const std::string &, boost::shared_ptr< util::ConsoleFeedback >) with the ParameterMap of the application to write the given image.
out_image | the image to be written |
exitOnError | terminate the application if there was an error writing the data |
Definition at line 211 of file io_application.cpp.
bool isis::data::IOApplication::autowrite | ( | std::list< data::Image > | out_images, |
bool | exitOnError = false |
||
) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 212 of file io_application.cpp.
bool isis::data::IOApplication::autowrite | ( | const util::ParameterMap & | parameters, |
Image | out_image, | ||
bool | exitOnError = false , |
||
const std::string & | suffix = "" , |
||
boost::shared_ptr< util::ConsoleFeedback > | feedback = boost::shared_ptr< util::ConsoleFeedback >() |
||
) | [static] |
Write images using parameters from the given ParameterMap.
These program parameters should be the same as set by addOutput().
parameters | the ParameterMap the parameters should be taken from |
out_image | the image to be written |
exitOnError | terminate the application if there was an error writing the data |
suffix | the same suffix used for addOutput() |
feedback | if given, the util::ConsoleFeedback object will be used to display reading progress if possible |
Definition at line 218 of file io_application.cpp.
bool isis::data::IOApplication::autowrite | ( | const util::ParameterMap & | parameters, |
std::list< Image > | out_images, | ||
bool | exitOnError = false , |
||
const std::string & | suffix = "" , |
||
boost::shared_ptr< util::ConsoleFeedback > | feedback = boost::shared_ptr< util::ConsoleFeedback >() |
||
) | [static] |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 222 of file io_application.cpp.
Image isis::data::IOApplication::fetchImage | ( | ) |
Get the next image from the input.
This removes the currently first image in the input list, and returns a cheap copy of this image. If the input image list is empty, an exception is thrown. You might want to check the amount of available images via images.size().
Definition at line 262 of file io_application.cpp.
TypedImage<TYPE> isis::data::IOApplication::fetchImageAs | ( | bool | copy = true | ) | [inline] |
Get the next image from the input.
This uses fetchImage() to get the next image off of the input list and makes sure, that all chunks of this image are of the given type (using convertToType). If the input image list is empty, an exception is thrown. You might want to check the amount of available images via images.size().
copy | enforce deep copy of the data, even if its not neccessary |
Definition at line 92 of file io_application.hpp.
boost::shared_ptr< util::MessageHandlerBase > isis::data::IOApplication::getLogHandler | ( | std::string | module, |
isis::LogLevel | level | ||
) | const [protected, virtual] |
Reimplemented from isis::util::Application.
Definition at line 270 of file io_application.cpp.
bool isis::data::IOApplication::init | ( | int | argc, |
char ** | argv, | ||
bool | exitOnError = true |
||
) | [virtual] |
Initializes the programm parameter map using argc/argv.
For every entry in parameters an corresponding command line parameter is searched and parsed. A command line parameter corresponds to an entry of parameters if it string-equals caseless to this entry and is preceded by "-".
argc | ammount of command line parameters in argv |
argv | array of const char[] containing the command line parameters |
exitOnError | if true the programm will exit, if there is a problem during the initialisation (like missing parameters). |
Reimplemented from isis::util::Application.
Definition at line 55 of file io_application.cpp.
void isis::data::IOApplication::printHelp | ( | bool | withHidden = false | ) | const [virtual] |
Virtual function to display a short help text.
Ths usually shall print the programm name plus all entries of parameters with their description.
Reimplemented from isis::util::Application.
Definition at line 143 of file io_application.cpp.
std::list<data::Image> isis::data::IOApplication::images |
Definition at line 41 of file io_application.hpp.