Skip to content

Commit

Permalink
add debug logs
Browse files Browse the repository at this point in the history
  • Loading branch information
ziw-liu committed Feb 16, 2024
1 parent 2698317 commit 7001352
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions iohub/mmstack.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ def __init__(self, data_path: StrOrBytesPath):
self.root = first_file.parent
self.dirname = self.root.name
self._first_tif = TiffFile(first_file, is_mmstack=True)
_logger.debug(f"Parsing {first_file} as MMStack.")
self._parse_data()
self._store = None

Expand Down Expand Up @@ -344,6 +345,7 @@ def _infer_image_meta(self) -> None:
"""
Infer data type and pixel size from the first image plane metadata.
"""
_logger.debug("Inferring image metadata.")
metadata = self.read_image_metadata(0, 0, 0, 0)
if metadata is not None:
try:
Expand Down
4 changes: 4 additions & 0 deletions iohub/reader.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from __future__ import annotations

import logging
import sys
import warnings
from pathlib import Path
Expand All @@ -19,6 +20,8 @@
if TYPE_CHECKING:
from _typeshed import StrOrBytesPath

_logger = logging.getLogger(__name__)


def _find_ngff_version_in_zarr_group(group: zarr.Group):
for key in ["omero", "plate", "well"]:
Expand Down Expand Up @@ -148,6 +151,7 @@ def read_images(
extra_info = None
if not data_type:
data_type, extra_info = _infer_format(path)
_logger.debug(f"Detected data type: {data_type} {extra_info}")
# identify data structure type
if data_type == "ometiff":
return MMStack(path)
Expand Down

0 comments on commit 7001352

Please sign in to comment.