예제 #1
0
 void subTable_normalize()
 {
     if (normaliz_method == 1)
     {
         List <string> col_list = TheTool.getListJointXYZ();
         TheTool_Stat.normalize_table_MinMax(this.sub_table, col_list, decimalNum);
     }
 }
예제 #2
0
 void subTable_calJointEuclidian(int fileID, DataTable dt)
 {
     try
     {
         //=================================================
         //============= Write Sub Table ==================
         //build Column First
         columnAdd_forJoints(dt, col_s_suffix_d);
         //======================================================
         //------ Variable For cal Euclidian Distance
         double[]      lastXYZ = { 0, 0, 0 }; double[] currentXYZ = { 0, 0, 0 };
         List <double> list_D;
         double        dist;
         //======================================================
         foreach (string joint in TheTool.joint_list_upperOnly)//Column first method
         {
             list_D = new List <double> {
             };
             if (normaliz_method == 4)
             {
                 TheMinMaxNormaliz.getMinMax(joint, ref temp_Dist_min, ref temp_Dist_max);
             }
             //------ Cal AvgC -----------------------------
             //double avg_C = TheTool_Stat.calAvg_byCol(dt, joint + "_c", decimalNum);
             //dataTable.Rows[fileID][joint + col_m_cAvg] = avg_C;
             //------ Cal Joint D -----------------------------
             for (int row = 0; row < dt.Rows.Count; row++)
             {
                 //------ Cal Euclidian --------------------------------
                 currentXYZ = TheTool.getDouble_fromJoint(dt, row, joint);
                 if (row == 0)
                 {
                     dt.Rows[row][joint + col_s_suffix_d] = "0";
                 }
                 else
                 {
                     dist = TheTool_Stat.calEuclidean(currentXYZ, lastXYZ, decimalNum);
                     if (normaliz_method == 4)
                     {
                         dist = TheTool_Stat.calMinMaxNormalize(dist, temp_Dist_min, temp_Dist_max);
                     }
                     dt.Rows[row][joint + col_s_suffix_d] = dist;
                     list_D.Add(dist);
                 }
                 lastXYZ = currentXYZ;
             }
             //=================================================
             //============= Write Main Table ==================
             calMainTable(list_D, fileID, joint);
         }
     }
     catch { }
 }
예제 #3
0
 //baseName = "Head"
 void calMainTable(List <double> list_D, int fileID, string baseName)
 {
     //------ For cal Distance Z-Score
     v_mean = TheTool_Stat.calMean(list_D);
     v_mean = list_D.Average();
     mainTable.Rows[fileID][baseName + col_suffix_dAvg] = v_mean.ToString();
     //
     v_variance = TheTool_Stat.calVariance(list_D, v_mean);
     mainTable.Rows[fileID][baseName + col_suffix_dV] = v_variance;
     //
     mainTable.Rows[fileID][baseName + col_suffix_dMax] = list_D.Max().ToString();
     //
     v_sd  = Math.Sqrt(v_variance);
     v_p75 = (0.674 * v_sd) + v_mean;
     mainTable.Rows[fileID][baseName + col_suffix_dP75] = v_p75.ToString();
     v_p90 = (1.282 * v_sd) + v_mean;
     mainTable.Rows[fileID][baseName + col_suffix_dP90] = v_p90.ToString();
 }