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

Method getStringProperty

ij/src/main/java/ij/ImagePlus.java:1551–1570  ·  view source on GitHub ↗

Returns the string value from the "Info" property string associated with 'key', or null if the key is not found. Works with DICOM tags and Bio-Formats metadata. @see #getNumericProperty @see #getInfoProperty @see #getProp @see #setProp

(String key)

Source from the content-addressed store, hash-verified

1549 * @see #setProp
1550 */
1551 public String getStringProperty(String key) {
1552 if (key==null)
1553 return null;
1554 if (isDicomTag(key))
1555 return DicomTools.getTag(this, key);
1556 if (getStackSize()>1) {
1557 ImageStack stack2 = getStack();
1558 String label = stack2.getSliceLabel(getCurrentSlice());
1559 if (label!=null && label.indexOf('\n')>0) {
1560 String value = getStringProperty(key, label);
1561 if (value!=null)
1562 return value;
1563 }
1564 }
1565 Object obj = getProperty("Info");
1566 if (obj==null || !(obj instanceof String))
1567 return null;
1568 String info = (String)obj;
1569 return getStringProperty(key, info);
1570 }
1571
1572 private boolean isDicomTag(String key) {
1573 if (key.length()!=9 || key.charAt(4)!=',')

Callers 5

getNumericPropertyMethod · 0.95
getPropMethod · 0.95
getInfoMethod · 0.95
doPropertyMethod · 0.95
infoMethod · 0.80

Calls 11

isDicomTagMethod · 0.95
getTagMethod · 0.95
getStackSizeMethod · 0.95
getStackMethod · 0.95
getSliceLabelMethod · 0.95
getCurrentSliceMethod · 0.95
getPropertyMethod · 0.95
findKeyMethod · 0.95
substringMethod · 0.80
lengthMethod · 0.65
indexOfMethod · 0.45

Tested by

no test coverage detected