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

Allow parameterization of 3D patch projection

parent 8a5486aa
No related branches found
No related tags found
No related merge requests found
......@@ -37,6 +37,7 @@ def export_patches_from_zstack(
pad_to: int = 256,
make_3d: bool = False,
prefix='patch',
projector=lambda x: np.max(x, axis=3, keepdims=True),
**kwargs
):
assert stack.chroma == 1, 'Expecting monochromatic image data'
......@@ -51,7 +52,7 @@ def export_patches_from_zstack(
if make_3d:
patch = stack.data[sl]
else:
patch = np.max(stack.data[sl], axis=3, keepdims=True)
patch = projector(stack.data[sl])
assert len(patch.shape) == 4
assert patch.shape[2] == stack.chroma
......
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