Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Find an alternative to Line.getInterpolatedPolygon() #5

Open
hadim opened this issue Apr 25, 2016 · 4 comments
Open

Find an alternative to Line.getInterpolatedPolygon() #5

hadim opened this issue Apr 25, 2016 · 4 comments

Comments

@hadim
Copy link
Contributor

hadim commented Apr 25, 2016

During kymograph creation I use the following code :

currentLine = new Line(new_xStart, new_yStart, new_xEnd, new_yEnd);
 currentLine.setStrokeWidth(1);
imp.setRoi(currentLine);

xpoints = currentLine.getInterpolatedPolygon().xpoints;
 ypoints = currentLine.getInterpolatedPolygon().ypoints;
npoints = currentLine.getInterpolatedPolygon().npoints;

I am pretty sure it makes things slower...

@hadim hadim assigned hadim and unassigned hadim Apr 25, 2016
@hadim
Copy link
Contributor Author

hadim commented Apr 26, 2016

@hadim hadim changed the title Remove IJ1 dependency Remove IJ1 dependency for getInterpolatedPolygon() Apr 28, 2016
@hadim
Copy link
Contributor Author

hadim commented Apr 29, 2016

I found an IJ2 algorithm that could do the job here : https://github.com/imglib/imglib2-roi/blob/master/src/main/java/net/imglib2/roi/util/ROIUtils.java#L126

The thing is for now bresenham() is guessing a closed loop. So I need to adapt it to my needs (and maybe submit a PR to imglib2-roi ?).

@hadim
Copy link
Contributor Author

hadim commented Apr 29, 2016

ROIUtils.bresenham() is not exactly the same as Line.getInterpolatedPolygon(). For example it does take into account the interval = 1 seen in Line.getInterpolatedPolygon().

So for now I don't plan to remove the IJ1 deps.

@hadim hadim changed the title Remove IJ1 dependency for getInterpolatedPolygon() Find an alternative to getInterpolatedPolygon() Apr 29, 2016
@hadim hadim changed the title Find an alternative to getInterpolatedPolygon() Find an alternative to Line.getInterpolatedPolygon() Apr 29, 2016
@hadim
Copy link
Contributor Author

hadim commented Apr 29, 2016

See imglib/imglib2-roi#27

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant