code: def load_save(self, new_spacing):
      self.image_path = join_paths(self.phase_path, "images")
      self.label_path = join_paths(self.phase_path, "labels")
      maybe_mkdir_p(self.image_path)
      maybe_mkdir_p(self.label_path)
      data_lists = os.listdir(join_paths(self.clean_folder, "imagesTr"))
      self.filenames = [
          filename.split(".")[0] for filename in data_lists
      ]
      for filename in tqdm(data_lists):
          nimg = nib.load(
              join_paths(self.clean_folder, "imagesTr", filename)
          )
          nlabel = nib.load(
              join_paths(self.clean_folder, "labelsTr", filename)
          )
          data_arrary = nimg.get_data()
          label_array = nlabel.get_data()
          original_spacing = nimg.header["pixdim"][1:4]
          assert data_arrary.shape == label_array.shape
          shape = data_arrary.shape
          new_shape = np.round(
              (
                  (
                      np.array(original_spacing) / np.array(new_spacing)
                  ).astype(float)
                  * np.array(shape)
              )
          ).astype(int)
          new_data_array = resize_image(data_arrary, new_shape)
          new_label_array = resize_segmentation(label_array, new_shape)
          # 将数据从hwd转化为dhw
          new_data_array = np.transpose(new_data_array, [2, 0, 1])
          new_label_array = np.transpose(new_label_array, [2, 0, 1])
          np.save(
              join_paths(
                  self.image_path, filename.replace(r".nii.gz", ".npy")
              ),
              new_data_array,
          )
          np.save(
              join_paths(
                  self.label_path, filename.replace(r".nii.gz", ".npy")
              ),
              new_label_array,
          )
  
file_path: PaddleSeg/contrib/MedicalSeg/tools/prepare_acdc.py
imports: import nibabel
  import shutil
  import os.path
  from preprocess_utils.file_and_folder_operations import *
  from preprocess_utils.geometry import *
  from preprocess_utils.path_utils import join_paths
  from tqdm import tqdm
label_desc: Use image node_id 3 for calling the PrepACDC obj's underlying member method code with example usage: obj.load_save(new_spacing) without return types