34 #include <Base/Image/ImageBase.hh>
35 #include <Base/Image/ImageConvert.hh>
36 #include <Base/Image/ImageIO.hh>
41 int main(
int argc,
char *argv[])
47 cerr << argv[0] <<
" <image>\n";
56 cout <<
"zero image outside of ("<<(w>>2)<<
", "<<(h>>2)<<
") <--> ("
57 <<(w-(w>>2))<<
", "<<(h-(h>>2))<<
")\n";
63 cout <<
"roi: "<<*im.
GetROI()<<endl;
65 for (
int x=w-3; x<w; x++)
66 for (
int y=h-3; y<h; y++)
70 cerr <<
"image too small\n";
80 cout <<
"im: "<<*im.
GetROI() << endl;
92 BIASERR(
"error loading image \"roi.mip\"");
96 cout <<
"im2: "<<*im2.
GetROI()<<endl;
110 cout << *im2.
GetROI()<<endl;
114 BIASERR(
"error reading image \"zeroed.mip\"");
stores valid/nvalid positions in image
unsigned int GetWidth() const
ROI * GetROI()
Returns a pointer to the roi object.
unsigned int GetHeight() const
void FillImageWithXValue()
fills image with value depending on x coordinate
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.
void SetOutsideROIZero()
sets all pixel not in ROI to zero
void Init(unsigned int Width, unsigned int Height, unsigned int channels=1, enum EStorageType storageType=ST_unsignedchar, const bool interleaved=true)
calls Init from ImageBase storageType is ignored, just dummy argument
int ConvertROIType(const enum ERoiType &type)
Generic conversion function from current ROI representation to the given ROI representation.
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...
void SetMask(const unsigned &x, const unsigned &y, const bool val)
Direct access to the mask data.
void SetVector(std::vector< Position > &pos)
Sets MaskValid_=false and VectorValid_=true.
int SetROICorners(unsigned int UpperLeftX, unsigned int UpperLeftY, unsigned int LowerRightX, unsigned int LowerRightY)