Skip to content

Commit

Permalink
fix: imagetype enum variants in manifests (#538)
Browse files Browse the repository at this point in the history
  • Loading branch information
nishaq503 authored Jul 23, 2024
1 parent 31746f5 commit 46b072f
Show file tree
Hide file tree
Showing 8 changed files with 43 additions and 22 deletions.
4 changes: 3 additions & 1 deletion visualization/precompute-slide-tool/.bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 1.7.1
current_version = 1.7.2-dev0
commit = False
tag = False
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(\-(?P<release>[a-z]+)(?P<dev>\d+))?
Expand All @@ -25,3 +25,5 @@ replace = version = "{new_version}"
[bumpversion:file:README.md]

[bumpversion:file:plugin.json]

[bumpversion:file:ict.yml]
21 changes: 18 additions & 3 deletions visualization/precompute-slide-tool/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Polus Precompute Slide Plugin (1.7.1)
# Polus Precompute Slide Plugin (1.7.2-dev0)

This WIPP plugin generates image pyramids in multiple viewing formats. Each
output has a special filepattern variable that will be used to combine images
Expand Down Expand Up @@ -37,7 +37,22 @@ This plugin can take four types of input argument and one output argument:
| Name | Description | I/O | Type |
| ------------- | ----------------------------------------------------- | ------ | ------- |
| `inpDir` | Input image collection (Single Image Planes/Z Stacks) | Input | Path |
| `pyramidType` | DeepZoom/Neuroglancer/Zarr | Input | String |
| `pyramidType` | DeepZoom/Neuroglancer/Zarr | Input | Enum |
| `filePattern` | Image pattern | Input | String |
| `imageType` | Neuroglancer type (Intensity/Segmentation) | Input | String |
| `imageType` | Neuroglancer type (Intensity/Segmentation) | Input | Enum |
| `outDir` | Output image pyramid | Output | Pyramid |

### Pyramid Types

Must be one of the following:

- `DeepZoom`
- `Neuroglancer`
- `Zarr`

### Image Types

Must be one of the following:

- `Intensity`
- `Segmentation` (Neuroglancer only)
2 changes: 1 addition & 1 deletion visualization/precompute-slide-tool/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.7.1
1.7.2-dev0
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,15 @@ ui:
title: 'Pyramid Type: '
type: select
- condition: inputs.pyramidType==Neuroglancer
description: Image or Segmentation?
description: Intensity or Segmentation?
fields:
- image
- segmentation
- Intensity
- Segmentation
key: inputs.imageType
title: 'Image Type: '
type: select
- description: 'Pattern of images in input collection (image_r{rrr}_c{ccc}_z{zzz}.ome.tif). '
key: inputs.filePattern
title: 'Image Pattern: '
type: text
version: 1.7.1-dev0
version: 1.7.2-dev0
16 changes: 9 additions & 7 deletions visualization/precompute-slide-tool/plugin.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "Precompute Slide",
"version": "1.7.1",
"containerId": "polusai/precompute-slide-tool:1.7.1",
"version": "1.7.2-dev0",
"containerId": "polusai/precompute-slide-tool:1.7.2-dev0",
"baseCommand": [
"python3",
"-m",
Expand Down Expand Up @@ -36,12 +36,12 @@
},
{
"name": "imageType",
"description": "Image is either Segmentation or Image",
"description": "Image is either Segmentation or Intensity",
"type": "enum",
"options": {
"values": [
"image",
"segmentation"
"Intensity",
"Segmentation"
]
},
"required": false
Expand Down Expand Up @@ -70,13 +70,15 @@
{
"key": "inputs.pyramidType",
"title": "Pyramid Type: ",
"description": "Build a DeepZoom, Neuroglancer, or Zarr pyramid?"
"description": "Build a DeepZoom, Neuroglancer, or Zarr pyramid?",
"default": "Zarr"
},
{
"key": "inputs.imageType",
"title": "Image Type: ",
"description": "Image or Segmentation?",
"condition": "inputs.pyramidType==Neuroglancer"
"condition": "inputs.pyramidType==Neuroglancer",
"default": "Intensity"
},
{
"key": "inputs.filePattern",
Expand Down
2 changes: 1 addition & 1 deletion visualization/precompute-slide-tool/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "polus-images-visualization-precompute-slide"
version = "1.7.1"
version = "1.7.2-dev0"
description = "Polus Precompute Slide Plugin."
authors = [
"Madhuri Vihani <Madhuri.Vihani@nih.gov>",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,17 +58,17 @@ def main( # noqa: PLR0913
resolve_path=True,
),
pyramid_type: PyramidType = typer.Option(
...,
"Zarr",
"--pyramidType",
"-p",
help="type of pyramid. Must be one of ['Neuroglancer','DeepZoom', 'Zarr']",
case_sensitive=False,
),
image_type: ImageType = typer.Option(
...,
"Intensity",
"--imageType",
"-t",
help="type of image. Must be one of ['image','segmentation']",
help="type of image. Must be one of ['Intensity','Segmentation']",
case_sensitive=False,
),
preview: bool = typer.Option(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class ImageType(str, enum.Enum):
"µm": 10**3,
"nm": 1,
"Å": 10**-1,
'UnitsLength.MICROMETER': 10**3,
"UnitsLength.MICROMETER": 10**3,
}

# Chunk Scale
Expand Down Expand Up @@ -222,7 +222,9 @@ def bfio_metadata_to_slide_info(

resolution = [phys_x[0] * UNITS[str(phys_x[1])]]
resolution.append(phys_y[0] * UNITS[str(phys_y[1])])
resolution.append(phys_z[0] * UNITS[str(phys_z[1])]) # Just used as a placeholder
resolution.append(
phys_z[0] * UNITS[str(phys_z[1])],
) # Just used as a placeholder
dtype = str(numpy.dtype(bfio_reader.dtype))

num_scales = int(numpy.ceil(numpy.log2(max(sizes))))
Expand Down

0 comments on commit 46b072f

Please sign in to comment.