public void fitSplineForStraightening() { fitSpline((int)(getUncalibratedLength()*2)+1); //preliminary finer splines with half-pixel steps (plus end point) if (xSpline==null || splinePoints==0) return; float[] xpoints = new float[splinePoints*2];
public void fitSpline() { double length = getUncalibratedLength(); int evaluationPoints = (int)(length/2.0); if (ic!=null) { double mag = ic.getMagnification(); if (mag<1.0) evaluationPoints *= mag;; } if (evaluationPoints<100) evaluationPoints = 100; fitSpline(evaluationPoints); }
public void fitSplineForStraightening() { fitSpline((int)(getUncalibratedLength()*2)+1); //preliminary finer splines with half-pixel steps (plus end point) if (xSpline==null || splinePoints==0) return; float[] xpoints = new float[splinePoints*2];
public void fitSpline() { double length = getUncalibratedLength(); int evaluationPoints = (int)(length/2.0); if (ic!=null) { double mag = ic.getMagnification(); if (mag<1.0) evaluationPoints *= mag;; } if (evaluationPoints<100) evaluationPoints = 100; fitSpline(evaluationPoints); }
void fitSpline() { Roi roi = imp.getRoi(); if (roi==null) {noRoi("Spline"); return;} int type = roi.getType(); boolean segmentedSelection = type==Roi.POLYGON||type==Roi.POLYLINE; if (!(segmentedSelection||type==Roi.FREEROI||type==Roi.TRACED_ROI||type==Roi.FREELINE)) {IJ.error("Spline Fit", "Polygon or polyline selection required"); return;} if (roi instanceof EllipseRoi) return; PolygonRoi p = (PolygonRoi)roi; Undo.setup(Undo.ROI, imp); if (!segmentedSelection && p.getNCoordinates()>3) { if (p.subPixelResolution()) p = trimFloatPolygon(p, p.getUncalibratedLength()); else p = trimPolygon(p, p.getUncalibratedLength()); } String options = Macro.getOptions(); if (options!=null && options.indexOf("straighten")!=-1) p.fitSplineForStraightening(); else if (options!=null && options.indexOf("remove")!=-1) p.removeSplineFit(); else p.fitSpline(); imp.draw(); LineWidthAdjuster.update(); }
void fitSpline() { Roi roi = imp.getRoi(); if (roi==null) {noRoi("Spline"); return;} int type = roi.getType(); boolean segmentedSelection = type==Roi.POLYGON||type==Roi.POLYLINE; if (!(segmentedSelection||type==Roi.FREEROI||type==Roi.TRACED_ROI||type==Roi.FREELINE)) {IJ.error("Spline Fit", "Polygon or polyline selection required"); return;} if (roi instanceof EllipseRoi) return; PolygonRoi p = (PolygonRoi)roi; Undo.setup(Undo.ROI, imp); if (!segmentedSelection && p.getNCoordinates()>3) { if (p.subPixelResolution()) p = trimFloatPolygon(p, p.getUncalibratedLength()); else p = trimPolygon(p, p.getUncalibratedLength()); } String options = Macro.getOptions(); if (options!=null && options.indexOf("straighten")!=-1) p.fitSplineForStraightening(); else if (options!=null && options.indexOf("remove")!=-1) p.removeSplineFit(); else p.fitSpline(); imp.draw(); LineWidthAdjuster.update(); }
double length = getUncalibratedLength(); float[] nodePositions = new float[nNodes]; float lastNodePosition = 0f; //independent coordinate for x & y-splines,
double length = getUncalibratedLength(); float[] nodePositions = new float[nNodes]; float lastNodePosition = 0f; //independent coordinate for x & y-splines,