Skip to content

Commit

Permalink
finalized iss reader
Browse files Browse the repository at this point in the history
  • Loading branch information
LucaMarconato committed May 7, 2024
1 parent 5e10972 commit 90a7032
Showing 1 changed file with 1 addition and 15 deletions.
16 changes: 1 addition & 15 deletions src/spatialdata_io/readers/iss.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
from typing import Any

import anndata as ad
import numpy as np
from dask_image.imread import imread
from spatialdata import SpatialData
from spatialdata.models import Image2DModel, Labels2DModel, TableModel
Expand Down Expand Up @@ -77,27 +76,14 @@ def iss(
path = Path(path)

adata = ad.read(path / h5ad_relative_path)
adata.obs[instance_key] = np.arange(len(adata))
adata.obs[instance_key] = adata.obs.index.astype(int)
adata.var_names_make_unique()
adata.obs[REGION_KEY] = REGION
table = TableModel.parse(adata, region=REGION, region_key=REGION_KEY, instance_key=instance_key)

transform_original = Identity()

labels_image = imread(path / labels_relative_path, **imread_kwargs).squeeze()
# import os
# labels_image = imread(os.path.expanduser('~/Desktop/labels_image.tif'), **imread_kwargs).squeeze()
##
# import matplotlib.pyplot as plt
# # x = labels_image.transpose(1, 2, 0)
# x = labels_image[0, :, :]
# x.shape
# plt.imshow(x[:, :, 0])
# plt.show()
# import tifffile
# import os
# tifffile.imsave(os.path.expanduser("~/Desktop/labels_image.tif"), x)
##
labels_image = DataArray(labels_image[2, :, :], dims=("y", "x"))

labels_image_parsed = Labels2DModel.parse(
Expand Down

0 comments on commit 90a7032

Please sign in to comment.