You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
IndexError Traceback (most recent call last)
Cell In[132], line 26
10 # keep all other parameters default
11 params = {'L':L,'T':T,
12 'niter': 200,
13 'pointsI': pointsI,
(...)
23 'epV': 5e1
24 }
---> 26 out = STalign.LDDMM([YI,XI], I, [YJ,XJ], J, **params)
File ~/.local/lib/python3.10/site-packages/STalign/STalign.py:1074, in LDDMM(xI, I, xJ, J, pointsI, pointsJ, L, T, A, v, xv, a, p, expand, nt, niter, diffeo_start, epL, epT, epV, sigmaM, sigmaB, sigmaA, sigmaR, sigmaP, device, dtype, muB, muA) 1072 else: 1073 raise Exception(f'If inputting an initial v, must input both xv and v')
-> 1074 extentV = extent_from_x(xv) 1075 dv = torch.as_tensor([x[1]-x[0] for x in xv],device=device,dtype=dtype) 1079 fv = [torch.arange(n,device=device,dtype=dtype)/n/d for n,d in zip(XV.shape,dv)]
File ~/.local/lib/python3.10/site-packages/STalign/STalign.py:857, in extent_from_x(xJ) 834 def extent_from_x(xJ): 835 ''' Given a set of pixel locations, returns an extent 4-tuple for use with np.imshow. 836 837 Note inputs are locations of pixels along each axis, i.e. row column not xy.
(...) 855 856 '''
--> 857 dJ = [x[1]-x[0] for x in xJ] 858 extentJ = ( (xJ[1][0] - dJ[1]/2.0).item(), 859 (xJ[1][-1] + dJ[1]/2.0).item(), 860 (xJ[0][-1] + dJ[0]/2.0).item(), 861 (xJ[0][0] - dJ[0]/2.0).item()) 862 return extentJ
File ~/.local/lib/python3.10/site-packages/STalign/STalign.py:857, in (.0) 834 def extent_from_x(xJ): 835 ''' Given a set of pixel locations, returns an extent 4-tuple for use with np.imshow. 836 837 Note inputs are locations of pixels along each axis, i.e. row column not xy.
(...) 855 856 '''
--> 857 dJ = [x[1]-x[0] for x in xJ] 858 extentJ = ( (xJ[1][0] - dJ[1]/2.0).item(), 859 (xJ[1][-1] + dJ[1]/2.0).item(), 860 (xJ[0][-1] + dJ[0]/2.0).item(), 861 (xJ[0][0] - dJ[0]/2.0).item()) 862 return extentJ
IndexError: index 1 is out of bounds for dimension 0 with size 1
The text was updated successfully, but these errors were encountered:
A simple affine alignment is needed to align the single-cell spatial transcriptomics dataset with the H&E staining image. So I performed non-linear local alignments via LDDMM. However, I encountered the bug illustrated as above.
IndexError Traceback (most recent call last)
Cell In[132], line 26
10 # keep all other parameters default
11 params = {'L':L,'T':T,
12 'niter': 200,
13 'pointsI': pointsI,
(...)
23 'epV': 5e1
24 }
---> 26 out = STalign.LDDMM([YI,XI], I, [YJ,XJ], J, **params)
File ~/.local/lib/python3.10/site-packages/STalign/STalign.py:1074, in LDDMM(xI, I, xJ, J, pointsI, pointsJ, L, T, A, v, xv, a, p, expand, nt, niter, diffeo_start, epL, epT, epV, sigmaM, sigmaB, sigmaA, sigmaR, sigmaP, device, dtype, muB, muA)
1072 else:
1073 raise Exception(f'If inputting an initial v, must input both xv and v')
-> 1074 extentV = extent_from_x(xv)
1075 dv = torch.as_tensor([x[1]-x[0] for x in xv],device=device,dtype=dtype)
1079 fv = [torch.arange(n,device=device,dtype=dtype)/n/d for n,d in zip(XV.shape,dv)]
File ~/.local/lib/python3.10/site-packages/STalign/STalign.py:857, in extent_from_x(xJ)
834 def extent_from_x(xJ):
835 ''' Given a set of pixel locations, returns an extent 4-tuple for use with np.imshow.
836
837 Note inputs are locations of pixels along each axis, i.e. row column not xy.
(...)
855
856 '''
--> 857 dJ = [x[1]-x[0] for x in xJ]
858 extentJ = ( (xJ[1][0] - dJ[1]/2.0).item(),
859 (xJ[1][-1] + dJ[1]/2.0).item(),
860 (xJ[0][-1] + dJ[0]/2.0).item(),
861 (xJ[0][0] - dJ[0]/2.0).item())
862 return extentJ
File ~/.local/lib/python3.10/site-packages/STalign/STalign.py:857, in (.0)
834 def extent_from_x(xJ):
835 ''' Given a set of pixel locations, returns an extent 4-tuple for use with np.imshow.
836
837 Note inputs are locations of pixels along each axis, i.e. row column not xy.
(...)
855
856 '''
--> 857 dJ = [x[1]-x[0] for x in xJ]
858 extentJ = ( (xJ[1][0] - dJ[1]/2.0).item(),
859 (xJ[1][-1] + dJ[1]/2.0).item(),
860 (xJ[0][-1] + dJ[0]/2.0).item(),
861 (xJ[0][0] - dJ[0]/2.0).item())
862 return extentJ
IndexError: index 1 is out of bounds for dimension 0 with size 1
The text was updated successfully, but these errors were encountered: