Aligning Nifti data to Dicom
Here is a script to align NIfTI files slice by slice with DICOM slices in Python.
As is well known, DICOM and NIfTI, two formats for radiological images, have different coordinate systems, making it challenging to display them properly.
This script addresses this issue by reading the data from the NIfTI file and retrieving the corresponding data for each DICOM slice.
Note that the original purpose of this script was to align the NIfTI slices generated by TotalSegmentor with the corresponding original DICOM slices.
Thanks to this blog for the help it provided me.