This commit is contained in:
moonanjum26
2018-08-10 11:46:55 +05:30
parent 58f29082c3
commit d1f4ac859d
10 changed files with 0 additions and 1963 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.0 KiB

View File

@@ -1 +0,0 @@
@"C:\Users\jeevan\AppData\Local\Programs\Python\Python35-32\python" -m PyQt5.uic.pyuic %1 %2 %3 %4 %5 %6 %7 %8 %9

View File

@@ -1,399 +0,0 @@
from PyQt5 import QtCore,QtGui,QtWidgets
import sys
import slide_scanner_test
import numpy as np
import cv2
import threading, time
from ximea import xiapi
import toQImage, PIL.Image
import serial
class gui(QtWidgets.QMainWindow,slide_scanner_test.Ui_MainWindow):
def __init__(self,parent=None):
super(gui,self).__init__(parent)
self.setupUi(self)
self.connectActions()
def main(self):
self.logoView.setPixmap(QtGui.QPixmap("0.jpg").scaled(50,50))
self.cam = xiapi.Camera()
self.cam.open_device()
self.cam.set_exposure(2000)
self.cam.set_imgdataformat('XI_RGB24')
self.img = xiapi.Image()
self.cam.start_acquisition()
self.livePreview = threading.Thread(name='cam_initialization',target=self.openCam,args=())
self.livePreview.start()
self.connect2arduino = threading.Thread(name='connect_arduino',target=self.connectArduino,args=())
self.connect2arduino.start()
self.currxpos = 0; self.currypos = 0; self.currzpos = 0
self.xFov = 1255; self.yFov = 1004; self.ymiddle = 40000;#round((12.5*self.yFov)/0.1596);
self.x0 = 0; self.x1 = 210000;#round((45*self.xFov)/0.1995);
self.y0 = 0; self.y1 = 80000;#round((12*self.yFov)/0.1596);
self.Zpulserate = 38400;self.Xpulserate = 38400;self.Ypulserate = 38400
self._translate = QtCore.QCoreApplication.translate
self.show()
def connectActions(self):
self.pushButton.clicked.connect(self.snapshot)
self.pushButton_2.clicked.connect(self.autoFocus)
self.pushButton_3.clicked.connect(self.xPlus)
self.pushButton_4.clicked.connect(self.yMinus)
self.pushButton_5.clicked.connect(self.yPlus)
self.pushButton_6.clicked.connect(self.xMinus)
self.pushButton_7.clicked.connect(self.zUp)
self.pushButton_8.clicked.connect(self.zDown)
self.pushButton_9.clicked.connect(lambda: self.gotoX(self.lineEdit.text()))
self.pushButton_10.clicked.connect(lambda: self.gotoY(self.lineEdit_3.text()))
self.pushButton_11.clicked.connect(lambda: self.gotoZ(self.lineEdit_2.text()))
self.pushButton_12.clicked.connect(lambda: self.setExposure(self.lineEdit_4.text()))
self.pushButton_13.clicked.connect(self.test)
self.pushButton_17.clicked.connect(self.bloodsmear)
self.pushButton_18.clicked.connect(self.resetOrigin)
def openCam(self):
while True:
self.cam.get_image(self.img)
self.data = self.img.get_image_data_numpy(invert_rgb_order=True)
self.pixmap = QtGui.QPixmap.fromImage(toQImage.toQImage(self.data))
self.slideImageView.setPixmap(self.pixmap.scaled(680,520))
def connectArduino(self):
self.ser = serial.Serial('COM3',57600)
#self.ser.open()
def setExposure(self, value):
self.cam.set_exposure(int(value))
def resetOrigin(self):
self.currxpos = 0
self.currypos = 0
self.currzpos = 0
self.ser.write(b'X')
self.label_13.setText(self._translate("MainWindow", str(self.currxpos)))
self.label_14.setText(self._translate("MainWindow", str(self.currypos)))
self.label_15.setText(self._translate("MainWindow", str(self.currzpos)))
def snapshot(self):
snapshot = PIL.Image.fromarray(self.data,'RGB')
snapshot.save('snap.jpg')
def autoFocus(self):
ts_start = time.time()
# Crude Auto-Focus
Z_travel_for_crude = 16000; crude_step_count = 500;
crude_pulse_count = Z_travel_for_crude / crude_step_count;
crude_max_var=0; crude_loc_max_var=0;
crude_start_loc = self.currzpos -(Z_travel_for_crude/2);
self.gotoZ(crude_start_loc);
crude_curr_loc = crude_start_loc;
kernel = np.ones((5,5),np.float32)/9
for i in range(int(crude_pulse_count)):
snapshot = self.data
crude_curr_var = np.var(cv2.filter2D(snapshot,-1,kernel))
print(crude_curr_var,'||',self.currzpos)
if crude_curr_var > crude_max_var:
crude_max_var = crude_curr_var
crude_loc_max_var = crude_curr_loc
crude_curr_loc = crude_curr_loc + crude_step_count
self.gotoZ(crude_curr_loc)
time.sleep(0.175)
self.gotoZ(crude_loc_max_var)
# Fine-crude AF
Z_travel_for_crude = 1000; crude_step_count = 50;
crude_loc_max_var = 0; crude_max_var = 0
crude_pulse_count = Z_travel_for_crude / crude_step_count;
crude_start_loc = self.currzpos - (Z_travel_for_crude/2);
self.gotoZ(crude_start_loc);
crude_curr_loc = crude_start_loc;
for i in range(int(crude_pulse_count)):
snapshot = self.data
crude_curr_var = np.var(cv2.filter2D(snapshot,-1,kernel))
print(crude_curr_var,'||',self.currzpos)
if crude_curr_var > crude_max_var:
crude_max_var = crude_curr_var
crude_loc_max_var = crude_curr_loc
crude_curr_loc = crude_curr_loc + crude_step_count
self.gotoZ(crude_curr_loc)
time.sleep(0.075)
self.gotoZ(crude_loc_max_var)
# Fine AF
Z_travel_for_crude = 120; crude_step_count = 5;
crude_loc_max_var = 0;crude_max_var = 0
crude_pulse_count = Z_travel_for_crude / crude_step_count;
crude_start_loc = self.currzpos - (Z_travel_for_crude/2);
self.gotoZ(crude_start_loc);
crude_curr_loc = crude_start_loc;
for i in range(int(crude_pulse_count)):
snapshot = self.data
crude_curr_var = np.var(snapshot)
print(crude_curr_var,'||',self.currzpos)
if crude_curr_var > crude_max_var:
crude_max_var = crude_curr_var
crude_loc_max_var = crude_curr_loc
crude_curr_loc = crude_curr_loc + crude_step_count
self.gotoZ(crude_curr_loc)
time.sleep(0.025)
self.gotoZ(crude_loc_max_var)
ts_stop = time.time()
print('time taken for autofocusing:'+str(ts_stop-ts_start)+' secs')
def parameter(self):
image = self.data
img = cv2.medianBlur(image,5)
cimg = cv2.cvtColor(img,cv2.COLOR_BGR2GRAY)
circles = cv2.HoughCircles(cimg,cv2.HOUGH_GRADIENT,1,35,param1=50,param2=30,minRadius=10,maxRadius=45)
area = 0
try:
circles = np.uint16(np.around(circles));#print('No.of Circles:',len(circles[0,:]))
for i in circles[0,:]:
# Total area
area = area + (3.1415 * i[2] * i[2])
except:
print("No circles detected")
ret,im_th = cv2.threshold(cimg,np.average(cimg),255,cv2.THRESH_BINARY_INV)
foreground_area = np.count_nonzero(im_th)
param = area/foreground_area
if(param == 0):
return (foreground_area/(1280*1024))
return param
def focus(self,travel,step_count):
ts_start = time.time()
# FineCrude
Z_travel_for_crude = travel; crude_step_count = step_count;
crude_loc_max_var = 0; crude_max_var = 0
crude_pulse_count = Z_travel_for_crude / crude_step_count;
crude_start_loc = self.currzpos - (Z_travel_for_crude/2);
self.gotoZ(crude_start_loc);
crude_curr_loc = crude_start_loc;
kernel = np.ones((5,5),np.float32)/9
for i in range(int(crude_pulse_count)):
snapshot = self.data
crude_curr_var = np.var(cv2.filter2D(snapshot,-1,kernel))
#print(crude_curr_var,'||',self.currzpos)
if crude_curr_var > crude_max_var:
crude_max_var = crude_curr_var
crude_loc_max_var = crude_curr_loc
crude_curr_loc = crude_curr_loc + crude_step_count
self.gotoZ(crude_curr_loc)
time.sleep(0.075)
self.gotoZ(crude_loc_max_var)
# Fine AF
Z_travel_for_crude = step_count*2; crude_step_count = 3;
crude_loc_max_var = 0;crude_max_var = 0
crude_pulse_count = Z_travel_for_crude / crude_step_count;
crude_start_loc = self.currzpos - (Z_travel_for_crude/2);
self.gotoZ(crude_start_loc);
crude_curr_loc = crude_start_loc;
for i in range(int(crude_pulse_count)):
snapshot = self.data
crude_curr_var = np.var(snapshot)
#print(crude_curr_var,'||',self.currzpos)
if crude_curr_var > crude_max_var:
crude_max_var = crude_curr_var
crude_loc_max_var = crude_curr_loc
crude_curr_loc = crude_curr_loc + crude_step_count
self.gotoZ(crude_curr_loc)
time.sleep(0.025)
self.gotoZ(crude_loc_max_var)
ts_stop = time.time()
print('time taken for autofocusing:'+str(ts_stop-ts_start)+' secs')
#def focalstack(self,travel):
def xMinus(self):
self.ser.write(b'D')
self.currxpos = self.currxpos - self.xFov
self.label_13.setText(self._translate("MainWindow", str(self.currxpos)))
def xPlus(self):
self.ser.write(b'A')
self.currxpos = self.currxpos + self.xFov
self.label_13.setText(self._translate("MainWindow", str(self.currxpos)))
def yMinus(self):
self.ser.write(b'S')
self.currypos = self.currypos - self.yFov
self.label_14.setText(self._translate("MainWindow", str(self.currypos)))
def yPlus(self):
self.ser.write(b'W')
self.currypos = self.currypos + self.yFov
self.label_14.setText(self._translate("MainWindow", str(self.currypos)))
def zDown(self):
self.ser.write(b'G')
self.currzpos = self.currzpos - 1
self.label_15.setText(self._translate("MainWindow", str(self.currzpos)))
def zUp(self):
self.ser.write(b'T')
self.currzpos = self.currzpos + 1
self.label_15.setText(self._translate("MainWindow", str(self.currzpos)))
def gotoX(self, xValue):
xValue = int(xValue)
if self.currxpos != xValue:
xValue_str = '#' + str("%($)07d" % {"$":xValue})
self.ser.write(b'B')
self.ser.write(xValue_str.encode())
time.sleep(abs(self.currxpos-xValue)/self.Xpulserate)
self.currxpos = int(xValue)
self.label_13.setText(self._translate("MainWindow", str(self.currxpos)))
def gotoY(self, yValue):
yValue = int(yValue)
if self.currypos != yValue:
yValue_str = '#' + str("%($)07d" % {"$":yValue})
self.ser.write(b'N')
self.ser.write(yValue_str.encode())
time.sleep(abs(self.currypos-yValue)/self.Ypulserate)
self.currypos = int(yValue)
self.label_14.setText(self._translate("MainWindow", str(self.currypos)))
def gotoZ(self, zValue):
zValue = int(zValue)
if self.currzpos != zValue:
zValue_str = '#' + str("%($)07d" % {"$":zValue})
self.ser.write(b'M')
self.ser.write(zValue_str.encode())
time.sleep(abs(self.currzpos-zValue)/self.Zpulserate)
self.currzpos = int(zValue)
self.label_15.setText(self._translate("MainWindow", str(self.currzpos)))
def bloodsmear(self):
self.gotoX('0')
self.gotoY('0')
self.gotoZ('0')
self.gotoY(self.ymiddle);time.sleep(2);
self.autoFocus()
Zval = []; param_y0 = []; Xpos = [];
xstep = round((self.x1-self.x0)/11);
for xpos in range(self.x0,self.x1,xstep):
self.gotoX(xpos)
self.focus(2000,50)
Zval.append(self.currzpos)
Xpos.append(self.currxpos)
snap = self.data
snapshot = PIL.Image.fromarray(snap,'RGB')
snapshot.save('snap@'+str(xpos)+'.jpg')
param_y0.append(self.parameter())
print(np.asarray(param_y0))
index = np.argmax((param_y0))
xbest = Xpos[index]
self.gotoX(Xpos[index])
self.gotoZ(Zval[index]);time.sleep(2);
param_y1 = [];Xpos = []; Zval = [];
if(xbest<=xstep):
for xpos in range(xbest,xbest+xstep*2,12581):
self.gotoX(xpos)
self.focus(500,50)
Zval.append(self.currzpos)
Xpos.append(self.currxpos)
snap = self.data
snapshot = PIL.Image.fromarray(snap,'RGB')
snapshot.save('snap@'+str(xpos)+'.jpg')
param_y1.append(self.parameter())
elif(xbest>self.x1):
for xpos in range(xbest-xstep*2,xbest,12581):
self.gotoX(xpos)
self.focus(500,50)
Zval.append(self.currzpos)
Xpos.append(self.currxpos)
snap = self.data
snapshot = PIL.Image.fromarray(snap,'RGB')
snapshot.save('snap@'+str(xpos)+'.jpg')
param_y1.append(self.parameter())
else:
for xpos in range(xbest-xstep,xbest+xstep,12581):
self.gotoX(xpos)
self.focus(500,50)
Zval.append(self.currzpos)
Xpos.append(self.currxpos)
snap = self.data
snapshot = PIL.Image.fromarray(snap,'RGB')
snapshot.save('snap@'+str(xpos)+'.jpg')
param_y1.append(self.parameter())
index = np.argmax(np.asarray(param_y1))
param = np.where(np.asarray(param_y1),1,0)
self.gotoY(0)
if(np.sum(param[1:4]) == 3):
x1 = Xpos[1];
x2 = Xpos[3];
self.gotoX(x1);self.focus(500,50);self.ser.write(b'R')
self.gotoX(x2);self.focus(500,50);self.ser.write(b'E')
self.gotoY(self.y1);self.focus(500,50);self.ser.write(b'Y')
xA = x1; xB = x2;
yC = self.y1; yB = 0;
numofX = round((xB-xA)/self.xFov);
numofY = round((yC-yB)/self.yFov);
self.ser.write(b'Z')
while(self.ser.read() != 'S'):
print('.')
rowcount = 0;
filecount = 0;
print('Starting Image Capture...')
while(rowcount <= numofY):
while(filecount <= numofX):
snap = PIL.Image.fromarray(self.data,'RGB')
snapshot.save('Image_'+str(rowcount)+'_'+str(filecount)+'.jpg')
filecount = filecount + 1
filecount = 0
rowcount = rowcount + 1
elif(np.sum(param[0:3] > np.sum(param[2:5]))):
x1 = Xpos[0];
x2 = Xpos[2];
self.gotoX(x1);self.focus(500,50);self.ser.write(b'R')
self.gotoX(x2);self.focus(500,50);self.ser.write(b'E')
self.gotoY(self.y1);self.focus(500,50);self.ser.write(b'Y')
xA = x1; xB = x2;
yC = self.y1; yB = 0;
numofX = round((xB-xA)/self.xFov);
numofY = round((yC-yB)/self.yFov);
self.ser.write(b'Z')
while(self.ser.read() != 'S'):
print('.')
rowcount = 0;
filecount = 0;
print('Starting Image Capture...')
while(rowcount <= numofY):
while(filecount <= numofX):
snap = PIL.Image.fromarray(self.data,'RGB')
snapshot.save('Image_'+str(rowcount)+'_'+str(filecount)+'.jpg')
filecount = filecount + 1
filecount = 0
rowcount = rowcount + 1
elif(np.sum(param[0:3] < np.sum(param[2:5]))):
x1 = Xpos[2];
x2 = Xpos[4];
self.gotoX(x1);self.focus(500,50);self.ser.write(b'R')
self.gotoX(x2);self.focus(500,50);self.ser.write(b'E')
self.gotoY(self.y1);self.focus(500,50);self.ser.write(b'Y')
xA = x1; xB = x2;
yC = self.y1; yB = 0;
numofX = round((xB-xA)/self.xFov);
numofY = round((yC-yB)/self.yFov);
self.ser.write(b'Z')
while(self.ser.read() != 'S'):
print('.')
rowcount = 0;
filecount = 0;
print('Starting Image Capture...')
while(rowcount <= numofY):
while(filecount <= numofX):
snap = PIL.Image.fromarray(self.data,'RGB')
snapshot.save('Image_'+str(rowcount)+'_'+str(filecount)+'.jpg')
filecount = filecount + 1
filecount = 0
rowcount = rowcount + 1
else:
print('No Best region detected!')
self.resetOrigin()
def test(self):
#var = round(np.var(self.data))
#self.label_8.setText(self._translate("MainWindow", str(var)))
self.focus(500,50)
if __name__ == '__main__' :
app = QtWidgets.QApplication(sys.argv)
x = gui()
x.main()
sys.exit(app.exec_())

