Skip to content

Commit

Permalink
Merge 3a5ceb6 into 19ea209
Browse files Browse the repository at this point in the history
  • Loading branch information
ajinkya-kulkarni authored Apr 7, 2023
2 parents 19ea209 + 3a5ceb6 commit f821d63
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/nanopyx/core/io/zip_image_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ def __init__(self, zip_file_path: str):
if name.endswith(".tif") and not name.startswith("_")
]
self.tiff_file_names = sorted(self.tiff_file_names)
# print(self.tiff_file_names)

def __getitem__(self, index: int) -> np.ndarray:
if index >= len(self.tiff_file_names):
Expand Down Expand Up @@ -53,11 +52,11 @@ def _get_im0(self):
self._dtype = self._im0.dtype
return self._im0

def get_shape(self) -> list:
def get_shape(self) -> List[int]:
"""
Returns the shape of the image stack
:return: shape of the image stack
:rtype: list
:rtype: list[int]
"""
self._get_im0()
return self._shape
Expand All @@ -81,7 +80,7 @@ def get_thumb(self, save_path=None):
_max = thumb.max()
_min = thumb.min()
thumb = (thumb.astype("float32") - _min / (_max - _min)) * 255
if save_path != None:
if save_path is not None:
# Save the thumbnail as a JPEG file
skimage.io.imsave(os.path.join(save_path, "thumbnail.jpg"), thumb)

Expand Down

0 comments on commit f821d63

Please sign in to comment.