Skip to content

Commit

Permalink
add convenience function to retrieve whole stack
Browse files Browse the repository at this point in the history
  • Loading branch information
gmazzamuto committed Feb 15, 2017
1 parent 3a88a93 commit 025c258
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions dcimg.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,22 @@ def layer(self, index, frames_per_layer=1, dtype=None):
return a
return a.astype(dtype)

def whole(self, dtype=None):
"""Convenience function to retrieve the whole stack.
Equivalent to call layer() with index=0 and frames_per_layer=self.nfrms
Parameters
----------
dtype
Returns
-------
A numpy array of the original type or of dtype, if specified. The
shape of the array is (self.nfrms, ysize, xsize).
"""
return self.layer(0, self.nfrms, dtype)

def frame(self, index, dtype=None):
"""Convenience function to retrieve a single layer.
Expand Down

0 comments on commit 025c258

Please sign in to comment.