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

Method sortStack

ij/src/main/java/ij/util/DicomTools.java:26–36  ·  view source on GitHub ↗
(ImageStack stack, String[] strings)

Source from the content-addressed store, hash-verified

24 }
25
26 private static ImageStack sortStack(ImageStack stack, String[] strings) {
27 ImageProcessor ip = stack.getProcessor(1);
28 ImageStack stack2 = new ImageStack(ip.getWidth(), ip.getHeight(), ip.getColorModel());
29 for (int i=0; i<stack.size(); i++) {
30 int slice = (int)Tools.parseDouble(strings[i].substring(strings[i].length()-MAX_DIGITS), 0.0);
31 if (slice==0) return null;
32 stack2.addSlice(sliceLabels[slice-1], stack.getPixels(slice));
33 }
34 stack2.update(stack.getProcessor(1));
35 return stack2;
36 }
37
38 private static String[] getSortStrings(ImageStack stack, String tag) {
39 double series = getSeriesNumber(getSliceLabel(stack,1));

Callers 1

sortMethod · 0.95

Calls 11

getWidthMethod · 0.95
getHeightMethod · 0.95
getColorModelMethod · 0.95
parseDoubleMethod · 0.95
addSliceMethod · 0.95
updateMethod · 0.95
substringMethod · 0.80
lengthMethod · 0.65
getProcessorMethod · 0.45
sizeMethod · 0.45
getPixelsMethod · 0.45

Tested by

no test coverage detected