lmrcImageROI2D(API)

From EosPedia
Jump to: navigation, search

DataManip/mrcImage/src/lmrcImageROI2D is API to cut out ROI file(2D). Mainly, it is used by mrcImageROI, mrcImageROIs. Also this API is used, when part of image data needs for calculation. e.g. mrcImageAutoRotationCorrelation

constant

It is used as value of Shape(lmrcImageSingleROIInfo's member).

typedef enum lmrcImageROIShape {
	Rect   =0,
	Rect2  =1,
	Circle =2,
	Line   =3
} lmrcImageROIShape;

struct

Setting data of lmrcImageSingleROI. By using lmrcImageROIsInformationGet, ROI Information in file is read, and store it.

typedef struct lmrcImageROIsInfo {
	lmrcImageSingleROIInfo* ROI;
	int                numROI;
} lmrcImageROIsInfo;

Setting data of each ROI Information.

typedef struct lmrcImageSingleROIInfo {
	char* FileName;
	lmrcImageROIShape Shape;
	float centerx;     /* For All Shape */
	float centery;     
	float blx;         /* For Rect, Rect2, Circle */
	float bly;
	float brx;
	float bry;
	float trx;
	float try;
	float tlx;
	float tly;
	float startx;      /* For Line */
	float starty;
	float endx; 
	float endy;

	/* For Post Modification */
	int flagWidth;     /* For Rect, Rect2, Circle, Line */
	float width;
	int flagHeight;    /* For Rect, Rect2, Circle */
	float height; 

	float radius;
	int mode;

	int flagRotation;
	float angle;

	int flagMagnifiedWidth;
	float magnifiedWidth;

	int flagMagnifiedHeight;
	float magnifiedHeight;

	int flagNonPeriodic;
	/* For Layer Line Information */
	int flagLayerLine;
	float truePitch;
	float Ly;
	float dY;
} lmrcImageSingleROIInfo;

API

Read ROI Information

Read Setting data in file, and store at ROI Information(linfo).

extern void lmrcImageROIsInformationGet(FILE* fpt, lmrcImageROIsInfo* linfo); 

ROI file

Cut out ROI file depending on ROI Information(linfo) in Input file(in).

extern void lmrcImageSingleROI(mrcImage* out, mrcImage* in, lmrcImageSingleROIInfo* linfo, int mode);