Skip to content

Commit 0c91f12

Browse files
authored
Merge pull request #44 from funkelab/v0.2.1-patch
V0.2.1 patch
2 parents 07f7e4e + 369ccde commit 0c91f12

File tree

6 files changed

+8657
-6
lines changed

6 files changed

+8657
-6
lines changed

finn/track_import_export/load_tracks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ def tracks_from_df(
225225
attrs.update(row_dict)
226226

227227
if "track_id" in df.columns:
228-
attrs[NodeAttr.TRACK_ID.value] = row["track_id"]
228+
attrs[NodeAttr.TRACK_ID.value] = int(row["track_id"])
229229

230230
# add the node to the graph
231231
graph.add_node(_id, **attrs)

finn_builtins/_tests/test_example_data.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,5 @@ def test_Fluo_N2DL_Hela(ds_function, img_shape, point_shape):
3939
assert raw_data.shape == img_shape
4040
assert seg_data.shape == img_shape
4141
assert raw_data.dtype == np.uint16
42-
assert seg_data.dtype == np.uint16
42+
assert seg_data.dtype == np.uint64
4343
assert points.shape == point_shape

finn_builtins/example_data.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -280,15 +280,14 @@ def _convert_tiff_stack_to_zarr(
280280
files = sorted(tiff_path.glob("*.tif"))
281281
logger.info("%s time points found.", len(files))
282282
example_image = tifffile.imread(files[0])
283+
dtype = np.uint64 if relabel else example_image.dtype
283284
data_shape = (len(files), *example_image.shape)
284285
# prepare zarr
285-
zarr_array = _create_zarr(
286-
zarr_path, zarr_group, shape=data_shape, dtype=example_image.dtype
287-
)
286+
zarr_array = _create_zarr(zarr_path, zarr_group, shape=data_shape, dtype=dtype)
288287
# load and save data in zarr
289288
max_label = 0
290289
for t, file in enumerate(files):
291-
frame = tifffile.imread(file)
290+
frame = tifffile.imread(file).astype(dtype)
292291
if relabel:
293292
frame[frame != 0] += max_label
294293
max_label = int(np.max(frame))

pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,9 @@ ignore = [
301301
]
302302

303303
[tool.ruff.lint.per-file-ignores]
304+
"scripts/*" = [
305+
"INP001", # implicit namespace
306+
]
304307
# ignoring a lot of napari debt so that we can continue to check in new code
305308
"finn/_app_model/*" = [
306309
"E501", # line too long

0 commit comments

Comments
 (0)