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
2 changes: 1 addition & 1 deletion mobie/__version__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
__version__ = "0.5.3"
__version__ = "0.5.4"
SPEC_VERSION = "0.3.0"
2 changes: 1 addition & 1 deletion mobie/import_data/traces.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ def traces_to_volume(traces, out_path, key, shape, resolution, chunks,
radius, n_threads, crop_overhanging=True):
# write temporary h5 dataset
# and write coordinates (with some radius) to it
with open_file(out_path) as f:
with open_file(out_path, mode="a") as f:
ds = f.require_dataset(key, shape=shape, dtype='int16', compression='gzip',
chunks=chunks)
ds.n_threads = n_threads
Expand Down
2 changes: 1 addition & 1 deletion mobie/validation/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"source": "https://raw.githubusercontent.com/mobie/mobie.github.io/master/schema/source.schema.json",
"view": "https://raw.githubusercontent.com/mobie/mobie.github.io/master/schema/view.schema.json",
"views": "https://raw.githubusercontent.com/mobie/mobie.github.io/master/schema/views.schema.json",
"NGFF": "https://raw.githubusercontent.com/ome/ngff/main/0.4/schemas/image.schema"
"NGFF": "https://raw.githubusercontent.com/ome/ngff/7ac3430c74a66e5bcf53e41c429143172d68c0a4/schemas/image.schema"
}


Expand Down
2 changes: 1 addition & 1 deletion mobie/xml_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def update_xml_transformation_parameter(xml_path, parameter):
else:
raise ValueError(f"Invalid affine transformation {parameter}")
resolution = get_resolution(xml_path, setup_id=0)
if np.product(resolution) != 1:
if np.prod(resolution) != 1:
warnings.warn(
f"The xml file at {xml_path} has the resolution {resolution}."
"The corresponding transformation will be over-written,"
Expand Down
8 changes: 4 additions & 4 deletions test/import_data/test_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def create_h5_input_data(self, shape=3*(64,)):
data = np.random.rand(*shape)
test_path = os.path.join(self.test_folder, "data-h5.h5")
key = "data"
with open_file(test_path) as f:
with open_file(test_path, mode="a") as f:
f.create_dataset(key, data=data)
return test_path, key, data

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

resolution=(0.25, 1, 1)
resolution = (0.25, 1, 1)

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

scales = [[1, 2, 2], [1, 2, 2], [2, 2, 2]]
import_image_data(im_folder, "*.tif", self.out_path,
Expand All @@ -126,7 +126,7 @@ def test_import_hdf5(self):
from mobie.import_data import import_image_data
test_path, key, data = self.create_h5_input_data()
scales = [[2, 2, 2], [2, 2, 2], [2, 2, 2]]
resolution=(1, 1, 1)
resolution = (1, 1, 1)
import_image_data(test_path, key, self.out_path,
resolution=resolution, chunks=(32, 32, 32),
scale_factors=scales, tmp_folder=self.tmp_folder,
Expand Down
2 changes: 1 addition & 1 deletion test/import_data/test_segmentation.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def test_import_segmentation(self):

test_path = os.path.join(self.test_folder, 'data.h5')
key = 'data'
with open_file(test_path) as f:
with open_file(test_path, mode="a") as f:
f.create_dataset(key, data=data)

scales = [[1, 2, 2], [2, 2, 2], [2, 2, 2]]
Expand Down
2 changes: 1 addition & 1 deletion test/test_image_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def make_tif_data(self, im_folder, shape):
os.makedirs(im_folder, exist_ok=True)
for z in range(shape[0]):
path = os.path.join(im_folder, "z_%03i.tif" % z)
imageio.imsave(path, np.random.rand(*shape[1:]))
imageio.imwrite(path, np.random.rand(*shape[1:]))

def test_init_from_tif(self):
shape = (32, 128, 128)
Expand Down