Load a DICOM image as a numpy array and apply normalization of the Siemens SPECT/CT
Scanner.
:param filename: filename of the DICOM image
:param direction: other than 0 changes the stacking order of slices to the desired direction
:return: the image scaled and loaded into a numpy array
"""
_,image=load_dcm(filename)
_,image=load_dcm(filename,direction=direction)
returnimage
defto_direction(
dcm:Tuple[DICOM,np.ndarray],direction:float=1
)->Tuple[DICOM,np.ndarray]:
"""
Change the stacking direction of slices in a DICOM image.
The direction is specified by the sign of the [Spacing Between Slices](https://dicom.innolitics.com/ciods/nm-image/nm-reconstruction/00180088) parameter.
:param dcm: a tuple of a DICOM header and an image
:param direction: the desired stacking direction as a float (>0 positive, <0 negative, =0 stay as it is)
:return: dicom header (with values updated) and image according to the desired stacking order