View File

@@ -1,419 +0,0 @@
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'slide_scanner_test.ui'
#
# Created by: PyQt5 UI code generator 5.6
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_MainWindow(object):
def setupUi(self, MainWindow):
MainWindow.setObjectName("MainWindow")
MainWindow.setWindowModality(QtCore.Qt.WindowModal)
MainWindow.resize(1024, 768)
font = QtGui.QFont()
font.setPointSize(8)
MainWindow.setFont(font)
icon = QtGui.QIcon()
icon.addPixmap(QtGui.QPixmap("F:/IITT_Logo/0.jpg"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
MainWindow.setWindowIcon(icon)
MainWindow.setAutoFillBackground(False)
MainWindow.setStyleSheet("background-color: rgb(90, 90, 90);")
self.centralwidget = QtWidgets.QWidget(MainWindow)
self.centralwidget.setObjectName("centralwidget")
self.logoView = QtWidgets.QLabel(self.centralwidget)
self.logoView.setGeometry(QtCore.QRect(20, 20, 50, 50))
self.logoView.setObjectName("logoView")
self.label = QtWidgets.QLabel(self.centralwidget)
self.label.setGeometry(QtCore.QRect(80, 20, 461, 51))
font = QtGui.QFont()
font.setPointSize(24)
self.label.setFont(font)
self.label.setStyleSheet("color: rgb(255, 255, 255);")
self.label.setObjectName("label")
self.slideImageView = QtWidgets.QLabel(self.centralwidget)
self.slideImageView.setGeometry(QtCore.QRect(20, 180, 640, 512))
self.slideImageView.setBaseSize(QtCore.QSize(640, 512))
self.slideImageView.setStyleSheet("background-color: rgb(85, 255, 127);")
self.slideImageView.setObjectName("slideImageView")
self.label_2 = QtWidgets.QLabel(self.centralwidget)
self.label_2.setGeometry(QtCore.QRect(220, 150, 221, 31))
font = QtGui.QFont()
font.setPointSize(18)
self.label_2.setFont(font)
self.label_2.setStyleSheet("color: rgb(255, 255, 255);")
self.label_2.setObjectName("label_2")
self.pushButton = QtWidgets.QPushButton(self.centralwidget)
self.pushButton.setEnabled(True)
self.pushButton.setGeometry(QtCore.QRect(680, 520, 141, 27))
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.pushButton.sizePolicy().hasHeightForWidth())
self.pushButton.setSizePolicy(sizePolicy)
font = QtGui.QFont()
font.setPointSize(12)
self.pushButton.setFont(font)
self.pushButton.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor))
self.pushButton.setStyleSheet("color: rgb(255, 255, 255);\n"
"background-color: rgb(0, 0, 0);\n"
"border-radius:10px;\n"
"")
self.pushButton.setCheckable(False)
self.pushButton.setAutoDefault(False)
self.pushButton.setObjectName("pushButton")
self.pushButton_2 = QtWidgets.QPushButton(self.centralwidget)
self.pushButton_2.setGeometry(QtCore.QRect(870, 520, 141, 27))
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.pushButton_2.sizePolicy().hasHeightForWidth())
self.pushButton_2.setSizePolicy(sizePolicy)
font = QtGui.QFont()
font.setPointSize(12)
self.pushButton_2.setFont(font)
self.pushButton_2.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor))
self.pushButton_2.setStyleSheet("color: rgb(255, 255, 255);\n"
"background-color: rgb(0, 0, 0);\n"
"border-radius:10px;")
self.pushButton_2.setObjectName("pushButton_2")
self.pushButton_3 = QtWidgets.QPushButton(self.centralwidget)
self.pushButton_3.setGeometry(QtCore.QRect(734, 300, 51, 23))
self.pushButton_3.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor))
self.pushButton_3.setStyleSheet("color: rgb(255, 255, 255);\n"
"background-color: rgb(0, 0, 0);\n"
"border-radius:10px;")
self.pushButton_3.setObjectName("pushButton_3")
self.pushButton_4 = QtWidgets.QPushButton(self.centralwidget)
self.pushButton_4.setGeometry(QtCore.QRect(680, 330, 51, 23))
self.pushButton_4.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor))
self.pushButton_4.setStyleSheet("color: rgb(255, 255, 255);\n"
"background-color: rgb(0, 0, 0);\n"
"border-radius:10px;")
self.pushButton_4.setCheckable(False)
self.pushButton_4.setAutoDefault(True)
self.pushButton_4.setObjectName("pushButton_4")
self.pushButton_5 = QtWidgets.QPushButton(self.centralwidget)
self.pushButton_5.setGeometry(QtCore.QRect(790, 330, 51, 23))
self.pushButton_5.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor))
self.pushButton_5.setStyleSheet("color: rgb(255, 255, 255);\n"
"background-color: rgb(0, 0, 0);\n"
"border-radius:10px;")
self.pushButton_5.setObjectName("pushButton_5")
self.pushButton_6 = QtWidgets.QPushButton(self.centralwidget)
self.pushButton_6.setGeometry(QtCore.QRect(734, 360, 51, 23))
self.pushButton_6.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor))
self.pushButton_6.setStyleSheet("color: rgb(255, 255, 255);\n"
"background-color: rgb(0, 0, 0);\n"
"border-radius:10px;")
self.pushButton_6.setObjectName("pushButton_6")
self.pushButton_7 = QtWidgets.QPushButton(self.centralwidget)
self.pushButton_7.setGeometry(QtCore.QRect(880, 300, 75, 23))
self.pushButton_7.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor))
self.pushButton_7.setAutoFillBackground(False)
self.pushButton_7.setStyleSheet("color: rgb(255, 255, 255);\n"
"background-color: rgb(0, 0, 0);\n"
"border-radius:10px;")
self.pushButton_7.setObjectName("pushButton_7")
self.pushButton_8 = QtWidgets.QPushButton(self.centralwidget)
self.pushButton_8.setGeometry(QtCore.QRect(880, 360, 75, 23))
self.pushButton_8.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor))
self.pushButton_8.setStyleSheet("color: rgb(255, 255, 255);\n"
"background-color: rgb(0, 0, 0);\n"
"border-radius:10px;")
self.pushButton_8.setObjectName("pushButton_8")
self.label_3 = QtWidgets.QLabel(self.centralwidget)
self.label_3.setGeometry(QtCore.QRect(680, 260, 181, 21))
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.label_3.sizePolicy().hasHeightForWidth())
self.label_3.setSizePolicy(sizePolicy)
font = QtGui.QFont()
font.setPointSize(12)
self.label_3.setFont(font)
self.label_3.setStyleSheet("color: rgb(255, 255, 255);")
self.label_3.setObjectName("label_3")
self.lineEdit = QtWidgets.QLineEdit(self.centralwidget)
self.lineEdit.setGeometry(QtCore.QRect(770, 420, 113, 20))
self.lineEdit.setObjectName("lineEdit")
self.label_4 = QtWidgets.QLabel(self.centralwidget)
self.label_4.setGeometry(QtCore.QRect(690, 420, 81, 21))
font = QtGui.QFont()
font.setPointSize(12)
self.label_4.setFont(font)
self.label_4.setStyleSheet("color: rgb(255, 255, 255);")
self.label_4.setObjectName("label_4")
self.label_5 = QtWidgets.QLabel(self.centralwidget)
self.label_5.setGeometry(QtCore.QRect(690, 480, 81, 21))
font = QtGui.QFont()
font.setPointSize(12)
self.label_5.setFont(font)
self.label_5.setStyleSheet("color: rgb(255, 255, 255);")
self.label_5.setObjectName("label_5")
self.lineEdit_2 = QtWidgets.QLineEdit(self.centralwidget)
self.lineEdit_2.setGeometry(QtCore.QRect(770, 480, 113, 20))
self.lineEdit_2.setObjectName("lineEdit_2")
self.label_6 = QtWidgets.QLabel(self.centralwidget)
self.label_6.setGeometry(QtCore.QRect(690, 450, 81, 21))
font = QtGui.QFont()
font.setPointSize(12)
self.label_6.setFont(font)
self.label_6.setStyleSheet("color: rgb(255, 255, 255);")
self.label_6.setObjectName("label_6")
self.lineEdit_3 = QtWidgets.QLineEdit(self.centralwidget)
self.lineEdit_3.setGeometry(QtCore.QRect(770, 450, 113, 20))
self.lineEdit_3.setObjectName("lineEdit_3")
self.pushButton_9 = QtWidgets.QPushButton(self.centralwidget)
self.pushButton_9.setGeometry(QtCore.QRect(890, 420, 75, 23))
font = QtGui.QFont()
font.setPointSize(12)
self.pushButton_9.setFont(font)
self.pushButton_9.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor))
self.pushButton_9.setStyleSheet("color: rgb(255, 255, 255);\n"
"background-color: rgb(0, 0, 0);\n"
"border-radius:10px;")
self.pushButton_9.setObjectName("pushButton_9")
self.pushButton_10 = QtWidgets.QPushButton(self.centralwidget)
self.pushButton_10.setGeometry(QtCore.QRect(890, 450, 75, 23))
font = QtGui.QFont()
font.setPointSize(12)
self.pushButton_10.setFont(font)
self.pushButton_10.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor))
self.pushButton_10.setStyleSheet("color: rgb(255, 255, 255);\n"
"background-color: rgb(0, 0, 0);\n"
"border-radius:10px;")
self.pushButton_10.setObjectName("pushButton_10")
self.pushButton_11 = QtWidgets.QPushButton(self.centralwidget)
self.pushButton_11.setGeometry(QtCore.QRect(890, 480, 75, 23))
font = QtGui.QFont()
font.setPointSize(12)
self.pushButton_11.setFont(font)
self.pushButton_11.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor))
self.pushButton_11.setStyleSheet("color: rgb(255, 255, 255);\n"
"background-color: rgb(0, 0, 0);\n"
"border-radius:10px;")
self.pushButton_11.setObjectName("pushButton_11")
self.pushButton_12 = QtWidgets.QPushButton(self.centralwidget)
self.pushButton_12.setGeometry(QtCore.QRect(940, 220, 75, 23))
font = QtGui.QFont()
font.setPointSize(12)
self.pushButton_12.setFont(font)
self.pushButton_12.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor))
self.pushButton_12.setStyleSheet("color: rgb(255, 255, 255);\n"
"background-color: rgb(0, 0, 0);\n"
"border-radius:10px;")
self.pushButton_12.setObjectName("pushButton_12")
self.label_7 = QtWidgets.QLabel(self.centralwidget)
self.label_7.setGeometry(QtCore.QRect(680, 220, 131, 21))
font = QtGui.QFont()
font.setPointSize(12)
self.label_7.setFont(font)
self.label_7.setStyleSheet("color: rgb(255, 255, 255);")
self.label_7.setAlignment(QtCore.Qt.AlignCenter)
self.label_7.setObjectName("label_7")
self.lineEdit_4 = QtWidgets.QLineEdit(self.centralwidget)
self.lineEdit_4.setGeometry(QtCore.QRect(820, 220, 113, 20))
self.lineEdit_4.setObjectName("lineEdit_4")
self.pushButton_13 = QtWidgets.QPushButton(self.centralwidget)
self.pushButton_13.setEnabled(True)
self.pushButton_13.setGeometry(QtCore.QRect(680, 560, 141, 27))
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.pushButton_13.sizePolicy().hasHeightForWidth())
self.pushButton_13.setSizePolicy(sizePolicy)
font = QtGui.QFont()
font.setPointSize(12)
self.pushButton_13.setFont(font)
self.pushButton_13.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor))
self.pushButton_13.setStyleSheet("color: rgb(255, 255, 255);\n"
"background-color: rgb(0, 0, 0);\n"
"border-radius:10px;\n"
"")
self.pushButton_13.setCheckable(False)
self.pushButton_13.setAutoDefault(False)
self.pushButton_13.setObjectName("pushButton_13")
self.label_8 = QtWidgets.QLabel(self.centralwidget)
self.label_8.setGeometry(QtCore.QRect(680, 180, 131, 21))
font = QtGui.QFont()
font.setPointSize(12)
self.label_8.setFont(font)
self.label_8.setStyleSheet("color: rgb(255, 255, 255);")
self.label_8.setAlignment(QtCore.Qt.AlignCenter)
self.label_8.setObjectName("label_8")
self.lineEdit_5 = QtWidgets.QLineEdit(self.centralwidget)
self.lineEdit_5.setGeometry(QtCore.QRect(820, 180, 113, 20))
self.lineEdit_5.setObjectName("lineEdit_5")
self.pushButton_14 = QtWidgets.QPushButton(self.centralwidget)
self.pushButton_14.setGeometry(QtCore.QRect(940, 180, 75, 23))
font = QtGui.QFont()
font.setPointSize(12)
self.pushButton_14.setFont(font)
self.pushButton_14.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor))
self.pushButton_14.setStyleSheet("color: rgb(255, 255, 255);\n"
"background-color: rgb(0, 0, 0);\n"
"border-radius:10px;")
self.pushButton_14.setObjectName("pushButton_14")
self.label_9 = QtWidgets.QLabel(self.centralwidget)
self.label_9.setGeometry(QtCore.QRect(840, 0, 131, 16))
font = QtGui.QFont()
font.setPointSize(12)
self.label_9.setFont(font)
self.label_9.setStyleSheet("color: rgb(255, 255, 255);")
self.label_9.setObjectName("label_9")
self.label_10 = QtWidgets.QLabel(self.centralwidget)
self.label_10.setGeometry(QtCore.QRect(840, 30, 81, 21))
font = QtGui.QFont()
font.setPointSize(12)
self.label_10.setFont(font)
self.label_10.setStyleSheet("color: rgb(255, 255, 255);")
self.label_10.setObjectName("label_10")
self.label_11 = QtWidgets.QLabel(self.centralwidget)
self.label_11.setGeometry(QtCore.QRect(840, 60, 81, 21))
font = QtGui.QFont()
font.setPointSize(12)
self.label_11.setFont(font)
self.label_11.setStyleSheet("color: rgb(255, 255, 255);")
self.label_11.setObjectName("label_11")
self.label_12 = QtWidgets.QLabel(self.centralwidget)
self.label_12.setGeometry(QtCore.QRect(840, 90, 81, 21))
font = QtGui.QFont()
font.setPointSize(12)
self.label_12.setFont(font)
self.label_12.setStyleSheet("color: rgb(255, 255, 255);")
self.label_12.setObjectName("label_12")
self.label_13 = QtWidgets.QLabel(self.centralwidget)
self.label_13.setGeometry(QtCore.QRect(930, 30, 81, 21))
font = QtGui.QFont()
font.setPointSize(12)
self.label_13.setFont(font)
self.label_13.setStyleSheet("color: rgb(255, 255, 255);")
self.label_13.setObjectName("label_13")
self.label_14 = QtWidgets.QLabel(self.centralwidget)
self.label_14.setGeometry(QtCore.QRect(930, 60, 81, 21))
font = QtGui.QFont()
font.setPointSize(12)
self.label_14.setFont(font)
self.label_14.setStyleSheet("color: rgb(255, 255, 255);")
self.label_14.setObjectName("label_14")
self.label_15 = QtWidgets.QLabel(self.centralwidget)
self.label_15.setGeometry(QtCore.QRect(930, 90, 81, 21))
font = QtGui.QFont()
font.setPointSize(12)
self.label_15.setFont(font)
self.label_15.setStyleSheet("color: rgb(255, 255, 255);")
self.label_15.setObjectName("label_15")
self.pushButton_15 = QtWidgets.QPushButton(self.centralwidget)
self.pushButton_15.setGeometry(QtCore.QRect(630, 30, 51, 23))
self.pushButton_15.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor))
self.pushButton_15.setStyleSheet("color: rgb(255, 255, 255);\n"
"background-color: rgb(0, 0, 0);\n"
"border-radius:10px;")
self.pushButton_15.setObjectName("pushButton_15")
self.pushButton_16 = QtWidgets.QPushButton(self.centralwidget)
self.pushButton_16.setGeometry(QtCore.QRect(700, 30, 51, 23))
self.pushButton_16.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor))
self.pushButton_16.setStyleSheet("color: rgb(255, 255, 255);\n"
"background-color: rgb(0, 0, 0);\n"
"border-radius:10px;")
self.pushButton_16.setObjectName("pushButton_16")
self.label_16 = QtWidgets.QLabel(self.centralwidget)
self.label_16.setGeometry(QtCore.QRect(630, 0, 131, 21))
font = QtGui.QFont()
font.setPointSize(12)
self.label_16.setFont(font)
self.label_16.setStyleSheet("color: rgb(255, 255, 255);")
self.label_16.setAlignment(QtCore.Qt.AlignCenter)
self.label_16.setObjectName("label_16")
self.pushButton_17 = QtWidgets.QPushButton(self.centralwidget)
self.pushButton_17.setEnabled(True)
self.pushButton_17.setGeometry(QtCore.QRect(870, 560, 141, 27))
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.pushButton_17.sizePolicy().hasHeightForWidth())
self.pushButton_17.setSizePolicy(sizePolicy)
font = QtGui.QFont()
font.setPointSize(10)
self.pushButton_17.setFont(font)
self.pushButton_17.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor))
self.pushButton_17.setStyleSheet("color: rgb(255, 255, 255);\n"
"background-color: rgb(0, 0, 0);\n"
"border-radius:10px;\n"
"")
self.pushButton_17.setCheckable(False)
self.pushButton_17.setAutoDefault(False)
self.pushButton_17.setObjectName("pushButton_17")
self.pushButton_18 = QtWidgets.QPushButton(self.centralwidget)
self.pushButton_18.setGeometry(QtCore.QRect(830, 120, 191, 23))
font = QtGui.QFont()
font.setPointSize(12)
self.pushButton_18.setFont(font)
self.pushButton_18.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor))
self.pushButton_18.setStyleSheet("color: rgb(255, 255, 255);\n"
"background-color: rgb(0, 0, 0);\n"
"border-radius:10px;")
self.pushButton_18.setObjectName("pushButton_18")
MainWindow.setCentralWidget(self.centralwidget)
self.menubar = QtWidgets.QMenuBar(MainWindow)
self.menubar.setGeometry(QtCore.QRect(0, 0, 1024, 21))
self.menubar.setObjectName("menubar")
MainWindow.setMenuBar(self.menubar)
self.statusbar = QtWidgets.QStatusBar(MainWindow)
self.statusbar.setObjectName("statusbar")
MainWindow.setStatusBar(self.statusbar)
self.retranslateUi(MainWindow)
QtCore.QMetaObject.connectSlotsByName(MainWindow)
def retranslateUi(self, MainWindow):
_translate = QtCore.QCoreApplication.translate
MainWindow.setWindowTitle(_translate("MainWindow", "Slide Scanner - ShanMukha Innovations Pvt Ltd"))
self.label.setText(_translate("MainWindow", "ShanMukha Innovations Pvt Ltd"))
self.label_2.setText(_translate("MainWindow", "Live Preview of Silde"))
self.pushButton.setText(_translate("MainWindow", "Take a Snapshot"))
self.pushButton_2.setText(_translate("MainWindow", "Auto-Focus"))
self.pushButton_3.setText(_translate("MainWindow", "X+"))
self.pushButton_4.setText(_translate("MainWindow", "Y-"))
self.pushButton_5.setText(_translate("MainWindow", "Y+"))
self.pushButton_6.setText(_translate("MainWindow", "X-"))
self.pushButton_7.setText(_translate("MainWindow", "Z - UP"))
self.pushButton_8.setText(_translate("MainWindow", "Z - DOWN"))
self.label_3.setText(_translate("MainWindow", "Slide Movement Controls"))
self.label_4.setText(_translate("MainWindow", "X position"))
self.label_5.setText(_translate("MainWindow", "Z position"))
self.label_6.setText(_translate("MainWindow", "Y position"))
self.pushButton_9.setText(_translate("MainWindow", "Go to X"))
self.pushButton_10.setText(_translate("MainWindow", "Go to Y"))
self.pushButton_11.setText(_translate("MainWindow", "Go to Z"))
self.pushButton_12.setText(_translate("MainWindow", "Set"))
self.label_7.setText(_translate("MainWindow", "Exposure (in ms)"))
self.pushButton_13.setText(_translate("MainWindow", "WSI Scan"))
self.label_8.setText(_translate("MainWindow", "Slide Name"))
self.pushButton_14.setText(_translate("MainWindow", "Set"))
self.label_9.setText(_translate("MainWindow", "Current Positions"))
self.label_10.setText(_translate("MainWindow", "X position"))
self.label_11.setText(_translate("MainWindow", "Y position"))
self.label_12.setText(_translate("MainWindow", "Z position"))
self.label_13.setText(_translate("MainWindow", "0"))
self.label_14.setText(_translate("MainWindow", "0"))
self.label_15.setText(_translate("MainWindow", "0"))
self.pushButton_15.setText(_translate("MainWindow", "40X"))
self.pushButton_16.setText(_translate("MainWindow", "20X"))
self.label_16.setText(_translate("MainWindow", "Magnification"))
self.pushButton_17.setText(_translate("MainWindow", "Best Region Scanning"))
self.pushButton_18.setText(_translate("MainWindow", "Set as Origin"))
if __name__ == "__main__":
import sys
app = QtWidgets.QApplication(sys.argv)
MainWindow = QtWidgets.QMainWindow()
ui = Ui_MainWindow()
ui.setupUi(MainWindow)
MainWindow.show()
sys.exit(app.exec_())

