-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- stage reconstruction inputs to directory - add exposure time metadata - prototype analysis dialogs
- Loading branch information
1 parent
37e0e3e
commit c43c5a9
Showing
95 changed files
with
1,918 additions
and
530 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
from abc import ABC, abstractmethod | ||
from collections.abc import Sequence | ||
from dataclasses import dataclass | ||
from pathlib import Path | ||
|
||
from .product import Product | ||
from .typing import RealArrayType | ||
|
||
|
||
@dataclass(frozen=True) | ||
class ElementMap: | ||
name: str | ||
counts_per_second: RealArrayType | ||
|
||
|
||
@dataclass(frozen=True) | ||
class FluorescenceDataset: | ||
element_maps: Sequence[ElementMap] | ||
counts_per_second_path: str | ||
channel_names_path: str | ||
|
||
# TODO need to communicate association between element map pixels and scan order. | ||
# integer-valued, same shape as counts_per_second | ||
#scan_indexes: IntegerArray | ||
|
||
|
||
class FluorescenceFileReader(ABC): | ||
|
||
@abstractmethod | ||
def read(self, filePath: Path) -> FluorescenceDataset: | ||
'''reads a fluorescence dataset from file''' | ||
pass | ||
|
||
|
||
class FluorescenceFileWriter(ABC): | ||
|
||
@abstractmethod | ||
def write(self, filePath: Path, dataset: FluorescenceDataset) -> None: | ||
'''writes a fluorescence dataset to file''' | ||
pass | ||
|
||
|
||
class UpscalingStrategy(ABC): | ||
'''Uses ptychography-corrected scan positions to remap element | ||
concentrations from the regular scan grid to the upscaled grid''' | ||
|
||
@abstractmethod | ||
def __call__(self, emap: ElementMap, product: Product) -> ElementMap: | ||
pass | ||
|
||
|
||
class DeconvolutionStrategy(ABC): | ||
'''Deconvolves the kernel from the accumulated array to obtain the | ||
resolution-enhanced element map''' | ||
|
||
@abstractmethod | ||
def __call__(self, emap: ElementMap, product: Product) -> ElementMap: | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
from typing import Any, TypeAlias | ||
|
||
import numpy | ||
import numpy.typing | ||
|
||
IntegerArrayType: TypeAlias = numpy.typing.NDArray[numpy.integer[Any]] | ||
Float32ArrayType: TypeAlias = numpy.typing.NDArray[numpy.float32] | ||
RealArrayType: TypeAlias = numpy.typing.NDArray[numpy.floating[Any]] | ||
ComplexArrayType: TypeAlias = numpy.typing.NDArray[numpy.complexfloating[Any, Any]] | ||
|
||
NumberTypes: TypeAlias = numpy.integer[Any] | numpy.floating[Any] | numpy.complexfloating[Any, Any] | ||
NumberArrayType: TypeAlias = numpy.typing.NDArray[NumberTypes] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.