「lFETOrientationSearchByFeatureAlignment(API)」の版間の差分
(同じ利用者による、間の12版が非表示) | |||
行22: | 行22: | ||
}lFETOrientationSearchByFeatureAlignmentInfo; | }lFETOrientationSearchByFeatureAlignmentInfo; | ||
+ | 座標 | ||
typedef struct lFETFeatureAlignmentCoord{ | typedef struct lFETFeatureAlignmentCoord{ | ||
double x, y, z; | double x, y, z; | ||
}lFETFeatureAlignmentCoord; | }lFETFeatureAlignmentCoord; | ||
+ | 特徴量 | ||
typedef struct lFETFeatureAlignmentFeature{ | typedef struct lFETFeatureAlignmentFeature{ | ||
double t, w, a, k; | double t, w, a, k; | ||
}lFETFeatureAlignmentFeature; | }lFETFeatureAlignmentFeature; | ||
+ | |||
+ | <table border> | ||
+ | <tr> | ||
+ | <th>メンバ</th> | ||
+ | <th>説明</th> | ||
+ | </tr> | ||
+ | <tr> | ||
+ | <td>t</td> | ||
+ | <td></td> | ||
+ | </tr> | ||
+ | <tr> | ||
+ | <td>w</td> | ||
+ | <td>幅</td> | ||
+ | </tr> | ||
+ | <tr> | ||
+ | <td>a</td> | ||
+ | <td>歪度</td> | ||
+ | </tr> | ||
+ | <tr> | ||
+ | <td>k</td> | ||
+ | <td>尖度</td> | ||
+ | </tr> | ||
+ | </table> | ||
+ | <br> | ||
typedef struct lFETFeatureAlignmentSpherePointInfo{ | typedef struct lFETFeatureAlignmentSpherePointInfo{ | ||
行66: | 行92: | ||
int center; | int center; | ||
}lFETFeatureAlignmentSphereSquareInfo; | }lFETFeatureAlignmentSphereSquareInfo; | ||
+ | <br> | ||
+ | curSwitch: 0, 1: データ切り替えのためのスイッチとして使用 | ||
typedef struct lFETFeatureAlignmentSphereInfo{ | typedef struct lFETFeatureAlignmentSphereInfo{ | ||
lFETFeatureAlignmentSphereSquareInfo sq6[2][6]; | lFETFeatureAlignmentSphereSquareInfo sq6[2][6]; | ||
行72: | 行100: | ||
int mode; | int mode; | ||
}lFETFeatureAlignmentSphereInfo; | }lFETFeatureAlignmentSphereInfo; | ||
+ | <br> | ||
typedef struct lFETFeatureAlignmentInfo{ | typedef struct lFETFeatureAlignmentInfo{ | ||
行131: | 行160: | ||
== API == | == API == | ||
+ | === メイン === | ||
extern void lFETOrientationSearchByFeatureAlignment(lFETOrientationSearchByFeatureAlignmentInfo in, int mode); | extern void lFETOrientationSearchByFeatureAlignment(lFETOrientationSearchByFeatureAlignmentInfo in, int mode); | ||
+ | in->modeにより初期データを設定方法を選択できます。(参照:[[FETOrientationSearchByFeatureAlignment#-m の詳細]])<br> | ||
<br> | <br> | ||
+ | === 初期設定 === | ||
sphの初期設定を行います。 | sphの初期設定を行います。 | ||
extern void lFETFeatureAlignmentSphereInit(lFETFeatureAlignmentSphereInfo* sph, int mode); | extern void lFETFeatureAlignmentSphereInit(lFETFeatureAlignmentSphereInfo* sph, int mode); | ||
<br> | <br> | ||
− | + | info->sphにて特徴量の設定を行います。 | |
− | + | ||
− | + | ||
extern void lFETFeatureAlignmentSphereFeatureSet(lFETFeatureAlignmentInfo* info); | extern void lFETFeatureAlignmentSphereFeatureSet(lFETFeatureAlignmentInfo* info); | ||
− | extern | + | <br> |
+ | |||
+ | sphの分割データ(self, fets)をsph->curSwitchの切り替えて格納します。元のデータは解放します。(sph->curSwitchは新しい格納場所を指します) | ||
+ | extern void lFETFeatureAlignmentSphereDevide(lFETFeatureAlignmentSphereInfo* sph); | ||
+ | <br> | ||
+ | |||
+ | 4 images selected by 90degree rule | ||
extern void lFETFeatureAlignmentInitSet_i2PCA(lFETFeatureAlignmentInfo* info); | extern void lFETFeatureAlignmentInitSet_i2PCA(lFETFeatureAlignmentInfo* info); | ||
+ | <br> | ||
+ | |||
+ | 1 image of image has largest radius<br> | ||
+ | info->seedImageをシードとする | ||
extern void lFETFeatureAlignmentInitSet_i1L(lFETFeatureAlignmentInfo* info); | extern void lFETFeatureAlignmentInitSet_i1L(lFETFeatureAlignmentInfo* info); | ||
+ | |||
+ | flagLX == targetをシードとする | ||
extern void lFETFeatureAlignmentInitSet_i1Ls(lFETFeatureAlignmentInfo* info, int target); | extern void lFETFeatureAlignmentInitSet_i1Ls(lFETFeatureAlignmentInfo* info, int target); | ||
+ | <br> | ||
+ | |||
extern void lFETFeatureAlignmentInitPreSet_i1Lss(lFETFeatureAlignmentInfo* info, lFETFeatureAlignment_i1LssInitInfo* out, int target); | extern void lFETFeatureAlignmentInitPreSet_i1Lss(lFETFeatureAlignmentInfo* info, lFETFeatureAlignment_i1LssInitInfo* out, int target); | ||
extern void lFETFeatureAlignmentInitSet_i1Lss(lFETFeatureAlignmentInfo* info, lFETFeatureAlignment_i1LssInitInfo* out, int mode); | extern void lFETFeatureAlignmentInitSet_i1Lss(lFETFeatureAlignmentInfo* info, lFETFeatureAlignment_i1LssInitInfo* out, int mode); | ||
行152: | 行196: | ||
extern void lFETFeatureAlignmentInitSet_i2LM(lFETFeatureAlignmentInfo* info); | extern void lFETFeatureAlignmentInitSet_i2LM(lFETFeatureAlignmentInfo* info); | ||
extern void lFETFeatureAlignmentInitSet_i21LMLX(lFETFeatureAlignmentInfo* info); | extern void lFETFeatureAlignmentInitSet_i21LMLX(lFETFeatureAlignmentInfo* info); | ||
+ | <br> | ||
+ | |||
+ | all images with random angles consist | ||
extern void lFETFeatureAlignmentInitSet_random(lFETFeatureAlignmentInfo* info); | extern void lFETFeatureAlignmentInitSet_random(lFETFeatureAlignmentInfo* info); | ||
+ | <br> | ||
+ | |||
+ | 2 images of image has largest radius | ||
extern void lFETFeatureAlignmentInitSet_i2LXs(lFETFeatureAlignmentInfo* info, int target); | extern void lFETFeatureAlignmentInitSet_i2LXs(lFETFeatureAlignmentInfo* info, int target); | ||
extern void lFETFeatureAlignmentInitPreSet_i11LMLXs(lFETFeatureAlignmentInfo* info, lFETFeatureAlignment_i11LMLXsInitInfo* out); | extern void lFETFeatureAlignmentInitPreSet_i11LMLXs(lFETFeatureAlignmentInfo* info, lFETFeatureAlignment_i11LMLXsInitInfo* out); | ||
行158: | 行208: | ||
<br> | <br> | ||
+ | === イテレーション === | ||
+ | inから参照データリストを作成し、outへ格納します。 | ||
+ | extern int lFETFeatureAlignmentSphereRefGenerate(lFETFeatureAlignmentInfo* in, lFETFeatureAlignmentImageInfo* out); | ||
+ | <br> | ||
+ | |||
+ | sphの縮退データをsph->curSwitchの切り替えて格納します。元のデータは解放します。(sph->curSwitchは新しい格納場所を指します) | ||
+ | extern void lFETFeatureAlignmentSphereDegenerate(lFETFeatureAlignmentSphereInfo* sph); | ||
+ | <br> | ||
+ | |||
+ | sphのある向きの特徴量を中心の特徴量にします。ある向きは(x, y, z)=(10, 7, 5)としています。 | ||
+ | extern void lFETFeatureAlignmentSphereRandDisturb(lFETFeatureAlignmentSphereInfo* sph); | ||
+ | <br> | ||
+ | |||
+ | === 演算 ・コピー === | ||
aの要素をbのメンバへコピーします。 | aの要素をbのメンバへコピーします。 | ||
extern void lFETFAfeaturecpy1(lFETFeatureAlignmentFeature* b, double* a); | extern void lFETFAfeaturecpy1(lFETFeatureAlignmentFeature* b, double* a); | ||
行189: | 行253: | ||
<br> | <br> | ||
+ | 4つの座標a, b, c, dを合計し、正規化した座標を返します。 | ||
extern lFETFeatureAlignmentCoord lFETFAcalcCoordSum(lFETFeatureAlignmentCoord a, lFETFeatureAlignmentCoord b, lFETFeatureAlignmentCoord c, lFETFeatureAlignmentCoord d); | extern lFETFeatureAlignmentCoord lFETFAcalcCoordSum(lFETFeatureAlignmentCoord a, lFETFeatureAlignmentCoord b, lFETFeatureAlignmentCoord c, lFETFeatureAlignmentCoord d); | ||
<br> | <br> | ||
行238: | 行303: | ||
<br> | <br> | ||
+ | aとbの外積をansへ格納します。(2軸に直交するベクトルを算出) | ||
extern void lFETFAvectorProduct1(double* a, double* b, double* ans); | extern void lFETFAvectorProduct1(double* a, double* b, double* ans); |
2015年3月25日 (水) 07:40時点における最新版
DataManip/transform/src/lFETOrientationSearchByFeatureAlignmentはFETOrientationSearchByFeatureAlignmentのためのAPI です。
定数
#define SphereDevNum 2100
構造体
typedef struct lFETOrientationSearchByFeatureAlignmentInfo{ FILE* In; FILE* In2; int flagInType; // 0:Sinogram 1:FET int flagIn2; FILE* Out; int ldn; double srl; int flagInA, flagOutA, flagOut2D, flagOutLOG; int itmax, devmax, mitmax, mdevmax; FILE* InA; FILE* OutA; FILE* Out2D; FILE* OutLOG; int mode; }lFETOrientationSearchByFeatureAlignmentInfo;
座標
typedef struct lFETFeatureAlignmentCoord{ double x, y, z; }lFETFeatureAlignmentCoord;
特徴量
typedef struct lFETFeatureAlignmentFeature{ double t, w, a, k; }lFETFeatureAlignmentFeature;
メンバ | 説明 |
---|---|
t | |
w | 幅 |
a | 歪度 |
k | 尖度 |
typedef struct lFETFeatureAlignmentSpherePointInfo{ lFETFeatureAlignmentCoord self; lFETFeatureAlignmentFeature fets; lFETFeatureAlignmentFeature nfets; int nnum; }lFETFeatureAlignmentSpherePointInfo;
typedef struct lFETFeatureAlignmentImageInfo{ char imagename[256]; lFETFeatureAlignmentFeature* fets; double lenmax; double lenmin; double lensum; int posmax; int posmin; int flagLX; double interAngle; lFETFeatureAlignmentCoord norm, base, yoys; //lFETFeatureAlignmentImageInfoClass group; lFETFeatureAlignmentSpherePointInfo* spt[2]; int next; }lFETFeatureAlignmentImageInfo;
typedef struct lFETFeatureAlignmentImageQSInfo{ lFETFeatureAlignmentFeature** corset; int** cset; int* lxseries; int* nseries; int seed; int num; }lFETFeatureAlignmentImageQSInfo;
typedef struct lFETFeatureAlignmentSphereSquareInfo{ lFETFeatureAlignmentSpherePointInfo** sq; int center; }lFETFeatureAlignmentSphereSquareInfo;
curSwitch: 0, 1: データ切り替えのためのスイッチとして使用
typedef struct lFETFeatureAlignmentSphereInfo{ lFETFeatureAlignmentSphereSquareInfo sq6[2][6]; int curSwitch; int mode; }lFETFeatureAlignmentSphereInfo;
typedef struct lFETFeatureAlignmentInfo{ lFETFeatureAlignmentImageInfo* images; int imagey; int imagenum; double llong; double lmiddle; double lmiddles; double lshort; int ldn; double srl; double corave; FILE* OutLOG; //int groupnum[9]; //int groups[9]; int seedImage, smallImage; lFETFeatureAlignmentSphereInfo sph; //lFETFeatureAlignmentSpherePointInfo* spt; int mode; }lFETFeatureAlignmentInfo;
typedef struct lFETFeatureAlignment_multiselectInfo{ lFETFeatureAlignmentImageInfo* images; double max; }lFETFeatureAlignment_multiselectInfo;
typedef struct lFETFeatureAlignment_i11LMLXsInitInfo{ int lmList[10]; int lxList[10]; int pos[10][10]; //int rev[10][10]; double cvalue[10]; double cor[10][10][2]; }lFETFeatureAlignment_i11LMLXsInitInfo;
typedef struct lFETFeatureAlignment_i2LMsLXsInitInfo{ int ser[2][5][10]; int num[2]; }lFETFeatureAlignment_i2LMsLXsInitInfo;
typedef struct lFETFeatureAlignment_i1LssInitInfo{ lFETFeatureAlignmentImageInfo* images[10]; int** angle[10]; int** nums[10]; int** max; }lFETFeatureAlignment_i1LssInitInfo;
typedef struct lFETFeatureAlignment_initmSelecterInfo{ int mode; FILE* InA; int itmax,devmax,mitmax,mdevmax; lFETFeatureAlignmentInfo* faInfo; lFETFeatureAlignment_multiselectInfo multi; lFETFeatureAlignment_i11LMLXsInitInfo i11LMLXs; lFETFeatureAlignment_i2LMsLXsInitInfo i2LMsLXs; lFETFeatureAlignment_i1LssInitInfo i1Lss; }lFETFeatureAlignment_initmSelecterInfo;
API
メイン
extern void lFETOrientationSearchByFeatureAlignment(lFETOrientationSearchByFeatureAlignmentInfo in, int mode);
in->modeにより初期データを設定方法を選択できます。(参照:FETOrientationSearchByFeatureAlignment#-m の詳細)
初期設定
sphの初期設定を行います。
extern void lFETFeatureAlignmentSphereInit(lFETFeatureAlignmentSphereInfo* sph, int mode);
info->sphにて特徴量の設定を行います。
extern void lFETFeatureAlignmentSphereFeatureSet(lFETFeatureAlignmentInfo* info);
sphの分割データ(self, fets)をsph->curSwitchの切り替えて格納します。元のデータは解放します。(sph->curSwitchは新しい格納場所を指します)
extern void lFETFeatureAlignmentSphereDevide(lFETFeatureAlignmentSphereInfo* sph);
4 images selected by 90degree rule
extern void lFETFeatureAlignmentInitSet_i2PCA(lFETFeatureAlignmentInfo* info);
1 image of image has largest radius
info->seedImageをシードとする
extern void lFETFeatureAlignmentInitSet_i1L(lFETFeatureAlignmentInfo* info);
flagLX == targetをシードとする
extern void lFETFeatureAlignmentInitSet_i1Ls(lFETFeatureAlignmentInfo* info, int target);
extern void lFETFeatureAlignmentInitPreSet_i1Lss(lFETFeatureAlignmentInfo* info, lFETFeatureAlignment_i1LssInitInfo* out, int target); extern void lFETFeatureAlignmentInitSet_i1Lss(lFETFeatureAlignmentInfo* info, lFETFeatureAlignment_i1LssInitInfo* out, int mode); extern void lFETFeatureAlignmentInitPreSet_i2LMsLXs(lFETFeatureAlignmentInfo* info, lFETFeatureAlignment_i2LMsLXsInitInfo* initInfo); extern void lFETFeatureAlignmentInitSet_i2LMsLXs(lFETFeatureAlignmentInfo* info, lFETFeatureAlignment_i2LMsLXsInitInfo* initInfo, int targetM, int targetS); extern void lFETFeatureAlignmentInitSet_i2LM(lFETFeatureAlignmentInfo* info); extern void lFETFeatureAlignmentInitSet_i21LMLX(lFETFeatureAlignmentInfo* info);
all images with random angles consist
extern void lFETFeatureAlignmentInitSet_random(lFETFeatureAlignmentInfo* info);
2 images of image has largest radius
extern void lFETFeatureAlignmentInitSet_i2LXs(lFETFeatureAlignmentInfo* info, int target); extern void lFETFeatureAlignmentInitPreSet_i11LMLXs(lFETFeatureAlignmentInfo* info, lFETFeatureAlignment_i11LMLXsInitInfo* out); extern void lFETFeatureAlignmentInitSet_i11LMLXs(lFETFeatureAlignmentInfo* info, lFETFeatureAlignment_i11LMLXsInitInfo* initInfo, int target);
イテレーション
inから参照データリストを作成し、outへ格納します。
extern int lFETFeatureAlignmentSphereRefGenerate(lFETFeatureAlignmentInfo* in, lFETFeatureAlignmentImageInfo* out);
sphの縮退データをsph->curSwitchの切り替えて格納します。元のデータは解放します。(sph->curSwitchは新しい格納場所を指します)
extern void lFETFeatureAlignmentSphereDegenerate(lFETFeatureAlignmentSphereInfo* sph);
sphのある向きの特徴量を中心の特徴量にします。ある向きは(x, y, z)=(10, 7, 5)としています。
extern void lFETFeatureAlignmentSphereRandDisturb(lFETFeatureAlignmentSphereInfo* sph);
演算 ・コピー
aの要素をbのメンバへコピーします。
extern void lFETFAfeaturecpy1(lFETFeatureAlignmentFeature* b, double* a);
以下の対応でコピーします。
bのメンバ | aの要素 |
---|---|
b->w | a[0] |
b->a | a[1] |
b->k | a[2] |
aのメンバをbのメンバへ加えます。(w, a, k)
extern void lFETFAfeatureAdd(lFETFeatureAlignmentFeature* b, lFETFeatureAlignmentFeature* a);
2つの座標a, b間の距離を返します。
extern double lFETFAcalcCoordDistance(lFETFeatureAlignmentCoord a, lFETFeatureAlignmentCoord b);
4つの座標a, b, c, dを合計し、正規化した座標を返します。
extern lFETFeatureAlignmentCoord lFETFAcalcCoordSum(lFETFeatureAlignmentCoord a, lFETFeatureAlignmentCoord b, lFETFeatureAlignmentCoord c, lFETFeatureAlignmentCoord d);
aの座標とmodeを掛けた値をbの要素へ格納します。
extern void lFATFAcoordcpy2(lFETFeatureAlignmentCoord* a, double* b, int mode);
以下の対応で格納します。
bの要素 | 値 |
---|---|
b[0] | a->x*mode |
b[1] | a->y*mode |
b[2] | a->z*mode |
aの要素とmodeを掛けた値をbの座標へ格納します。
extern void lFETFAcoordcpy1(lFETFeatureAlignmentCoord* b, double* a, int mode);
以下の対応で格納します。
bのメンバ | 値 |
---|---|
x | a[0]*mode |
y | a[1]*mode |
z | a[2]*mode |
aとbの外積をansへ格納します。(2軸に直交するベクトルを算出)
extern void lFETFAvectorProduct1(double* a, double* b, double* ans);