Commit 25d9dc5f authored by lombardo's avatar lombardo

Merge branch 'test' into 'master'

Test



See merge request !1
parents 89d7892d 472c70cd
......@@ -8,11 +8,11 @@
<parent>
<groupId>sc.fiji</groupId>
<artifactId>pom-fiji</artifactId>
<version>11.0.0</version>
<version>21.3.0</version>
</parent>
<groupId>BIIS.mpi-cbg</groupId>
<artifactId>Manual_Registration</artifactId>
<artifactId>Manual_Drift_Correction</artifactId>
<version>1.0.0</version>
<name>Manual_Registration.jar</name>
......@@ -52,11 +52,9 @@
<developers>
<developer>
<id>developer_id</id>
<name> XXX </name>
<email>XXX@XXX</email>
<url>http://XXX</url>
<organization>XXX</organization>
<organizationUrl>http://XXX</organizationUrl>
<name> Benoit </name>
<email>ipf(A_T)mpi-cbg.de</email>
<organization>MPI-CBG</organization>
<roles>
<role>developer</role>
</roles>
......
package de.mpicbg.scf.ManualDriftCorrection;
/**
* Author: Benoit Lombardot, Scientific computing facility @ MPI-CBG
* date: 2015-06-03
......@@ -9,7 +11,7 @@
for the manual_registration:
- load the manual registration script in fiji script editor
- load the image to analyze
- save a set of ROI (point, lin or polyline) describing your object movement to the ROI manager
- save a set of ROI (point, line or polyline) describing your object movement to the ROI manager
(in menu "Analyze>tools>ROI manager", use the key "t" to add a region to the ROI manager).
Only one type of roi can be used for a given dataset
- check with the function "Image>hyperstack>stack to hyperstack" that the time dimension of your data
......@@ -17,8 +19,8 @@ for the manual_registration:
- Set the time slider to the reference image (all other image of the stack will be registered to this one)
- click run in the script editor. The output will be a registered stack.
rk : the ROI should be in ascending time order (smallest time first)
rk2 : the plugin currently does translation correction. it can very easily be adapted to correct for
rk : the ROI in the Roi manager should be in ascending time order (smallest time first)
rk2 : the plugin currently does 2D translation correction. it can very easily be adapted to correct for
rigid transformation or similarity transformation
rk3 : there should be the same number of landmark at each time step
rk4 : there should be a landmark at first and last time step. if not the landmark appearing first (last) will be used
......@@ -33,14 +35,12 @@ import ij.process.ImageProcessor;
import ij.plugin.frame.RoiManager;
import ij.gui.Roi;
import ij.gui.Line;
//import ij.gui.PointRoi;
import ij.gui.PolygonRoi;
import ij.CompositeImage;
import ij.ImageStack;
//import java.util.Hashtable;
import java.util.ArrayList;
import java.util.Arrays;
......@@ -48,16 +48,13 @@ import mpicbg.models.Point;
import mpicbg.models.PointMatch;
import mpicbg.ij.InverseTransformMapping;
import mpicbg.ij.Mapping;
//import mpicbg.models.CoordinateTransform;
import mpicbg.models.InverseCoordinateTransform;
//import mpicbg.models.Model;
import mpicbg.models.TranslationModel2D;
//import mpicbg.models.RigidModel2D;
//import mpicbg.models.SimilarityModel2D;
import mpicbg.models.TranslationModel2D;
//import mpicbg.models.AffineModel2D;
import mpicbg.models.NotEnoughDataPointsException;
//import mpicbg.models.IllDefinedDataPointsException;
import mpicbg.models.Affine2D;
//import mpicbg.models.AffineModel2D;
......@@ -67,8 +64,8 @@ import mpicbg.models.Affine2D;
* TODO:
* - create a proper class: to set land marks, interpolate them, set the model, perform the registration
* - interface : ref slice, slice range, methods, origin stack (for the landmark czt position proper calculus)
* - register along z or along t or else
* - changing number of landmark by creating some landmark trajectory
* - register along z, t or channel
* (- changing number of landmark by creating some landmark trajectory)
* (- handle 3D reg) not sure it worth
*/
......@@ -81,7 +78,7 @@ public class Manual_Registration implements PlugIn {
interpolate=true;
showMatrix=false;
IJ.log("-------------Drift Correction Plugin ------------");
ImagePlus imp = IJ.getImage();
int[] inputDims = imp.getDimensions();
int slice_per_frame = inputDims[2]*inputDims[3]; // Nchannel*Nz
......@@ -155,8 +152,8 @@ public class Manual_Registration implements PlugIn {
npt = npoints;
}
}
IJ.log("key landmark " + keyLandmark_list.toString() );
IJ.log("key Frame " + keyFrame_list.toString() );
//IJ.log("key landmark " + keyLandmark_list.toString() );
//IJ.log("key Frame " + keyFrame_list.toString() );
......@@ -196,8 +193,8 @@ public class Manual_Registration implements PlugIn {
t1_idx=t1_idx_max; t2_idx=t1_idx_max;
}
}
IJ.log("interp range ; "+t1+" "+t+" "+t2);
IJ.log("t1 idx : " + t1_idx);
//IJ.log("interp range ; "+t1+" "+t+" "+t2);
//IJ.log("t1 idx : " + t1_idx);
ArrayList<Point> point_list = new ArrayList<Point>();
if (t<=t1){
......@@ -249,6 +246,9 @@ public class Manual_Registration implements PlugIn {
int nCZT = inputDims[2]*inputDims[3]*inputDims[4];
IJ.log("reference slice :"+ref_t);
IJ .log("Processing drift corrected sequence ...");
for(int idx=1; idx<=nCZT; idx++)
{
//int idx = 179;
......@@ -303,18 +303,18 @@ public class Manual_Registration implements PlugIn {
imp_transform.setCalibration(imp.getCalibration());
CompositeImage comp_imp_transform = new CompositeImage(imp_transform,CompositeImage.COMPOSITE);
comp_imp_transform.show();
IJ.log("-------------Drift Correction Done! --------------");
// display the new sequence
}
public static void main(final String... args) {
new ij.ImageJ();
IJ.open( "E:\\project_data\\Marija(Norden)\\2015-06-08\\MIP_20150521_TgAth5_injH2B_5min_start@35hpf_Subset_stamped 2.tif" );
//ImagePlus imp = IJ.getImage();
//IJ.run(imp, "Z Project...", "projection=[Max Intensity] all");
IJ.open("E:\\project_data\\Marija(Norden)\\2015-06-08\\ROIRegPoints_MIP_20150521_TgAth5_injH2B_5min_start@35hpf_Subset_stamped.zip");
IJ.open( "A_sequence)_file.tiff" );
IJ.getImage().setT(100);
//IJ.run(imp, "Z Project...", "projection=[Max Intensity] all");
new Manual_Registration().run("");
}
}
......@@ -9,4 +9,4 @@
# If something like ("<arg>") is appended to the class name, the setup() method
# will get that as arg parameter; otherwise arg is simply the empty string.
Plugins>SciComp_MPI-CBG, "Manual Registration", Manual_Registration
Plugins>Registration, "Manual Drift Correction", de.mpicbg.scf.ManualDriftCorrection.Manual_Registration
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