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

Method setMetadata

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

Source from the content-addressed store, hash-verified

4386 }
4387
4388 void setMetadata() {
4389 String metadata = null;
4390 String arg1 = getFirstString();
4391 if (interp.nextToken()==',')
4392 metadata = getLastString();
4393 else
4394 interp.getRightParen();
4395 ImagePlus imp = getImage();
4396 boolean isInfo = false;
4397 if (metadata==null) { // one argument
4398 metadata = arg1;
4399 if (imp.getStackSize()==1)
4400 isInfo = true;
4401 if (metadata.startsWith("Info:")) {
4402 metadata = metadata.substring(5);
4403 isInfo = true;
4404 }
4405 } else
4406 isInfo = arg1.startsWith("info") || arg1.startsWith("Info");
4407 if (metadata!=null && metadata.length()==0)
4408 metadata = null;
4409 if (isInfo)
4410 imp.setProperty("Info", metadata);
4411 else {
4412 imp.getStack().setSliceLabel(metadata, imp.getCurrentSlice());
4413 if (!Interpreter.isBatchMode()) imp.repaintWindow();
4414 }
4415 }
4416
4417 String getMetadata() {
4418 String type = "info";

Callers 1

doFunctionMethod · 0.95

Calls 15

getFirstStringMethod · 0.95
getLastStringMethod · 0.95
getImageMethod · 0.95
getStackSizeMethod · 0.95
setPropertyMethod · 0.95
getStackMethod · 0.95
getCurrentSliceMethod · 0.95
isBatchModeMethod · 0.95
repaintWindowMethod · 0.95
getRightParenMethod · 0.80
startsWithMethod · 0.80
substringMethod · 0.80

Tested by

no test coverage detected