Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions build.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ class Platform:

windows_x64 = Platform(pypi_suffix="win_amd64", metadata="windows-x64")
linux_x64 = Platform(pypi_suffix="manylinux2014_x86_64", metadata="linux-x64")
macos_arm = Platform(pypi_suffix="macosx_12_0_arm64", metadata="macos-x64")
# macos_intel = Platform(pypi_suffix="macosx_10_16_x86_64", metadata="macos-x64")
macos_arm = Platform(pypi_suffix="macosx_12_0_arm64", metadata="macos-arm64")
macos_intel = Platform(pypi_suffix="macosx_10_16_x86_64", metadata="macos-x64")


required_packages = [
Expand All @@ -42,8 +42,8 @@ class Platform:
"zarr==3.0.8",
"fsspec==2025.5.1",
'cmap==0.6.0',
's3fs==2025.5.1'

's3fs==2025.5.1',
'pyyaml==6.0.2', # needed for preference yaml loading and writing
# development
# "ipycytoscape" # for visualizing dask trees
]
Expand All @@ -57,7 +57,7 @@ class Platform:
windows_x64,
linux_x64,
macos_arm,
# macos_intel,
macos_intel,
]


Expand Down
22 changes: 18 additions & 4 deletions microscopynodes/blender_manifest.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
schema_version = "1.0.0"

