From 69f1a57a7cc7f8018d8c802f9b4845fa1565c742 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan-Hendrik=20M=C3=BCller?= <44469195+kolibril13@users.noreply.github.com> Date: Thu, 30 May 2024 13:38:29 +0200 Subject: [PATCH] feat!: Rename AnyNiivue to Niivue (#65) --- README.md | 4 ++-- demo/additive_voxels.ipynb | 6 +++--- demo/basic_multiplanar.ipynb | 6 +++--- src/ipyniivue/__init__.py | 2 +- src/ipyniivue/_widget.py | 4 ++-- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 78a93f7..47f2d44 100644 --- a/README.md +++ b/README.md @@ -14,9 +14,9 @@ pip install ipyniivue In a Jupyter environment: ```py -from ipyniivue import AnyNiivue +from ipyniivue import NiiVue -nv = AnyNiivue() +nv = NiiVue() nv.load_volumes([{"path": "images/mni152.nii.gz"}]) nv ``` diff --git a/demo/additive_voxels.ipynb b/demo/additive_voxels.ipynb index 8e9f5a4..6fe2303 100644 --- a/demo/additive_voxels.ipynb +++ b/demo/additive_voxels.ipynb @@ -18,7 +18,7 @@ "metadata": {}, "outputs": [], "source": [ - "from ipyniivue import AnyNiivue, SliceType\n", + "from ipyniivue import NiiVue, SliceType\n", "# based on https://niivue.github.io/niivue/features/additive.voxels.html\n", "\n", "volumes = [\n", @@ -36,7 +36,7 @@ " \"cal_max\": 4,\n", " },\n", "]\n", - "nv = AnyNiivue(\n", + "nv = NiiVue(\n", " back_color=(1, 1, 1, 1),\n", " show_3D_crosshair=True,\n", " is_colorbar=True,\n", @@ -78,7 +78,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.12.2" + "version": "3.12.3" }, "widgets": { "application/vnd.jupyter.widget-state+json": { diff --git a/demo/basic_multiplanar.ipynb b/demo/basic_multiplanar.ipynb index 9bc1412..5408122 100644 --- a/demo/basic_multiplanar.ipynb +++ b/demo/basic_multiplanar.ipynb @@ -17,7 +17,7 @@ "metadata": {}, "outputs": [], "source": [ - "from ipyniivue import AnyNiivue, SliceType\n", + "from ipyniivue import NiiVue, SliceType\n", "# based on https://niivue.github.io/niivue/features/basic.multiplanar.html\n", "\n", "volumes = [\n", @@ -25,7 +25,7 @@ " { \"path\": \"../images/hippo.nii.gz\", \"colormap\": \"red\", \"visible\": True, \"opacity\": 1 },\n", "\n", "]\n", - "nv = AnyNiivue(slice_type=SliceType.MULTIPLANAR)\n", + "nv = NiiVue(slice_type=SliceType.MULTIPLANAR)\n", "nv.load_volumes(volumes)\n", "nv" ] @@ -71,7 +71,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.12.2" + "version": "3.12.3" }, "widgets": { "application/vnd.jupyter.widget-state+json": { diff --git a/src/ipyniivue/__init__.py b/src/ipyniivue/__init__.py index bf0ea3e..627b4e4 100644 --- a/src/ipyniivue/__init__.py +++ b/src/ipyniivue/__init__.py @@ -3,6 +3,6 @@ import importlib.metadata from ._constants import DragMode, MuliplanarType, SliceType # noqa: F401 -from ._widget import AnyNiivue # noqa: F401 +from ._widget import NiiVue # noqa: F401 __version__ = importlib.metadata.version("ipyniivue") diff --git a/src/ipyniivue/_widget.py b/src/ipyniivue/_widget.py index a9e1365..a0fa65f 100644 --- a/src/ipyniivue/_widget.py +++ b/src/ipyniivue/_widget.py @@ -8,7 +8,7 @@ from ._options_mixin import OptionsMixin from ._utils import file_serializer, serialize_options, snake_to_camel -__all__ = ["AnyNiivue"] +__all__ = ["NiiVue"] class Volume(ipywidgets.Widget): @@ -22,7 +22,7 @@ class Volume(ipywidgets.Widget): cal_max = t.Float(None, allow_none=True).tag(sync=True) -class AnyNiivue(OptionsMixin, anywidget.AnyWidget): +class NiiVue(OptionsMixin, anywidget.AnyWidget): """Represents a Niivue instance.""" _esm = pathlib.Path(__file__).parent / "static" / "widget.js"