Пример #1
0
    def calcAnovaIS(self):
        """TODO: implement the checks for rerun"""

        # calculates Anova on inverse space (IS)
        if self.AnovaCheck:
            self.IS = Stat.Anova(self.H5, self.Mainframe)
            # Parametric Analysis
            if self.AnovaParam:
                if self.doAnovaParamIS:
                    self.IS.Param()
                    self.progressTxt.append('Parametric Anova (IS) : %s' %
                                            self.IS.elapsedTime)

            # Non Parametric Analysis
            else:
                if self.doAnovaNonParamIS:
                    self.IS.NonParam(self.AnovaIteration)
                    self.progressTxt.append('Non-Parametric Anova (IS) : %s' %
                                            self.IS.elapsedTime)

            # Makes sure that the h5 files are always closed at the end
            self.IS.file.close()
            self.cancel = self.IS.cancel

        # calculates PostHoc on inverse space (IS)
        if self.PostHocCheck:

            self.ISPostHoc = Stat.PostHoc(self.H5, self.Mainframe)

            # Parametric Analysis
            if self.PostHocParam:
                if self.doPostHocParamIS:
                    self.ISPostHoc.Param()
                    self.progressTxt.append('Parametric PostHoc (IS) : %s' %
                                            self.ISPostHoc.elapsedTime)

            # Non Parametric Analysis
            else:
                if self.doPostHocNonParamIS:
                    self.ISPostHoc.NonParam(self.PostHocIteration)
                    self.progressTxt.append(
                        'Non-Parametric PostHoc (IS) : %s' %
                        self.ISPostHoc.elapsedTime)

            # Makes sure that the h5 files are always closed at the end
            self.ISPostHoc.file.close()
            self.cancel = self.ISPostHoc.cancel
        # Multiple testing and writing Data, Post Stat Analysis - i.e Mathematical Morphology, write
        if self.SpaceFile == '':
            self.SpaceFile = None
        Correction = PostStat.MultipleTestingCorrection(
            self.H5,
            self.Mainframe,
            TF=self.PtsConsec,
            Alpha=self.Alpha,
            SpaceCont=self.Clust,
            SpaceFile=self.SpaceFile)
        Correction.Calculation()
        self.Param = {'Anova': self.AnovaParam, 'PostHoc': self.PostHocParam}
        Writing = PostStat.WriteData(self.PathResult,
                                     self.H5,
                                     self.Param,
                                     DataGFP=False)
        Writing.StatistcalData(Correction.CorrectedMask)
        Writing.IntermediateResult()
        Writing.file.close()
Пример #2
0
    def calcAnovaWave(self):
        # calculates Anova on wave and/or GFP
        if self.AnovaCheck:

            self.Wave = Stat.Anova(self.H5, self.Mainframe)
            # Parametric Analysis
            if self.AnovaParam:
                if self.AnalyseType in ["GFP Only", "Both"] \
                        and self.doAnovaParamGFP:
                    self.Wave.Param(DataGFP=True)
                    self.progressTxt.append('Parametric Anova (GFP) : %s' %
                                            self.Wave.elapsedTime)


                if self.AnalyseType in ["All Electrodes", "Both"] \
                        and self.doAnovaParamElect:
                    self.Wave.Param()
                    self.progressTxt.append(
                        'Parametric Anova (All Electrodes) : %s' %
                        self.Wave.elapsedTime)

            # Non Parametric Analysis
            else:
                if self.AnalyseType in ["GFP Only", "Both"] \
                        and self.doAnovaNonParamGFP:
                    self.Wave.NonParam(self.AnovaIteration, DataGFP=True)
                    self.progressTxt.append('Non-Parametric Anova (GFP) : %s' %
                                            self.Wave.elapsedTime)

                if self.AnalyseType in ["All Electrodes", "Both"] \
                        and self.doAnovaNonParamElect:
                    self.Wave.NonParam(self.AnovaIteration)
                    self.progressTxt.append(
                        'Non-Parametric Anova (All Electrodes) : %s' %
                        self.Wave.elapsedTime)

            # Makes sure that the h5 files are always closed at the end
            self.cancel = self.Wave.cancel
            self.Wave.file.close()

        # calculates PostHoc on wave and/or GFP
        if self.PostHocCheck:

            self.WavePostHoc = Stat.PostHoc(self.H5, self.Mainframe)

            # Parametric
            if self.PostHocParam:
                if self.AnalyseType in ["GFP Only", "Both"] \
                        and self.doPostHocParamGFP:
                    self.WavePostHoc.Param(DataGFP=True)
                    self.progressTxt.append('Parametric PostHoc (GFP) : %s' %
                                            self.WavePostHoc.elapsedTime)

                if self.AnalyseType in ["All Electrodes", "Both"] \
                        and self.doPostHocParamElect:
                    self.WavePostHoc.Param()
                    self.progressTxt.append(
                        'Parametric PostHoc (All Electrodes) : %s' %
                        self.WavePostHoc.elapsedTime)

            # Non Parametric
            else:
                if self.AnalyseType in ["GFP Only", "Both"] \
                        and self.doPostHocNonParamGFP:
                    self.WavePostHoc.NonParam(self.PostHocIteration,
                                              DataGFP=True)
                    self.progressTxt.append(
                        'Non-Parametric PostHoc (GFP) : %s' %
                        self.WavePostHoc.elapsedTime)

                if self.AnalyseType in ["All Electrodes", "Both"] \
                        and self.doPostHocNonParamElect:
                    self.WavePostHoc.NonParam(self.PostHocIteration)
                    self.progressTxt.append(
                        'Non-Parametric PostHoc (All Electrodes) : %s' %
                        self.WavePostHoc.elapsedTime)
            # Makes sure that the h5 files are always closed at the end
            self.cancel = self.WavePostHoc.cancel
            self.WavePostHoc.file.close()

        # Multiple testing and writing Data
        if self.SpaceFile == '':
            self.SpaceFile = None
        Correction = PostStat.MultipleTestingCorrection(
            self.H5,
            self.Mainframe,
            TF=self.PtsConsec,
            Alpha=self.Alpha,
            SpaceCont=self.Clust,
            SpaceFile=self.SpaceFile)
        Correction.Calculation()
        self.Param = {'Anova': self.AnovaParam, 'PostHoc': self.PostHocParam}
        if self.AnalyseType in ["GFP Only", "Both"]:
            Writing = PostStat.WriteData(self.PathResult,
                                         self.H5,
                                         self.Param,
                                         DataGFP=True)
            Writing.StatistcalData(Correction.CorrectedMask)
            Writing.IntermediateResult()
            Writing.file.close()
        if self.AnalyseType in ["All Electrodes", "Both"]:
            Writing = PostStat.WriteData(self.PathResult,
                                         self.H5,
                                         self.Param,
                                         DataGFP=False)
            Writing.StatistcalData(Correction.CorrectedMask)
            Writing.IntermediateResult()
            Writing.file.close()