def load_medical_data(f):
        """
        load data of different format into numpy array, return data is in xyz
        f: the complete path to the file that you want to load
        """
        filename = osp.basename(f).lower()
        images = []
        # validate nii.gz on lung and mri with correct spacing_resample
        if filename.endswith((".nii", ".nii.gz", ".dcm")):
            if "radiopaedia" in filename or "corona" in filename:
                f_nps = [nib.load(f).get_fdata(dtype=np.float32)]
            else:
                itkimage = sitk.ReadImage(f)
                if itkimage.GetDimension() == 4:
                    images = [itkimage]
                else:
                    images = [itkimage]
                f_nps = [sitk.GetArrayFromImage(img) for img in images]
        return f_nps

        load data of different format into numpy array, return data is in xyz
        f: the complete path to the file that you want to load
        
contrib/MedicalSeg/tools/prepare_msd_brain_seg.py