Split picture into grid7/3/2023 I’m sure it can be adapted to add user selections for not splitting in z, but the z split was what I found most int(label=“How many divisions (e.g. Here’s my solution for the stack splitting. Print(“Position (after): “+channel+”, “+slice+”, “+frame) Ĭall(“ij.”, locX + offsetX, locY + offsetY) Print("Position (before): “+channel+”, “+slice+”, "+frame) Stack.getPosition(channel, slice, frame) GetDimensions(w, h, channels, slices, frames) N = getNumber(“How many divisions (e.g., 2 means quarters)?”, 2) Now I just have to figure out how to recreate my two channel stacks for each part. I really have no idea what I am doing and am shocked it worked for me. I modified scripts uploaded by and Matthew above: I have called the Macro “ChopStack”. Hi all, I had a similar question (I wanted to divide a STACK into several parts - not just the image and I wanted to make sure everything was labelled uniquely in a logical manner). Too - if you want to then merge those images into a stack at the end… after the close() call - just add this line: run("Images to Stack", "name=Stack title= use") and all those tiles will be merged into a single stack. Introduction into Macro Programming page of the wiki.A helpful workshop on Scripting with Fiji - the slides are here. Here are some helpful links on Scripting in ImageJ/Fiji: How to split the image Vertically Horizontally Both (grid) Vertically Split by. You can adapt this script as you see fit. MakeRectangle(offsetX, offsetY, tileWidth, tileHeight) GetLocationAndSize(locX, locY, sizeW, sizeH) Ĭall("ij.", locX + offsetX, locY + offsetY) This macro chops an image into NxN tiles, where N is the number Had answered a similar question on the listserv awhile back… He presented this macro that will divide up an image into equal parts chosen by the user - I just updated it a bit using Script Parameters: int(label="How many divisions (e.g., 2 means quarters)?") n
0 Comments
Leave a Reply. |