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

Method sortDicom

ij/src/main/java/ij/VirtualStack.java:421–433  ·  view source on GitHub ↗
(String[] strings, String[] info, int maxDigits)

Source from the content-addressed store, hash-verified

419 }
420
421 public ImageStack sortDicom(String[] strings, String[] info, int maxDigits) {
422 int n = size();
423 String[] names2 = new String[n];
424 for (int i=0; i<n; i++)
425 names2[i] = names[i];
426 for (int i=0; i<n; i++) {
427 int slice = (int)Tools.parseDouble(strings[i].substring(strings[i].length()-maxDigits), 0.0);
428 if (slice==0) return null;
429 names[i] = names2[slice-1];
430 labels[i] = info[slice-1];
431 }
432 return this;
433 }
434
435 /** Returns the ImagePlus Properties assoctated with the current slice, or null. */
436 public Properties getProperties() {

Callers 1

sortMethod · 0.80

Calls 4

sizeMethod · 0.95
parseDoubleMethod · 0.95
substringMethod · 0.80
lengthMethod · 0.65

Tested by

no test coverage detected