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

Error in tutorial? #19

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

Error in tutorial? #19

Jorges1000 opened this issue Jul 29, 2024 · 2 comments

Comments

@Jorges1000
Copy link

Jorges1000 commented Jul 29, 2024

Hi,

I was following your tutorial and in your original code it seems that cnt will reflect the last step (contour by y, not cv2). I modified to look at the different contours with each algorithm, but the step #### 4.4 Plot gene expression image only works with cnty and not cntcv2.

#Three different algorithms to detect contour, select the best one. Here we use cv2.

#-----------------1. Detect contour using cv2-----------------
cntcv2=tesla.cv2_detect_contour(img, apertureSize=5,L2gradient = True)

#-----------------2. Scan contour by x-----------------
spots=counts.obs.loc[:, ['pixel_x', 'pixel_y', "array_x", "array_y"]]
#shape="hexagon" for 10X Visium, shape="square" for ST
cntx=tesla.scan_contour(spots, scan_x=True, shape="hexagon")

#-----------------3. Scan contour by y-----------------
spots=counts.obs.loc[:, ['pixel_x', 'pixel_y', "array_x", "array_y"]]
#shape="hexagon" for 10X Vsium, shape="square" for ST
cnty=tesla.scan_contour(spots, scan_x=False, shape="hexagon")
#_----------------------
cnt = cnty

Also, in this code:

6.2 Leading edge detection

ret_img=tesla.leading_edge_detection(img=img, 
                                     pred_refined=pred_refined, 
                                     resize_factor=resize_factor, 
                                     target_clusters=target_clusters, 
                                     binary=binary)

gives error:
Traceback (most recent call last):
File "", line 1, in
File "/home/jsepulveda/.local/lib/python3.9/site-packages/TESLAforST-1.2.4-py3.9.egg/TESLA/tumor_edge_core.py", line 19, in leading_edge_detection
cnt_info=cv2_detect_contour((target_img==0).astype(np.uint8), apertureSize=5,L2gradient = True, all_cnt_info=True)
File "/home/jsepulveda/.local/lib/python3.9/site-packages/TESLAforST-1.2.4-py3.9.egg/TESLA/contour_util.py", line 73, in cv2_detect_contour
cnt=cnt_info[0][0]
IndexError: list index out of range

@huskyth
Copy link

huskyth commented Oct 12, 2024

have you any solutions?

@huskyth
Copy link

huskyth commented Oct 12, 2024

i have the same error, but how to solve

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