def image_list_from_path(self):
        dir_list = os.listdir(self.data_path)
        image_list = []

        for file in dir_list:
            # if self.modality in file:
            img_nii = cat.load(os.path.join(self.data_path, file))
            image_list.append(img_nii)

        return np.array(image_list)
def convert_aseg_to_9_v1_and_save(directory="./",
                                  result_filename="converted.nii.gz"):
    aparc_aseg = cat.load(os.path.join(directory, ASEG_FILENAME))
    converted = convert_aseg_to_9_v1(aparc_aseg.get_data())
    cat.Nifti1Image(converted, aparc_aseg.affine,
                    header=aparc_aseg.header).to_filename(result_filename)
def convert_104_v1_to_104_v2_and_save(aqua_104_v1_filename,
                                      result_filename="converted.nii.gz"):
    aqua_104_v1 = cat.load(aqua_104_v1_filename)
    converted = convert_104_v1_to_104_v2(aqua_104_v1.get_data())
    cat.Nifti1Image(converted, aqua_104_v1.affine,
                    header=aqua_104_v1.header).to_filename(result_filename)