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.