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

Method getTag

ij/src/main/java/ij/util/DicomTools.java:120–130  ·  view source on GitHub ↗

Returns the value (as a string) of the specified DICOM tag id (in the form "0018,0050") of the specified image or stack slice. Returns null if the tag id is not found.

(ImagePlus imp, String id)

Source from the content-addressed store, hash-verified

118 /** Returns the value (as a string) of the specified DICOM tag id (in the form "0018,0050")
119 of the specified image or stack slice. Returns null if the tag id is not found. */
120 public static String getTag(ImagePlus imp, String id) {
121 String metadata = null;
122 if (imp.getStackSize()>1) {
123 ImageStack stack = imp.getStack();
124 String label = stack.getSliceLabel(imp.getCurrentSlice());
125 if (label!=null && label.indexOf('\n')>0) metadata = label;
126 }
127 if (metadata==null)
128 metadata = (String)imp.getProperty("Info");
129 return getTag(metadata, id);
130 }
131
132 /** Returns the name of the specified DICOM tag id. */
133 public static String getTagName(String id) {

Callers 3

getStringPropertyMethod · 0.95
getVoxelDepthMethod · 0.95
getNumericTagMethod · 0.95

Calls 8

getSliceLabelMethod · 0.95
getCurrentSliceMethod · 0.80
charAtMethod · 0.80
substringMethod · 0.80
getStackSizeMethod · 0.45
getStackMethod · 0.45
indexOfMethod · 0.45
getPropertyMethod · 0.45

Tested by

no test coverage detected