Skip to content

Commit 3af771c

Browse files
authored
Microjson light doc (#18)
* Added units, doc for alternate version * Bump version 0.1.11 -> 0.1.12 * Fixed test issues * Bump version 0.1.12 -> 0.1.13 * Bump version 0.1.13 -> 0.2.0 * Updated README after feedback
1 parent 5963ee0 commit 3af771c

File tree

8 files changed

+61
-17
lines changed

8 files changed

+61
-17
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
poetry.lock
2+
tmp*
3+
dist/*
24
src/microjson/__pycache__/
35
tests/__pycache__/
46
tiles/
@@ -7,3 +9,4 @@ tiles/
79
*/__pycache__/
810
*.pyc
911
.vscode/
12+

README.md

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
MicroJSON is a JSON-based format inspired by [GeoJSON](https://geojson.org), designed to encode a variety of data structures related to microscopy images. It can handle representations of reference points, regions of interest, and other annotations, making it an ideal solution for conveying complex microscopy data in a straightforward, easy-to-use format.
44

5+
For more extensive documentation, please refer to the [online documentation](https://polusai.github.io/microjson/).
6+
7+
58
## Features
69

710
MicroJSON offers a range of features designed to meet the needs of microscopy data representation:
@@ -19,9 +22,23 @@ There are two additional functionalities added which supports binary and label i
1922

2023
- **MicrojsonBinaryModel:** Reconstruct binary images using polygon coordinates from json file.
2124

25+
## Installation
26+
27+
To install MicroJSON, you can use the following command:
28+
29+
```bash
30+
pip install microjson
31+
```
32+
This will install the default version of MicroJSON with the basic functionalities and minimal dependencies. If you want to use the additional functionalities, such as provided by the ```utils``` module, you can install the package with the following command:
33+
34+
```bash
35+
pip install microjson[all]
36+
```
37+
38+
2239
## Usage
2340

24-
MicroJSON can be used with any application or tool that can process JSON data. Due to its design, it is particularly suited to applications related to the analysis, visualization, and manipulation of microscopy images.
41+
MicroJSON is compatible with any application or tool that process JSON data. Its design makes it especially well-suited for applications involving analysis, visualization, and manipulation of microscopy images.
2542

2643
## Examples
2744

README_short.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,15 @@ There are two additional functionalities added which supports binary images.
1717
**BinaryMicrojsonModel:** Converts objects in a binary image into polygon coordinates (rectangle, encoding) and save them in json file format using microjson package.
1818
**MicrojsonBinaryModel:** Reconstruct binary images using polygon coordinates from json file.
1919

20+
## Installation
21+
22+
To install MicroJSON, you can use the following command:
23+
24+
```pip install microjson```
25+
This will install the default version of MicroJSON with the basic functionalities and minimal dependencies. If you want to use the additional functionalities, such as provided by the ```utils``` module, you can install the package with the following command:
26+
27+
```pip install microjson[all]```
28+
2029
## Usage
2130

2231
MicroJSON can be used with any application or tool that can process JSON data. Due to its design, it is particularly suited to applications related to the analysis, visualization, and manipulation of microscopy images.
@@ -31,10 +40,7 @@ We welcome contributions to the development and enhancement of MicroJSON. Whethe
3140

3241
## License
3342

34-
MicroJSON is licensed under MIT License, (c) 2023 Polus AI & Nextonic Solutions LLC.
35-
36-
## Authors
37-
43+
MicroJSON is licensed under MIT License.
3844

3945

4046
---

pyproject.toml

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"
44

55
[tool.poetry]
66
name = "microjson"
7-
version = "0.1.11"
7+
version = "0.2.0"
88
description = "MicroJSON is a library for validating, parsing, and manipulating MicroJSON data."
99
readme = "README_short.md"
1010
authors = ["Bengt Ljungquist <[email protected]>"]
@@ -28,39 +28,47 @@ where = ["src"]
2828
[tool.poetry.dependencies]
2929
python = ">=3.9.15,<3.12"
3030
pydantic = "^2.3.0"
31-
scikit-image = "0.20.0"
3231
geojson-pydantic = "^1.0.2"
32+
jsonschema = "^4.0.0"
3333
geojson2vt = "^1.0.1"
3434
vt2pbf = "^0.1.5"
3535
protobuf = "^4.25.3"
3636
geojson = "^3.1.0"
3737
shapely = "^2.0.6"
3838

39-
39+
[tool.poetry.dependencies.scikit-image]
40+
version = "^0.20.0"
41+
optional = true
4042

4143
[tool.poetry.dependencies.bfio]
4244
version = "2.4.3"
4345
extras = ["all"]
4446
optional = true
4547

4648
[tool.poetry.dependencies.scipy]
47-
version = ">=1.8,<1.9.2"
49+
version = "^1.9.1"
4850
optional = true
4951

5052
[tool.poetry.dependencies.filepattern]
5153
version = "^2.0.1"
5254
optional = true
5355

54-
[tool.poetry.dependencies.vaex]
55-
version = "^4.17.0"
56+
[tool.poetry.dependencies.vaex-core]
57+
version = "^4.8.0"
58+
optional = true
59+
60+
[tool.poetry.dependencies.matplotlib]
61+
version = "^3.5.1"
5662
optional = true
5763

5864
[tool.poetry.extras]
5965
all = [
6066
"bfio",
6167
"scipy",
6268
"filepattern",
63-
"vaex"
69+
"vaex-core",
70+
"scikit-image",
71+
"matplotlib",
6472
]
6573

6674
[tool.poetry.dev-dependencies]
@@ -80,7 +88,7 @@ mkdocstrings = "^0.23.0"
8088
testpaths = ["tests/"]
8189

8290
[tool.bumpver]
83-
current_version = "0.1.11"
91+
current_version = "0.2.0"
8492
version_pattern = "MAJOR.MINOR.PATCH"
8593
commit_message = "Bump version {old_version} -> {new_version}"
8694
commit = true

src/microjson/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
from .tilemodel import TileJSON # noqa: F401
33
from .microjson2vt.microjson2vt import microjson2vt # noqa: F401
44

5+
__version__ = "0.2.0"
56

6-
__version__ = "0.1.11"

src/microjson/model.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,14 @@ class Unit(Enum):
6363
PIXEL = "pixel"
6464
RADIAN = "radian"
6565
DEGREE = "degree"
66+
MILLISECOND = "millisecond"
67+
SECOND = "second"
68+
MINUTE = "minute"
69+
HOUR = "hour"
70+
DAY = "day"
71+
WEEK = "week"
72+
MONTH = "month"
73+
YEAR = "year"
6674

6775

6876
class AxisType(Enum):

src/microjson/utils.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@
2828
from microjson.model import Feature
2929
from typing import Union
3030
import pydantic
31+
import matplotlib.pyplot as plt
32+
3133

3234
#define conditional imports
3335
try:

tests/test_utils.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@
66
import tempfile
77
from pathlib import Path
88
from typing import Union
9-
import numpy as np
10-
from pydantic import ValidationError
119
import pytest
12-
import skimage as sk
10+
1311
HAS_BFIO = False
1412
try:
1513
import bfio
1614
HAS_BFIO = True
15+
import numpy as np
16+
import skimage as sk
1717
except ImportError:
1818
pass
1919

0 commit comments

Comments
 (0)