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

Method makeStack

ij/src/main/java/ij/plugin/StackMaker.java:61–79  ·  view source on GitHub ↗
(ImageProcessor ip, int rows, int columns, int border)

Source from the content-addressed store, hash-verified

59 }
60
61 public ImageStack makeStack(ImageProcessor ip, int rows, int columns, int border) {
62 int stackSize = rows*columns;
63 int width = ip.getWidth()/columns;
64 int height = ip.getHeight()/rows;
65 //IJ.log("makeStack: "+rows+" "+columns+" "+border+" "+width+" "+height);
66 ImageStack stack = new ImageStack(width, height);
67 for (int y=0; y<rows; y++)
68 for (int x=0; x<columns; x++) {
69 ip.setRoi(x*width, y*height, width, height);
70 stack.addSlice(null, ip.crop());
71 }
72 if (border>0) {
73 int cropwidth = width-border-border/2;
74 int cropheight = height-border-border/2;
75 StackProcessor sp = new StackProcessor(stack,ip);
76 stack = sp.crop(border, border, cropwidth, cropheight);
77 }
78 return stack;
79 }
80}

Callers 1

runMethod · 0.95

Calls 6

addSliceMethod · 0.95
cropMethod · 0.95
getWidthMethod · 0.45
getHeightMethod · 0.45
setRoiMethod · 0.45
cropMethod · 0.45

Tested by

no test coverage detected