コード例 #1
0
ファイル: mainwindow.py プロジェクト: eidelen/MIALab_2012
 def on_LoadXray_released(self):
     """
     Slot documentation goes here.
     """
     fileName = QFileDialog.getOpenFileName(self, "Open X-ray File", "","DICOM Files (*.dcm)")
     (reader, img) = dicom.open_image(str(fileName))
     self.mOrignialXRayImage = img
     
     self.display_image( self.mOrignialXRayImage )
     self.dectectJointsButton.enabledChange(True)
     print str(fileName)
コード例 #2
0
ファイル: mainwindow.py プロジェクト: eidelen/MIALab_2012
    def on_LoadXray_released(self):
        """
        Slot documentation goes here.
        """
        fileName = QFileDialog.getOpenFileName(self, "Open X-ray File", "",
                                               "DICOM Files (*.dcm)")
        (reader, img) = dicom.open_image(str(fileName))
        self.mOrignialXRayImage = img

        self.display_image(self.mOrignialXRayImage)
        self.dectectJointsButton.enabledChange(True)
        print str(fileName)
コード例 #3
0
 def __init__(self):
     
     self.fileNameRef = '../training/Case1.dcm'
     (reader, self.imgSample) = dicom.open_image(str(self.fileNameRef))
     self.imgSample = self.resize_image(self.imgSample)
     self.patch = self.imgSample[50:100][:,185:270] # only tip
コード例 #4
0
ファイル: fromShell.py プロジェクト: eidelen/MIALab_2012
#> 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
コード例 #5
0
#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(
                    directory + '/' + str(i) + "_littleFinger_" +
                    str(jointNum) + ".png", joint)
                jointNum = jointNum + 1

        if (len(fingers['middleFinger']) == 3):
            jointNum = 1
            for joint in fingers['middleFinger']:
                imsave(
コード例 #6
0
	images=list()
	fingerImagesPool[finger]=images
	
	imgLF1=Image.new('L',size)
	images.append(imgLF1)
	
	imgLF2=Image.new('L',size)
	images.append(imgLF2)
	
	if (images!='thumb'):
		imgLF3=Image.new('L',size)
		images.append(imgLF3)

for i in okImg:
	
	(reader, img) = dicom.open_image("../training/Case" + str(i) + ".dcm")
		
	fingers = aClass.detect_joints_of_interest(img)
	
	for fingerName in evaluatedFingers:
				
		if(len(fingers)==3):
			if(len(fingers[fingerName])>=2):
				jointNum=1
				for joint in fingers[fingerName]:
					#imagesLF[jointNum-1].paste(Image.fromarray((255.0*255.0/joint.max()*(joint-joint.min())).astype(np.uint16)),((i-1)*140,0))
					fingerImagesPool[fingerName][jointNum-1].paste(Image.fromarray((255.0/joint.max()*(joint-joint.min())).astype(np.uint8)),((i-1)*140,0))
					#imagesLF[jointNum-1].paste(Image.fromarray(joint,'L'),((i-1)*140,0))
					jointNum = jointNum+1

#write down images
コード例 #7
0
    def __init__(self):

        self.fileNameRef = '../training/Case1.dcm'
        (reader, self.imgSample) = dicom.open_image(str(self.fileNameRef))
        self.imgSample = self.resize_image(self.imgSample)
        self.patch = self.imgSample[50:100][:, 185:270]  # only tip
コード例 #8
0
#> 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