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

Method getShapeRoi

ij/src/main/java/ij/io/RoiDecoder.java:458–480  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

456 }
457
458 public Roi getShapeRoi() throws IOException {
459 int type = getByte(TYPE);
460 if (type!=rect)
461 throw new IllegalArgumentException("Invalid composite ROI type");
462 int top= getShort(TOP);
463 int left = getShort(LEFT);
464 int bottom = getShort(BOTTOM);
465 int right = getShort(RIGHT);
466 int width = right-left;
467 int height = bottom-top;
468 int n = getInt(SHAPE_ROI_SIZE);
469
470 ShapeRoi roi = null;
471 float[] shapeArray = new float[n];
472 int base = COORDINATES;
473 for(int i=0; i<n; i++) {
474 shapeArray[i] = getFloat(base);
475 base += 4;
476 }
477 roi = new ShapeRoi(shapeArray);
478 roi.setName(getRoiName());
479 return roi;
480 }
481
482 Roi getTextRoi(Roi roi, int version) {
483 Rectangle r = roi.getBounds();

Callers 1

getRoiMethod · 0.95

Calls 6

getByteMethod · 0.95
getShortMethod · 0.95
getIntMethod · 0.95
getFloatMethod · 0.95
getRoiNameMethod · 0.95
setNameMethod · 0.45

Tested by

no test coverage detected