Login  Register

Re: correction for constant drift of the center of mass within a stack

Posted by Jerome Mutterer-3 on Jun 23, 2011; 8:00pm
URL: http://imagej.273.s1.nabble.com/correction-for-constant-drift-of-the-center-of-mass-within-a-stack-tp3684139p3684140.html

Denis
If the drift is constant, measure the positions of centers of mass of a
reference object in the first and in the last image. This should give you
the total drift. Then, correct for i/(totaldrift) for each slice, using the
"Translate..." command in a loop.
Jerome.

////////
Dialog.create('stack drift');
  Dialog.addNumber('xdrift',10);
  Dialog.addNumber('ydrift',10);
Dialog.show();
dx=Dialog.getNumber();
dy=Dialog.getNumber();
for (i=0;i<nSlices;i++) {
setSlice(i+1);
x=dx*i/nSlices; y=dy*i/nSlices;
run("Translate...", "x=&x y=&y interpolation=Bilinear");
}
///////

On Thu, Jun 23, 2011 at 2:31 PM, Denis Rouede <[hidden email]>
wrote:
>
> dear Sir , Mme
>
> I am working with  a stack of images.
>
> Each image of the stack shows objects at different locations.
>
> Ideally, the center of mass of these objects is the same for each image of
the stack.
>
> I have noticed a constant drift of this center of mass and I would like to
correct all images from this drift.
>
>
> Turboreg reg does not work because the objects are different for each
image of the stack.
>
> thank you if someone can help
>
> denis