Package fabio :: Module edfimage :: Class edfimage
[hide private]
[frames] | no frames]

Class edfimage

source code

           object --+    
                    |    
fabioimage.fabioimage --+
                        |
                       edfimage

Read and try to write the ESRF edf data format

Instance Methods [hide private]
 
__init__(self, data=None, header=None, header_keys=None, frames=None)
Set up initial values
source code
 
_readheader(self, infile)
Read all headers in a file and populate self.header data is not yet populated
source code
 
read(self, fname)
Read in header into self.header and...
source code
 
swap_needed(self)
Decide if we need to byteswap
source code
 
unpack(self)
Unpack a binary blob according to the specification given in the header and return the dataset
source code
 
getframe(self, num)
returns the file numbered 'num' in the series as a fabioimage
source code
 
previous(self)
returns the previous file in the series as a fabioimage
source code
 
next(self)
returns the next file in the series as a fabioimage
source code
 
write(self, fname, force_type=None)
Try to write a file check we can write zipped also mimics that fabian was writing uint16 (we sometimes want floats)
source code
 
appendFrame(self, frame=None, data=None, header=None)
Method used add a frame to an EDF file
source code
 
deleteFrame(self, frameNb=None)
Method used to remove a frame from an EDF image.
source code
 
getNbFrames(self)
Getter for number of frames
source code
 
setNbFrames(self, val)
Setter for number of frames ...
source code
 
getHeader(self)
Getter for the headers.
source code
 
setHeader(self, _dictHeader)
Enforces the propagation of the header to the list of frames
source code
 
delHeader(self)
Deleter for edf header
source code
 
getHeaderKeys(self)
Getter for edf header_keys
source code
 
setHeaderKeys(self, _listtHeader)
Enforces the propagation of the header_keys to the list of frames
source code
 
delHeaderKeys(self)
Deleter for edf header_keys
source code
numpy.ndarray
getData(self)
getter for edf Data
source code
 
setData(self, _data)
Enforces the propagation of the data to the list of frames
source code
 
delData(self)
deleter for edf Data
source code
dict
getCapsHeader(self)
getter for edf headers keys in upper case
source code
 
setCapsHeader(self, _data)
Enforces the propagation of the header_keys to the list of frames
source code
 
delCapsHeader(self)
deleter for edf capsHeader
source code
 
getDim1(self) source code
 
setDim1(self, _iVal) source code
 
getDim2(self) source code
 
setDim2(self, _iVal) source code
 
getDims(self) source code
 
getByteCode(self) source code
 
setByteCode(self, _iVal) source code
 
getBpp(self) source code
 
setBpp(self, _iVal) source code

Inherited from fabioimage.fabioimage: add, getheader, getmax, getmean, getmin, getstddev, integrate_area, make_slice, readheader, rebin, resetvals, toPIL16, update_header

Inherited from fabioimage.fabioimage (private): _compressed_stream, _open

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Static Methods [hide private]
 
_readHeaderBlock(infile)
Read in a header in some EDF format from an already open file
source code
Class Variables [hide private]
Properties [hide private]
  nframes
Getter for number of frames
  header
property: header of EDF file
  header_keys
property: header_keys of EDF file
  data
property: data of EDF file
  capsHeader
property: capsHeader of EDF file, i.e.
  dim1
  dim2
  dims
  bytecode
  bpp

Inherited from object: __class__

Method Details [hide private]

__init__(self, data=None, header=None, header_keys=None, frames=None)
(Constructor)

source code 

Set up initial values

Overrides: object.__init__
(inherited documentation)

_readHeaderBlock(infile)
Static Method

source code 

Read in a header in some EDF format from an already open file

Parameters:
  • infile - file object open in read mode
