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

Method toIntR

ij/src/main/java/ij/gui/Roi.java:2550–2556  ·  view source on GitHub ↗

Converts a float array to an int array using rounding.

(float[] arr)

Source from the content-addressed store, hash-verified

2548
2549 /** Converts a float array to an int array using rounding. */
2550 public static int[] toIntR(float[] arr) {
2551 int n = arr.length;
2552 int[] temp = new int[n];
2553 for (int i=0; i<n; i++)
2554 temp[i] = (int)Math.floor(arr[i]+0.5);
2555 return temp;
2556 }
2557
2558 /** Converts an int array to a float array. */
2559 public static float[] toFloat(int[] arr) {

Callers 9

runMethod · 0.95
getConvexHullMethod · 0.95
getXCoordinatesMethod · 0.80
getYCoordinatesMethod · 0.80
getPolygonMethod · 0.80
getPolygonMethod · 0.80
createRoiMethod · 0.80
getPolygonMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected