ImageStack unpad(ImageStack stack) { Object w = imp.getProperty("FFT width"); Object h = imp.getProperty("FFT height"); if (w==null || h==null) return stack; int width = (int)Tools.parseDouble((String)w, 0.0); int height = (int)Tools.parseDouble((String)h, 0.0); if (width==0 || height==0 || (width==stack.getWidth()&&height==stack.getHeight())) return stack; StackProcessor sp = new StackProcessor(stack, null); ImageStack stack2 = sp.crop(0, 0, width, height); return stack2; }
ImageStack unpad(ImageStack stack) { Object w = imp.getProperty("FFT width"); Object h = imp.getProperty("FFT height"); if (w==null || h==null) return stack; int width = (int)Tools.parseDouble((String)w, 0.0); int height = (int)Tools.parseDouble((String)h, 0.0); if (width==0 || height==0 || (width==stack.getWidth()&&height==stack.getHeight())) return stack; StackProcessor sp = new StackProcessor(stack, null); ImageStack stack2 = sp.crop(0, 0, width, height); return stack2; }
public ImageStack makeStack(ImageProcessor ip, int rows, int columns, int border) { int stackSize = rows*columns; int width = ip.getWidth()/columns; int height = ip.getHeight()/rows; //IJ.log("makeStack: "+rows+" "+columns+" "+border+" "+width+" "+height); ImageStack stack = new ImageStack(width, height); for (int y=0; y<rows; y++) for (int x=0; x<columns; x++) { ip.setRoi(x*width, y*height, width, height); stack.addSlice(null, ip.crop()); } if (border>0) { int cropwidth = width-border-border/2; int cropheight = height-border-border/2; StackProcessor sp = new StackProcessor(stack,ip); stack = sp.crop(border, border, cropwidth, cropheight); } return stack; } }
public ImageStack makeStack(ImageProcessor ip, int rows, int columns, int border) { int stackSize = rows*columns; int width = ip.getWidth()/columns; int height = ip.getHeight()/rows; //IJ.log("makeStack: "+rows+" "+columns+" "+border+" "+width+" "+height); ImageStack stack = new ImageStack(width, height); for (int y=0; y<rows; y++) for (int x=0; x<columns; x++) { ip.setRoi(x*width, y*height, width, height); stack.addSlice(null, ip.crop()); } if (border>0) { int cropwidth = width-border-border/2; int cropheight = height-border-border/2; StackProcessor sp = new StackProcessor(stack,ip); stack = sp.crop(border, border, cropwidth, cropheight); } return stack; } }