(ImageRoi roi, double xscale, double yscale, boolean centered)
| 153 | } |
| 154 | |
| 155 | private static Roi scaleImage(ImageRoi roi, double xscale, double yscale, boolean centered) { |
| 156 | roi = (ImageRoi)roi.clone(); |
| 157 | ImageProcessor ip2 = roi.getProcessor(); |
| 158 | //ip2.setInterpolationMethod(interpolationMethod); |
| 159 | int newWidth = (int)Math.round(ip2.getWidth()*xscale); |
| 160 | int newHeight = (int)Math.round(ip2.getHeight()*yscale); |
| 161 | ip2 = ip2.resize(newWidth, newHeight, true); |
| 162 | roi.setProcessor(ip2); |
| 163 | Rectangle bounds = roi.getBounds(); |
| 164 | int x = (int)Math.round(bounds.x*xscale); |
| 165 | int y = (int)Math.round(bounds.y*yscale); |
| 166 | roi.setLocation(x,y); |
| 167 | roi.copyAttributes(roi); |
| 168 | return roi; |
| 169 | } |
| 170 | |
| 171 | } |
no test coverage detected