Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OmeZarrWrapper instead of OmeTiffWrapper ? #86

Open
Artur-man opened this issue Jul 16, 2024 · 2 comments
Open

OmeZarrWrapper instead of OmeTiffWrapper ? #86

Artur-man opened this issue Jul 16, 2024 · 2 comments

Comments

@Artur-man
Copy link

Artur-man commented Jul 16, 2024

Hey there,

I would like to create this issue, also discussed in https://imagesc.zulipchat.com. It seems OmeTiffWrapper objects behave well with AnnDataWrapper with no problem, but are there any plans for implementing an OmeZarrWrapper functioning similar to OmeTiffWrapper ?

Sharing an example below:

library(vitessceR)
vc <- VitessceConfig$new(schema_version = "1.0.15", name='MBrain Example', description='mBrain')
dataset <- vc$add_dataset("MBrain")$add_object(
  MultiImageWrapper$new(
    image_wrappers = list(
      OmeTiffWrapper$new(name="Test", img_path="data/p01_x01_y01_wx0_wy0_c1.ome.tif")
    )
  )
)$add_object(
  AnnDataWrapper$new(
    adata_path="data/mbrain.zarr/",
    obs_set_paths = c("obs/clusters"),
    obs_set_names = c("Clusters"),
    obs_locations_path = "obsm/spatial",
    obs_segmentations_path="obsm/segmentation",
    obs_embedding_paths=c("obsm/umap")
  )
)
umap <- vc$add_view(dataset = dataset, Component$SCATTERPLOT, mapping = "umap")
cell_sets <- vc$add_view(dataset, Component$OBS_SETS)
spatial <- vc$add_view(dataset, Component$SPATIAL)
spatial_layers <- vc$add_view(dataset, Component$LAYER_CONTROLLER)
spatial_segmentation_layer_value <- list(opacity = 1, radius = 0, visible = TRUE, stroked = FALSE)
vc$link_views(views = c(spatial),
              c_types = c(CoordinationType$SPATIAL_ZOOM, "spatialSegmentationLayer"),
              c_values = c(0, spatial_segmentation_layer_value))

vc$layout(
  hconcat(spatial, vconcat(umap, hconcat(cell_sets, spatial_layers)))
)
vc$widget()

Screenshot 2024-07-16 at 22 35 37

@Artur-man Artur-man changed the title OmeTiffWrapper instead of OmeZarrWrapper ? OmeZarrWrapper instead of OmeTiffWrapper ? Jul 16, 2024
@ashishjain1988
Copy link

Hey @Artur-man,

I am getting an error while adding the MultiImageWrapper object to the VitessceConfig object. Did you also encountered the same issue while running your code?

vc <- VitessceConfig$new(schema_version = "1.0.15", name = "My config")
vc$add_dataset("T604")$add_object(
MultiImageWrapper$new(
image_wrappers = list(
OmeTiffWrapper$new(name="Test", img_path="data/cytassist_image.tiff")
)
)
)

Error in obj$convert_and_save(self$dataset$uid, length(private$objs), :
unused argument (base_dir = self$base_dir)

Regards,
Ashish Jain

@Artur-man
Copy link
Author

Artur-man commented Jul 25, 2024

Ah ok, I think I have corrected this in my fork as well. You have to pass the self$base_dir from MultiImageWrapper's convert_and_save to OmeTiffWrapper's convert_and_save, like in here: a6dd34f.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants