first commit
This commit is contained in:
479
src/firmware/IAD_v2_4_AIO.ino
Normal file
479
src/firmware/IAD_v2_4_AIO.ino
Normal file
@@ -0,0 +1,479 @@
|
||||
#include <EEPROM.h>
|
||||
|
||||
#define Xdir 13
|
||||
#define Ydir 12
|
||||
#define Zdir 11
|
||||
|
||||
#define Ybump 32
|
||||
#define Xbump 36
|
||||
#define AFbump 28
|
||||
#define bumpGnd 42
|
||||
|
||||
/***************************************************************************************
|
||||
This is what matters when you change the Step size : change the FoV accordingly
|
||||
Rest of everything is calculated in terms of steps only
|
||||
So the GUI needs to take care of step size to um conversion
|
||||
***************************************************************************************/
|
||||
// FoV size. This is in steps. Calcuated as FoV (steps) = FoV (um) / stepSize
|
||||
// The step size as on 27 June is 198 nm / step
|
||||
long xFoV = 1843, yFoV = 2323;
|
||||
|
||||
long XMaxStep=260000L, YMaxStep=130000L, ZMaxStep=30000L;
|
||||
long limitTOZfocus = 31000L,limitToXZero=-250000,limitToYZero=4000;
|
||||
|
||||
// steps to go before stopping
|
||||
int trayOutNoiseMargin = 50;
|
||||
|
||||
long XcurrStep=0L, YcurrStep=0L, ZcurrStep=0L;
|
||||
long Ax=0L,Ay=0L,Az=0L,Bx=0L,By=0L,Bz=0L,Cx=0L,Cy=0L,Cz=0L;
|
||||
long nextZstep = 0, XdeltaZperFoV=0, YdeltaZperFoV=0;
|
||||
int needtocheckXmovement=0,needtocheckYmovement=0,needtocheckZmovement=0;
|
||||
|
||||
void setup() {
|
||||
Serial.begin(57600);
|
||||
// pulse : X,Y,Z :: TX 1,2,3
|
||||
Serial1.begin(38400); Serial2.begin(38400); Serial3.begin(38400);
|
||||
pinMode(Zdir,OUTPUT); pinMode(Ydir,OUTPUT); pinMode(Xdir,OUTPUT);
|
||||
pinMode(Xbump,INPUT); pinMode(Ybump,INPUT); pinMode(AFbump,INPUT); // The bump switchs
|
||||
pinMode(bumpGnd,OUTPUT); digitalWrite(bumpGnd,LOW); // this sets the gnd for the bump switches
|
||||
|
||||
}
|
||||
|
||||
void loop() {
|
||||
|
||||
int choice = Serial.read();
|
||||
|
||||
switch(choice){
|
||||
case('T') : digitalWrite(Zdir,LOW); delayMicroseconds(10); doZSteps(1); ZcurrStep=ZcurrStep-1; // T == Z up by 5 counts
|
||||
break;
|
||||
case('G') : digitalWrite(Zdir,HIGH); delayMicroseconds(10); doZSteps(1); ZcurrStep=ZcurrStep+1; // G == Z down
|
||||
break;
|
||||
case('A') : needtocheckXmovement=1; digitalWrite(Xdir,LOW); delayMicroseconds(10); doXSteps(xFoV/5); XcurrStep=XcurrStep+xFoV; // A == X up by 1 FoV
|
||||
break;
|
||||
case('D') : needtocheckXmovement=0; digitalWrite(Xdir,HIGH); delayMicroseconds(10); doXSteps(xFoV/5); XcurrStep=XcurrStep-xFoV; // D == X down by 1 FoV
|
||||
break;
|
||||
case('W') : needtocheckYmovement=0; digitalWrite(Ydir,LOW); delayMicroseconds(10); doYSteps(yFoV/5); YcurrStep=YcurrStep+yFoV; // W == Y up
|
||||
break;
|
||||
case('S') : needtocheckYmovement=1; digitalWrite(Ydir,HIGH); delayMicroseconds(10); doYSteps(yFoV/5); YcurrStep=YcurrStep-yFoV; // S == Y down
|
||||
break;
|
||||
case('J') : XcurrStep = 0; // J == X reset
|
||||
break;
|
||||
case('K') : YcurrStep = 0; // K == Y reset
|
||||
break;
|
||||
case('L') : ZcurrStep = 0; // L == Z reset
|
||||
break;
|
||||
case('B') : gotoXSetStep(getStep());
|
||||
break;
|
||||
case('N') : gotoYSetStep(getStep());
|
||||
break;
|
||||
case('M') : gotoZSetStep(getStep());
|
||||
break;
|
||||
case('I') : Serial1.flush(); Serial.print('X'); Serial.print("#"); Serial.print(XcurrStep); Serial.print("#");
|
||||
break;
|
||||
case('O') : Serial2.flush(); Serial.print('Y'); Serial.print("#"); Serial.print(YcurrStep); Serial.print("#");
|
||||
break;
|
||||
case('P') : Serial3.flush(); Serial.print('Z');Serial.print("#"); Serial.print(ZcurrStep); Serial.print("#");
|
||||
break;
|
||||
|
||||
// Set A,B,C - Codes are E,R,Y respectively
|
||||
case('E') : Ax=XcurrStep; Ay=YcurrStep; Az=ZcurrStep;
|
||||
break;
|
||||
case('R') : Bx=XcurrStep; By=YcurrStep; Bz=ZcurrStep;
|
||||
break;
|
||||
case('Y') : Cx=XcurrStep; Cy=YcurrStep; Cz=ZcurrStep;
|
||||
break;
|
||||
case('U') :
|
||||
break;
|
||||
case('Z') : do4ptArea();
|
||||
break;
|
||||
case('X') :
|
||||
break;
|
||||
case('C') : // linear scan
|
||||
doAtoB();
|
||||
break;
|
||||
case('V') : debug();
|
||||
break;
|
||||
case('Q') : gohome();
|
||||
break;
|
||||
case('F') : doFullArea();
|
||||
break;
|
||||
|
||||
case('H') : gotoZSetStep(0);
|
||||
// Signal that ready to AF now
|
||||
Serial.print("H#");
|
||||
break;
|
||||
case('1') : tray_out();
|
||||
break;
|
||||
case('2') : tray_in();
|
||||
break;
|
||||
case('0') : EEPROM.write(0,0);
|
||||
break;
|
||||
case('7') : Serial.print('7'); Serial.print("#");
|
||||
break;
|
||||
case('3') : digitalWrite(Zdir,HIGH); delayMicroseconds(10); Serial3.print("X"); ZcurrStep=ZcurrStep+1;
|
||||
break;
|
||||
case('5') : digitalWrite(Zdir,LOW); delayMicroseconds(10); Serial3.print("X"); ZcurrStep=ZcurrStep-1;
|
||||
break;
|
||||
case('.'): // this is the travel sync option. First go 20 k steps and note time
|
||||
Serial.print('0'); Serial.print("#"); gotoXSetStep(XcurrStep+20000); Serial.print('1'); Serial.print("#");
|
||||
Serial.print('2'); Serial.print("#"); gotoXSetStep(XcurrStep-20000); Serial.print('3'); Serial.print("#");
|
||||
Serial.print('4'); Serial.print("#"); gotoYSetStep(YcurrStep+20000); Serial.print('5'); Serial.print("#");
|
||||
Serial.print('6'); Serial.print("#"); gotoYSetStep(YcurrStep-20000); Serial.print('7'); Serial.print("#");
|
||||
default : break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void doXSteps(long num) { while (num > 0 ) {
|
||||
if( (needtocheckXmovement==1) && (digitalRead(Xbump) == LOW)) { XcurrStep=0; return;} // DO NOT MOVE IF ALREADY AT LIMIT
|
||||
Serial1.print("U"); num--; } }
|
||||
|
||||
void doYSteps(long num) { while (num > 0 ) {
|
||||
if( (needtocheckYmovement==1) && (digitalRead(Ybump) == LOW)) { YcurrStep=0; return;} // DO NOT MOVE IF ALREADY AT LIMIT
|
||||
Serial2.print("U"); num--; } }
|
||||
|
||||
void doZSteps(long num) { while (num > 0 ) {
|
||||
if( (needtocheckZmovement==1) && (digitalRead(AFbump) == LOW)) { ZcurrStep=0; return;} // DO NOT MOVE IF ALREADY AT LIMIT
|
||||
Serial3.print("@"); num--; } }
|
||||
|
||||
long getStep()
|
||||
{
|
||||
long index = 0, inpStep[7]={0,0,0,0,0,0,0}, invalidInput = 0;
|
||||
long setStep = 0L;
|
||||
|
||||
|
||||
for(index=0; index<8; index++ )
|
||||
{
|
||||
while ( Serial.available() < 1 );
|
||||
inpStep[index] = Serial.read() - 48;
|
||||
}
|
||||
|
||||
// DISCARD first byte : MATLAB sends the terminator character there. We need it since if we turn it off, MATALB won't read the Tx from this arduino
|
||||
// ALSO igmore the second byte : that's the sign symbol
|
||||
setStep = (inpStep[2]*100000) + (inpStep[3]*10000) + (inpStep[4]*1000) + (inpStep[5]*100) + (inpStep[6]*10) + (inpStep[7]*1) + 0L ;
|
||||
|
||||
// check what sign was sent. If it was anything other than a '-' then dont worry
|
||||
if (inpStep[1] + 48 == '-' ) { setStep = setStep*(-1); }
|
||||
|
||||
return setStep;
|
||||
}
|
||||
|
||||
void gotoXSetStep(long XsetStep)
|
||||
{
|
||||
if(XsetStep > XMaxStep) {XsetStep=XMaxStep;}
|
||||
long stepstodo = abs(XsetStep - XcurrStep) / 5;
|
||||
|
||||
if (XsetStep > XcurrStep)
|
||||
{ needtocheckXmovement=1 ;
|
||||
digitalWrite(Xdir,LOW); delayMicroseconds(10); XcurrStep=XsetStep; doXSteps( stepstodo ); }
|
||||
|
||||
if (XsetStep < XcurrStep)
|
||||
{ needtocheckXmovement=0 ;
|
||||
digitalWrite(Xdir,HIGH); delayMicroseconds(10); XcurrStep=XsetStep; doXSteps( stepstodo ); }
|
||||
|
||||
}
|
||||
|
||||
void gotoYSetStep(long YsetStep)
|
||||
{
|
||||
if(YsetStep > YMaxStep) {YsetStep = YMaxStep;}
|
||||
long stepstodo = abs(YsetStep - YcurrStep) / 5;
|
||||
|
||||
if (YsetStep > YcurrStep)
|
||||
{ needtocheckYmovement=0 ;
|
||||
digitalWrite(Ydir,LOW); delayMicroseconds(10); YcurrStep=YsetStep; doYSteps( stepstodo ); }
|
||||
|
||||
if (YsetStep < YcurrStep)
|
||||
{
|
||||
needtocheckYmovement=1 ;
|
||||
digitalWrite(Ydir,HIGH); delayMicroseconds(10); YcurrStep=YsetStep; doYSteps( stepstodo ); }
|
||||
|
||||
}
|
||||
|
||||
void gotoZSetStep(long ZsetStep)
|
||||
{
|
||||
//if(ZsetStep > ZMaxStep) {ZsetStep = ZMaxStep;}
|
||||
long stepstodo = abs(ZsetStep - ZcurrStep) / 5;
|
||||
|
||||
if (ZsetStep > ZcurrStep)
|
||||
{ needtocheckZmovement=0 ;
|
||||
digitalWrite(Zdir,HIGH); delayMicroseconds(10); ZcurrStep=ZsetStep; doZSteps( stepstodo ); }
|
||||
|
||||
if (ZsetStep < ZcurrStep)
|
||||
{
|
||||
needtocheckZmovement=1 ;
|
||||
digitalWrite(Zdir,LOW); delayMicroseconds(10); ZcurrStep=ZsetStep; doZSteps( stepstodo ); }
|
||||
|
||||
}
|
||||
|
||||
void tray_out ()
|
||||
{/*
|
||||
// if already tray out then skip this
|
||||
//if (EEPROM.read(0) == 1) { return; }
|
||||
// var to even out electric noise
|
||||
int Xnoise=0, Ynoise=0, Znoise=0;
|
||||
// x & y out
|
||||
digitalWrite(Xdir,HIGH); digitalWrite(Ydir,HIGH); digitalWrite(Zdir,HIGH); delayMicroseconds(20);
|
||||
|
||||
while ( Znoise < trayOutNoiseMargin )
|
||||
{
|
||||
Serial1.print("U");
|
||||
if (digitalRead(AFbump) == HIGH) { Znoise++; }
|
||||
}
|
||||
|
||||
digitalWrite(Zdir,LOW);
|
||||
for (int i=0; i<2000;i++)
|
||||
{ Serial1.print("U"); }
|
||||
|
||||
|
||||
while ( Xnoise < trayOutNoiseMargin )
|
||||
{
|
||||
Serial2.print("U");
|
||||
if (digitalRead(Xbump) == HIGH) { Xnoise++; }
|
||||
}
|
||||
|
||||
for (int i=0; i<5000;i++)
|
||||
{ Serial2.print("U"); }
|
||||
|
||||
while ( Ynoise < trayOutNoiseMargin )
|
||||
{
|
||||
Serial3.print("U");
|
||||
if (digitalRead(Ybump) == LOW) { Ynoise++; }
|
||||
}
|
||||
|
||||
// if all done, store this in EEPROM
|
||||
//EEPROM.write(0,1);
|
||||
*/
|
||||
|
||||
Serial.println("Tray out");
|
||||
}
|
||||
|
||||
void tray_in()
|
||||
{
|
||||
// assuming that it is called only after tray_out
|
||||
// gotoXSetStep(125000);
|
||||
//gotoYSetStep(-40000);
|
||||
// gotoZSetStep(-3000);
|
||||
|
||||
// now that we're at position, reset counts
|
||||
//XcurrStep=0L; YcurrStep=0L; ZcurrStep=0L;
|
||||
|
||||
// and the tray in var
|
||||
// EEPROM.write(0,0);
|
||||
}
|
||||
|
||||
|
||||
void doFullArea()
|
||||
{
|
||||
// calculate num of x & y FoV. And the tilts
|
||||
long XstepCount = 252525 ; long numXsteps = (XstepCount / xFoV) ; long YstepCount = 126260 ; long numYsteps = (YstepCount / yFoV) ;
|
||||
|
||||
/* The equations are
|
||||
* Az = {Tx(Ax-Bx)} + {Ty(Ay-By)} + {Bz}
|
||||
* and
|
||||
* Az = {Tx(Ax-Cx)} + {Ty(Ay-Cy)} + {Cz}
|
||||
*
|
||||
* we can find Tx and Ty after some algebra
|
||||
* After Tx and Ty, we can find Oz too
|
||||
*/
|
||||
long a = (round)( (Ax-Bx) / (float)xFoV); long b = (round)((Ay-By)/(float)yFoV); long c = (Az-Bz);
|
||||
long d = (round)((Ax-Cx)/(float)xFoV); long e = (round)((Ay-Cy)/(float)yFoV); long f =(Az-Cz);
|
||||
long Oz = 0L;
|
||||
|
||||
XdeltaZperFoV = (round) ((c*e)-(b*f)) / (float) ((a*e)-(b*d)) ;
|
||||
YdeltaZperFoV = (round) (c-(a*XdeltaZperFoV)) / (float) b ;
|
||||
Oz = Az - (XdeltaZperFoV *(Ax/xFoV)) - (YdeltaZperFoV * (Ay/yFoV));
|
||||
|
||||
// Tilts calculated. Now go ahead with WSI **************************************************************
|
||||
// set the initial delta z to the x one. Later, in the loop, it will be changed continously
|
||||
long deltaZperFoV = XdeltaZperFoV;
|
||||
|
||||
//this var keeps track of xdir while scanning . +1 is inc., -1 is dec
|
||||
long XtravelDir = 1;
|
||||
|
||||
// go to the origin
|
||||
gotoXSetStep(0); gotoYSetStep(0); gotoZSetStep(Oz);
|
||||
delay(300);
|
||||
|
||||
// Send sync signal to the imager. By now we're starting FoV and this will be immediately imaged.
|
||||
Serial.print("S#");
|
||||
|
||||
// go go go
|
||||
for (long trackY = 0; trackY <= numYsteps; trackY++)
|
||||
{
|
||||
for (long trackX = 0; trackX < numXsteps; trackX++)
|
||||
{
|
||||
gotoXSetStep(XcurrStep + (XtravelDir * xFoV));
|
||||
|
||||
/* Four cases now --- (a) we're at 1st fov : dont move Z !
|
||||
* --- (b)we're on first strip but more than 1st fov : keep adding X tilt
|
||||
* --- (c) we're at end of strip and just moved to next strip : only add the Y tilt
|
||||
* --- (d) we're in 2nd or higher strip : keep adding only X tilt (Y tilt already added at (c))
|
||||
*/
|
||||
|
||||
if((trackX==0)&&(trackY==0)) { nextZstep = ZcurrStep; }
|
||||
if((trackX>0)&&(trackY==0)) { nextZstep = ZcurrStep +(XtravelDir * deltaZperFoV); }
|
||||
if((trackX==0)&&(trackY>0)) { nextZstep = ZcurrStep + YdeltaZperFoV;}
|
||||
if((trackX>0)&&(trackY>0)) { nextZstep = ZcurrStep +(XtravelDir * deltaZperFoV); }
|
||||
|
||||
gotoZSetStep(nextZstep);
|
||||
|
||||
}
|
||||
|
||||
// shift in the Y dir
|
||||
gotoYSetStep(YcurrStep + yFoV);
|
||||
|
||||
// now go in the opposite direction
|
||||
XtravelDir = XtravelDir * -1;
|
||||
}
|
||||
|
||||
// All done. Now go back to ORIGIN
|
||||
gotoXSetStep(0); gotoYSetStep(0); gotoZSetStep(0);
|
||||
delay(300);
|
||||
}
|
||||
|
||||
|
||||
//88888888888888888888888888888888888888888888888888888888888888888
|
||||
// THIS IS THE GOHOME() FUNCTION
|
||||
//88888888888888888888888888888888888888888888888888888888888888888
|
||||
void gohome()
|
||||
{
|
||||
// turn on all lights
|
||||
gotoYSetStep(-300000); gotoXSetStep(400000);
|
||||
Serial1.flush(); Serial.print('X'); Serial.print("#"); Serial.print(XcurrStep); Serial.print("#");
|
||||
// Y already at origin. Need to bring X and Z there
|
||||
|
||||
gotoXSetStep(limitToXZero); gotoYSetStep(limitToYZero);
|
||||
|
||||
gotoZSetStep(-100000); gotoZSetStep(limitTOZfocus);
|
||||
|
||||
// SET THIS AS ORIGIN
|
||||
XcurrStep=0L; YcurrStep=0L; ZcurrStep=0L;
|
||||
// all done now. Send sync signal
|
||||
Serial.print("S#");
|
||||
}
|
||||
|
||||
void debug()
|
||||
{
|
||||
|
||||
// calc steps in X
|
||||
long XstepCount = abs(Bx - Ax) ; long numXsteps = (XstepCount / xFoV) ;
|
||||
|
||||
// calc steps in Y
|
||||
long YstepCount = abs(Cy - By) ; long numYsteps = (YstepCount / yFoV) ;
|
||||
|
||||
// calc the z changes
|
||||
long XZdeltaCount = Bz - Az ; long XdeltaZperFoV = XZdeltaCount / (numXsteps-1);
|
||||
long YZdeltaCount = Cz - Bz ; long YdeltaZperFoV = YZdeltaCount / (numYsteps-1);
|
||||
|
||||
// set the initial delta z to the x one. Later, in the loop, it will be changed continously
|
||||
long deltaZperFoV = XdeltaZperFoV;
|
||||
|
||||
Serial.print(" Ax: ");Serial.print(Ax);Serial.print(" Ay: ");Serial.print(Ay);Serial.print(" Az: ");Serial.print(Az);
|
||||
Serial.print(" Bx: ");Serial.print(Bx);Serial.print(" By: ");Serial.print(By);Serial.print(" Bz: ");Serial.print(Bz);
|
||||
Serial.print(" Cx: ");Serial.print(Cx);Serial.print(" Cy: ");Serial.print(Cy);Serial.print(" Cz: ");Serial.print(Cz);
|
||||
Serial.print(" XdeltaZperFoV: ");Serial.print(XdeltaZperFoV);
|
||||
Serial.print(" YdeltaZperFoV: ");Serial.print(YdeltaZperFoV);
|
||||
Serial.print("#");
|
||||
|
||||
}
|
||||
|
||||
void do4ptArea()
|
||||
{
|
||||
// calc steps in X
|
||||
long XstepCount = abs(Bx - Ax) ; long numXsteps = (XstepCount / xFoV) ;
|
||||
|
||||
// calc steps in Y
|
||||
long YstepCount = abs(Cy - By) ; long numYsteps = (YstepCount / yFoV) ;
|
||||
|
||||
// calc the z changes
|
||||
long XZdeltaCount = Bz - Az ; long XdeltaZperFoV = XZdeltaCount / (numXsteps-1);
|
||||
long YZdeltaCount = Cz - Bz ; long YdeltaZperFoV = YZdeltaCount / (numYsteps-1);
|
||||
|
||||
// set the initial delta z to the x one. Later, in the loop, it will be changed continously
|
||||
long deltaZperFoV = XdeltaZperFoV;
|
||||
|
||||
//this var keeps track of xdir while scanning . +1 is inc., -1 is dec
|
||||
long XtravelDir = 1;
|
||||
|
||||
// go to the origin
|
||||
gotoXSetStep(Ax); gotoYSetStep(Ay); gotoZSetStep(Az);
|
||||
delay(300);
|
||||
|
||||
// Send sync signal to the imager
|
||||
Serial.print("S#");
|
||||
// go go go
|
||||
for (long trackY = 0; trackY <= numYsteps; trackY++)
|
||||
{
|
||||
for (long trackX = 0; trackX < numXsteps; trackX++)
|
||||
{
|
||||
gotoXSetStep(XcurrStep + (XtravelDir * xFoV));
|
||||
|
||||
/* Four cases now --- (a) we're at 1st fov : dont move Z !
|
||||
* --- (b)we're on first strip but more than 1st fov : keep adding X tilt
|
||||
* --- (c) we're at end of strip and just moved to next strip : only add the Y tilt
|
||||
* --- (d) we're in 2nd or higher strip : keep adding only X tilt (Y tilt already added at (c))
|
||||
*/
|
||||
|
||||
if((trackX==0)&&(trackY==0)) { nextZstep = ZcurrStep; }
|
||||
if((trackX>0)&&(trackY==0)) { nextZstep = ZcurrStep +(XtravelDir * deltaZperFoV); }
|
||||
if((trackX==0)&&(trackY>0)) { nextZstep = ZcurrStep + YdeltaZperFoV;}
|
||||
if((trackX>0)&&(trackY>0)) { nextZstep = ZcurrStep +(XtravelDir * deltaZperFoV); }
|
||||
|
||||
gotoZSetStep(nextZstep);
|
||||
|
||||
}
|
||||
|
||||
// shift in the Y dir
|
||||
gotoYSetStep(YcurrStep + yFoV);
|
||||
|
||||
// now go in the opposite direction
|
||||
XtravelDir = XtravelDir * -1;
|
||||
}
|
||||
|
||||
// All done. Now go back to ORIGIN
|
||||
gotoXSetStep(0); gotoYSetStep(0); gotoZSetStep(0);
|
||||
delay(300);
|
||||
}
|
||||
|
||||
void doAtoB()
|
||||
{
|
||||
long XMovDir = 1;
|
||||
|
||||
// find num of Fov to be traversed and their direction
|
||||
long XstepCount = abs(Bx - Ax) ; long numXFoV = (XstepCount / xFoV) ;
|
||||
|
||||
if (Bx > Ax) { XMovDir = 1; }
|
||||
if (Bx < Ax) { XMovDir = -1; }
|
||||
|
||||
// setup Z data
|
||||
long ZdeltaCount = Bz - Az ;
|
||||
long deltaZperFoV = ZdeltaCount / numXFoV; // This gives the Z change per FoV
|
||||
Serial.println("deltaperZfov is ");
|
||||
Serial.println(deltaZperFoV);
|
||||
// go to the origin
|
||||
gotoXSetStep(Ax); gotoYSetStep(Ay); gotoZSetStep(Az);
|
||||
|
||||
// Send sync signal to the imager
|
||||
Serial.print("S#");
|
||||
delay(300);
|
||||
|
||||
// go go go
|
||||
if( XMovDir == 1) // means we're going in inc X dir
|
||||
{
|
||||
for(long i=0; i<numXFoV; i++)
|
||||
{
|
||||
gotoXSetStep(XcurrStep + xFoV);
|
||||
gotoZSetStep(ZcurrStep + deltaZperFoV);
|
||||
}
|
||||
}
|
||||
|
||||
if( XMovDir == -1) // means we're going in dec X dir
|
||||
{
|
||||
for(long i=0; i<numXFoV; i++)
|
||||
{
|
||||
gotoXSetStep(XcurrStep - xFoV);
|
||||
gotoZSetStep(ZcurrStep + deltaZperFoV);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
BIN
src/matlab/IAD_v_2_3.fig
Normal file
BIN
src/matlab/IAD_v_2_3.fig
Normal file
Binary file not shown.
1213
src/matlab/IAD_v_2_3.m
Normal file
1213
src/matlab/IAD_v_2_3.m
Normal file
File diff suppressed because it is too large
Load Diff
BIN
src/python/0.jpg
Normal file
BIN
src/python/0.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 7.0 KiB |
1
src/python/pyuic5.bat
Normal file
1
src/python/pyuic5.bat
Normal file
@@ -0,0 +1 @@
|
||||
@"C:\Users\jeevan\AppData\Local\Programs\Python\Python35-32\python" -m PyQt5.uic.pyuic %1 %2 %3 %4 %5 %6 %7 %8 %9
|
||||
399
src/python/slide_scanner_gui.py
Normal file
399
src/python/slide_scanner_gui.py
Normal file
@@ -0,0 +1,399 @@
|
||||
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_())
|
||||
419
src/python/slide_scanner_test.py
Normal file
419
src/python/slide_scanner_test.py
Normal file
@@ -0,0 +1,419 @@
|
||||
# -*- 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_())
|
||||
|
||||
BIN
src/python/slide_scanner_test.pyc
Normal file
BIN
src/python/slide_scanner_test.pyc
Normal file
Binary file not shown.
111
src/python/slide_scanner_test.qml
Normal file
111
src/python/slide_scanner_test.qml
Normal file
@@ -0,0 +1,111 @@
|
||||
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
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
20
src/python/slide_scanner_test.qmlproject
Normal file
20
src/python/slide_scanner_test.qmlproject
Normal file
@@ -0,0 +1,20 @@
|
||||
/* 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" ]
|
||||
}
|
||||
986
src/python/slide_scanner_test.ui
Normal file
986
src/python/slide_scanner_test.ui
Normal file
@@ -0,0 +1,986 @@
|
||||
<?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>
|
||||
27
src/python/toQImage.py
Normal file
27
src/python/toQImage.py
Normal file
@@ -0,0 +1,27 @@
|
||||
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
|
||||
BIN
src/python/toQImage.pyc
Normal file
BIN
src/python/toQImage.pyc
Normal file
Binary file not shown.
Reference in New Issue
Block a user