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

Method getSliceLabel

ij/src/main/java/ij/VirtualStack.java:350–366  ·  view source on GitHub ↗

Returns the label of the Nth image.

(int n)

Source from the content-addressed store, hash-verified

348
349 /** Returns the label of the Nth image. */
350 public String getSliceLabel(int n) {
351 if (isTranslatingIndices())
352 n = translate(n);
353 if (labels==null)
354 return null;
355 String label = (n<=labels.length) ? labels[n-1] : null; //subclass may have grown stack without adding labels
356 if (names == null)
357 return label;
358 if (label==null)
359 return names[n-1];
360 else {
361 if (label.startsWith("Label: ")) // slice label
362 return label.substring(7,label.length());
363 else
364 return names[n-1]+"\n"+label;
365 }
366 }
367
368 /** Returns null. */
369 public Object[] getImageArray() {

Callers 2

saveImageMethod · 0.95
getProcessorMethod · 0.45

Calls 5

isTranslatingIndicesMethod · 0.95
translateMethod · 0.95
startsWithMethod · 0.80
substringMethod · 0.80
lengthMethod · 0.65

Tested by

no test coverage detected