Binary file not shown.

View File

@@ -1,111 +0,0 @@
import QtQuick 2.2
import QtQuick.Window 2.2
import QtGraphicalEffects 1.0
Window {
id: main
visible: true
width: 1280
height: 720
color: "#000000"
title: qsTr("Main")
Image {
id: image
x: 30
anchors.right: parent.right
anchors.rightMargin: 558
anchors.left: parent.left
anchors.leftMargin: 30
anchors.bottom: parent.bottom
anchors.bottomMargin: 30
anchors.top: parent.top
anchors.topMargin: 170
clip: false
source: "qrc:/qtquickplugin/images/template_image.png"
}
Image {
id: image1
x: 30
y: 30
width: 50
height: 50
fillMode: Image.Stretch
source: "0.jpg"
}
Text {
id: text1
x: 86
y: 30
width: 442
height: 50
color: "#ffffff"
text: qsTr("ShanMukha Innovations Pvt Ltd")
verticalAlignment: Text.AlignVCenter
lineHeight: 5
fontSizeMode: Text.Fit
horizontalAlignment: Text.AlignHCenter
font.pixelSize: 31
}
Text {
id: text2
x: 260
y: 135
color: "#ffffff"
text: qsTr("Live View of the Slide")
styleColor: "#d20909"
fontSizeMode: Text.Fit
font.pixelSize: 24
}
Row {
id: row
x: 758
y: 170
width: 512
height: 256
spacing: 2
anchors.right: parent.right
anchors.rightMargin: 30
Rectangle {
id: rectangle
width: 240
height: 64
color: "#ffffff"
radius: 30
border.color: "#040404"
Text {
id: text3
text: qsTr("Take a Snapshot")
anchors.fill: parent
verticalAlignment: Text.AlignVCenter
horizontalAlignment: Text.AlignHCenter
font.pixelSize: 24
}
}
Rectangle {
id: rectangle1
width: 240
height: 64
color: "#ffffff"
radius: 30
anchors.right: parent.right
anchors.rightMargin: 0
Text {
id: text4
text: qsTr("Auto Focus")
anchors.fill: parent
verticalAlignment: Text.AlignVCenter
horizontalAlignment: Text.AlignHCenter
font.pixelSize: 24
}
}
}
}

