2929 gen_obs_labels_schema ,
3030 gen_obs_sets_schema ,
3131 gen_sdata_image_schema ,
32- gen_sdata_labels_schema ,
32+ gen_sdata_obs_segmentations_schema ,
3333 gen_sdata_obs_spots_schema ,
3434 gen_sdata_obs_sets_schema ,
3535 gen_sdata_obs_feature_matrix_schema ,
@@ -1401,7 +1401,7 @@ def auto_view_config(self, vc):
14011401
14021402class SpatialDataWrapper (AnnDataWrapper ):
14031403
1404- def __init__ (self , sdata_path : Optional [str ] = None , sdata_url : Optional [str ] = None , sdata_store : Optional [Union [str , zarr .storage .StoreLike ]] = None , sdata_artifact : Optional [ln .Artifact ] = None , image_path : Optional [str ] = None , region : Optional [str ] = None , coordinate_system : Optional [str ] = None , affine_transformation : Optional [ np . ndarray ] = None , obs_spots_path : Optional [str ] = None , labels_path : Optional [str ] = None , table_path : str = "tables/table" , coordination_values = None , ** kwargs ):
1404+ def __init__ (self , sdata_path : Optional [str ] = None , sdata_url : Optional [str ] = None , sdata_store : Optional [Union [str , zarr .storage .StoreLike ]] = None , sdata_artifact : Optional [ln .Artifact ] = None , image_path : Optional [str ] = None , region : Optional [str ] = None , coordinate_system : Optional [str ] = None , obs_spots_path : Optional [str ] = None , obs_segmentations_path : Optional [str ] = None , table_path : str = "tables/table" , coordination_values = None , ** kwargs ):
14051405 """
14061406 Wrap a SpatialData object.
14071407
@@ -1421,8 +1421,8 @@ def __init__(self, sdata_path: Optional[str] = None, sdata_url: Optional[str] =
14211421 :type affine_transformation: Optional[np.ndarray]
14221422 :param obs_spots_path: Location of shapes that should be interpreted as spot observations, by default None
14231423 :type obs_spots_path: Optional[str]
1424- :param labels_path: Location of the labels (segmentation bitmask image), by default None
1425- :type labels_path : Optional[str]
1424+ :param obs_segmentations_path: Path to a labels or shapes element (segmentation bitmask label image or segmentation polygon shapes ), by default None
1425+ :type obs_segmentations_path : Optional[str]
14261426 """
14271427 raise_error_if_zero_or_more_than_one ([
14281428 sdata_path ,
@@ -1437,14 +1437,21 @@ def __init__(self, sdata_path: Optional[str] = None, sdata_url: Optional[str] =
14371437 kwargs .get ('adata_artifact' , None )
14381438 ])
14391439 super ().__init__ (adata_path = sdata_path , adata_url = sdata_url , adata_store = sdata_store , adata_artifact = sdata_artifact , ** kwargs )
1440+ if "labels_path" in kwargs :
1441+ warnings .warn ("`labels_path` is deprecated. Use `obs_segmentations_path` instead." , DeprecationWarning )
1442+ self ._obs_segmentations_path = kwargs ["labels_path" ]
1443+ if "shapes_path" in kwargs :
1444+ warnings .warn ("`shapes_path` is deprecated. Use `obs_segmentations_path` instead." , DeprecationWarning )
1445+ if "affine_transformation" in kwargs :
1446+ warnings .warn ("`affine_transformation` is deprecated. Store transformations in the SpatialData object, then specify `coordinate_system`." , DeprecationWarning )
1447+
14401448 self .local_dir_uid = make_unique_filename (".sdata.zarr" )
14411449 self ._image_path = image_path
14421450 self ._region = region
14431451 self ._coordinate_system = coordinate_system
1444- self ._affine_transformation = affine_transformation
14451452 self ._kwargs = kwargs
14461453 self ._obs_spots_path = obs_spots_path
1447- self ._labels_path = labels_path
1454+ self ._obs_segmentations_path = obs_segmentations_path
14481455 if self ._adata_path is not None :
14491456 self .zarr_folder = 'spatialdata.zarr'
14501457 self .obs_type_label = None
@@ -1530,8 +1537,8 @@ def generator(base_url):
15301537 options = gen_sdata_obs_feature_matrix_schema (options , self ._expression_matrix , self ._gene_var_filter , self ._matrix_gene_var_filter , self ._region )
15311538 options = gen_sdata_obs_sets_schema (options , self ._obs_set_elems , self ._obs_set_names , self ._table_path , self ._region )
15321539 options = gen_sdata_obs_spots_schema (options , self ._obs_spots_path , self ._table_path , self ._region , self ._coordinate_system )
1533- options = gen_sdata_image_schema (options , self ._image_path , self ._coordinate_system , self . _affine_transformation )
1534- options = gen_sdata_labels_schema (options , self ._labels_path , self ._table_path , self ._coordinate_system , self . _affine_transformation )
1540+ options = gen_sdata_image_schema (options , self ._image_path , self ._coordinate_system )
1541+ options = gen_sdata_obs_segmentations_schema (options , self ._obs_segmentations_path , self ._table_path , self ._coordinate_system )
15351542 options = gen_feature_labels_schema (self ._feature_labels , options )
15361543 if len (options .keys ()) > 0 :
15371544 obj_file_def = {
0 commit comments