__init__.py 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. """Generic utilities.
  2. This module contains a number of utility functions to work with images in general.
  3. """
  4. import functools
  5. import warnings
  6. import numpy as np
  7. # keep .dtype imports first to avoid circular imports
  8. from .dtype import (
  9. dtype_limits,
  10. img_as_float,
  11. img_as_float32,
  12. img_as_float64,
  13. img_as_bool,
  14. img_as_int,
  15. img_as_ubyte,
  16. img_as_uint,
  17. )
  18. from ._slice_along_axes import slice_along_axes
  19. from ._invert import invert
  20. from ._label import label_points
  21. from ._montage import montage
  22. from ._map_array import map_array
  23. from ._regular_grid import regular_grid, regular_seeds
  24. from .apply_parallel import apply_parallel
  25. from .arraycrop import crop
  26. from .compare import compare_images
  27. from .noise import random_noise
  28. from .shape import view_as_blocks, view_as_windows
  29. from .unique import unique_rows
  30. from .lookfor import lookfor
  31. from .._shared.utils import FailedEstimationAccessError
  32. __all__ = [
  33. 'img_as_float32',
  34. 'img_as_float64',
  35. 'img_as_float',
  36. 'img_as_int',
  37. 'img_as_uint',
  38. 'img_as_ubyte',
  39. 'img_as_bool',
  40. 'dtype_limits',
  41. 'view_as_blocks',
  42. 'view_as_windows',
  43. 'slice_along_axes',
  44. 'crop',
  45. 'compare_images',
  46. 'map_array',
  47. 'montage',
  48. 'random_noise',
  49. 'regular_grid',
  50. 'regular_seeds',
  51. 'apply_parallel',
  52. 'invert',
  53. 'unique_rows',
  54. 'label_points',
  55. 'lookfor',
  56. 'FailedEstimationAccessError',
  57. 'PendingSkimage2Change',
  58. ]
  59. class PendingSkimage2Change(PendingDeprecationWarning):
  60. """A warning about API usage that will silently change or break in skimage2.
  61. As a subclass of :class:`PendingDeprecationWarning`, this warning isn't
  62. shown by default. But it can be enabled with a warnings filter to prepare
  63. for code changes related to skimage2 early on:
  64. .. code-block:: python
  65. import warnings
  66. import skimage as ski
  67. warnings.filterwarnings(
  68. action="default", category=ski.util.PendingSkimage2Change
  69. )
  70. """