fsl.data.bitmap
¶
This module contains the Bitmap
class, for loading bitmap image
files. Pillow is required to use the Bitmap
class.
-
fsl.data.bitmap.
BITMAP_EXTENSIONS
= ['.bmp', '.png', '.jpg', '.jpeg', '.tif', '.tiff', '.gif', '.rgba']¶ File extensions we understand.
-
fsl.data.bitmap.
BITMAP_DESCRIPTIONS
= ['Bitmap', 'Portable Network Graphics', 'JPEG', 'JPEG', 'TIFF', 'TIFF', 'Graphics Interchange Format', 'Raw RGBA']¶ A description for each
BITMAP_EXTENSION
.
-
class
fsl.data.bitmap.
Bitmap
(bmp)[source]¶ Bases:
object
The
Bitmap
class can be used to load a bitmap image. TheasImage()
method will convert the bitmap into anImage
instance.-
__init__
(bmp)[source]¶ Create a
Bitmap
.- Parameters
bmp – File name of an image, or a
numpy
array containing image data.
-
__hash__
()[source]¶ Returns a number which uniquely idenfities this
Bitmap
instance (the result ofid(self)
).
-
property
name
¶ Returns the name of this
Bitmap
, typically the base name of the file.
-
property
dataSource
¶ Returns the bitmap data source - typically the file name.
-
property
data
¶ Convenience method which returns the bitmap data as a
(w, h, c)
array, wherec
is either 3 or 4.
-
__dict__
= mappingproxy({'__module__': 'fsl.data.bitmap', '__doc__': 'The ``Bitmap`` class can be used to load a bitmap image. The\n :meth:`asImage` method will convert the bitmap into an :class:`.Image`\n instance.\n ', '__init__': <function Bitmap.__init__>, '__hash__': <function Bitmap.__hash__>, '__str__': <function Bitmap.__str__>, '__repr__': <function Bitmap.__repr__>, 'name': <property object>, 'dataSource': <property object>, 'data': <property object>, 'shape': <property object>, 'asImage': <function Bitmap.asImage>, '__dict__': <attribute '__dict__' of 'Bitmap' objects>, '__weakref__': <attribute '__weakref__' of 'Bitmap' objects>})¶
-
__module__
= 'fsl.data.bitmap'¶
-
__weakref__
¶ list of weak references to the object (if defined)
-
property
shape
¶ Returns the bitmap shape -
(width, height, nchannels)
.
-