Esempio n. 1
0
File: Start.py Progetto: Jothy/RTQA
    def AnalysePicketFence0(self):
        if self.Mode=="Manual":
            files=QFileDialog(self)
            files.setWindowTitle('Picket Fence 0')
            self.CurrentImages=files.getOpenFileNames(self,caption='Continuous Stripes (1)')

        ContStripesDlg1=ContStripesDlg.ContStripesWidget(self)
        #ContStripesDlg1.Img=DCMReader.ReadDCMFile(str(self.CurrentImages[0]))

        mypf = PicketFence(str(self.CurrentImages[0]))

        mypf.image.check_inversion()
        mypf.analyze(tolerance=0.5, action_tolerance=0.3,hdmlc=False)
        mypf.save_analyzed_image('PicketFence0',gaurd_rails=True,mlc_peaks=True,overlay=True,leaf_error_subplot=True)
        #print(mypf.num_pickets,'No. of pickets found')
        #print(mypf.return_results())
        #mypf.plot_analyzed_image()


        AnalyzedImage=pl.imread('PicketFence0.png')
        ContStripesDlg1.Stripes.axes.imshow(AnalyzedImage)
        ContStripesDlg1.ResultsLabel.setText(mypf.return_results())
        #mypf.plot_analyzed_image(ContStripesDlg1.Stripes)
        numPickets=str(mypf.num_pickets)
        ContStripesDlg1.Stripes.axes.set_title("No. of pickets found: "+numPickets+"Gantry=0")
        ContStripesDlg1.Stripes.axes.text(5,25,"Tol=0.5mm,Act_Tol=0.3mm",color='g')
        ContStripesDlg1.Stripes.axes.text(5,60,"Warning:Picket & leaf indexing starts with 0",color='r')
        self.SaveWidgetScreenShot(ContStripesDlg1,'PicketFence0.jpg')

        ContStripesDlg1.Stripes.axes.arrow(25,550, 50,0, head_width=10, head_length=25, fc='b', ec='b')
        ContStripesDlg1.Stripes.axes.arrow(25,550,0,-50, head_width=10, head_length=25, fc='b', ec='b')
        ContStripesDlg1.Stripes.axes.text(35,570,"Count",color='gray')
        ContStripesDlg1.Stripes.axes.text(5,515,"Count",color='gray',rotation=90)

        ContStripesDlg1.Stripes.axes.set_xlabel("Pixel No. G-T")
        ContStripesDlg1.Stripes.axes.set_ylabel("Pixel No. A-B")

        if self.Mode=="Manual":
            ContStripesDlg1.Stripes.draw()
            ContStripesDlg1.exec_()
Esempio n. 2
0
File: Start.py Progetto: Jothy/RTQA
    def AnalyseContStripes(self):
        files=QFileDialog(self)
        files.setWindowTitle('Picket Fence')
        self.CurrentImages=files.getOpenFileNames(self,caption='Picket Fence')

        ContStripesDlg1=ContStripesDlg.ContStripesWidget(self)
        ContStripesDlg1.Img=DCMReader.ReadDCMFile(str(self.CurrentImages[0]))

        mypf = PicketFence(str(self.CurrentImages[0]))
        mypf.image.check_inversion()
        mypf.analyze(tolerance=0.50, action_tolerance=0.3,hdmlc=False)
        mypf.save_analyzed_image('PicketFence',gaurd_rails=True,mlc_peaks=True,overlay=True)
        #print(mypf.num_pickets,'No. of pickets found')
        print("SID:",mypf.image.SID)


        AnalyzedImage=pl.imread('PicketFence.png')
        ContStripesDlg1.Stripes.axes.imshow(AnalyzedImage)
        ContStripesDlg1.ResultsLabel.setText(mypf.return_results())
        #mypf.plot_analyzed_image(ContStripesDlg1.Stripes)
        ContStripesDlg1.Stripes.draw()
        ContStripesDlg1.exec_()

        self.SaveWidgetScreenShot(ContStripesDlg1,'PicketFence.jpg')