Skip to content

Commit

Permalink
added layer_indices property to Bscan
Browse files Browse the repository at this point in the history
  • Loading branch information
Oli4 committed Oct 5, 2020
1 parent cb2759a commit bd4f669
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions eyepy/core/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,8 @@ def __init__(self,
else:
self._data_processing = data_processing

self._layer_indices = None

@property
def oct_obj(self):
if self._oct_obj is None:
Expand Down Expand Up @@ -207,6 +209,19 @@ def scan(self):
def shape(self):
return self.scan.shape

@property
def layer_indices(self):
if self._layer_indices is None:

self._layer_indices = {}
for key, layer_height in self.layers.items():
nan_indices = np.isnan(layer_height)
col_indices = np.arange(self.shape[1])[~nan_indices]
row_indices = np.rint(layer_height).astype(int)[~nan_indices]
self._layer_indices[key] = (row_indices, col_indices)

return self._layer_indices

@property
def layers(self):
data = self.layers_raw.copy()
Expand Down

0 comments on commit bd4f669

Please sign in to comment.