def on_dectectJointsButton_released(self): #boneBinaryImage = age_determination.extract_Bones( self.mOrignialXRayImage ) QApplication.setOverrideCursor(QCursor(Qt.WaitCursor)) aClass = AgeDetermination() aClass.setVerbosity( True ) self.mDetectedJoints=aClass.detect_joints_of_interest( self.mOrignialXRayImage ) #self.display_image( joint_marked_image ) QApplication.restoreOverrideCursor() self.rateJointsButton.enabledChange(True)
def on_dectectJointsButton_released(self): #boneBinaryImage = age_determination.extract_Bones( self.mOrignialXRayImage ) QApplication.setOverrideCursor(QCursor(Qt.WaitCursor)) aClass = AgeDetermination() aClass.setVerbosity(True) self.mDetectedJoints = aClass.detect_joints_of_interest( self.mOrignialXRayImage) #self.display_image( joint_marked_image ) QApplication.restoreOverrideCursor() self.rateJointsButton.enabledChange(True)
def on_rateJointsButton_released(self): QApplication.setOverrideCursor(QCursor(Qt.WaitCursor)) if (self.mDetectedJoints!=None): scoreTable = np.loadtxt('scores/scores.txt') aClass = AgeDetermination() aClass.setVerbosity( True ) #[rateSum, okRatings]=aClass.rate_joints(self.mDetectedJoints,scoreTable) #print "----- FINAL Score is " + str(rateSum) +" with " + str(okRatings)+" found ratings! ------" print "Final prediction: " + str(aClass.rate_joints(self.mDetectedJoints,scoreTable)) else: print "Detect joints first!" QApplication.restoreOverrideCursor()
def on_rateJointsButton_released(self): QApplication.setOverrideCursor(QCursor(Qt.WaitCursor)) if (self.mDetectedJoints != None): scoreTable = np.loadtxt('scores/scores.txt') aClass = AgeDetermination() aClass.setVerbosity(True) #[rateSum, okRatings]=aClass.rate_joints(self.mDetectedJoints,scoreTable) #print "----- FINAL Score is " + str(rateSum) +" with " + str(okRatings)+" found ratings! ------" print "Final prediction: " + str( aClass.rate_joints(self.mDetectedJoints, scoreTable)) else: print "Detect joints first!" QApplication.restoreOverrideCursor()
#> ipython --pylab --deep-reload import numpy as np scores = np.loadtxt('../training/scores.txt') import dicom (reader, img) = dicom.open_image("../training/Case1.dcm") from AgeDetermination import AgeDetermination aClass = AgeDetermination() aClass.detect_joints_of_interest(img) # in ipython run -> # run fromShell.py
#> ipython --pylab --deep-reload import os import numpy as np import dicom from AgeDetermination import AgeDetermination from scipy.misc import imsave #scores = np.loadtxt('../training/scores.txt') aClass = AgeDetermination() directory = '../extractedJoints' if not os.path.exists(directory): os.makedirs(directory) #Add numbers of the working studies here: okImg = [ 1, 2, 3, 4, 6, 7, 9, 10, 11, 12, 13, 15, 17, 19, 20, 21, 22, 23, 26, 27, 28, 29, 30, 33 ] for i in okImg: (reader, img) = dicom.open_image("../training/Case" + str(i) + ".dcm") fingers = aClass.detect_joints_of_interest(img) if (len(fingers) == 2): if (len(fingers['littleFinger']) == 3): jointNum = 1 for joint in fingers['littleFinger']: imsave(
#> ipython --pylab --deep-reload import os import numpy as np import dicom from AgeDetermination import AgeDetermination from scipy.misc import imsave import Image scores = np.loadtxt('../training/scores.txt') aClass = AgeDetermination() directory = '../extractedJoints' if not os.path.exists(directory): os.makedirs(directory) #Add numbers of the working studies here: okImg=[1,3,10,23,28,29,30] evaluatedFingers = ['littleFinger','middleFinger','thumb'] size=140*33,140 fingerImagesPool=dict() for finger in evaluatedFingers: images=list() fingerImagesPool[finger]=images imgLF1=Image.new('L',size) images.append(imgLF1)