Hi
I am interested in measuring the moment of inertia of a bone slice. Can this be done in ImageJ? Thank you Debby Schneider |
This macro might be a start. It uses the center of mass as the axis of
rotation, assumed perpendicular to the image. (The conversion for a different axis appears to be to add Md^2 according to the "parallel axis theorem for moments of inertia," where M is the total mass and d is the displacement to the new axis.) The macro presumably needs to be calibrated to convert pixels into length units and image levels into mass. Bob Robert P. Dougherty, Ph.D. President, OptiNav, Inc. Phone (425) 467-1118 Fax (425) 467-1119 www.optinav.com // Find the center of mass getBoundingRect(x1, y1, width, height); xSum = 0; ySum = 0; sum = 0; x2 = x1 + width; y2 = y1 + height; for (x=x1; x<x2; x++) { for (y=y1; y<y2; y++) { v = getPixel(x, y); xSum += v*x; ySum += v*y; sum += v; } } x0 = xSum/sum; y0 = ySum/sum; // Find the moment of inertia about the center of mass moment = 0; for (x=x1; x<x2; x++) { for (y=y1; y<y2; y++) { v = getPixel(x, y); rSq = (x-x0)*(x-x0) + (y-y0)*(y-y0); moment = moment + v*rSq; } } print(x0+" "+y0+" "+moment); > -----Original Message----- > From: ImageJ Interest Group [mailto:[hidden email]] On Behalf Of > Debra K Schneider > Sent: Wednesday, February 22, 2006 8:18 AM > To: [hidden email] > Subject: Moment of inertia calculations > > Hi > I am interested in measuring the moment of inertia of a bone slice. > Can this be done in ImageJ? > Thank you > Debby Schneider |
In reply to this post by Debra K Schneider
Hi Debby,
I have a plugin that does just this, which we have used successfully on bone fracture surfaces that were scanned on a flatbed scanner. Its not very user friendly, I'm afraid, as I wrote it in a hurry for one job only and have not had time to pretty it up since (a familiar story to all I suspect...) Rather than burden the list with binary attachments, I have sent the .zip file direct to you, and also to Wayne to see if it is up to inclusion on the main ImageJ site. Rob. -- Robert Day ph +61 8 9224 3227 Project Bioengineer fax +61 8 9224 1138 Royal Perth Hospital [hidden email] > -----Original Message----- > From: ImageJ Interest Group [mailto:[hidden email]] > Sent: Thursday, 23 February 2006 12:18 AM > To: [hidden email] > Subject: Moment of inertia calculations > > > Hi > I am interested in measuring the moment of inertia of a bone slice. > Can this be done in ImageJ? > Thank you > Debby Schneider > |
In reply to this post by Robert Dougherty
MOMENTOS DE INERCIA
----- Original Message ----- From: "Robert Dougherty" <[hidden email]> To: <[hidden email]> Sent: Thursday, February 23, 2006 1:48 AM Subject: Re: Moment of inertia calculations > This macro might be a start. It uses the center of mass as the axis of > rotation, assumed perpendicular to the image. (The conversion for a > different axis appears to be to add Md^2 according to the "parallel axis > theorem for moments of inertia," where M is the total mass and d is the > displacement to the new axis.) The macro presumably needs to be calibrated > to convert pixels into length units and image levels into mass. > > Bob > > Robert P. Dougherty, Ph.D. > President, OptiNav, Inc. > Phone (425) 467-1118 > Fax (425) 467-1119 > www.optinav.com > > > // Find the center of mass > > getBoundingRect(x1, y1, width, height); > xSum = 0; > ySum = 0; > sum = 0; > x2 = x1 + width; > y2 = y1 + height; > for (x=x1; x<x2; x++) { > for (y=y1; y<y2; y++) { > v = getPixel(x, y); > xSum += v*x; > ySum += v*y; > sum += v; > } > } > x0 = xSum/sum; > y0 = ySum/sum; > > // Find the moment of inertia about the center of mass > > moment = 0; > for (x=x1; x<x2; x++) { > for (y=y1; y<y2; y++) { > v = getPixel(x, y); > rSq = (x-x0)*(x-x0) + (y-y0)*(y-y0); > moment = moment + v*rSq; > } > } > print(x0+" "+y0+" "+moment); > > > > > > -----Original Message----- > > From: ImageJ Interest Group [mailto:[hidden email]] On Behalf Of > > Debra K Schneider > > Sent: Wednesday, February 22, 2006 8:18 AM > > To: [hidden email] > > Subject: Moment of inertia calculations > > > > Hi > > I am interested in measuring the moment of inertia of a bone slice. > > Can this be done in ImageJ? > > Thank you > > Debby Schneider > |
In reply to this post by Day, Robert
Only a comment,
The algorithm below is for the component 1,1 of the tensor of inertia. The other components must be also calculated (20, and 02). These terms are analogous to the 1,1 component but using a sum with (x-x0)*(x-x0) and (y-y0)*(y-y0). Then, the matrix can be diagonalized for obtaining the main moments of inertia (in the main directions). Am I right? Day, Robert wrote: >Hi Debby, > >I have a plugin that does just this, which we have used successfully on bone fracture surfaces that were scanned on a flatbed scanner. Its not very user friendly, I'm afraid, as I wrote it in a hurry for one job only and have not had time to pretty it up since (a familiar story to all I suspect...) > >Rather than burden the list with binary attachments, I have sent the .zip file direct to you, and also to Wayne to see if it is up to inclusion on the main ImageJ site. > >Rob. >-- >Robert Day ph +61 8 9224 3227 >Project Bioengineer fax +61 8 9224 1138 >Royal Perth Hospital [hidden email] > > > >>-----Original Message----- >>From: ImageJ Interest Group [mailto:[hidden email]] >>Sent: Thursday, 23 February 2006 12:18 AM >>To: [hidden email] >>Subject: Moment of inertia calculations >> >> >>Hi >>I am interested in measuring the moment of inertia of a bone slice. >>Can this be done in ImageJ? >>Thank you >>Debby Schneider >> >> >> > > > > |
In reply to this post by Debra K Schneider
Dear Bob,
Thank you for the macro that calculate the center of mass. Could you tell me how to calculate the "center of Grey"? Thank you very much. Best regards df > ---------- > From: Robert Dougherty > Reply To: List IMAGEJ > Sent: Wednesday, February 22, 2006 7:48 PM > To: List IMAGEJ > Subject: Re: Moment of inertia calculations > > This macro might be a start. It uses the center of mass as the axis of > rotation, assumed perpendicular to the image. (The conversion for a > different axis appears to be to add Md^2 according to the "parallel axis > theorem for moments of inertia," where M is the total mass and d is the > displacement to the new axis.) The macro presumably needs to be calibrated > to convert pixels into length units and image levels into mass. > > Bob > > Robert P. Dougherty, Ph.D. > President, OptiNav, Inc. > Phone (425) 467-1118 > Fax (425) 467-1119 > www.optinav.com > > > // Find the center of mass > > getBoundingRect(x1, y1, width, height); > xSum = 0; > ySum = 0; > sum = 0; > x2 = x1 + width; > y2 = y1 + height; > for (x=x1; x<x2; x++) { > for (y=y1; y<y2; y++) { > v = getPixel(x, y); > xSum += v*x; > ySum += v*y; > sum += v; > } > } > x0 = xSum/sum; > y0 = ySum/sum; > > // Find the moment of inertia about the center of mass > > moment = 0; > for (x=x1; x<x2; x++) { > for (y=y1; y<y2; y++) { > v = getPixel(x, y); > rSq = (x-x0)*(x-x0) + (y-y0)*(y-y0); > moment = moment + v*rSq; > } > } > print(x0+" "+y0+" "+moment); > > > > > > -----Original Message----- > > From: ImageJ Interest Group [mailto:[hidden email]] On Behalf Of > > Debra K Schneider > > Sent: Wednesday, February 22, 2006 8:18 AM > > To: [hidden email] > > Subject: Moment of inertia calculations > > > > Hi > > I am interested in measuring the moment of inertia of a bone slice. > > Can this be done in ImageJ? > > Thank you > > Debby Schneider > > |
df,
I am not familiar with that expression. Where did you find it? Bob > -----Original Message----- > From: ImageJ Interest Group [mailto:[hidden email]] On Behalf Of Liu, > Dongfang (NIH/NIAID) [E] > Sent: Thursday, February 23, 2006 5:53 AM > To: [hidden email] > Subject: Re: Moment of inertia calculations > > Dear Bob, > > Thank you for the macro that calculate the center of mass. > Could you tell me how to calculate the "center of Grey"? > Thank you very much. > > Best regards > df > > |
In reply to this post by Pablo Domínguez García
If the 3rd direction is perpendicular to the image, then the macro computes
the (3,3) element of the inertia tensor. If the object is really a 2-D slice, then I33 will turn out to be one of the principle moments, since I13, I23, I31, and I32 are 0 (since the CM is clearly in the plane). In this case, assuming the angular velocity vector is perpendicular to the image, the rotational kinetic energy is (1/2)I33*(omega3)^2 and the angular momentum in the third direction is I33*omega3. For rotations with the angular velocity parallel to the image, or with a real 3D object, it would be necessary to compute more of the tensor. Before putting more effort into this, it would be good to understand the 3D problem better. Bob Robert P. Dougherty, Ph.D. President, OptiNav, Inc. Phone (425) 467-1118 Fax (425) 467-1119 www.optinav.com > -----Original Message----- > From: ImageJ Interest Group [mailto:[hidden email]] On Behalf Of > Pablo Domínguez García > Sent: Thursday, February 23, 2006 4:02 AM > To: [hidden email] > Subject: Re: Moment of inertia calculations > > Only a comment, > > The algorithm below is for the component 1,1 of the tensor of inertia. > The other components must be also calculated (20, and 02). These terms > are analogous to the 1,1 component but using a sum with (x-x0)*(x-x0) > and (y-y0)*(y-y0). > > Then, the matrix can be diagonalized for obtaining the main moments of > inertia (in the main directions). > > Am I right? > > |
In reply to this post by Debra K Schneider
I also am unsure of the original poster's problem.
In my case, I used the moments of the section to calculate the bending properties of the bone, so I use Ixx & Iyy about the centroid, along a user defined bending axis. The principal axes and Iz are there too, but I don't use them in the final output. As Bob said, it depends on what Debra is after... Rob. -- Robert Day ph +61 8 9224 3227 Project Bioengineer fax +61 8 9224 1138 Royal Perth Hospital [hidden email] > -----Original Message----- > From: ImageJ Interest Group [mailto:[hidden email]] > Sent: Friday, 24 February 2006 2:51 AM > To: [hidden email] > Subject: Re: Moment of inertia calculations > > <snip> > be necessary to compute more of the tensor. Before putting > more effort into > this, it would be good to understand the 3D problem better. > > Bob > > Robert P. Dougherty, Ph.D. > President, OptiNav, Inc. > Phone (425) 467-1118 > Fax (425) 467-1119 > www.optinav.com > |
Free forum by Nabble | Edit this page |