Skip to content

Deprecate 32 and 64 bits integer types support #4442

Open

Description

@rfezzani

Description

I experienced some confusion with behavior definition with images with int dtype #4424 (comment).

@jni pointed out that "int images are a big problem for us in general" (see #3009 for example).

I wonder if we can not simply deprecate the support of int images with higher depth than 16-bit:

  • Does int images with higher depth than 16-bit represent a real use case?
  • If any use case exist, can't we advise users to cast the images to float and use the preserve_range argument?

Activity

  1. hmaarrfk commented on Feb 11, 2020

    @hmaarrfk
    Member

    Fixed point math is quite useful. I wouldn't throw it away because of convenience.

    What does deprecating a datatype mean in python? Do we have to check at every entry point that we don't have int32? Seems tiresome.

    What about checking for int24? Or other strange datatypes.

  2. rfezzani commented on Feb 11, 2020

    @rfezzani
    MemberAuthor

    I am not saying that fixed point is not useful :-) I am just saying that in the context of image processing, I don't see much applications with more then 16 bits int, but I am pretty sure that I am mistaken here 😄

    Yes, this is made by checking np.issubdtype(img.dtype, np.integer) and img.dtype.itemsize < 3, mainly in the skimage.util.dtype module... It will hopefully impact a great majority of the package.

    We may also apply this check in some specific modules/ functions where it makes sens, I think about skimage.color, but there is probably more...

    We may then specify in the user guide data types section that we don't recommend the use of 32 and 64 bits integers.

  3. rfezzani commented on Feb 11, 2020

    @rfezzani
    MemberAuthor

    I see in the user guide data types section that With a few exceptions, 64-bit (u)int images are not supported. already 😄

  4. jni commented on Feb 11, 2020

    @jni
    Member

    I think this discussion needs to take place in the context of #3009. I generally advocate for deprecating implicit rescaling in the library altogether. In that case, it doesn't make sense to deprecate those dtypes.

    It does make sense to deprecate rescaling of int32 range to [0, 1]. I've never encountered a case where that was a good idea.

  5. locked and limited conversation to collaborators on Oct 18, 2021
  6. added
    📜 type: API
    on Mar 20, 2022
  7. unlocked this conversation on Mar 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    📜 type: API💬 Discussion

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions