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 |
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 |
In reply to this post by Denis Rouede-2
This is a no frills method we've used. But it only works if the drift is truly a constant speed and direction. And it cuts off the edge of the images.
//===================================================================================== // This macro is not ready for general use because it requires entering numbers manually. // In its current state it moves the field a fixed amount per step and this amount is 1/22. macro "Drift Compensation" { setPasteMode("Copy"); for (i=0; i<nSlices; i++) { setSlice(i+1); makeRectangle(30, 24, 463, 466); run("Copy"); makeRectangle(30+(i/22), 24, 463, 466); // put dx and dy in this step run("Paste"); } // for i } // Drift Compensation ________________________________________________________ Michael Cammer, Assistant Research Scientist Skirball Institute of Biomolecular Medicine Lab: (212) 263-3208 Cell: (914) 309-3270 -----Original Message----- From: ImageJ Interest Group [mailto:[hidden email]] On Behalf Of Denis Rouede Sent: Thursday, June 23, 2011 8:31 AM To: [hidden email] Subject: correction for constant drift of the center of mass within a stack 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 ------------------------------------------------------------ This email message, including any attachments, is for the sole use of the intended recipient(s) and may contain information that is proprietary, confidential, and exempt from disclosure under applicable law. Any unauthorized review, use, disclosure, or distribution is prohibited. If you have received this email in error please notify the sender by return email and delete the original message. Please note, the recipient should check this email and any attachments for the presence of viruses. The organization accepts no liability for any damage caused by any virus transmitted by this email. ================================= |
In reply to this post by Jerome Mutterer-3
Please disregard my last message about the no frills macro. Jerome Mutterer's is much better and uses a command I overlooked, "Translate".
-Michael -----Original Message----- From: ImageJ Interest Group [mailto:[hidden email]] On Behalf Of Jerome Mutterer Sent: Thursday, June 23, 2011 4:00 PM To: [hidden email] Subject: Re: correction for constant drift of the center of mass within a stack 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 ------------------------------------------------------------ This email message, including any attachments, is for the sole use of the intended recipient(s) and may contain information that is proprietary, confidential, and exempt from disclosure under applicable law. Any unauthorized review, use, disclosure, or distribution is prohibited. If you have received this email in error please notify the sender by return email and delete the original message. Please note, the recipient should check this email and any attachments for the presence of viruses. The organization accepts no liability for any damage caused by any virus transmitted by this email. ================================= |
Free forum by Nabble | Edit this page |