Login  Register

Re: Arbitrary/random line through sections stack

Posted by Michael Schmid on Jan 24, 2018; 7:43pm
URL: http://imagej.273.s1.nabble.com/Arbitrary-random-line-through-sections-stack-tp5019933p5019945.html

Hi Aleksandr,

it is not really clear to me what you want to do.
Is it the following?
(1) Define a point in the first slice and a (different) point in the
last slice
(2) Determine the intersection points of the line between these two
slices and mark them in each image

Then it can be easily done in a macro, roughly like this:
setTool("point");
setSlice(1);
waitForUser("Select point on slice 1, then press OK");
getSelectionBounds(x1, y1, width, height);
setSlice(nSlices());
waitForUser("Select point on last slice, then press OK");
getSelectionBounds(xE, yE, width, height);
roiManager("Associate", "true");
for (i=1; i<= nSlices(); i++) {
   setSlice(i);
   x = x1 + (i-1)*(xE-x1)/(nSlices()-1);
   y = y1 + (i-1)*(yE-y1)/(nSlices()-1);
   makePoint(x, y);
   run("Add Selection...");//roiManager("Add");
}
run("Select None");

Michael
________________________________________________________________
On 23/01/2018 11:15, Aleksandr Mironov wrote:
> Dear All,
>
> Could you, please, suggest how to make an overlay of  line going through
> the volume in a arbitrary/random direction, so that every slice of 3D
> stack will have a projection of this line. Is it possible to do this by
> means of macro language?
>

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html