My 3d array is a stack of pixel values obtained with the following code.
dcm_list = glob.glob(os.path.join(PathDicom, "*.dcm"))
dcms = sorted(dcm_list, key = numericalSort)
slices = [pydicom.read_file(dcm) for dcm in dcms]
slices.sort(key = lambda x: float(x.InstanceNumber))
if ('RescaleIntercept' in slices[0] and 'RescaleSlope' in slices[0]):
    slope = slices[0].RescaleSlope
    intercept = slices[0].RescaleIntercept
    image = np.stack([s.pixel_array*slope+intercept for s in slices], axis=0)
else:
    image = np.stack([s.pixel_array for s in slices], axis=0)

The following example shows the columns from the 512th row of the 0th slice.

%EC%BA%A1%EC%B2%981101×385 3.54 KB

I want voxel (pixel) coordinates to be calculated in RCS coordinates using affine formula.
Thanks!