Exemplo n.º 1
0
    def temporalPlotSingleEmg(cls):

        # ----DATA-----
        DATA_PATH = pyCGM2.TEST_DATA_PATH + "EMG\\SampleNantes\\"
        gaitTrial = "gait.c3d"
        restTrial = "repos.c3d"

        EMG_LABELS = ['EMG1']

        acq = btkTools.smartReader(DATA_PATH + gaitTrial)

        bf = emgFilters.BasicEmgProcessingFilter(acq, EMG_LABELS)
        bf.setHighPassFrequencies(20.0, 200.0)
        bf.run()
        btkTools.smartWriter(acq, "testBasicPlot.c3d")

        trial = trialTools.smartTrialReader(None, "testBasicPlot.c3d")

        fig = plt.figure()
        ax = plt.gca()
        plot.temporalPlot(ax,
                          trial,
                          "EMG1_Rectify",
                          0,
                          color="blue",
                          title="test",
                          xlabel="frame",
                          ylabel="emg",
                          ylim=None,
                          legendLabel=None,
                          customLimits=None)
        plot.addTemporalNormalActivationLayer(ax, trial, "RECFEM", "Left")
        plt.show()
Exemplo n.º 2
0
    def test_temporalPlotSingleEmg(self):

        # ----DATA-----
        DATA_PATH = pyCGM2.TEST_DATA_PATH+"GaitData\\EMG\\Hånnibøl Lecter-nerve block\\"
        gaitTrial = "PRE-gait trial 01.c3d"
        restTrial = "PRE-repos.c3d"

        DATA_PATH_OUT = pyCGM2.TEST_DATA_PATH_OUT+"GaitData\\EMG\\Hånnibøl Lecter-nerve block\\"
        files.createDir(DATA_PATH_OUT)

        EMG_LABELS=['EMG1']

        acq = btkTools.smartReader(DATA_PATH +gaitTrial)
        bf = emgFilters.BasicEmgProcessingFilter(acq,EMG_LABELS)
        bf.setHighPassFrequencies(20.0,200.0)
        bf.run()
        btkTools.smartWriter(acq,DATA_PATH_OUT+"test_temporalPlotSingleEmg.c3d")


        trial =trialTools.smartTrialReader(DATA_PATH_OUT,"test_temporalPlotSingleEmg.c3d")

        fig = plt.figure()
        ax = plt.gca()
        plot.temporalPlot(ax,trial,"EMG1_Rectify",0,
                color="blue",
                title="test", xlabel="frame", ylabel="emg",ylim=None,legendLabel=None,
                customLimits=None)
        plot.addTemporalNormalActivationLayer(ax,trial,"RECFEM","Left")
Exemplo n.º 3
0
    def __setData(self):
        #suffixPlus = "_" + self.m_pointLabelSuffix if self.m_pointLabelSuffix!="" else ""

        for i in range(0, len(self.emgs)):
            label = self.emgs[i]["Label"]+"_Rectify" if self.rectify  else self.emgs[i]["Label"]+"_HPF"
            context = self.emgs[i]["Context"]
            colorContext = plotUtils.colorContext(context)

            normalActivationLabel = self.m_normalActivEmgs[i]

            plot.temporalPlot(self.fig.axes[i],self.m_trial,
                                    label,0,
                                    color=colorContext)
            plot.addTemporalNormalActivationLayer(self.fig.axes[i],self.m_trial,self.m_normalActivEmgs[i],context)