Source code for blissoda.tomo.nxtomo.zseries
from __future__ import annotations
from pathlib import Path
from typing import Any
SEQUENCES = frozenset({"tomo:zseries"})
[docs]
def matches(processor: Any, entry: Any) -> bool:
return processor._sequence_name(entry) in SEQUENCES
[docs]
def expanded_subscan_plan(processor: Any, entry: Any) -> list[tuple[str | None, int]]:
return processor._subscan_plan(entry)
[docs]
def synthetic_translation(processor: Any, entry: Any, alias_name: str):
return processor._position_array(entry, alias_name)
[docs]
def segment_specs(processor: Any, entry: Any, records: list[dict[str, Any]]):
return [{"label": None, "pieces": records}]
[docs]
def stitched_dataset_stem(processor: Any, bliss_path: str) -> str:
collection_name = Path(bliss_path).with_suffix("").parent.parent.name
return f"{collection_name}_stitched"
[docs]
def stitched_dataset_dir(processor: Any, bliss_path: str) -> Path:
processed_path = Path(bliss_path.replace("RAW_DATA", "PROCESSED_DATA")).with_suffix(
""
)
collection_dir = processed_path.parent.parent
return collection_dir / stitched_dataset_stem(processor, bliss_path)
[docs]
def stitch_manifest_path(processor: Any, bliss_path: str) -> Path:
dataset_stem = stitched_dataset_stem(processor, bliss_path)
return (
stitched_dataset_dir(processor, bliss_path)
/ "workflows"
/ "gallery"
/ f"{dataset_stem}_zseries_stitching.json"
)