Skip to content

Commit

Permalink
When loading B-Scans assume image has 2 dimensions. In case it as 3 d…
Browse files Browse the repository at this point in the history
…imensions (last dimension for RGB) keep only the R array
  • Loading branch information
Oli4 committed Sep 10, 2020
1 parent 04f8d6b commit 0290a7b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions eyepy/io/heyex/he_xml.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

import imageio
import numpy as np
from skimage.color import rgb2gray

from eyepy.core.config import SEG_MAPPING
from eyepy.core.octbase import Bscan
Expand Down Expand Up @@ -210,7 +209,10 @@ def segmentation(self):
@property
def scan(self):
if self._scan is None:
self._scan = imageio.imread(self._xmlfilepath.parent / self.scan_name)[..., 0]
self._scan = imageio.imread(self._xmlfilepath.parent / self.scan_name)
# In case 3 arrays (RGB values) are stored instead of a single array
if self._scan.ndim == 3:
self._scan = self._scan[..., 0]
return self._scan

@property
Expand Down

0 comments on commit 0290a7b

Please sign in to comment.