Skip to content
Snippets Groups Projects
Commit daf2c42d authored by Christopher Randolph Rhodes's avatar Christopher Randolph Rhodes
Browse files

Added support for RGB PNG

parent 735ca41a
No related branches found
No related tags found
No related merge requests found
...@@ -4,6 +4,7 @@ from pathlib import Path ...@@ -4,6 +4,7 @@ from pathlib import Path
from typing import Dict from typing import Dict
import numpy as np import numpy as np
from skimage.io import imread
import czifile import czifile
import tifffile import tifffile
...@@ -114,6 +115,17 @@ class TifSingleSeriesFileAccessor(GenericImageFileAccessor): ...@@ -114,6 +115,17 @@ class TifSingleSeriesFileAccessor(GenericImageFileAccessor):
def __del__(self): def __del__(self):
self.tf.close() self.tf.close()
class PngFileAccessor(GenericImageFileAccessor):
def __init__(self, fpath: Path):
super().__init__(fpath)
try:
arr = imread(fpath)
except Exception:
FileAccessorError(f'Unable to access data in {fpath}')
self._data = np.expand_dims(arr, 3)
class CziImageFileAccessor(GenericImageFileAccessor): class CziImageFileAccessor(GenericImageFileAccessor):
""" """
Image that is stored in a Zeiss .CZI file; may be multi-channel, and/or a z-stack, Image that is stored in a Zeiss .CZI file; may be multi-channel, and/or a z-stack,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment