Commit 472c70cd authored by lombardo's avatar lombardo

update package name, update config file accordingly. A few cosmetic change in the logged info

parent 21dd5aa5
package de.mpicbg.scf.ManualDriftCorrection;
/** /**
* Author: Benoit Lombardot, Scientific computing facility @ MPI-CBG * Author: Benoit Lombardot, Scientific computing facility @ MPI-CBG
* date: 2015-06-03 * date: 2015-06-03
...@@ -9,7 +11,7 @@ ...@@ -9,7 +11,7 @@
for the manual_registration: for the manual_registration:
- load the manual registration script in fiji script editor - load the manual registration script in fiji script editor
- load the image to analyze - 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). (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 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 - check with the function "Image>hyperstack>stack to hyperstack" that the time dimension of your data
...@@ -17,8 +19,8 @@ for the manual_registration: ...@@ -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) - 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. - 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) rk : the ROI in the Roi manager 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 rk2 : the plugin currently does 2D translation correction. it can very easily be adapted to correct for
rigid transformation or similarity transformation rigid transformation or similarity transformation
rk3 : there should be the same number of landmark at each time step 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 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; ...@@ -33,14 +35,12 @@ import ij.process.ImageProcessor;
import ij.plugin.frame.RoiManager; import ij.plugin.frame.RoiManager;
import ij.gui.Roi; import ij.gui.Roi;
import ij.gui.Line; import ij.gui.Line;
//import ij.gui.PointRoi;
import ij.gui.PolygonRoi; import ij.gui.PolygonRoi;
import ij.CompositeImage; import ij.CompositeImage;
import ij.ImageStack; import ij.ImageStack;
//import java.util.Hashtable;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
...@@ -48,16 +48,13 @@ import mpicbg.models.Point; ...@@ -48,16 +48,13 @@ import mpicbg.models.Point;
import mpicbg.models.PointMatch; import mpicbg.models.PointMatch;
import mpicbg.ij.InverseTransformMapping; import mpicbg.ij.InverseTransformMapping;
import mpicbg.ij.Mapping; import mpicbg.ij.Mapping;
//import mpicbg.models.CoordinateTransform;
import mpicbg.models.InverseCoordinateTransform; import mpicbg.models.InverseCoordinateTransform;
//import mpicbg.models.Model; import mpicbg.models.TranslationModel2D;
//import mpicbg.models.RigidModel2D; //import mpicbg.models.RigidModel2D;
//import mpicbg.models.SimilarityModel2D; //import mpicbg.models.SimilarityModel2D;
import mpicbg.models.TranslationModel2D; //import mpicbg.models.AffineModel2D;
import mpicbg.models.NotEnoughDataPointsException; import mpicbg.models.NotEnoughDataPointsException;
//import mpicbg.models.IllDefinedDataPointsException;
import mpicbg.models.Affine2D; import mpicbg.models.Affine2D;
//import mpicbg.models.AffineModel2D;
...@@ -67,8 +64,8 @@ import mpicbg.models.Affine2D; ...@@ -67,8 +64,8 @@ import mpicbg.models.Affine2D;
* TODO: * TODO:
* - create a proper class: to set land marks, interpolate them, set the model, perform the registration * - 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) * - interface : ref slice, slice range, methods, origin stack (for the landmark czt position proper calculus)
* - register along z or along t or else * - register along z, t or channel
* - changing number of landmark by creating some landmark trajectory * (- changing number of landmark by creating some landmark trajectory)
* (- handle 3D reg) not sure it worth * (- handle 3D reg) not sure it worth
*/ */
...@@ -81,7 +78,7 @@ public class Manual_Registration implements PlugIn { ...@@ -81,7 +78,7 @@ public class Manual_Registration implements PlugIn {
interpolate=true; interpolate=true;
showMatrix=false; showMatrix=false;
IJ.log("-------------Drift Correction Plugin ------------");
ImagePlus imp = IJ.getImage(); ImagePlus imp = IJ.getImage();
int[] inputDims = imp.getDimensions(); int[] inputDims = imp.getDimensions();
int slice_per_frame = inputDims[2]*inputDims[3]; // Nchannel*Nz int slice_per_frame = inputDims[2]*inputDims[3]; // Nchannel*Nz
...@@ -155,8 +152,8 @@ public class Manual_Registration implements PlugIn { ...@@ -155,8 +152,8 @@ public class Manual_Registration implements PlugIn {
npt = npoints; npt = npoints;
} }
} }
IJ.log("key landmark " + keyLandmark_list.toString() ); //IJ.log("key landmark " + keyLandmark_list.toString() );
IJ.log("key Frame " + keyFrame_list.toString() ); //IJ.log("key Frame " + keyFrame_list.toString() );
...@@ -196,8 +193,8 @@ public class Manual_Registration implements PlugIn { ...@@ -196,8 +193,8 @@ public class Manual_Registration implements PlugIn {
t1_idx=t1_idx_max; t2_idx=t1_idx_max; t1_idx=t1_idx_max; t2_idx=t1_idx_max;
} }
} }
IJ.log("interp range ; "+t1+" "+t+" "+t2); //IJ.log("interp range ; "+t1+" "+t+" "+t2);
IJ.log("t1 idx : " + t1_idx); //IJ.log("t1 idx : " + t1_idx);
ArrayList<Point> point_list = new ArrayList<Point>(); ArrayList<Point> point_list = new ArrayList<Point>();
if (t<=t1){ if (t<=t1){
...@@ -249,6 +246,9 @@ public class Manual_Registration implements PlugIn { ...@@ -249,6 +246,9 @@ public class Manual_Registration implements PlugIn {
int nCZT = inputDims[2]*inputDims[3]*inputDims[4]; int nCZT = inputDims[2]*inputDims[3]*inputDims[4];
IJ.log("reference slice :"+ref_t); IJ.log("reference slice :"+ref_t);
IJ .log("Processing drift corrected sequence ...");
for(int idx=1; idx<=nCZT; idx++) for(int idx=1; idx<=nCZT; idx++)
{ {
//int idx = 179; //int idx = 179;
...@@ -303,18 +303,18 @@ public class Manual_Registration implements PlugIn { ...@@ -303,18 +303,18 @@ public class Manual_Registration implements PlugIn {
imp_transform.setCalibration(imp.getCalibration()); imp_transform.setCalibration(imp.getCalibration());
CompositeImage comp_imp_transform = new CompositeImage(imp_transform,CompositeImage.COMPOSITE); CompositeImage comp_imp_transform = new CompositeImage(imp_transform,CompositeImage.COMPOSITE);
comp_imp_transform.show(); comp_imp_transform.show();
IJ.log("-------------Drift Correction Done! --------------");
// display the new sequence // display the new sequence
} }
public static void main(final String... args) { public static void main(final String... args) {
new ij.ImageJ(); new ij.ImageJ();
IJ.open( "E:\\project_data\\Marija(Norden)\\2015-06-08\\MIP_20150521_TgAth5_injH2B_5min_start@35hpf_Subset_stamped 2.tif" ); IJ.open( "A_sequence)_file.tiff" );
//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.getImage().setT(100); IJ.getImage().setT(100);
//IJ.run(imp, "Z Project...", "projection=[Max Intensity] all");
new Manual_Registration().run(""); new Manual_Registration().run("");
} }
} }
...@@ -9,4 +9,4 @@ ...@@ -9,4 +9,4 @@
# If something like ("<arg>") is appended to the class name, the setup() method # 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. # 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