コード例 #1
0
ファイル: analysis.py プロジェクト: mitkof6/pyCGM2
    def computeKinetics(self):
        """ compute descriptive of kinetics parameters

            :return:
                - `out` (dict) - dictionnary with descriptive statictics of kinetics parameters
                - `outPst` ( dict) - dictionnary with descriptive statictics of spatio-temporal parameters matching  kinetics parameters

        """


        out={}
        outPst={}
        outOptional={}

        logging.info("--kinetic computation--")
        if self.m_cycles.kineticCycles is not None:

           found_context = list()
           for cycle in self.m_cycles.kineticCycles:
               found_context.append(cycle.context)


           if "Left" in self.m_kineticLabelsDict.keys():
               if "Left" in found_context:
                   for label in self.m_kineticLabelsDict["Left"]:
                       labelPlus = label + "_" + self.m_pointlabelSuffix if self.m_pointlabelSuffix is not None else label
                       out[labelPlus,"Left"]=CGM2cycle.point_descriptiveStats(self.m_cycles.kineticCycles,labelPlus,"Left")
                   for label in self.m_kinematicLabelsDict["Left"]:
                       labelPlus = label + "_" + self.m_pointlabelSuffix if self.m_pointlabelSuffix is not None else label
                       outOptional[labelPlus,"Left"]=CGM2cycle.point_descriptiveStats(self.m_cycles.kineticCycles,labelPlus,"Left")
                   logging.info("left kinetic computation---> done")
               else:
                   logging.warning("No left Kinetic computation")

           if "Right" in self.m_kineticLabelsDict.keys():
               if  "Right" in found_context:
                   for label in self.m_kineticLabelsDict["Right"]:
                       labelPlus = label + "_" + self.m_pointlabelSuffix if self.m_pointlabelSuffix is not None else label
                       out[labelPlus,"Right"]=CGM2cycle.point_descriptiveStats(self.m_cycles.kineticCycles,labelPlus,"Right")

                   for label in self.m_kinematicLabelsDict["Right"]:
                       labelPlus = label + "_" + self.m_pointlabelSuffix if self.m_pointlabelSuffix is not None else label
                       outOptional[labelPlus,"Right"]=CGM2cycle.point_descriptiveStats(self.m_cycles.kineticCycles,labelPlus,"Right")

                   logging.info("right kinetic computation---> done")
               else:
                   logging.warning("No right Kinetic computation")


        else:
            logging.warning("No Kinetic computation")

        return out,outPst,outOptional
コード例 #2
0
ファイル: analysis.py プロジェクト: sremm/pyCGM2
    def computeKinematics(self):
        """ compute descriptive of kinematics parameters

            :return:
                - `out` (dict) - dictionnary with descriptive statictics of kinematics parameters
                - `outPst` ( dict) - dictionnary with descriptive statictics of spatio-temporal parameters matching  kinematics parameters

        """

        out = {}
        outPst = {}

        LOGGER.logger.info("--kinematic computation--")
        if self.m_cycles.kinematicCycles is not None:
            if "Left" in self.m_kinematicLabelsDict.keys():
                for label in self.m_kinematicLabelsDict["Left"]:
                    labelPlus = label + "_" + self.m_pointlabelSuffix if self.m_pointlabelSuffix is not None else label
                    out[labelPlus, "Left"] = CGM2cycle.point_descriptiveStats(
                        self.m_cycles.kinematicCycles, labelPlus, "Left")

                for label in CGM2cycle.GaitCycle.STP_LABELS:
                    outPst[
                        label,
                        "Left"] = CGM2cycle.spatioTemporelParameter_descriptiveStats(
                            self.m_cycles.kinematicCycles, label, "Left")

                LOGGER.logger.info("left kinematic computation---> done")
            else:
                LOGGER.logger.warning("No left Kinematic computation")

            if "Right" in self.m_kinematicLabelsDict.keys():
                for label in self.m_kinematicLabelsDict["Right"]:
                    labelPlus = label + "_" + self.m_pointlabelSuffix if self.m_pointlabelSuffix is not None else label
                    out[labelPlus, "Right"] = CGM2cycle.point_descriptiveStats(
                        self.m_cycles.kinematicCycles, labelPlus, "Right")

                for label in CGM2cycle.GaitCycle.STP_LABELS:
                    outPst[
                        label,
                        "Right"] = CGM2cycle.spatioTemporelParameter_descriptiveStats(
                            self.m_cycles.kinematicCycles, label, "Right")

                LOGGER.logger.info("right kinematic computation---> done")
            else:
                LOGGER.logger.warning("No right Kinematic computation")

        else:
            LOGGER.logger.warning("No Kinematic computation")

        return out, outPst