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

depending on the new repository from Tischi for Embryo alignment

parent 4c3acdb9
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
<groupId>embl.almf</groupId> <groupId>embl.almf</groupId>
<version>1.0.2-SNAPSHOT</version> <version>1.0.3-SNAPSHOT</version>
<name>Fly_Embryo_Feedback</name> <name>Fly_Embryo_Feedback</name>
<inceptionYear>2017</inceptionYear> <inceptionYear>2017</inceptionYear>
...@@ -93,8 +93,8 @@ ...@@ -93,8 +93,8 @@
<dependency> <dependency>
<groupId>de.embl.cba</groupId> <groupId>de.embl.cba</groupId>
<artifactId>fiji-plugin-morphometry</artifactId> <artifactId>fly-reg</artifactId>
<version>0.4.05</version> <version>0.1.0</version>
</dependency> </dependency>
</dependencies> </dependencies>
......
...@@ -10,10 +10,9 @@ import automic.online.jobs.Job_Default; ...@@ -10,10 +10,9 @@ import automic.online.jobs.Job_Default;
import automic.parameters.ParameterCollection; import automic.parameters.ParameterCollection;
import automic.parameters.ParameterType; import automic.parameters.ParameterType;
import automic.table.TableModel; import automic.table.TableModel;
import de.embl.cba.morphometry.ImageIO; import de.embl.cba.flyreg.FlyEmbryoRegistrationSettings;
import de.embl.cba.flyreg.FlyEmbryoSingleChannelRegistration;
import de.embl.cba.morphometry.Utils; import de.embl.cba.morphometry.Utils;
import de.embl.cba.morphometry.drosophila.registration.DrosophilaRegistrationSettings;
import de.embl.cba.morphometry.drosophila.registration.DrosophilaSingleChannelRegistration;
import ij.IJ; import ij.IJ;
import net.imagej.ImageJ; import net.imagej.ImageJ;
import ij.ImagePlus; import ij.ImagePlus;
...@@ -142,32 +141,17 @@ public class Job_FocusEmbryoAutoDatasetSplit extends Job_Default{ ...@@ -142,32 +141,17 @@ public class Job_FocusEmbryoAutoDatasetSplit extends Job_Default{
} }
private < T extends RealType< T > & NativeType< T > >
void getEllipsoidParameters(ImagePlus _image)throws Exception { void getEllipsoidParameters(ImagePlus _image)throws Exception {
final DrosophilaRegistrationSettings settings =
new DrosophilaRegistrationSettings();
settings.onlyComputeEllipsoidParameters = true;
//double w=img.getCalibration().pixelWidth/settings.registrationResolution;
//double h=img.getCalibration().pixelHeight/settings.registrationResolution;
//double d=img.getCalibration().pixelDepth/settings.registrationResolution;
RandomAccessibleInterval< T > images =
ImageIO.getChannelImages( _image );
RandomAccessibleInterval< T > image = final FlyEmbryoRegistrationSettings settings = new FlyEmbryoRegistrationSettings();
ImageIO.getChannelImage( images, 0 ); settings.onlyComputeEllipsoidParameters = true;
final DrosophilaSingleChannelRegistration registration = new DrosophilaSingleChannelRegistration( settings, opService ); final FlyEmbryoSingleChannelRegistration registration = new FlyEmbryoSingleChannelRegistration( settings, opService );
final double[] calibration = Utils.getCalibration( _image ); final double[] calibration = Utils.getCalibration( _image );
registration.run( image, calibration ); registration.run( _image,0);
final double[] centre = registration.getElliposidCentreInInputImagePixelUnits(); final double[] centre = registration.getElliposidCentreInInputImagePixelUnits();
final double[] angles = registration.getElliposidEulerAnglesInDegrees(); final double[] angles = registration.getElliposidEulerAnglesInDegrees();
...@@ -176,6 +160,7 @@ public class Job_FocusEmbryoAutoDatasetSplit extends Job_Default{ ...@@ -176,6 +160,7 @@ public class Job_FocusEmbryoAutoDatasetSplit extends Job_Default{
selectedYPosition = centre[1]; selectedYPosition = centre[1];
selectedZPosition = centre[2]; selectedZPosition = centre[2];
rotation=-angles[0]; rotation=-angles[0];
} }
...@@ -282,7 +267,7 @@ public class Job_FocusEmbryoAutoDatasetSplit extends Job_Default{ ...@@ -282,7 +267,7 @@ public class Job_FocusEmbryoAutoDatasetSplit extends Job_Default{
// start ImageJ // start ImageJ
new ImageJ().ui().showUI(); new ImageJ().ui().showUI();
String tblPth="X:\\group\\ALMFstuff\\Aliaksandr\\User_data\\Crocker-fly-feedback\\03082019_march_test"; String tblPth="X:\\group\\Aliaksandr\\User_data\\Crocker-fly-feedback\\03082019_march_test";
String tblFnm="summary_test03_.txt"; String tblFnm="summary_test03_.txt";
Job_FocusEmbryoAutoDatasetSplit testJob=new Job_FocusEmbryoAutoDatasetSplit(); Job_FocusEmbryoAutoDatasetSplit testJob=new Job_FocusEmbryoAutoDatasetSplit();
testJob.initialise(null, "Focus.Image", false); testJob.initialise(null, "Focus.Image", false);
......
...@@ -4,19 +4,14 @@ package algorithm.tests; ...@@ -4,19 +4,14 @@ package algorithm.tests;
import java.io.File; import java.io.File;
import de.embl.cba.morphometry.ImageIO; import de.embl.cba.flyreg.FlyEmbryoRegistrationSettings;
import de.embl.cba.morphometry.Logger; import de.embl.cba.flyreg.FlyEmbryoSingleChannelRegistration;
import de.embl.cba.morphometry.Utils; import de.embl.cba.morphometry.Utils;
import de.embl.cba.morphometry.drosophila.registration.DrosophilaRegistrationSettings;
import de.embl.cba.morphometry.drosophila.registration.DrosophilaSingleChannelRegistration;
import de.embl.cba.morphometry.geometry.ellipsoids.EllipsoidMLJ;
import de.embl.cba.morphometry.geometry.ellipsoids.EllipsoidsMLJ;
import ij.ImagePlus; import ij.ImagePlus;
import loci.plugins.BF; import loci.plugins.BF;
import net.imagej.ImageJ; import net.imagej.ImageJ;
import net.imagej.ops.OpService; import net.imagej.ops.OpService;
import net.imglib2.RandomAccessibleInterval;
import net.imglib2.realtransform.AffineTransform3D;
import net.imglib2.type.NativeType; import net.imglib2.type.NativeType;
import net.imglib2.type.numeric.RealType; import net.imglib2.type.numeric.RealType;
...@@ -35,21 +30,16 @@ public class FindEmbryoOrientationTischi { ...@@ -35,21 +30,16 @@ public class FindEmbryoOrientationTischi {
final ImagePlus imagePlus = BF.openImagePlus(inputPath)[0]; final ImagePlus imagePlus = BF.openImagePlus(inputPath)[0];
imagePlus.show(); imagePlus.show();
final DrosophilaRegistrationSettings settings = final FlyEmbryoRegistrationSettings settings = new FlyEmbryoRegistrationSettings();
new DrosophilaRegistrationSettings();
settings.onlyComputeEllipsoidParameters = true; settings.onlyComputeEllipsoidParameters = true;
RandomAccessibleInterval< T > images = final FlyEmbryoSingleChannelRegistration registration = new FlyEmbryoSingleChannelRegistration( settings, opService );
ImageIO.getChannelImages( imagePlus );
RandomAccessibleInterval< T > image =
ImageIO.getChannelImage( images, 0 );
final DrosophilaSingleChannelRegistration registration = new DrosophilaSingleChannelRegistration( settings, opService );
final double[] calibration = Utils.getCalibration( imagePlus ); final double[] calibration = Utils.getCalibration( imagePlus );
registration.run( image, calibration ); registration.run(imagePlus, 0);
final double[] centre = registration.getElliposidCentreInInputImagePixelUnits(); final double[] centre = registration.getElliposidCentreInInputImagePixelUnits();
final double[] angles = registration.getElliposidEulerAnglesInDegrees(); final double[] angles = registration.getElliposidEulerAnglesInDegrees();
......
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