Skip to content
Snippets Groups Projects
Commit 9c444ae9 authored by Christopher Randolph Rhodes's avatar Christopher Randolph Rhodes
Browse files

Small changes that slipped through merge, also changed test with updated RoiSet parameter

parent d191e4c2
No related branches found
No related tags found
No related merge requests found
......@@ -61,6 +61,11 @@ class GenericImageDataAccessor(ABC):
)
)
def get_mip(self):
"""
Return a new accessor of maximum intensity projection (MIP) along z-axis
"""
return self.apply(lambda x: x.max(axis=self._ga('Z'), keepdims=True))
def get_mono(self, channel: int, mip: bool = False):
return self.get_channels([channel], mip=mip)
......
from typing import Dict, Union
from pydantic import BaseModel, Field
from pydantic import BaseModel, Field, validator
from ..accessors import GenericImageDataAccessor
from .router import router
......@@ -51,7 +51,8 @@ class RoiSetObjectMapParams(PipelineParams):
'filters': {
'area': {'min': 1e3, 'max': 1e8}
},
'expand_box_by': [128, 2]
'expand_box_by': [128, 2],
'deproject_channel': None,
})
export_params: RoiSetExportParams = RoiSetExportParams()
derived_channels_input_channel: Union[int, None] = Field(
......
......@@ -62,6 +62,7 @@ class RoiSetExportParams(BaseModel):
patches_2d: Union[PatchParams, None] = None
annotated_zstacks: Union[AnnotatedZStackParams, None] = None
object_classes: bool = False
derived_channels: bool = False
def get_label_ids(acc_seg_mask: GenericImageDataAccessor, allow_3d=False, connect_3d=True) -> InMemoryDataAccessor:
......@@ -1091,7 +1092,7 @@ class RoiSetWithDerivedChannels(RoiSet):
def __init__(self, *a, **k):
self.accs_derived = []
return super().__init__(*a, **k)
super().__init__(*a, **k)
def classify_by(
self, name: str, channels: list[int],
......
......@@ -29,6 +29,7 @@ class TestDerivedChannels(unittest.TestCase):
self.seg_mask,
params=RoiSetMetaParams(
filters={'area': {'min': 1e3, 'max': 1e4}},
deproject_channel=0,
)
)
self.assertIsInstance(roiset, RoiSetWithDerivedChannels)
......
......@@ -60,7 +60,8 @@ class BaseTestRoiSetMonoProducts(object):
'filters': {
'area': {'min': 1e0, 'max': 1e8}
},
'expand_box_by': [128, 2]
'expand_box_by': [128, 2],
'deproject_channel': 0,
}
def _get_models(self): # tests can either use model objects directly, or load in API via project file string
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment