Skip to content

Commit

Permalink
Merge fed14ef into fdc721b
Browse files Browse the repository at this point in the history
  • Loading branch information
mzouink authored Jun 20, 2024
2 parents fdc721b + fed14ef commit 33e6d52
Show file tree
Hide file tree
Showing 11 changed files with 761 additions and 65 deletions.
1 change: 1 addition & 0 deletions dacapo/experiments/datasplits/datasets/arrays/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@

# nonconfigurable arrays (helpers)
from .numpy_array import NumpyArray # noqa
from .constant_array_config import ConstantArray, ConstantArrayConfig # noqa
79 changes: 79 additions & 0 deletions dacapo/experiments/datasplits/datasets/arrays/concat_array.py
Original file line number Diff line number Diff line change
Expand Up @@ -459,3 +459,82 @@ def __getitem__(self, roi: Roi) -> np.ndarray:
f"Concatenated array has only one channel: {self.name} {concatenated.shape}"
)
return concatenated

def _can_neuroglance(self):
"""
This method returns True if the source array can be visualized in neuroglance.
Returns:
bool: True if the source array can be visualized in neuroglance.
Raises:
ValueError: If the source array is not writable.
Examples:
>>> binarize_array._can_neuroglance()
Note:
This method is used to return True if the source array can be visualized in neuroglance.
"""
return any(
[
source_array._can_neuroglance()
for source_array in self.source_arrays.values()
]
)

def _neuroglancer_source(self):
"""
This method returns the source array for neuroglancer.
Returns:
neuroglancer.LocalVolume: The source array for neuroglancer.
Raises:
ValueError: If the source array is not writable.
Examples:
>>> binarize_array._neuroglancer_source()
Note:
This method is used to return the source array for neuroglancer.
"""
# return self._source_array._neuroglancer_source()
return [
source_array._neuroglancer_source()
for source_array in self.source_arrays.values()
]

def _neuroglancer_layer(self):
"""
This method returns the neuroglancer layer for the source array.
Returns:
neuroglancer.SegmentationLayer: The neuroglancer layer for the source array.
Raises:
ValueError: If the source array is not writable.
Examples:
>>> binarize_array._neuroglancer_layer()
Note:
This method is used to return the neuroglancer layer for the source array.
"""
# layer = neuroglancer.SegmentationLayer(source=self._neuroglancer_source())
return [
source_array._neuroglancer_layer()
for source_array in self.source_arrays.values()
if source_array._can_neuroglance()
]

def _source_name(self):
"""
This method returns the name of the source array.
Returns:
str: The name of the source array.
Raises:
ValueError: If the source array is not writable.
Examples:
>>> binarize_array._source_name()
Note:
This method is used to return the name of the source array.
"""
# return self._source_array._source_name()
return [
source_array._source_name()
for source_array in self.source_arrays.values()
if source_array._can_neuroglance()
]
Loading

0 comments on commit 33e6d52

Please sign in to comment.