Batch Z-stack, rotating file acording to 2 reference points

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Batch Z-stack, rotating file acording to 2 reference points

patsi
This post was updated on .
Good night
I would like to get some insights and help in how to write a Macro on Image J (I just started learning macros and I am not confortable yet) that allows me to:


1 - get from directory that I select a MMStack.ome file
2 - apply z-project of slices 1 to 7 , so, make a projection
3 - select a reference point (X,Y) on the image, that will define a left point (I must chose this X,Y with the mouse pointer)
4 - select a reference point (X,Y) on the image, that will define a right point (I must also chose)
5 - the line that consits of 3 to 4, (left and right point) will command the projection to rotate accordingly so that the line that I defined is horizontal. Paralel to the X axis.
6 - Crop a rectangular shape that I can define the size
7 - Do this to several files in a folder, so batch.

All files that I have are oriented/rotated randomly, since the images were acquired/filmed this way, so rotation is dependent of 2 points (X,Y) that I select individualy. In each projection I must choose 2 points.

Can I use batch option considering this? or can I design a macro that does everything but asks me for every projection to click the 2 points. This would be more suitable.

I appreciate all help.
example of two already z-stack projected .ome files