Login  Register

Re: Type conversion

Posted by karo03 on Mar 05, 2007; 5:29pm
URL: http://imagej.273.s1.nabble.com/Type-conversion-tp3700176p3700178.html

Thank you for the quick answer, I could not read it out from the  
mentioned routine (no Java capabilites):
     /** Converts a ShortProcessor to a ByteProcessor. */
     ByteProcessor convertShortToByte() {
         if (doScaling) {
             Image img = ip.createImage();
             return new ByteProcessor(img);
         } else {

Karsten

Am 05.03.2007 um 18:17 schrieb Michael Schmid:

> Hi Karsten,
>
> have a look at the Browseable Sourcecode under Developer Resources,
> http://rsb.info.nih.gov/ij/developer/source/index.html
> In TypeConverter
> http://rsb.info.nih.gov/ij/developer/source/ij/process/ 
> TypeConverter.java.html
> you will find convertShortToByte().
>
> Without scaling (Edit/Options/Conversions Scale when converting):
>
>   16-bit values between 0 and 255 are unchanged, larger values  
> become 255.
>
> With scaling:
>
>   Gray values as on the screen (i.e., those set by Image/Adjust/
> Brightness&Contrast) are used.
>
> Michael
> ________________________________________________________________
>
> On 5 Mar 2007, at 18:02, Karsten Rodenacker wrote:
>
>> Hi,
>> does anybody know how the 16-bit to 8-bit type conversion is  
>> exactly done in ImageJ?
>>
>> Thanks
>> Karsten