示例#1
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")
示例#2
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()
示例#3
0
    def temporalPlot_OneModelOutputPlot(cls):
        """
        Plot only one Model output
        """

        # ----DATA-----
        DATA_PATH = pyCGM2.TEST_DATA_PATH + "operations\\plot\\gaitPlot\\"
        modelledFilenames = ["gait Trial 03 - viconName.c3d"]

        trial = trialTools.smartTrialReader(DATA_PATH, modelledFilenames[0])

        fig = plt.figure()
        ax = plt.gca()
        plot.temporalPlot(ax,
                          trial,
                          "LPelvisAngles",
                          0,
                          color="blue",
                          title="test",
                          xlabel="frame",
                          ylabel="angle",
                          ylim=None,
                          legendLabel=None,
                          customLimits=None)

        plt.show()
示例#4
0
    def test_temporalPlot(self):
        DATA_PATH, modelledFilenames,acq = dataTest1()
        fig = plt.figure()
        ax = plt.gca()
        reportPlot.temporalPlot(ax,acq,"LPelvisAngles",0,color="blue",
                title="test", xlabel="frame", ylabel="angle",ylim=None,legendLabel=None,
                customLimits=None)

        if SHOW: plt.show()
        return fig
示例#5
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)
示例#6
0
    def test_temporalPlot_OneModelOutputPlot(self):
        """
        Plot only one Model output
        """

        # ----DATA-----
        DATA_PATH = pyCGM2.TEST_DATA_PATH + "GaitData\CGM1-NormalGaitData-Events\Hånnibøl Lecter\\"
        modelledFilenames = ["gait Trial 01.c3d"]

        trial = trialTools.smartTrialReader(DATA_PATH, modelledFilenames[0])

        fig = plt.figure()
        ax = plt.gca()
        plot.temporalPlot(ax,
                          trial,
                          "LPelvisAngles",
                          0,
                          color="blue",
                          title="test",
                          xlabel="frame",
                          ylabel="angle",
                          ylim=None,
                          legendLabel=None,
                          customLimits=None)