Is there currently a way to do a non-rigid transformation of a ROI which would meet the following requirements (in 2D) ?
- Float or Double precision (so Sub-pixel accuracy)
- ‘Holes’ handling (for instance a polygon contour with an excluded polygon inside the first one)
- Being able to keep the same number of control point before and after deformation. So let’s say if I have an external polygon made of 10 points and an excluded polygon defined by 5 points inside, I want to keep 15 control points before and after the transformation. For instance, solutions that would go through a rasterization step wouldn’t work for me. The underlying reason is that I want the user to be able to adjust as easily the transformed ROI as the non transformed one.
- Compatible with IJ1 (Shape) ROIs (still happy to hear about pure imglib2 options!)
Here’s an example of a rigid transformation in IJ1:
run("Blobs (25K)"); setAutoThreshold("Default"); setOption("BlackBackground", false); run("Convert to Mask"); run("Invert"); makeRectangle(72, 32, 85, 81); run("Crop"); //setTool("zoom"); run("Create Selection"); run("Scale... ", "x=0.5 y=0.5 centered"); run("Rotate...", "rotate angle=15"); run("Blue"); roiManager("Add");
And I don’t even know if it is possible to edit points of the transformed ShapeRoi.
Happy to hear about any hints or direction where to go !