Re: float->byte->float is same with original float image. why float->ubyte->float is different???

Discussion in 'C Programming' started by bd, Jul 7, 2003.

  1. bd

    bd Guest

    On Thu, 19 Jun 2003 15:24:57 -0400, hkso wrote:

    >
    > Dear you floks,
    > I have a unix program to process of medical images.
    > I tried to test my program if it works correctly.
    > I did following works;
    > 1. float->ubyte->float
    > 2. float->ushort->float
    > 3. float->double->float
    > .
    > .
    > .
    > The original float image have -8.95 of minimum value and 70,875 of maximum
    > value.
    > I expected that the last float result image have same minimum and maximum
    > value with original one and most reslut image had almost same value and
    > looked same image features except 1 (ubyte) and 2 (ushort) case.
    > In ubyte case, they have 0 of minimum value and 255 of maximum value at
    > the final float image.
    > In ushort case, they have 0 of minimum value and 65535 at the final float
    > image.
    > Actually, I'm beginner of c-language. So, I'm not sure if this kind of
    > result are correct.
    > If you folks have some idea for this, please let me know.


    Assuming that you
    typedef unsigned char ubyte;
    typedef unsigned short ushort;

    Then the results sound correct. unsigned char and unsigned short hold only
    integers, and the cited ranges are the minimum anges required by the
    standard. What did you expect to happen?

    --
    Freenet distribution not available
    Ten years of rejection slips is nature's way of telling you to stop writing.
    -- R. Geis
    bd, Jul 7, 2003
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mr. SweatyFinger
    Replies:
    2
    Views:
    1,763
    Smokey Grindel
    Dec 2, 2006
  2. Christopher Brewster
    Replies:
    5
    Views:
    334
    John Machin
    Nov 14, 2008
  3. bluebaron
    Replies:
    3
    Views:
    727
    Jonathan N. Little
    Nov 4, 2009
  4. gelonida
    Replies:
    1
    Views:
    738
    Gabriel Genellina
    May 6, 2010
  5. Guest
    Replies:
    2
    Views:
    171
    Foo Man Chew
    Dec 29, 2003
Loading...

Share This Page