Login  Register

16bit binary

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options Options
Embed post
Permalink
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

16bit binary

Benito Alarcon
6 posts
Dear all, in order to operate between 16bit images we would need to
get a binary image. The binary that we obtain in ImageJ is a 8bit. Is
it possible to get a 16bit binary which values were 0 and 65535?.
Sorry if this is an obvious question, I am new in this area. Thanks in advance  

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

Re: 16bit binary

Robert Lockwood
77 posts
You have another problem as Java doesn't support unsigned shorts if you
really need the value 65535 you need to use an int.  If you need a short
with all the bits set and you are not interpreting it the value is -32767,
but someone else will need to reply for an ImageJ method to do that.


On Mon, Mar 31, 2014 at 12:21 AM, Benito Alarcon <[hidden email]>wrote:

> Dear all, in order to operate between 16bit images we would need to get a
> binary image. The binary that we obtain in ImageJ is a 8bit. Is it possible
> to get a 16bit binary which values were 0 and 65535?. Sorry if this is an
> obvious question, I am new in this area. Thanks in advance
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>



--
When I was 12 I thought I would live forever.
So far, so good.

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

Re: 16bit binary

Gabriel Landini
1783 posts
 On Mon, Mar 31, 2014 at 12:21 AM, Benito Alarcon <[hidden email]>wrote:
> Dear all, in order to operate between 16bit images we would need to get a
> binary image. The binary that we obtain in ImageJ is a 8bit. Is it
> possible to get a 16bit binary which values were 0 and 65535?.

Yes you can. I am assuming that your image is background 0 and foreground 255.

Convert to 16bit
Multiply it by 65535.
Of course the multiplication overflows the max value held in a 16 bit image,
but it is clipped and you end up with background 0 and foreground 65535.

Regards

Gabriel

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html