Skip to content

Commit

Permalink
move import utils locally
Browse files Browse the repository at this point in the history
  • Loading branch information
weiglszonja committed May 30, 2024
1 parent 894dfef commit 3722f6d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def parse_ome_metadata(metadata: OME) -> dict:
- channel_names
"""
images_metadata = metadata["images"][0]
images_metadata = metadata.images[0]
pixels_metadata = images_metadata.pixels

sampling_frequency = None
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

from ...extraction_tools import PathType
from .bioformatsimagingextractor import BioFormatsImagingExtractor
from .bioformats_utils import extract_ome_metadata, parse_ome_metadata


class CxdImagingExtractor(BioFormatsImagingExtractor):
Expand All @@ -36,6 +35,8 @@ def get_available_channels(cls, file_path) -> List[str]:
channel_names: list
List of channel names.
"""
from .bioformats_utils import extract_ome_metadata, parse_ome_metadata

ome_metadata = extract_ome_metadata(file_path=file_path)
parsed_metadata = parse_ome_metadata(metadata=ome_metadata)
channel_names = parsed_metadata["channel_names"]
Expand All @@ -55,6 +56,8 @@ def get_available_planes(cls, file_path):
plane_names: list
List of plane names.
"""
from .bioformats_utils import extract_ome_metadata, parse_ome_metadata

ome_metadata = extract_ome_metadata(file_path=file_path)
parsed_metadata = parse_ome_metadata(metadata=ome_metadata)
num_planes = parsed_metadata["num_planes"]
Expand Down Expand Up @@ -87,6 +90,8 @@ def __init__(self, file_path: PathType, channel_name: str = None, plane_name: st
plane_name : str
The name of the plane for this extractor. (default=None)
"""
from .bioformats_utils import extract_ome_metadata, parse_ome_metadata

if "JAVA_HOME" not in os.environ:
conda_home = os.environ.get("CONDA_PREFIX")
os.environ["JAVA_HOME"] = conda_home
Expand Down

0 comments on commit 3722f6d

Please sign in to comment.