I am working through the docs of skimage and tried out the image conversions. The docs say that these functions *properly rescale* the values, but I'm not sure what is meant with *properly? * *IF *rescaling is meant to exploit the defined range between 0 and 1 for floats, that does not seem to happen: In [13]: data=np.uint(data) In [14]: data.max() Out[14]: 27 In [15]: data.min() Out[15]: 17 In [16]: fimg = skimage.img_as skimage.img_as_float skimage.img_as_int skimage.img_as_ubyte skimage.img_as_uint In [16]: fimg = skimage.img_as_float(data) In [17]: fimg.max() Out[17]: 6.2864273801181529e09 In [18]: fimg.min() Out[18]: 3.9581209430373555e09 In [19]: imshow(fimg) Out[19]: <matplotlib.image.AxesImage at 0xe38b1f0> In [20]: data.dtype Out[20]: dtype('uint32') Or do I misunderstand something? Best regards, Michael
I think I understand now. Because the uint32 range was only used up to value of 27, the float value became so small, right?: In [23]: 27.0/(2**32) Out[23]: 6.28642737865448e09 Ok, good that we talked about it... ;) (and sorry for the noise..)
On Thu, Feb 9, 2012 at 9:20 AM, Michael Aye <kmichael.aye@gmail.com> wrote:
I think I understand now. Because the uint32 range was only used up to value of 27, the float value became so small, right?:
In [23]: 27.0/(2**32) Out[23]: 6.28642737865448e09
Ok, good that we talked about it... ;) (and sorry for the noise..)
Glad you figured it out on your own, but that's actually a good point: we don't have uint32 ranges listed in the docs. Based on your recent emails, I think you may be a good resource. Please continue to point out any spots in the code or the docs where things aren't clear. It's easy for us to overlook the unintuitive parts of the package after using it for awhile. Thanks, Tony
On Feb 9, 2012 6:32 AM, "Michael Aye" <kmichael.aye@gmail.com> wrote:
I think I understand now. Because the uint32 range was only used up to
value of 27, the float value became so small, right?:
In [23]: 27.0/(2**32) Out[23]: 6.28642737865448e09
That's right! Tony also wrote a function called "rescale_intensity" for modifying the extents of an image. Stéfan
participants (3)

Michael Aye

Stéfan van der Walt

Tony Yu