Example #1
0
    def computeSpatioTemporel(self):

        """
            **Description:** compute descriptive of spatio-temporal parameters

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

        """
        out={}

        logging.info("--stp computation--")
        if self.m_cycles.spatioTemporalCycles is not None :

            enableLeftComputation = len ([cycle for cycle in self.m_cycles.spatioTemporalCycles if cycle.enableFlag and cycle.context=="Left"])
            enableRightComputation = len ([cycle for cycle in self.m_cycles.spatioTemporalCycles if cycle.enableFlag and cycle.context=="Right"])

            for label in CGM2cycle.GaitCycle.STP_LABELS:
                if enableLeftComputation:
                    out[label,"Left"]=CGM2cycle.spatioTemporelParameter_descriptiveStats(self.m_cycles.spatioTemporalCycles,label,"Left")

                if enableRightComputation:
                    out[label,"Right"]=CGM2cycle.spatioTemporelParameter_descriptiveStats(self.m_cycles.spatioTemporalCycles,label,"Right")
            if enableLeftComputation:
                logging.info("left stp computation---> done")
            if enableRightComputation:
                logging.info("right stp computation---> done")
        else:
            logging.warning("No spatioTemporal computation")

        return out
Example #2
0
    def computeEmgEnvelopes(self):

        """
            Compute descriptive of emg values

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


        out={}
        outPst={}

        logging.info("--emg computation--")
        if self.m_cycles.emgCycles is not None:

            for rawLabel in self.m_emgLabelList:
                out[rawLabel,"Left"]=CGM2cycle.analog_descriptiveStats(self.m_cycles.emgCycles,rawLabel,"Left")
                out[rawLabel,"Right"]=CGM2cycle.analog_descriptiveStats(self.m_cycles.emgCycles,rawLabel,"Right")


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

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

        return out,outPst
Example #3
0
    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