docstr: 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
docstr_tok: ["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"]
code: 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
  
file_path: PaddleSeg/contrib/MedicalSeg/tools/prepare_msd_brain_seg.py
imports: import os
  import os.path
  import sys
  import time
  import numpy
  import nibabel
  import SimpleITK
  from tqdm import tqdm
  from prepare import Prep
  from tools.preprocess_utils import join_paths
label_desc: Use image node_id 4 for calling the PrepMSDBrain obj's underlying member method code with example usage: obj.load_medical_data(f) and returns: f_nps