Commit 8db62c9f authored by Aliaksandr Halavatyi's avatar Aliaksandr Halavatyi

projecting stacjs for auto ambryo selection

parent dd1a0da7
......@@ -19,6 +19,7 @@ import ij.ImagePlus;
import ij.gui.Overlay;
import ij.gui.Roi;
import ij.plugin.Duplicator;
import ij.plugin.ZProjector;
import ij.plugin.filter.MaximumFinder;
import ij.plugin.filter.ParticleAnalyzer;
import ij.plugin.filter.RankFilters;
......@@ -56,19 +57,12 @@ public class Job_SelectMultipleEmbryosAuto extends Job_Default{
public static final String KEY_WAIT_IMAGE_OPENING="Wait for image opening (milliseconds)";
//private static final Roi nullRoi=null;
protected ImagePlus img=null;
//private Roi selectedPointsRoi;
//private Integer selectedXPosition;
//private Integer selectedYPosition;
private Point2D.Double[] selectedPoints;
private Roi wellRoi;
private Roi[] embryoRois;
private Roi[] selectedEmbryoRois;
//private boolean selectionMade=false;
//private boolean invert_Z;
private int wellBrightFieldChannel=2;
private int wellBrightFieldThreshold=10;
......@@ -136,12 +130,30 @@ public class Job_SelectMultipleEmbryosAuto extends Job_Default{
@Override
protected boolean runProcessing()throws Exception{
this.showDebug(img, "original image", true);
wellRoi=getWellRoi(new Duplicator().run(img, wellBrightFieldChannel, wellBrightFieldChannel, 1, 1, 1, 1));
ImagePlus wellImage=new Duplicator().run(img, wellBrightFieldChannel, wellBrightFieldChannel, 1, img.getNSlices(), 1, 1);
if(wellImage.getNSlices()>1) {
ZProjector maxProjector=new ZProjector(wellImage);
maxProjector.setMethod(ZProjector.MAX_METHOD);
maxProjector.doProjection();
wellImage=maxProjector.getProjection();
}
wellRoi=getWellRoi(wellImage);
if (wellRoi==null)
return false;
identifyEmbryos(new Duplicator().run(img, embryoFluorChannel, embryoFluorChannel, 1, 1, 1, 1));
ImagePlus embryoImage=new Duplicator().run(img, embryoFluorChannel, embryoFluorChannel, 1, img.getNSlices(), 1, 1);
if(embryoImage.getNSlices()>1) {
ZProjector maxProjector=new ZProjector(embryoImage);
maxProjector.setMethod(ZProjector.MAX_METHOD);
maxProjector.doProjection();
embryoImage=maxProjector.getProjection();
}
identifyEmbryos(embryoImage);
if (embryoRois==null) return false;
if (embryoRois.length<1) return false;
......
Markdown is supported
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