id = "microscopynodes"
version = "2.2.2"
version = "2.2.4"
name = "Microscopy Nodes"
tagline = "Handling microscopy data in Blender, up to 5D volumes"
maintainer = "Aafke Gros <aafke.gros@embl.de>"
Expand All @@ -13,6 +13,7 @@ website = "https://aafkegros.github.io/MicroscopyNodes/"
platforms = [
"windows-x64",
"linux-x64",
"macos-arm64",
"macos-x64",
]
tags = [
Expand All @@ -29,31 +30,36 @@ copyright =[
# Optional: bundle 3rd party Python modules.
# https://docs.blender.org/manual/en/dev/advanced/extensions/python_wheels.html
wheels = [
"./wheels/PyYAML-6.0.2-cp311-cp311-macosx_10_9_x86_64.whl",
"./wheels/PyYAML-6.0.2-cp311-cp311-macosx_11_0_arm64.whl",
"./wheels/PyYAML-6.0.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"./wheels/PyYAML-6.0.2-cp311-cp311-win_amd64.whl",
"./wheels/aiobotocore-2.24.1-py3-none-any.whl",
"./wheels/aiobotocore-2.24.2-py3-none-any.whl",
"./wheels/aiohappyeyeballs-2.6.1-py3-none-any.whl",
"./wheels/aiohttp-3.12.15-cp311-cp311-macosx_10_9_x86_64.whl",
"./wheels/aiohttp-3.12.15-cp311-cp311-macosx_11_0_arm64.whl",
"./wheels/aiohttp-3.12.15-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"./wheels/aiohttp-3.12.15-cp311-cp311-win_amd64.whl",
"./wheels/aioitertools-0.12.0-py3-none-any.whl",
"./wheels/aiosignal-1.4.0-py3-none-any.whl",
"./wheels/attrs-25.3.0-py3-none-any.whl",
"./wheels/botocore-1.39.11-py3-none-any.whl",
"./wheels/botocore-1.40.18-py3-none-any.whl",
"./wheels/click-8.2.1-py3-none-any.whl",
"./wheels/cloudpickle-3.1.1-py3-none-any.whl",
"./wheels/cmap-0.6.0-py3-none-any.whl",
"./wheels/crc32c-2.7.1-cp311-cp311-macosx_10_9_x86_64.whl",
"./wheels/crc32c-2.7.1-cp311-cp311-macosx_11_0_arm64.whl",
"./wheels/crc32c-2.7.1-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"./wheels/crc32c-2.7.1-cp311-cp311-win_amd64.whl",
"./wheels/dask-2025.5.1-py3-none-any.whl",
"./wheels/donfig-0.8.1.post1-py3-none-any.whl",
"./wheels/frozenlist-1.7.0-cp311-cp311-macosx_10_9_x86_64.whl",
"./wheels/frozenlist-1.7.0-cp311-cp311-macosx_11_0_arm64.whl",
"./wheels/frozenlist-1.7.0-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"./wheels/frozenlist-1.7.0-cp311-cp311-win_amd64.whl",
"./wheels/fsspec-2025.5.1-py3-none-any.whl",
"./wheels/idna-3.10-py3-none-any.whl",
"./wheels/imagecodecs-2025.3.30-cp311-cp311-macosx_10_14_x86_64.whl",
"./wheels/imagecodecs-2025.3.30-cp311-cp311-macosx_11_0_arm64.whl",
"./wheels/imagecodecs-2025.3.30-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"./wheels/imagecodecs-2025.3.30-cp311-cp311-win_amd64.whl",
Expand All @@ -62,37 +68,45 @@ wheels = [
"./wheels/jmespath-1.0.1-py3-none-any.whl",
"./wheels/lazy_loader-0.4-py3-none-any.whl",
"./wheels/locket-1.0.0-py2.py3-none-any.whl",
"./wheels/multidict-6.6.4-cp311-cp311-macosx_10_9_x86_64.whl",
"./wheels/multidict-6.6.4-cp311-cp311-macosx_11_0_arm64.whl",
"./wheels/multidict-6.6.4-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl",
"./wheels/multidict-6.6.4-cp311-cp311-win_amd64.whl",
"./wheels/networkx-3.5-py3-none-any.whl",
"./wheels/numcodecs-0.16.2-cp311-cp311-macosx_10_13_x86_64.whl",
"./wheels/numcodecs-0.16.2-cp311-cp311-macosx_11_0_arm64.whl",
"./wheels/numcodecs-0.16.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"./wheels/numcodecs-0.16.2-cp311-cp311-win_amd64.whl",
"./wheels/packaging-25.0-py3-none-any.whl",
"./wheels/partd-1.4.2-py3-none-any.whl",
"./wheels/pillow-11.3.0-cp311-cp311-macosx_10_10_x86_64.whl",
"./wheels/pillow-11.3.0-cp311-cp311-macosx_11_0_arm64.whl",
"./wheels/pillow-11.3.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl",
"./wheels/pillow-11.3.0-cp311-cp311-win_amd64.whl",
"./wheels/propcache-0.3.2-cp311-cp311-macosx_10_9_x86_64.whl",
"./wheels/propcache-0.3.2-cp311-cp311-macosx_11_0_arm64.whl",
"./wheels/propcache-0.3.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"./wheels/propcache-0.3.2-cp311-cp311-win_amd64.whl",
"./wheels/python_dateutil-2.9.0.post0-py2.py3-none-any.whl",
"./wheels/s3fs-2025.5.1-py3-none-any.whl",
"./wheels/scikit_image-0.25.2-cp311-cp311-macosx_10_9_x86_64.whl",
"./wheels/scikit_image-0.25.2-cp311-cp311-macosx_12_0_arm64.whl",
"./wheels/scikit_image-0.25.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"./wheels/scikit_image-0.25.2-cp311-cp311-win_amd64.whl",
"./wheels/scipy-1.15.2-cp311-cp311-macosx_10_13_x86_64.whl",
"./wheels/scipy-1.15.2-cp311-cp311-macosx_12_0_arm64.whl",
"./wheels/scipy-1.15.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"./wheels/scipy-1.15.2-cp311-cp311-win_amd64.whl",
"./wheels/six-1.17.0-py2.py3-none-any.whl",
"./wheels/tifffile-2025.6.11-py3-none-any.whl",
"./wheels/toolz-1.0.0-py3-none-any.whl",
"./wheels/typing_extensions-4.14.1-py3-none-any.whl",
"./wheels/typing_extensions-4.15.0-py3-none-any.whl",
"./wheels/urllib3-2.5.0-py3-none-any.whl",
"./wheels/wrapt-1.17.3-cp311-cp311-macosx_10_9_x86_64.whl",
"./wheels/wrapt-1.17.3-cp311-cp311-macosx_11_0_arm64.whl",
"./wheels/wrapt-1.17.3-cp311-cp311-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl",
"./wheels/wrapt-1.17.3-cp311-cp311-win_amd64.whl",
"./wheels/yarl-1.20.1-cp311-cp311-macosx_10_9_x86_64.whl",
"./wheels/yarl-1.20.1-cp311-cp311-macosx_11_0_arm64.whl",
"./wheels/yarl-1.20.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"./wheels/yarl-1.20.1-cp311-cp311-win_amd64.whl",
Expand Down
7 changes: 6 additions & 1 deletion microscopynodes/file_to_array/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,12 @@ def change_path(self, context):
log("")
context.scene.property_unset("MiN_reload")
if get_loader() is not None:
get_loader().change_path(context)
try:
get_loader().change_path(context)
except Exception as e:
print(e)
log(f"Error loading file: {e}")
return
bpy.context.scene.MiN_enable_ui = True
return

Expand Down
4 changes: 2 additions & 2 deletions microscopynodes/file_to_array/arrayloading.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ def _set_unit(self, unit_str):
try:
bpy.context.scene.MiN_unit = parse_unit(unit_str)
except Exception as e:
print(f'did not parse unit ({unit_str})', e)
bpy.context.scene.property_unset("MiN_unit")
# print(f'did not parse unit ({unit_str})', e)
bpy.context.scene.MiN_unit = "AU"

def _set_axes_order(self, axes_order):
try:
Expand Down
7 changes: 5 additions & 2 deletions microscopynodes/file_to_array/tif.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,11 @@ class TifLoader(ArrayLoader):
def set_file_globals(self, input_file):
with tifffile.TiffFile(input_file) as ifstif:
self._set_axes_order(ifstif.series[0].axes.lower().replace('s', 'c').replace('q','z'))
if 'unit' in dict(ifstif.imagej_metadata):
self._set_unit(dict(ifstif.imagej_metadata)['unit'])
try: # try for non imagej tif
if 'unit' in dict(ifstif.imagej_metadata):
self._set_unit(dict(ifstif.imagej_metadata)['unit'])
except TypeError as e:
self._set_unit(None)
return

def fill_array_options(self, input_file):
Expand Down
8 changes: 5 additions & 3 deletions microscopynodes/parse_inputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,16 +69,18 @@ def parse_unit(string):
def parse_scale(size_px, pixel_size, objs):
scale = None
scale_factor = 1

world_scale = addon_preferences(bpy.context).import_scale
print(bpy.context.scene.MiN_unit, world_scale)
print('hey')
isotropic = np.array([1,1,pixel_size[-1]/pixel_size[0]])
if world_scale == "DEFAULT" or bpy.context.scene.MiN_unit == 'AU': # cm / px
scale = isotropic*0.01

if world_scale == "MOLECULAR_NODES": # cm / nm
if world_scale == "MOLECULAR_NODES" and bpy.context.scene.MiN_unit != 'AU': # cm / nm
physical_size = parse_unit(bpy.context.scene.MiN_unit) * pixel_size
scale = physical_size / 1e-7
if "_SCALE" in world_scale:
if "_SCALE" in world_scale and bpy.context.scene.MiN_unit != 'AU': # m / unit
physical_size = parse_unit(bpy.context.scene.MiN_unit) * pixel_size
scale = physical_size / parse_unit(world_scale.removesuffix("_SCALE"))

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "microscopynodes"
version = "2.2.1"
version = "2.2.4"
description = "Loading and handling microscopy data in Blender."
authors = ["Oane Gros <oane.gros@embl.de>"]
include = [
Expand Down
Loading