Skip to content

Commit edc170d

Browse files
Fix ome ngff schmea location and bump version (#142)
* Fix ome ngff schmea location and bump version * Fix tests * More test fixes
1 parent bf9b5fd commit edc170d

File tree

7 files changed

+10
-10
lines changed

7 files changed

+10
-10
lines changed

mobie/__version__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
__version__ = "0.5.3"
1+
__version__ = "0.5.4"
22
SPEC_VERSION = "0.3.0"

mobie/import_data/traces.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ def traces_to_volume(traces, out_path, key, shape, resolution, chunks,
118118
radius, n_threads, crop_overhanging=True):
119119
# write temporary h5 dataset
120120
# and write coordinates (with some radius) to it
121-
with open_file(out_path) as f:
121+
with open_file(out_path, mode="a") as f:
122122
ds = f.require_dataset(key, shape=shape, dtype='int16', compression='gzip',
123123
chunks=chunks)
124124
ds.n_threads = n_threads

mobie/validation/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"source": "https://raw.githubusercontent.com/mobie/mobie.github.io/master/schema/source.schema.json",
1414
"view": "https://raw.githubusercontent.com/mobie/mobie.github.io/master/schema/view.schema.json",
1515
"views": "https://raw.githubusercontent.com/mobie/mobie.github.io/master/schema/views.schema.json",
16-
"NGFF": "https://raw.githubusercontent.com/ome/ngff/main/0.4/schemas/image.schema"
16+
"NGFF": "https://raw.githubusercontent.com/ome/ngff/7ac3430c74a66e5bcf53e41c429143172d68c0a4/schemas/image.schema"
1717
}
1818

1919

mobie/xml_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ def update_xml_transformation_parameter(xml_path, parameter):
123123
else:
124124
raise ValueError(f"Invalid affine transformation {parameter}")
125125
resolution = get_resolution(xml_path, setup_id=0)
126-
if np.product(resolution) != 1:
126+
if np.prod(resolution) != 1:
127127
warnings.warn(
128128
f"The xml file at {xml_path} has the resolution {resolution}."
129129
"The corresponding transformation will be over-written,"

test/import_data/test_image.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ def create_h5_input_data(self, shape=3*(64,)):
9292
data = np.random.rand(*shape)
9393
test_path = os.path.join(self.test_folder, "data-h5.h5")
9494
key = "data"
95-
with open_file(test_path) as f:
95+
with open_file(test_path, mode="a") as f:
9696
f.create_dataset(key, data=data)
9797
return test_path, key, data
9898

@@ -108,11 +108,11 @@ def test_import_tif(self):
108108
im_folder = os.path.join(self.test_folder, "im-stack")
109109
os.makedirs(im_folder, exist_ok=True)
110110

111-
resolution=(0.25, 1, 1)
111+
resolution = (0.25, 1, 1)
112112

113113
for z in range(shape[0]):
114114
path = os.path.join(im_folder, "z_%03i.tif" % z)
115-
imageio.imsave(path, data[z])
115+
imageio.imwrite(path, data[z])
116116

117117
scales = [[1, 2, 2], [1, 2, 2], [2, 2, 2]]
118118
import_image_data(im_folder, "*.tif", self.out_path,
@@ -126,7 +126,7 @@ def test_import_hdf5(self):
126126
from mobie.import_data import import_image_data
127127
test_path, key, data = self.create_h5_input_data()
128128
scales = [[2, 2, 2], [2, 2, 2], [2, 2, 2]]
129-
resolution=(1, 1, 1)
129+
resolution = (1, 1, 1)
130130
import_image_data(test_path, key, self.out_path,
131131
resolution=resolution, chunks=(32, 32, 32),
132132
scale_factors=scales, tmp_folder=self.tmp_folder,

test/import_data/test_segmentation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def test_import_segmentation(self):
4646

4747
test_path = os.path.join(self.test_folder, 'data.h5')
4848
key = 'data'
49-
with open_file(test_path) as f:
49+
with open_file(test_path, mode="a") as f:
5050
f.create_dataset(key, data=data)
5151

5252
scales = [[1, 2, 2], [2, 2, 2], [2, 2, 2]]

test/test_image_data.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def make_tif_data(self, im_folder, shape):
4646
os.makedirs(im_folder, exist_ok=True)
4747
for z in range(shape[0]):
4848
path = os.path.join(im_folder, "z_%03i.tif" % z)
49-
imageio.imsave(path, np.random.rand(*shape[1:]))
49+
imageio.imwrite(path, np.random.rand(*shape[1:]))
5050

5151
def test_init_from_tif(self):
5252
shape = (32, 128, 128)

0 commit comments

Comments
 (0)