Co-Ordinate Transformation

I am fairly new to 3D slicer.
I have a .dcm series and corresponding nifti file having lesion position. After overlaying nifti over dcm series I am trying to compute the position of lesions from the nifti label to dcm position. As shown in the below image, when I calculate the position of the red lesion, I get correct x,y,z values, with correct sign. From the 3D slicer GUI, this translated position of red lesions is in RSA.

mm_coords = nib.affines.apply_affine(roi.affine, [x,y,z])

But when I calculate the green one, I get correct values but signs are changed for L and I values. In 3D slice all the LAI values are positive but the nibabel is giving changed signs for L and I values.
What could be the possible reason? Thank you in advance.

Everything in Slicer is RAS - have a look at this document and is should give you all the info you need:

Yes, I know everything in slicer is in RAS. I have also read the link you just gave. It says .dcm files uses LPS. On the other hand the nifti file created using slicer obviously is in RAS. when I overlap them, and visually look at the green lesion it shows x,y,z as LAI in data probe. Also when I try to calculate from nifti x,y,z to dcm in pythoon using

nib.affines.apply_affine(nifti_roi.affine, [x,y,z])

I get negative signs for L and I values. But in slicer GUI all LAI values are shown positve. But that does not happen in case of red lesion. I get correct values with correct sign and shwon as RAS. I hope that clarify more my question.

Have a closer look at the data probe: labels are changing dynamically. If a point is on the left side then you get coordinate value such as “L 12.3” (instead of “R -12.3”).

You should not copy-paste values from the Slicer GUI anyway. Place markups then go to Markups module and click “Copy” button to copy selected markup point coordinates to the clipboard (you can directly paste to Excel).