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

Working on 3D segmentation matrix #861

Open
rsemeraro opened this issue Jul 29, 2024 · 2 comments
Open

Working on 3D segmentation matrix #861

rsemeraro opened this issue Jul 29, 2024 · 2 comments
Assignees
Labels
image 🔬 question ❓ Further information is requested

Comments

@rsemeraro
Copy link

Hello everyone,
First of all, I'd like to extend my sincere thanks to all the developers and contributors to Squidpy and the entire Scanpy ecosystem. Your work is immensely valuable and greatly appreciated.
I've been working with single-cell data for quite a while, but this is my first time exploring spatial data. Following the tutorial on the website, I was analyzing Nanostring data and encountered an issue at the visualization step using sq.pl.spatial_segment. The error message I received was:
ValueError: all the input arrays must have same number of dimensions, but the array at index 0 has 4 dimension(s) and the array at index 1 has 3 dimension(s).
After inspecting my data object and comparing it with the one from the tutorial, I noticed that the "segment" field in my object contains 3-dimensional arrays, whereas the tutorial's object uses 2-dimensional arrays.
Could anyone provide guidance on how I might resolve this issue and successfully visualize my images?
Thank you in advance for your assistance and for fostering such a supportive community.
Best regards!

@giovp
Copy link
Member

giovp commented Aug 19, 2024

Could anyone provide guidance on how I might resolve this issue and successfully visualize my images?

could you try to squeeze() the numpy array? I'm not sure how the segmentation mask is imported but it should indeed only be 2 dimensions

@giovp giovp added question ❓ Further information is requested image 🔬 labels Aug 19, 2024
@rsemeraro
Copy link
Author

rsemeraro commented Sep 2, 2024

Dear @giovp,
Thank you for the answer, but unfortunately, I cannot use the squeeze() function because none of the axes in my matrix have a dimension of 1, as required by that function. The dimensions of my matrix are (4256, 4256, 3). In the meantime, I made other observations.

The first one is related to the composition of the 'spatial' field in my AnnData. In particular, I have some IDs (20-37) containing the 'hires' field and others (1-19) where this field is missing.

Screenshot 2024-09-04 at 12 20 39

Moreover, I also tried to open the data with the spatialdata_io.cosmx command, but it fails during opening.

Screenshot 2024-09-04 at 12 16 11

Could this error also be related to the presence/absence of the hires field for some IDs?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
image 🔬 question ❓ Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants