23 __all__ = [
"Image",
"DecoratedImage"]
28 from ..slicing
import supportSlicing
29 from ..disableArithmetic
import disableImageArithmetic
30 from .fitsIoWithOptions
import imageReadFitsWithOptions, imageWriteFitsWithOptions
31 from .image
import ImageI, ImageF, ImageD, ImageU, ImageL
32 from .image
import DecoratedImageI, DecoratedImageF, DecoratedImageD, DecoratedImageU, DecoratedImageL
35 class Image(metaclass=TemplateMeta):
42 return "{}, bbox={}".
format(self.array, self.getBBox())
45 return "{}.{}={}".
format(self.__module__, self.__class__.__name__, str(self))
47 readFitsWithOptions = classmethod(imageReadFitsWithOptions)
49 writeFitsWithOptions = imageWriteFitsWithOptions
52 Image.register(np.int32, ImageI)
53 Image.register(np.float32, ImageF)
54 Image.register(np.float64, ImageD)
55 Image.register(np.uint16, ImageU)
56 Image.register(np.uint64, ImageL)
57 Image.alias(
"I", ImageI)
58 Image.alias(
"F", ImageF)
59 Image.alias(
"D", ImageD)
60 Image.alias(
"U", ImageU)
61 Image.alias(
"L", ImageL)
67 return ImageF(self, deep=
True)
70 return ImageD(self, deep=
True)
72 readFitsWithOptions = classmethod(imageReadFitsWithOptions)
74 writeFitsWithOptions = imageWriteFitsWithOptions
77 DecoratedImage.register(np.int32, DecoratedImageI)
78 DecoratedImage.register(np.float32, DecoratedImageF)
79 DecoratedImage.register(np.float64, DecoratedImageD)
80 DecoratedImage.register(np.uint16, DecoratedImageU)
81 DecoratedImage.register(np.uint64, DecoratedImageL)
82 DecoratedImage.alias(
"I", DecoratedImageI)
83 DecoratedImage.alias(
"F", DecoratedImageF)
84 DecoratedImage.alias(
"D", DecoratedImageD)
85 DecoratedImage.alias(
"U", DecoratedImageU)
86 DecoratedImage.alias(
"L", DecoratedImageL)
89 for cls
in set(Image.values()):
93 for cls
in set(DecoratedImage.values()):