Commit 89d7892d authored by lombardo's avatar lombardo

correct 2 bugs: distinguish stack and hyper stack, handle correctly the case...

correct 2 bugs: distinguish stack and hyper stack, handle correctly the case when the 1st landmark is not on the 1st frame
parent 2210dee8
...@@ -104,10 +104,15 @@ public class Manual_Registration implements PlugIn { ...@@ -104,10 +104,15 @@ public class Manual_Registration implements PlugIn {
{ {
Roi roi = manager.getRoi(i); Roi roi = manager.getRoi(i);
String label = roi.getName(); String label = roi.getName();
if (label==null){ IJ.log("labe is null");} if (label==null){ IJ.log("label is null");}
//int frame = (int) (manager.getSliceNumber(label)/slice_per_frame)+1; int frame;
int frame = (int) ((float)(roi.getPosition()-1)/slice_per_frame )+1; if (imp.isHyperStack())
{ frame = roi.getTPosition(); }
else
{ //int frame = (int) (manager.getSliceNumber(label)/slice_per_frame)+1;
frame = (int) ((float)(roi.getPosition()-1)/slice_per_frame )+1;
}
IJ.log("rois: name - frame : "+roi.getName()+" - "+frame); IJ.log("rois: name - frame : "+roi.getName()+" - "+frame);
//IJ.log("roimanager: slice - name : "+ manager.getSliceNumber(label) +" - "+label); //IJ.log("roimanager: slice - name : "+ manager.getSliceNumber(label) +" - "+label);
...@@ -191,11 +196,15 @@ public class Manual_Registration implements PlugIn { ...@@ -191,11 +196,15 @@ 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(t2 == t1){ if (t<=t1){
for(int pt=0; pt<npt; pt++)
point_list.add( new Point( keyLandmark_list.get(t1_idx).get(pt).getL() ) );
}
else if(t2 == t1){
for(int pt=0; pt<npt; pt++) for(int pt=0; pt<npt; pt++)
point_list.add( new Point( keyLandmark_list.get(t1_idx).get(pt).getL() ) ); point_list.add( new Point( keyLandmark_list.get(t1_idx).get(pt).getL() ) );
} }
...@@ -249,7 +258,7 @@ public class Manual_Registration implements PlugIn { ...@@ -249,7 +258,7 @@ public class Manual_Registration implements PlugIn {
Mapping< InverseCoordinateTransform > mapping = new InverseTransformMapping< InverseCoordinateTransform >( ict ); Mapping< InverseCoordinateTransform > mapping = new InverseTransformMapping< InverseCoordinateTransform >( ict );
int t = (int)Math.ceil((double)idx/slice_per_frame); int t = (int)Math.ceil((double)idx/slice_per_frame);
IJ.log("warping frame "+t); //IJ.log("warping frame "+t);
ImageProcessor ipSource = imp.getStack().getProcessor(idx); ImageProcessor ipSource = imp.getStack().getProcessor(idx);
ImageProcessor ipTarget = ipSource.createProcessor( inputDims[0],inputDims[1] ); ImageProcessor ipTarget = ipSource.createProcessor( inputDims[0],inputDims[1] );
ArrayList< PointMatch > matches = new ArrayList< PointMatch >(); ArrayList< PointMatch > matches = new ArrayList< PointMatch >();
...@@ -301,11 +310,11 @@ public class Manual_Registration implements PlugIn { ...@@ -301,11 +310,11 @@ public class Manual_Registration implements PlugIn {
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\\2015-02-25_Iskra(Norden)\\20150128_hspcytoGFP_f1_concatenated-2.tif" ); 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(); //ImagePlus imp = IJ.getImage();
//IJ.run(imp, "Z Project...", "projection=[Max Intensity] all"); //IJ.run(imp, "Z Project...", "projection=[Max Intensity] all");
IJ.open("E:\\project_data\\2015-02-25_Iskra(Norden)\\RoiSet.zip"); 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);
new Manual_Registration().run(""); new Manual_Registration().run("");
} }
} }
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