rescaling a gray scale image

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

rescaling a gray scale image

SUBSCRIBE IMAGEJ J Pirayesh
Hi everybody

I am studying on 3D gray scale images by ImageJ.I want to rescale the gray scale values of the images, that is shown by pointing in everywhere on the image, to my predefined scale, for example 0-10. Could you please guide me that the program have such an ability, and/or is there a macro or plugin for such a rescaling?

best regards
Reply | Threaded
Open this post in threaded view
|

Re: rescaling a gray scale image

Rasband, Wayne (NIH/NIMH) [E]
On Feb 4, 2012, at 2:27 AM, SUBSCRIBE IMAGEJ J Pirayesh wrote:

> Hi everybody
>
> I am studying on 3D gray scale images by ImageJ.I want to rescale the gray scale values of the images, that is shown by pointing in everywhere on the image, to my predefined scale, for example 0-10. Could you please guide me that the program have such an ability, and/or is there a macro or plugin for such a rescaling?

You can rescale an image using a simple macro.

  newMax = 10;
  getRawStatistics(nPixels, mean, min, max);
  run("Subtract...", "value=&min");
  scale = newMax/(max-min);
  run("Multiply...", "value=&scale");
  setMinAndMax(0, newMax);

-wayne
Reply | Threaded
Open this post in threaded view
|

Re: rescaling a gray scale image

SUBSCRIBE IMAGEJ J Pirayesh
In reply to this post by SUBSCRIBE IMAGEJ J Pirayesh
Hi Dear Rasband Wayne

Greatly thanks for your respond on rescaling an Image,But I want the newMax can be selectable for running the macro, and not be a fixed number,such as 10.In the other word, during running the macro, the program need to the user define a newMax number!
Is that possible to add such an ability for the macro?

Best regards
Reply | Threaded
Open this post in threaded view
|

Re: rescaling a gray scale image

Gabriel Landini
On Saturday 04 Feb 2012 17:09:36 you wrote:
> Greatly thanks for your respond on rescaling an Image,But I want the newMax
> can be selectable for running the macro, and not be a fixed number,such as
> 10.In the other word, during running the macro, the program need to the
> user define a newMax number!
> Is that possible to add such an ability for the macro?

You can't process the pixel data and go back because after all you pixel
values have been converted to something else and you want to readjust, where
is the original data? (There is an undo function, but it seems a very
inefficient way of doing it).

What about using the Adjust Brightness applet and use the sliders?

That is fast because it is only 256 LUT values to process. When you are happy,
you just Apply the transformation.

G.
Reply | Threaded
Open this post in threaded view
|

Re: rescaling a gray scale image

SUBSCRIBE IMAGEJ J Pirayesh
In reply to this post by SUBSCRIBE IMAGEJ J Pirayesh
Dear Wayne

I am studying on the DICOM images produced by SPECT from radioisotope scanning of an organ. I found the ImageJ is an effective program  for my images. In the imaging technique, images and/or projections prepared from different views, for example 180 degrees, and therefore, there is an SPECT file with some number of views around the organ, named here as a DICOM image file. So from the ImageJ point of view, This file contained with a series of images. According to your final macro, I can simply define image radioisotopic dose distribution on an image  by the gray scale value from in a series that was shown in an opened file, without modification on the image, but other images in the file were shown with a change in the density. If your macro also works on the images similar to the image that rescaled without changing the density, That will be the macro that I consider for my studying.

Best wishes

Jalil