MCPcopy Create free account
hub / github.com/AstroImageJ/astroimagej / scaleImage

Method scaleImage

ij/src/main/java/ij/plugin/RoiScaler.java:155–169  ·  view source on GitHub ↗
(ImageRoi roi, double xscale, double yscale, boolean centered)

Source from the content-addressed store, hash-verified

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}

Callers 1

scaleMethod · 0.95

Calls 10

getWidthMethod · 0.95
getHeightMethod · 0.95
resizeMethod · 0.95
cloneMethod · 0.65
getBoundsMethod · 0.65
getProcessorMethod · 0.45
roundMethod · 0.45
setProcessorMethod · 0.45
setLocationMethod · 0.45
copyAttributesMethod · 0.45

Tested by

no test coverage detected