1 #include <Base/Debug/Error.hh>
2 #include <Base/Image/ImageIO.hh>
3 #include <Utils/Param.hh>
13 int main(
int argc,
char ** argv)
17 param.
AddParamBool(
"ignoreNegative",
"do not use negative values",
24 if (argc>0) cerr << argv[0] <<
" <image 1> <image 2> <outfile> \n";
25 cerr <<
" divides image 1 by image 2 (pixelwise) and writes the result "
32 BIASERR(
"error loading "<<argv[next]);
36 BIASERR(
"error loading "<<argv[next+1]);
40 BIASERR(
"image size,depth,or ST does not match");
54 cout <<
"ignoring negative\n";
56 float *i2=fim2.GetImageData();
58 float *end = i1 + fim1.GetPixelCount() * fim1.GetChannelCount();
61 if ( (*i1)<=0.0 || (*i2) <=0.0) *d = 0.0;
66 BIASERR(
"error writing "<<argv[next+2]);
72 cerr <<
"storage type not supported \n";
void DisableDestructorWarning()
Uses this just before end of your program to avoid error from destructor.
bool * AddParamBool(const std::string &name, const std::string &help, bool deflt=false, char cmdshort=0, int Group=GRP_NOSHOW)
unsigned int GetWidth() const
int ParseCommandLine(int &argc, char *argv[])
scan command line arguments for valid parameters
bool * GetParamBool(const std::string &name) const
void Usage(std::ostream &os=std::cout)
print Help-Information to stdout
unsigned int GetHeight() const
bool SamePixelAndChannelCount(const ImageBase &Image) const
checks if data area has same "size" as Image of other type
static int Save(const std::string &filename, const ImageBase &img, const enum TFileFormat FileFormat=FF_auto, const bool sync=BIAS_DEFAULT_SYNC, const int c_jpeg_quality=BIAS_DEFAULT_IMAGE_QUALITY, const bool forceNewID=BIAS_DEFAULT_FORCENEWID, const bool &writeMetaData=true)
Export image as file using extrnal libs.
const StorageType * GetImageData() const
overloaded GetImageData() from ImageBase
This class Param provides generic support for parameters.
static int Load(const std::string &FileName, ImageBase &img)
first tries a call to Read MIP image and if that fails, tries to Import Image with all other availabl...
enum EStorageType GetStorageType() const
This is the base class for images in BIAS.