Commit f5620cbd authored by Aliaksandr Halavatyi's avatar Aliaksandr Halavatyi
Browse files

correct AF zenblue procedure

parent ed4eebc9
......@@ -20,6 +20,7 @@ public class Job_AutofocusInit_ZenBlue extends Job_Default{
//private static final Roi nullRoi=null;
private ImagePlus img=null;
int maxind=-1;
int zSubmit=-1;
Boolean isLineScan=null;
@Override
......@@ -43,7 +44,7 @@ public class Job_AutofocusInit_ZenBlue extends Job_Default{
TimeUnit.MILLISECONDS.sleep(1000);
ImageOpenerWithBioformats.turnLineScans=true;
img=ImageOpenerWithBioformats.openImage(newImgFile);
isLineScan=(img.getWidth()==1)||(img.getHeight()==1);
isLineScan=(img.getNSlices()==1);
}
@Override
......@@ -51,17 +52,19 @@ public class Job_AutofocusInit_ZenBlue extends Job_Default{
//img=ImageOpenerWithBioformats.openImage(currentTable.getFile(curDInd, imgColumnNm, "IMG"));
ImageOpenerWithBioformats.turnLineScans=true;
img=ImageOpenerWithBioformats.openImage(newImgFile);
isLineScan=(img.getWidth()==1)||(img.getHeight()==1);
isLineScan=(img.getNSlices()==1);
}
@Override
protected boolean runProcessing()throws Exception{
if (isLineScan)
if (isLineScan) {
maxind=getFocusValueLine(img);
else {
zSubmit=img.getHeight()-maxind-1;
}else {
maxind=getFocusValueFrameStack(img);
zSubmit=maxind;
}
return true;
......@@ -133,7 +136,7 @@ public class Job_AutofocusInit_ZenBlue extends Job_Default{
@Override
public void postProcessSuccess()throws Exception{
ZeissLSM800.submitJobPixels(newImgFile, "spindle-LZ", new Point3D(null,null,(double)maxind));
ZeissLSM800.submitJobPixels(newImgFile, "spindle-LZ", new Point3D(null,null,(double)zSubmit));
Roi[] rs=getOverlay().toArray();
if (!ROIManipulator2D.isEmptyRoiArr(rs))
saveRoisForImage(newImgFile,rs);
......@@ -141,10 +144,11 @@ public class Job_AutofocusInit_ZenBlue extends Job_Default{
@Override
public void postProcessOffline()throws Exception{
ZeissLSM800.submitJobPixels(newImgFile, "spindle-LZ", new Point3D(null,null,(double)maxind));
ZeissLSM800.submitJobPixels(newImgFile, "spindle-LZ", new Point3D(null,null,(double)zSubmit));
Roi[] rs=getOverlay().toArray();
if (!ROIManipulator2D.isEmptyRoiArr(rs))
saveRoisForImage(newImgFile,rs);
this.visualise(1000, 100);
}
......@@ -158,7 +162,7 @@ public class Job_AutofocusInit_ZenBlue extends Job_Default{
Job_AutofocusInit_ZenBlue testJob=new Job_AutofocusInit_ZenBlue();
testJob.initialise(null, "AFocus", false);
testJob.testImageFile(new File("X:\\group\\Aliaksandr\\test-Tobias-auto-20200724\\20200724-150541\\AF\\AF--W0000--P0001-T0001.czi"));
testJob.testImageFile(new File("X:\\group\\Aliaksandr\\User_data\\Marco_Cosenza\\test-AF-update\\AF--W0000--P0001-T0001.czi"));
//testJob.testJobMicTable(0, tblPth, tblFnm);
}
......
......@@ -80,7 +80,7 @@ public class ImageOpenerWithBioformats {
ImagePlus img=imgs[0];
if(turnLineScans&&((img.getWidth()==1)||(img.getHeight()==1))) {
img=new Turn().run(Image.wrap(img), 0, 0, -1).imageplus();//img.duplicate();
img=new Turn().run(Image.wrap(img), 0, 0, 1).imageplus();//img.duplicate();
//IJ.run(transformedImage, "TransformJ Turn", "z-angle=0 y-angle=0 x-angle=90");
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment