Skip to content

Commit

Permalink
Position for 2D slices with varying extents
Browse files Browse the repository at this point in the history
  • Loading branch information
aditiiyer committed May 30, 2024
1 parent 967ce90 commit adaacc3
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion cerr/plan_container.py
Original file line number Diff line number Diff line change
Expand Up @@ -626,7 +626,15 @@ def import_scan_array(scan3M, xV, yV, zV, modality, assocScanNum, planC):
dx = xV[1] - xV[0]
dy = yV[0] - yV[1]
for slc in range(siz[2]):
cerrImgPatPos = [xV[0], yV[0], zV[slc], 1]
if xV.ndim == 2 and yV.ndim==2:
#xV is a num_cols x num slices matrix
#yV is a num_rows x num_slices matrix
#with x,y values varying across slices
dx = xV[1,slc] - xV[0,slc]
dy = yV[0,slc] - yV[1,slc]
cerrImgPatPos = [xV[0,slc], yV[0,slc], zV[slc], 1]
else:
cerrImgPatPos = [xV[0], yV[0], zV[slc], 1]
dcmImgPos = np.matmul(planC.scan[assocScanNum].cerrToDcmTransM, cerrImgPatPos)[:3]
s_info = scn_info.ScanInfo()
s_info.frameOfReferenceUID = forUID
Expand Down

0 comments on commit adaacc3

Please sign in to comment.