Returns:
string (or None if no header was found.

_readheader(self, infile)

source code 

Read all headers in a file and populate self.header data is not yet populated

Parameters:
  • infile (file object open in read mode)
Overrides: fabioimage.fabioimage._readheader

read(self, fname)

source code 

Read in header into self.header and
    the data   into self.data

Overrides: fabioimage.fabioimage.read

unpack(self)

source code 

Unpack a binary blob according to the specification given in the header and return the dataset

Returns:
dataset as numpy.ndarray

getframe(self, num)

source code 

returns the file numbered 'num' in the series as a fabioimage

Overrides: fabioimage.fabioimage.getframe

previous(self)

source code 

returns the previous file in the series as a fabioimage

Overrides: fabioimage.fabioimage.previous

next(self)

source code 

returns the next file in the series as a fabioimage

Overrides: fabioimage.fabioimage.next

write(self, fname, force_type=None)

source code 

Try to write a file check we can write zipped also mimics that fabian was writing uint16 (we sometimes want floats)

Parameters:
  • force_type - can be numpy.uint16 or simply "float"
Returns:
None
Overrides: fabioimage.fabioimage.write

appendFrame(self, frame=None, data=None, header=None)

source code 

Method used add a frame to an EDF file

Parameters:
  • frame (instance of Frame) - frame to append to edf image
Returns:
None

deleteFrame(self, frameNb=None)

source code 

Method used to remove a frame from an EDF image. by default the last one is removed.

Parameters:
  • frameNb (integer) - frame number to remove, by default the last.
Returns:
None

setNbFrames(self, val)

source code 

Setter for number of frames ... should do nothing. Here just to avoid bugs

getHeader(self)

source code 

Getter for the headers. used by the property header,

setHeaderKeys(self, _listtHeader)

source code 

Enforces the propagation of the header_keys to the list of frames

Parameters:
  • _listtHeader (python list) - list of the (ordered) keys in the header

getData(self)

source code 

getter for edf Data

Returns: numpy.ndarray
data for current frame

setData(self, _data)

source code 

Enforces the propagation of the data to the list of frames

Parameters:
  • _data - numpy array representing data

getCapsHeader(self)

source code 

getter for edf headers keys in upper case

Returns: dict
data for current frame

setCapsHeader(self, _data)

source code 

Enforces the propagation of the header_keys to the list of frames

Parameters:
  • _data - numpy array representing data

Property Details [hide private]

nframes

Getter for number of frames

Get Method:
getNbFrames(self) - Getter for number of frames
Set Method:
setNbFrames(self, val) - Setter for number of frames ...
Delete Method:
'property: number of frames in EDF file'

header

property: header of EDF file

Get Method:
getHeader(self) - Getter for the headers.
Set Method:
setHeader(self, _dictHeader) - Enforces the propagation of the header to the list of frames
Delete Method:
delHeader(self) - Deleter for edf header

header_keys

property: header_keys of EDF file

Get Method:
getHeaderKeys(self) - Getter for edf header_keys
Set Method:
setHeaderKeys(self, _listtHeader) - Enforces the propagation of the header_keys to the list of frames
Delete Method:
delHeaderKeys(self) - Deleter for edf header_keys

data

property: data of EDF file

Get Method:
getData(self) - getter for edf Data
Set Method:
setData(self, _data) - Enforces the propagation of the data to the list of frames
Delete Method:
delData(self) - deleter for edf Data

capsHeader

property: capsHeader of EDF file, i.e. the keys of the header in UPPER case.

Get Method:
getCapsHeader(self) - getter for edf headers keys in upper case
Set Method:
setCapsHeader(self, _data) - Enforces the propagation of the header_keys to the list of frames
Delete Method:
delCapsHeader(self) - deleter for edf capsHeader

dim1

Get Method:
getDim1(self)
Set Method:
setDim1(self, _iVal)

dim2

Get Method:
getDim2(self)
Set Method:
setDim2(self, _iVal)

dims

Get Method:
getDims(self)

bytecode

Get Method:
getByteCode(self)
Set Method:
setByteCode(self, _iVal)

bpp

Get Method:
getBpp(self)
Set Method:
setBpp(self, _iVal)