-
Notifications
You must be signed in to change notification settings - Fork 25
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
Alignment image with xenium #168
Comments
For context, the issue is also discussed here: discourse.scverse.org/t/moved-how-to-align-image-to-cropped-data-visualize-with-xenium-explorer/2368/2. |
Your usage seems correct, we can correct it from our side by adding a parameter |
Thank you so much! I'm not sure if this helps, but I tried the example Xenium data and HE picture, and it worked. However, it didn't work for my pictures. Please let me know if it would help you better if I upload my pictures. |
We need to make a fix to the function |
Wondering if there is new information about this issue |
I just implemented a solution in #196. To try it please install the latest |
Thank you! I will try it and let you know if it working. |
Hi I got new error for this. I install the spatialdata, spatialdata-io from github. It seems like not working with spatial-plot . And I install the spatial-plot again from github. It give me a this error code. TypeError Traceback (most recent call last) File d:\Yifan_Wang\Software\envs\SpatialData\Lib\site-packages\spatialdata_utils.py:261, in _deprecation_alias..deprecation_decorator..wrapper(*args, **kwargs) File d:\Yifan_Wang\Software\envs\SpatialData\Lib\site-packages\spatialdata_plot\pl\basic.py:276, in PlotAccessor.render_shapes(self, element, color, fill_alpha, groups, palette, na_color, outline, outline_width, outline_color, outline_alpha, cmap, norm, scale, method, table_name, **kwargs) TypeError: ShapesRenderParams.init() got an unexpected keyword argument 'element' |
@timtreis any idea? @Yifan-debug thanks for reporting, I'd suggest using this PR from We do a complete check of the interactions between the various repositories before each release so unfortunately using freshly dev code may lead to these kind of problems sometimes. |
Sure, I totally understand. And thank you so much for developing this useful tools. |
In alternative, if the above doesn't work, you can reinstall the latest stable code and manually fix the above by copy-pasting the code in |
I think I may haven't downloaded the right version of spatialdata. |
pip install git+https://github.com/scverse/spatialdata-io.git@main Here are the codes I used to download |
Please you should install spatialdata-io from the PR linked to this issue (#196), not from main. |
But actually, I will merge it now, after that you can install from main (this will automatically close the issue, but feel free to continue the discussion here). |
Great! Thank you so much!! Appreciate for doing this. Just for curiously, Do you have any plan for next(new) stable version. That package will largely help my project |
Happy to help! 😊 We are fixing some PRs related to plotting, I think in 1-2 weeks we'll make a release. |
Perfect! Thank you so much!
…________________________________
From: LucaMarconato ***@***.***>
Sent: Monday, August 12, 2024 01:41 PM
To: scverse/spatialdata-io ***@***.***>
Cc: Yifan Wang ***@***.***>; Mention ***@***.***>
Subject: [EXT] Re: [scverse/spatialdata-io] Alignment image with xenium (Issue #168)
CAUTION: Email Originated Outside of Auburn.
Happy to help! 😊 We are fixing some PRs related to plotting, I think in 1-2 weeks we'll make a release.
—
Reply to this email directly, view it on GitHub<#168 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ANECHKMTECD2AUGRPAJS63DZRDXS7AVCNFSM6AAAAABKICQT26VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEOBUGU3TSOBQGQ>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Not super sure which version is now actually underlying your issue but at one point, @melonora and I refactored |
Hi @LucaMarconato But I still get the same error code as begin.AssertionError Traceback (most recent call last) File d:\Yifan_Wang\Software\envs\sopa\lib\site-packages\spatialdata_io\readers\xenium.py:637, in xenium_aligned_image(image_path, alignment_file, imread_kwargs, image_models_kwargs) AssertionError: Would you mind let me know the correct code or version for download the spatialdata? I'm sorry for keep asking but this do confuse me for a while. |
Hi some updated information. spatialdata 0.2.3.dev9+g774b492 pypi_0 pypi |
@Yifan-debug for the traceback it seems that the
Is this the case? |
HI @LucaMarconato |
The argument |
Sorry for the continuous questions, and I'm really at the beginning stage of spatial transcriptomics.
I aligned my confocal image (Z-stack OME TIFF file) with the Xenium dataset in Xenium Explorer. I downloaded the matrix.csv from Xenium Explorer.
Please let me know if I need provide more information
I use this tutorial for alignment. https://github.com/quentinblampey/spatialdata_xenium_explorer/blob/master/docs/10x_tutorials/xenium/xenium_tuto.ipynb
However, I got the issue at this step.
alignment_matrix_path = "../C1-blank-section1-ant2-SOAR40x_alignment_files/matrix.csv"
confocal_path = "../C1-blank-section1-ant2-SORA40x.ome.tif"
image = xenium_aligned_image(confocal_path, alignment_matrix_path)
AssertionError Traceback (most recent call last)
Cell In[14], line 6
3 alignment_matrix_path = "../C1-blank-section1-ant2-SOAR40x_alignment_files/matrix.csv"
4 confocal_path = "../C1-blank-section1-ant2-SORA40x.ome.tif"
----> 6 image = xenium_aligned_image(confocal_path, alignment_matrix_path)
7 sdata.add_image(image_name, image)
8 sdata
File d:\Yifan_Wang\Software\envs\SP\lib\site-packages\spatialdata_io\readers\xenium.py:595, in xenium_aligned_image(image_path, alignment_file, imread_kwargs, image_models_kwargs)
593 else:
594 assert len(image.shape) == 3
--> 595 assert image.shape[0] in [3, 4]
596 if image.shape[0] == 4:
597 # as explained before in _get_images(), we need to add a dummy channel until we support 4-channel images as
598 # non-RGBA images in napari
599 image = da.concatenate([image, da.zeros_like(image[0:1])], axis=0)
AssertionError:---------------------------------------------------------------------------
AssertionError Traceback (most recent call last)
Cell In[14], line 6
3 alignment_matrix_path = "../C1-blank-section1-ant2-SOAR40x_alignment_files/matrix.csv"
4 confocal_path = "../C1-blank-section1-ant2-SORA40x.ome.tif"
----> 6 image = xenium_aligned_image(confocal_path, alignment_matrix_path)
7 sdata.add_image(image_name, image)
8 sdata
File d:\Yifan_Wang\Software\envs\SP\lib\site-packages\spatialdata_io\readers\xenium.py:595, in xenium_aligned_image(image_path, alignment_file, imread_kwargs, image_models_kwargs)
593 else:
594 assert len(image.shape) == 3
--> 595 assert image.shape[0] in [3, 4]
596 if image.shape[0] == 4:
597 # as explained before in _get_images(), we need to add a dummy channel until we support 4-channel images as
598 # non-RGBA images in napari
599 image = da.concatenate([image, da.zeros_like(image[0:1])], axis=0)
AssertionError:
The text was updated successfully, but these errors were encountered: