Arbitrary/random line through sections stack

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

Arbitrary/random line through sections stack

AAM71
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?

--
Dr. Aleksandr Mironov
E-mail: [hidden email]

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Arbitrary/random line through sections stack

Michael Schmid-3
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
Reply | Threaded
Open this post in threaded view
|

Re: Arbitrary/random line through sections stack

AAM71
Thank you Michael!
That is very similar to what I want. I just need to make minor modifications.

Sincerely,
Alex

________________________________________
From: Michael Schmid [[hidden email]]
Sent: 24 January 2018 19:43
To: [hidden email]
Subject: Re: Arbitrary/random line through sections stack

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

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