bfio 2.4.5__tar.gz → 2.4.6__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: bfio
3
- Version: 2.4.5
3
+ Version: 2.4.6
4
4
  Summary: Simple reading and writing classes for tiled tiffs using Bio-Formats.
5
5
  Author-email: Nick Schaub <nick.schaub@nih.gov>, Sameeul Bashir Samee <sameeul.samee@axleinfo.com>
6
6
  Maintainer-email: Sameeul Bashir Samee <sameeul.samee@axleinfo.com>
@@ -45,9 +45,10 @@ Requires-Dist: tifffile>=2022.8.12
45
45
  Requires-Dist: bfiocpp
46
46
  Provides-Extra: dev
47
47
  Requires-Dist: ome_zarr; extra == "dev"
48
+ Requires-Dist: pillow; extra == "dev"
48
49
  Requires-Dist: requests>=2.26.0; extra == "dev"
49
50
 
50
- # **B**io**F**ormats **I**nput/**O**utput utility (bfio 2.4.5)
51
+ # **B**io**F**ormats **I**nput/**O**utput utility (bfio 2.4.6)
51
52
 
52
53
  [![Documentation Status](https://readthedocs.org/projects/bfio/badge/?version=latest)](https://bfio.readthedocs.io/en/latest/?badge=latest)
53
54
  [![PyPI](https://img.shields.io/pypi/v/bfio)](https://pypi.org/project/bfio/)
@@ -99,15 +100,15 @@ be installed using pip:
99
100
 
100
101
  ## Docker
101
102
 
102
- ### polusai/bfio:2.4.5
103
+ ### polusai/bfio:2.4.6
103
104
 
104
105
  Ubuntu based container with bfio and all dependencies (including Java).
105
106
 
106
- ### polusai/bfio:2.4.5-imagej
107
+ ### polusai/bfio:2.4.6-imagej
107
108
 
108
109
  Same as above, except comes with ImageJ and PyImageJ.
109
110
 
110
- ### polusai/bfio:2.4.5-tensorflow
111
+ ### polusai/bfio:2.4.6-tensorflow
111
112
 
112
113
  Tensorflow container with bfio installed.
113
114
 
@@ -1,4 +1,4 @@
1
- # **B**io**F**ormats **I**nput/**O**utput utility (bfio 2.4.5)
1
+ # **B**io**F**ormats **I**nput/**O**utput utility (bfio 2.4.6)
2
2
 
3
3
  [![Documentation Status](https://readthedocs.org/projects/bfio/badge/?version=latest)](https://bfio.readthedocs.io/en/latest/?badge=latest)
4
4
  [![PyPI](https://img.shields.io/pypi/v/bfio)](https://pypi.org/project/bfio/)
@@ -50,15 +50,15 @@ be installed using pip:
50
50
 
51
51
  ## Docker
52
52
 
53
- ### polusai/bfio:2.4.5
53
+ ### polusai/bfio:2.4.6
54
54
 
55
55
  Ubuntu based container with bfio and all dependencies (including Java).
56
56
 
57
- ### polusai/bfio:2.4.5-imagej
57
+ ### polusai/bfio:2.4.6-imagej
58
58
 
59
59
  Same as above, except comes with ImageJ and PyImageJ.
60
60
 
61
- ### polusai/bfio:2.4.5-tensorflow
61
+ ### polusai/bfio:2.4.6-tensorflow
62
62
 
63
63
  Tensorflow container with bfio installed.
64
64
 
@@ -56,6 +56,7 @@ requires-python = ">=3.8"
56
56
  [project.optional-dependencies]
57
57
  dev = [
58
58
  "ome_zarr",
59
+ "pillow",
59
60
  "requests>=2.26.0"
60
61
  ]
61
62
 
@@ -86,7 +87,7 @@ namespaces = false
86
87
 
87
88
 
88
89
  [tool.bumpversion]
89
- current_version = "2.4.5"
90
+ current_version = "2.4.6"
90
91
  commit = true
91
92
  tag = true
92
93
  commit_args = "--no-verify"
@@ -0,0 +1 @@
1
+ 2.4.6
@@ -988,17 +988,7 @@ try:
988
988
 
989
989
  def _read_image(self, X, Y, Z, C, T, output):
990
990
  out = self._image
991
- pseudo_interleaved = any(
992
- channel.samples_per_pixel > 1
993
- for channel in self.frontend.metadata.images[0].pixels.channels
994
- )
995
-
996
- interleaved = False
997
- if (
998
- self.frontend.metadata.images[0].pixels.interleaved
999
- or pseudo_interleaved
1000
- ):
1001
- interleaved = True
991
+ interleaved = self.frontend.metadata.images[0].pixels.interleaved
1002
992
 
1003
993
  self._prev_read_cached_loc = None
1004
994
  self._cached_read_data = None
@@ -39,7 +39,7 @@ try:
39
39
  """
40
40
 
41
41
  global JAR_VERSION
42
- scyjava.config.endpoints.append("ome:formats-gpl:7.3.0")
42
+ scyjava.config.endpoints.append("ome:formats-gpl:8.0.0")
43
43
  scyjava.start_jvm()
44
44
  import loci
45
45
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: bfio
3
- Version: 2.4.5
3
+ Version: 2.4.6
4
4
  Summary: Simple reading and writing classes for tiled tiffs using Bio-Formats.
5
5
  Author-email: Nick Schaub <nick.schaub@nih.gov>, Sameeul Bashir Samee <sameeul.samee@axleinfo.com>
6
6
  Maintainer-email: Sameeul Bashir Samee <sameeul.samee@axleinfo.com>
@@ -45,9 +45,10 @@ Requires-Dist: tifffile>=2022.8.12
45
45
  Requires-Dist: bfiocpp
46
46
  Provides-Extra: dev
47
47
  Requires-Dist: ome_zarr; extra == "dev"
48
+ Requires-Dist: pillow; extra == "dev"
48
49
  Requires-Dist: requests>=2.26.0; extra == "dev"
49
50
 
50
- # **B**io**F**ormats **I**nput/**O**utput utility (bfio 2.4.5)
51
+ # **B**io**F**ormats **I**nput/**O**utput utility (bfio 2.4.6)
51
52
 
52
53
  [![Documentation Status](https://readthedocs.org/projects/bfio/badge/?version=latest)](https://bfio.readthedocs.io/en/latest/?badge=latest)
53
54
  [![PyPI](https://img.shields.io/pypi/v/bfio)](https://pypi.org/project/bfio/)
@@ -99,15 +100,15 @@ be installed using pip:
99
100
 
100
101
  ## Docker
101
102
 
102
- ### polusai/bfio:2.4.5
103
+ ### polusai/bfio:2.4.6
103
104
 
104
105
  Ubuntu based container with bfio and all dependencies (including Java).
105
106
 
106
- ### polusai/bfio:2.4.5-imagej
107
+ ### polusai/bfio:2.4.6-imagej
107
108
 
108
109
  Same as above, except comes with ImageJ and PyImageJ.
109
110
 
110
- ### polusai/bfio:2.4.5-tensorflow
111
+ ### polusai/bfio:2.4.6-tensorflow
111
112
 
112
113
  Tensorflow container with bfio installed.
113
114
 
@@ -9,4 +9,5 @@ bfiocpp
9
9
 
10
10
  [dev]
11
11
  ome_zarr
12
+ pillow
12
13
  requests>=2.26.0
@@ -5,6 +5,8 @@ import bfio
5
5
  import numpy as np
6
6
  import pickle
7
7
  import random
8
+ import tifffile
9
+ from PIL import Image
8
10
  import zarr
9
11
  from ome_zarr.utils import download as zarr_download
10
12
 
@@ -457,3 +459,37 @@ class TestBioReaderPickle(unittest.TestCase):
457
459
  assert unpickled_rdr.Y == img_height
458
460
  assert unpickled_rdr[:].sum() == data_sum
459
461
  unpickled_rdr.close()
462
+
463
+
464
+ class TestMultiChannelBioformats(unittest.TestCase):
465
+
466
+ def test_multi_channel_bioformats(self):
467
+
468
+ # Set image dimensions
469
+ width, height = 256, 256
470
+
471
+ # Create random 3-channel image data
472
+ random_image_data = np.random.randint(
473
+ 0, 256, (height, width, 3), dtype=np.uint8
474
+ )
475
+
476
+ # Save interleaved TIFF (RGBRGB...)
477
+ interleaved_image = Image.fromarray(random_image_data, mode="RGB")
478
+ interleaved_image.save(TEST_DIR.joinpath("interleaved.tiff"))
479
+
480
+ # Create non-interleaved data (separate planes for R, G, B)
481
+ non_interleaved_data = np.moveaxis(
482
+ random_image_data, 2, 0
483
+ ) # Shape: (3, height, width)
484
+
485
+ # Save non-interleaved TIFF
486
+ with tifffile.TiffWriter(TEST_DIR.joinpath("non_interleaved.tiff")) as tif:
487
+ tif.write(non_interleaved_data, photometric="rgb")
488
+
489
+ with bfio.BioReader(TEST_DIR.joinpath("non_interleaved.tiff")) as br:
490
+ for c in range(br.C):
491
+ assert (br[:, :, :, c] - random_image_data[:, :, c]).sum() == 0
492
+
493
+ with bfio.BioReader(TEST_DIR.joinpath("interleaved.tiff")) as br:
494
+ for c in range(br.C):
495
+ assert (br[:, :, :, c] - non_interleaved_data[c, :, :]).sum() == 0
@@ -1 +0,0 @@
1
- 2.4.5
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes