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

Method resampleArray

ij/src/main/java/ij/macro/Functions.java:6668–6683  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

6666 }
6667
6668 Variable[] resampleArray() {
6669 interp.getLeftParen();
6670 Variable[] a1 = getArray();
6671 int len1 = a1.length;
6672 int len2 = (int)getLastArg();
6673 if (len1 == 0 || len2<=0)
6674 interp.error("Cannot resample from or to zero-length");
6675 double[] d1 = new double[len1];
6676 for (int i=0; i<len1; i++)
6677 d1[i] = a1[i].getValue();
6678 double[] d2 = Tools.resampleArray(d1, len2);
6679 Variable[] a2 = new Variable[len2];
6680 for (int i=0; i<len2; i++)
6681 a2[i] = new Variable(d2[i]);
6682 return a2;
6683 }
6684
6685 Variable[] reverseArray() {
6686 interp.getLeftParen();

Callers 1

doArrayMethod · 0.95

Calls 6

getArrayMethod · 0.95
getLastArgMethod · 0.95
resampleArrayMethod · 0.95
getLeftParenMethod · 0.80
errorMethod · 0.45
getValueMethod · 0.45

Tested by

no test coverage detected