Align dicom series

Hello Everyone,
I am fairly new to CT image. I am struggling with coordinate transformation. I have data of the same patient with following details:

Series 1
‘ImagePositionPatient’,
[’-205.0966796875’, ‘-384.0966796875’, ‘-1496.5’]
‘Pixelspacing’,[‘0.806640625’, ‘0.806640625’]
slice Thickness’ 2mm
Image Orientation (Patient)[‘1’, ‘0’, ‘0’, ‘0’, ‘1’, ‘0’]

Series 2
‘ImagePositionPatient’,
[’-171.650390625’, ‘-356.650390625’, ‘-1099.7’]
‘Pixelspacing’, [‘0.69921875’, ‘0.69921875’]
‘slice Thickness’, 2mm
Image Orientation (Patient)[‘1’, ‘0’, ‘0’, ‘0’, ‘1’, ‘0’]
In both series slices are of 512*512 in size

What I want to do is translate coordinates of series 1 to coordinates of series 2 and vice versa. I know this can be done by interpolation. But I want to know what would be the affine transformation matrix to do that job ? I tried to formulate but failed.
Any code example in python or the formula would be great help.
Thanks a lot in advance.

This page may help in getting started: https://www.slicer.org/wiki/Coordinate_systems

I have already read. Converted nifti to dicom coordinate. But now trying to align one dicom to another dicom series. To do that how can I construct the transformation matrix ?

You can compute transformation between physical coordinate system of images by using any of the registration modules, such as:

  • intensity-based registration (e.g., General registration (BRAINS) module)
  • landmark-based registration (e.g., Fiducial Registration Wizard module in SlicerIGT extension)
  • segmentation based registration (Segment Registration module in SegmentRegistration extension)