From 33d5a30fd8195dcdba256b5ade7fbedf62e3f33d Mon Sep 17 00:00:00 2001 From: Matt McCormick Date: Fri, 8 Mar 2024 14:37:29 -0500 Subject: [PATCH 1/2] BUG: Fix detection of itk package It is possible that the `itk` metapackage is not install, but one of the more specific packages were just installed, e.g. `itk-filtering`. Check for `itk-core`, which will always be installed and which has the required functionality, when checking for ITK Python. --- itkwidgets/integrations/itk.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/itkwidgets/integrations/itk.py b/itkwidgets/integrations/itk.py index 58563c0f..6a18e37e 100644 --- a/itkwidgets/integrations/itk.py +++ b/itkwidgets/integrations/itk.py @@ -4,7 +4,7 @@ import importlib_metadata HAVE_ITK = False try: - itk_version = importlib_metadata.version('itk') + itk_version = importlib_metadata.version('itk-core') if version.parse(itk_version) < version.parse('5.3.0'): raise RuntimeError('itk 5.3 or newer is required. `pip install itk>=5.3.0`') HAVE_ITK = True From 3ace3870591e15232fe0c53c51f37978bb1b3f2d Mon Sep 17 00:00:00 2001 From: Matt McCormick Date: Fri, 8 Mar 2024 14:40:07 -0500 Subject: [PATCH 2/2] DOC: Bump the itkwidgets version in the SelectROI notebook to 1.0a48 --- examples/integrations/itk/SelectROI.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/integrations/itk/SelectROI.ipynb b/examples/integrations/itk/SelectROI.ipynb index f48d1565..c238eb72 100644 --- a/examples/integrations/itk/SelectROI.ipynb +++ b/examples/integrations/itk/SelectROI.ipynb @@ -32,7 +32,7 @@ "# Install dependencies for this example\n", "import sys\n", "\n", - "!{sys.executable} -m pip install -q pooch tqdm \"itk-io>=5.3.0\" \"itk-filtering>=5.3.0\" \"itkwidgets[all]>=1.0a41\" rich" + "!{sys.executable} -m pip install -q pooch tqdm \"itk-io>=5.3.0\" \"itk-filtering>=5.3.0\" \"itkwidgets[all]>=1.0a48\" rich" ] }, {