View File

@@ -1,20 +0,0 @@
/* File generated by Qt Creator */
import QmlProject 1.1
Project {
mainFile: "slide_scanner_test.qml"
/* Include .qml, .js, and image files from current directory and subdirectories */
QmlFiles {
directory: "."
}
JavaScriptFiles {
directory: "."
}
ImageFiles {
directory: "."
}
/* List of plugin directories passed to QML runtime */
// importPaths: [ "../exampleplugin" ]
}

View File

@@ -1,986 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>MainWindow</class>
<widget class="QMainWindow" name="MainWindow">
<property name="windowModality">
<enum>Qt::WindowModal</enum>
</property>
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>1024</width>
<height>768</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>8</pointsize>
</font>
</property>
<property name="windowTitle">
<string>Slide Scanner - ShanMukha Innovations Pvt Ltd</string>
</property>
<property name="windowIcon">
<iconset>
<normaloff>F:/IITT_Logo/0.jpg</normaloff>F:/IITT_Logo/0.jpg</iconset>
</property>
<property name="autoFillBackground">
<bool>false</bool>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgb(90, 90, 90);</string>
</property>
<widget class="QWidget" name="centralwidget">
<widget class="QGraphicsView" name="logoView">
<property name="geometry">
<rect>
<x>20</x>
<y>20</y>
<width>50</width>
<height>50</height>
</rect>
</property>
<property name="autoFillBackground">
<bool>false</bool>
</property>
<property name="foregroundBrush">
<brush brushstyle="NoBrush">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</property>
<property name="viewportUpdateMode">
<enum>QGraphicsView::SmartViewportUpdate</enum>
</property>
</widget>
<widget class="QLabel" name="label">
<property name="geometry">
<rect>
<x>80</x>
<y>20</y>
<width>461</width>
<height>51</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>24</pointsize>
</font>
</property>
<property name="styleSheet">
<string notr="true">color: rgb(255, 255, 255);</string>
</property>
<property name="text">
<string>ShanMukha Innovations Pvt Ltd</string>
</property>
</widget>
<widget class="QGraphicsView" name="slideImageView">
<property name="geometry">
<rect>
<x>20</x>
<y>180</y>
<width>640</width>
<height>512</height>
</rect>
</property>
<property name="baseSize">
<size>
<width>640</width>
<height>512</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgb(85, 255, 127);</string>
</property>
</widget>
<widget class="QLabel" name="label_2">
<property name="geometry">
<rect>
<x>220</x>
<y>150</y>
<width>221</width>
<height>31</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>18</pointsize>
</font>
</property>
<property name="styleSheet">
<string notr="true">color: rgb(255, 255, 255);</string>
</property>
<property name="text">
<string>Live Preview of Silde</string>
</property>
</widget>
<widget class="QPushButton" name="pushButton">
<property name="enabled">
<bool>true</bool>
</property>
<property name="geometry">
<rect>
<x>680</x>
<y>520</y>
<width>141</width>
<height>27</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<pointsize>12</pointsize>
</font>
</property>
<property name="cursor">
<cursorShape>PointingHandCursor</cursorShape>
</property>
<property name="styleSheet">
<string notr="true">color: rgb(255, 255, 255);
background-color: rgb(0, 0, 0);
border-radius:10px;
</string>
</property>
<property name="text">
<string>Take a Snapshot</string>
</property>
<property name="checkable">
<bool>false</bool>
</property>
<property name="autoDefault">
<bool>false</bool>
</property>
</widget>
<widget class="QPushButton" name="pushButton_2">
<property name="geometry">
<rect>
<x>870</x>
<y>520</y>
<width>141</width>
<height>27</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<pointsize>12</pointsize>
</font>
</property>
<property name="cursor">
<cursorShape>PointingHandCursor</cursorShape>
</property>
<property name="styleSheet">
<string notr="true">color: rgb(255, 255, 255);
background-color: rgb(0, 0, 0);
border-radius:10px;</string>
</property>
<property name="text">
<string>Auto-Focus</string>
</property>
</widget>
<widget class="QPushButton" name="pushButton_3">
<property name="geometry">
<rect>
<x>734</x>
<y>300</y>
<width>51</width>
<height>23</height>
</rect>
</property>
<property name="cursor">
<cursorShape>PointingHandCursor</cursorShape>
</property>
<property name="styleSheet">
<string notr="true">color: rgb(255, 255, 255);
background-color: rgb(0, 0, 0);
border-radius:10px;</string>
</property>
<property name="text">
<string>X+</string>
</property>
</widget>
<widget class="QPushButton" name="pushButton_4">
<property name="geometry">
<rect>
<x>680</x>
<y>330</y>
<width>51</width>
<height>23</height>
</rect>
</property>
<property name="cursor">
<cursorShape>PointingHandCursor</cursorShape>
</property>
<property name="styleSheet">
<string notr="true">color: rgb(255, 255, 255);
background-color: rgb(0, 0, 0);
border-radius:10px;</string>
</property>
<property name="text">
<string>Y-</string>
</property>
<property name="checkable">
<bool>false</bool>
</property>
<property name="autoDefault">
<bool>true</bool>
</property>
</widget>
<widget class="QPushButton" name="pushButton_5">
<property name="geometry">
<rect>
<x>790</x>
<y>330</y>
<width>51</width>
<height>23</height>
</rect>
</property>
<property name="cursor">
<cursorShape>PointingHandCursor</cursorShape>
</property>
<property name="styleSheet">
<string notr="true">color: rgb(255, 255, 255);
background-color: rgb(0, 0, 0);
border-radius:10px;</string>
</property>
<property name="text">
<string>Y+</string>
</property>
</widget>
<widget class="QPushButton" name="pushButton_6">
<property name="geometry">
<rect>
<x>734</x>
<y>360</y>
<width>51</width>
<height>23</height>
</rect>
</property>
<property name="cursor">
<cursorShape>PointingHandCursor</cursorShape>
</property>
<property name="styleSheet">
<string notr="true">color: rgb(255, 255, 255);
background-color: rgb(0, 0, 0);
border-radius:10px;</string>
</property>
<property name="text">
<string>X-</string>
</property>
</widget>
<widget class="QPushButton" name="pushButton_7">
<property name="geometry">
<rect>
<x>880</x>
<y>300</y>
<width>75</width>
<height>23</height>
</rect>
</property>
<property name="cursor">
<cursorShape>PointingHandCursor</cursorShape>
</property>
<property name="autoFillBackground">
<bool>false</bool>
</property>
<property name="styleSheet">
<string notr="true">color: rgb(255, 255, 255);
background-color: rgb(0, 0, 0);
border-radius:10px;</string>
</property>
<property name="text">
<string>Z - UP</string>
</property>
</widget>
<widget class="QPushButton" name="pushButton_8">
<property name="geometry">
<rect>
<x>880</x>
<y>360</y>
<width>75</width>
<height>23</height>
</rect>
</property>
<property name="cursor">
<cursorShape>PointingHandCursor</cursorShape>
</property>
<property name="styleSheet">
<string notr="true">color: rgb(255, 255, 255);
background-color: rgb(0, 0, 0);
border-radius:10px;</string>
</property>
<property name="text">
<string>Z - DOWN</string>
</property>
</widget>
<widget class="QLabel" name="label_3">
<property name="geometry">
<rect>
<x>680</x>
<y>260</y>
<width>181</width>
<height>21</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<pointsize>12</pointsize>
</font>
</property>
<property name="styleSheet">
<string notr="true">color: rgb(255, 255, 255);</string>
</property>
<property name="text">
<string>Slide Movement Controls</string>
</property>
</widget>
<widget class="QLineEdit" name="lineEdit">
<property name="geometry">
<rect>
<x>770</x>
<y>420</y>
<width>113</width>
<height>20</height>
</rect>
</property>
</widget>
<widget class="QLabel" name="label_4">
<property name="geometry">
<rect>
<x>690</x>
<y>420</y>
<width>81</width>
<height>21</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>12</pointsize>
</font>
</property>
<property name="styleSheet">
<string notr="true">color: rgb(255, 255, 255);</string>
</property>
<property name="text">
<string>X position</string>
</property>
</widget>
<widget class="QLabel" name="label_5">
<property name="geometry">
<rect>
<x>690</x>
<y>480</y>
<width>81</width>
<height>21</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>12</pointsize>
</font>
</property>
<property name="styleSheet">
<string notr="true">color: rgb(255, 255, 255);</string>
</property>
<property name="text">
<string>Z position</string>
</property>
</widget>
<widget class="QLineEdit" name="lineEdit_2">
<property name="geometry">
<rect>
<x>770</x>
<y>480</y>
<width>113</width>
<height>20</height>
</rect>
</property>
</widget>
<widget class="QLabel" name="label_6">
<property name="geometry">
<rect>
<x>690</x>
<y>450</y>
<width>81</width>
<height>21</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>12</pointsize>
</font>
</property>
<property name="styleSheet">
<string notr="true">color: rgb(255, 255, 255);</string>
</property>
<property name="text">
<string>Y position</string>
</property>
</widget>
<widget class="QLineEdit" name="lineEdit_3">
<property name="geometry">
<rect>
<x>770</x>
<y>450</y>
<width>113</width>
<height>20</height>
</rect>
</property>
</widget>
<widget class="QPushButton" name="pushButton_9">
<property name="geometry">
<rect>
<x>890</x>
<y>420</y>
<width>75</width>
<height>23</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>12</pointsize>
</font>
</property>
<property name="cursor">
<cursorShape>PointingHandCursor</cursorShape>
</property>
<property name="styleSheet">
<string notr="true">color: rgb(255, 255, 255);
background-color: rgb(0, 0, 0);
border-radius:10px;</string>
</property>
<property name="text">
<string>Go to X</string>
</property>
</widget>
<widget class="QPushButton" name="pushButton_10">
<property name="geometry">
<rect>
<x>890</x>
<y>450</y>
<width>75</width>
<height>23</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>12</pointsize>
</font>
</property>
<property name="cursor">
<cursorShape>PointingHandCursor</cursorShape>
</property>
<property name="styleSheet">
<string notr="true">color: rgb(255, 255, 255);
background-color: rgb(0, 0, 0);
border-radius:10px;</string>
</property>
<property name="text">
<string>Go to Y</string>
</property>
</widget>
<widget class="QPushButton" name="pushButton_11">
<property name="geometry">
<rect>
<x>890</x>
<y>480</y>
<width>75</width>
<height>23</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>12</pointsize>
</font>
</property>
<property name="cursor">
<cursorShape>PointingHandCursor</cursorShape>
</property>
<property name="styleSheet">
<string notr="true">color: rgb(255, 255, 255);
background-color: rgb(0, 0, 0);
border-radius:10px;</string>
</property>
<property name="text">
<string>Go to Z</string>
</property>
</widget>
<widget class="QPushButton" name="pushButton_12">
<property name="geometry">
<rect>
<x>940</x>
<y>220</y>
<width>75</width>
<height>23</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>12</pointsize>
</font>
</property>
<property name="cursor">
<cursorShape>PointingHandCursor</cursorShape>
</property>
<property name="styleSheet">
<string notr="true">color: rgb(255, 255, 255);
background-color: rgb(0, 0, 0);
border-radius:10px;</string>
</property>
<property name="text">
<string>Set</string>
</property>
</widget>
<widget class="QLabel" name="label_7">
<property name="geometry">
<rect>
<x>680</x>
<y>220</y>
<width>131</width>
<height>21</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>12</pointsize>
</font>
</property>
<property name="styleSheet">
<string notr="true">color: rgb(255, 255, 255);</string>
</property>
<property name="text">
<string>Exposure (in ms)</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
<widget class="QLineEdit" name="lineEdit_4">
<property name="geometry">
<rect>
<x>820</x>
<y>220</y>
<width>113</width>
<height>20</height>
</rect>
</property>
</widget>
<widget class="QPushButton" name="pushButton_13">
<property name="enabled">
<bool>true</bool>
</property>
<property name="geometry">
<rect>
<x>680</x>
<y>560</y>
<width>141</width>
<height>27</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<pointsize>12</pointsize>
</font>
</property>
<property name="cursor">
<cursorShape>PointingHandCursor</cursorShape>
</property>
<property name="styleSheet">
<string notr="true">color: rgb(255, 255, 255);
background-color: rgb(0, 0, 0);
border-radius:10px;
</string>
</property>
<property name="text">
<string>WSI Scan</string>
</property>
<property name="checkable">
<bool>false</bool>
</property>
<property name="autoDefault">
<bool>false</bool>
</property>
</widget>
<widget class="QLabel" name="label_8">
<property name="geometry">
<rect>
<x>680</x>
<y>180</y>
<width>131</width>
<height>21</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>12</pointsize>
</font>
</property>
<property name="styleSheet">
<string notr="true">color: rgb(255, 255, 255);</string>
</property>
<property name="text">
<string>Slide Name</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
<widget class="QLineEdit" name="lineEdit_5">
<property name="geometry">
<rect>
<x>820</x>
<y>180</y>
<width>113</width>
<height>20</height>
</rect>
</property>
</widget>
<widget class="QPushButton" name="pushButton_14">
<property name="geometry">
<rect>
<x>940</x>
<y>180</y>
<width>75</width>
<height>23</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>12</pointsize>
</font>
</property>
<property name="cursor">
<cursorShape>PointingHandCursor</cursorShape>
</property>
<property name="styleSheet">
<string notr="true">color: rgb(255, 255, 255);
background-color: rgb(0, 0, 0);
border-radius:10px;</string>
</property>
<property name="text">
<string>Set</string>
</property>
</widget>
<widget class="QLabel" name="label_9">
<property name="geometry">
<rect>
<x>840</x>
<y>0</y>
<width>131</width>
<height>16</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>12</pointsize>
</font>
</property>
<property name="styleSheet">
<string notr="true">color: rgb(255, 255, 255);</string>
</property>
<property name="text">
<string>Current Positions</string>
</property>
</widget>
<widget class="QLabel" name="label_10">
<property name="geometry">
<rect>
<x>840</x>
<y>30</y>
<width>81</width>
<height>21</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>12</pointsize>
</font>
</property>
<property name="styleSheet">
<string notr="true">color: rgb(255, 255, 255);</string>
</property>
<property name="text">
<string>X position</string>
</property>
</widget>
<widget class="QLabel" name="label_11">
<property name="geometry">
<rect>
<x>840</x>
<y>60</y>
<width>81</width>
<height>21</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>12</pointsize>
</font>
</property>
<property name="styleSheet">
<string notr="true">color: rgb(255, 255, 255);</string>
</property>
<property name="text">
<string>Y position</string>
</property>
</widget>
<widget class="QLabel" name="label_12">
<property name="geometry">
<rect>
<x>840</x>
<y>90</y>
<width>81</width>
<height>21</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>12</pointsize>
</font>
</property>
<property name="styleSheet">
<string notr="true">color: rgb(255, 255, 255);</string>
</property>
<property name="text">
<string>Z position</string>
</property>
</widget>
<widget class="QLabel" name="label_13">
<property name="geometry">
<rect>
<x>930</x>
<y>30</y>
<width>81</width>
<height>21</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>12</pointsize>
</font>
</property>
<property name="styleSheet">
<string notr="true">color: rgb(255, 255, 255);</string>
</property>
<property name="text">
<string>0</string>
</property>
</widget>
<widget class="QLabel" name="label_14">
<property name="geometry">
<rect>
<x>930</x>
<y>60</y>
<width>81</width>
<height>21</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>12</pointsize>
</font>
</property>
<property name="styleSheet">
<string notr="true">color: rgb(255, 255, 255);</string>
</property>
<property name="text">
<string>0</string>
</property>
</widget>
<widget class="QLabel" name="label_15">
<property name="geometry">
<rect>
<x>930</x>
<y>90</y>
<width>81</width>
<height>21</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>12</pointsize>
</font>
</property>
<property name="styleSheet">
<string notr="true">color: rgb(255, 255, 255);</string>
</property>
<property name="text">
<string>0</string>
</property>
</widget>
<widget class="QPushButton" name="pushButton_15">
<property name="geometry">
<rect>
<x>630</x>
<y>30</y>
<width>51</width>
<height>23</height>
</rect>
</property>
<property name="cursor">
<cursorShape>PointingHandCursor</cursorShape>
</property>
<property name="styleSheet">
<string notr="true">color: rgb(255, 255, 255);
background-color: rgb(0, 0, 0);
border-radius:10px;</string>
</property>
<property name="text">
<string>40X</string>
</property>
</widget>
<widget class="QPushButton" name="pushButton_16">
<property name="geometry">
<rect>
<x>700</x>
<y>30</y>
<width>51</width>
<height>23</height>
</rect>
</property>
<property name="cursor">
<cursorShape>PointingHandCursor</cursorShape>
</property>
<property name="styleSheet">
<string notr="true">color: rgb(255, 255, 255);
background-color: rgb(0, 0, 0);
border-radius:10px;</string>
</property>
<property name="text">
<string>20X</string>
</property>
</widget>
<widget class="QLabel" name="label_16">
<property name="geometry">
<rect>
<x>630</x>
<y>0</y>
<width>131</width>
<height>21</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>12</pointsize>
</font>
</property>
<property name="styleSheet">
<string notr="true">color: rgb(255, 255, 255);</string>
</property>
<property name="text">
<string>Magnification</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
<widget class="QPushButton" name="pushButton_17">
<property name="enabled">
<bool>true</bool>
</property>
<property name="geometry">
<rect>
<x>870</x>
<y>560</y>
<width>141</width>
<height>27</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<pointsize>10</pointsize>
</font>
</property>
<property name="cursor">
<cursorShape>PointingHandCursor</cursorShape>
</property>
<property name="styleSheet">
<string notr="true">color: rgb(255, 255, 255);
background-color: rgb(0, 0, 0);
border-radius:10px;
</string>
</property>
<property name="text">
<string>Best Region Scanning</string>
</property>
<property name="checkable">
<bool>false</bool>
</property>
<property name="autoDefault">
<bool>false</bool>
</property>
</widget>
<widget class="QPushButton" name="pushButton_18">
<property name="geometry">
<rect>
<x>830</x>
<y>120</y>
<width>191</width>
<height>23</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>12</pointsize>
</font>
</property>
<property name="cursor">
<cursorShape>PointingHandCursor</cursorShape>
</property>
<property name="styleSheet">
<string notr="true">color: rgb(255, 255, 255);
background-color: rgb(0, 0, 0);
border-radius:10px;</string>
</property>
<property name="text">
<string>Set as Origin</string>
</property>
</widget>
</widget>
<widget class="QMenuBar" name="menubar">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>1024</width>
<height>21</height>
</rect>
</property>
</widget>
<widget class="QStatusBar" name="statusbar"/>
</widget>
<resources/>
<connections/>
</ui>

View File

@@ -1,27 +0,0 @@
from PyQt5.QtGui import QImage, qRgb
import numpy as np
class NotImplementedException:
pass
gray_color_table = [qRgb(i, i, i) for i in range(256)]
def toQImage(im, copy=False):
if im is None:
return QImage()
if im.dtype == np.uint8:
if len(im.shape) == 2:
qim = QImage(im.data, im.shape[1], im.shape[0], im.strides[0], QImage.Format_Indexed8)
qim.setColorTable(gray_color_table)
return qim.copy() if copy else qim
elif len(im.shape) == 3:
if im.shape[2] == 3:
qim = QImage(im.data, im.shape[1], im.shape[0], im.strides[0], QImage.Format_RGB888);
return qim.copy() if copy else qim
elif im.shape[2] == 4:
qim = QImage(im.data, im.shape[1], im.shape[0], im.strides[0], QImage.Format_ARGB32);
return qim.copy() if copy else qim
#raise NotImplementedException

Binary file not shown.