Hello EveryOne,
I am using imagej tools for opening my images. for changing the image window width and center imagej provides setMinAndMax() So according to that min and max window level is set. But my purpose is to by changing the Window width and window center i have to set min and max Example:- Suppose Min = -32733 , Max = 32883 then WindowCenter = (Max + Min)/2 = (32883 -32733)/2 = 150/2 = 75 WindowWidth = (Max - Min) = 32 But How to calculate min and max from Window Width and window center. With Warm Regards -------------------------------------------------------------------- Prashant Chandrakar Software Developer MedSynaptic Pvt Ltd 9270710943 [hidden email] "If the facts don't fit the theory, change the facts." |
Prashant,
If you are asking an algebra question, the answer is Min = WindowCenter - WindowWidth/2; Max = WindowCenter + WindowWidth/2; You can derive this graphically or by solving the simultaneous equations you gave. (In the example, should it read (Max - Min) = 32883 - (-32733) = 65616 ?) Bob Robert P. Dougherty, Ph.D. President, OptiNav, Inc. Phone (425) 990-5912 Fax (425) 467-1119 www.optinav.com > WindowCenter = (Max + Min)/2 = (32883 -32733)/2 = 150/2 = 75 > WindowWidth = (Max - Min) = 32 > But How to calculate min and max from Window Width and window center. > > |
Hi,
Thanks for you reply, Actually its very different for signed and unsigned images. currently i derive a formula which is reverse of those formula which calculates window width and window center from min and max. i.e it calculate min and max from window width and center see min - max = WW -------eq1 (max + min)/2 = WC ----- eq2 So finally by solving these equations we get min = (2 * WC - WW)/2 max = WW + min So if i want to adjust WW = 1880 and WC = 950 then by formula min = (2 * 950 - 1880)/2 = 10 max =1880 + 10 = 1890 but image is not looking good respetive to my min and max. Please tell are i am doing anything wrong? ----- Original Message ----- From: "Robert Dougherty" <[hidden email]> To: <[hidden email]> Sent: Monday, October 20, 2008 8:28 PM Subject: Re: how to calculate min and max of images Prashant, If you are asking an algebra question, the answer is Min = WindowCenter - WindowWidth/2; Max = WindowCenter + WindowWidth/2; You can derive this graphically or by solving the simultaneous equations you gave. (In the example, should it read (Max - Min) = 32883 - (-32733) = 65616 ?) Bob Robert P. Dougherty, Ph.D. President, OptiNav, Inc. Phone (425) 990-5912 Fax (425) 467-1119 www.optinav.com > WindowCenter = (Max + Min)/2 = (32883 -32733)/2 = 150/2 = 75 > WindowWidth = (Max - Min) = 32 > But How to calculate min and max from Window Width and window center. > > |
In reply to this post by Prashant-2-3
Hi Prashant,
Can you be more specific about what you mean by, "not looking good"? -- Harry Parker Senior Imaging Systems Engineer Digital Imaging Systems, Inc. ----- Original Message ---- From: prashant <[hidden email]> To: [hidden email] Sent: Tuesday, October 21, 2008 1:25:40 AM Subject: Re: how to calculate min and max of images Hi, Thanks for you reply, Actually its very different for signed and unsigned images. currently i derive a formula which is reverse of those formula which calculates window width and window center from min and max. i.e it calculate min and max from window width and center see min - max = WW -------eq1 (max + min)/2 = WC ----- eq2 So finally by solving these equations we get min = (2 * WC - WW)/2 max = WW + min So if i want to adjust WW = 1880 and WC = 950 then by formula min = (2 * 950 - 1880)/2 = 10 max =1880 + 10 = 1890 but image is not looking good respetive to my min and max. Please tell are i am doing anything wrong? ----- Original Message ----- From: "Robert Dougherty" <[hidden email]> To: <[hidden email]> Sent: Monday, October 20, 2008 8:28 PM Subject: Re: how to calculate min and max of images Prashant, If you are asking an algebra question, the answer is Min = WindowCenter - WindowWidth/2; Max = WindowCenter + WindowWidth/2; You can derive this graphically or by solving the simultaneous equations you gave. (In the example, should it read (Max - Min) = 32883 - (-32733) = 65616 ?) Bob Robert P. Dougherty, Ph.D. President, OptiNav, Inc. Phone (425) 990-5912 Fax (425) 467-1119 www.optinav.com > WindowCenter = (Max + Min)/2 = (32883 -32733)/2 = 150/2 = 75 > WindowWidth = (Max - Min) = 32 > But How to calculate min and max from Window Width and window center. > > |
Free forum by Nabble | Edit this page |