Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor improvements #43

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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