I’m looking write a macro that will analyse cells at the ‘top’, center and ‘bottom’ of my sample. I was thinking to do this by selecting a slice in my z-stack that was close to the start of stack as the top (e.g. 10 slices in, as sample is inverted) then the center slice and then close to the end (e.g. 10 slices away from the end of the stack).
My way of going about this was to create a substack of just one slice from each of these positions using the code run(“Make Substack…”, “slices=__”) so
E.g. run(“Make Substack…”, “slices=10”); would be the slice I analyse as top of my sample.
The command nSlices tells you how you how many slices there are in your stack.
I was thinking I could make a variables e.g. centerSlice= nSlices/2 and bottomSlice= nSlices - 10
and use these in the code
e.g. run(“Make Substack…”, “slices= “centerSlice””); and this would pick out the slice in the middle of the stack for me to analyse on its own.
This isn’t working for two reasons:
- This code run(“Make Substack…”, " slices= "); will not accept my variable name as the input after “slices= ____”.
- Depending on the stack when dividing it by 2 it might not be a whole number. The code run(“Make Substack…”, “slices=___” will not work with a fraction.
If anyone has any suggestions about how I can alter the above code so it works or go about the task in a different way I would really appreciate the help