def METHOD_NAME():
    time.sleep(0.5)
    sys.stderr.write('\n# --------------------------------------------------------------------------------- #\n')
    sys.stderr.write('#                             Starting SPM test...\n')
    sys.stderr.write('# --------------------------------------------------------------------------------- #\n')
    time.sleep(0.5)
    # Resample an image with NiftyResampler. Register SPM, check the result
    # TM
    translations = np.array([5.,  4., -5.], dtype=np.float32)
    euler_angles = np.array([5., -2., -3.], dtype=np.float32)
    tm = sirf.Reg.AffineTransformation(translations, euler_angles)
    niftyreg_resampler = sirf.Reg.NiftyResampler()
    niftyreg_resampler.set_padding_value(0.)
    niftyreg_resampler.set_reference_image(ref_aladin)
    niftyreg_resampler.set_floating_image(ref_aladin)
    niftyreg_resampler.add_transformation(tm)
    niftyreg_resampler.set_interpolation_type_to_linear()
    floating = niftyreg_resampler.forward(ref_aladin)
    # Register with SPM
    spm_reg = sirf.Reg.SPMRegistration()
    spm_reg.set_reference_image(ref_aladin)
    spm_reg.add_floating_image(floating)
    spm_reg.add_floating_image(floating)
    spm_reg.set_working_folder(spm_working_folder)
    spm_reg.set_working_folder_file_overwrite(True)
    spm_reg.set_delete_temp_files(False)
    spm_reg.process()
    spm_tm = spm_reg.get_transformation_matrix_forward(1)
    spm_inv_tm = spm_tm.get_inverse()
    # Check tm roughly equals inverse TM of the resampler
    estimated_euler_angles = spm_inv_tm.get_Euler_angles()
    estimated_translations = spm_inv_tm.as_array()[:3, 3]
    input_euler_angles = tm.get_Euler_angles()
    input_translations = translations
    diff_euler_angles = 100. * (input_euler_angles - estimated_euler_angles) / input_euler_angles
    diff_translations = 100. * (input_translations - estimated_translations) / input_translations
    print("Input Euler angles:              " + np.array2string(input_euler_angles))
    print("Estimated Euler angles:          " + np.array2string(estimated_euler_angles))
    print("Percentage diff in Euler angles: " + np.array2string(diff_euler_angles))
    print("Input translations:              " + np.array2string(input_translations))
    print("Estimated translations:          " + np.array2string(estimated_translations))
    print("Percentage diff in translations: " + np.array2string(diff_translations))
    # Check differences are less than 1%
    if any(diff_euler_angles > 1):
        raise AssertionError("SPM registration failed (angles).")
    if any(diff_translations > 1):
        raise AssertionError("SPM registration failed (translations).")
    if spm_reg.get_output(1) != ref_aladin:
        raise AssertionError("SPM registration failed (image difference).")
    ref_aladin.write(spm_to_register_ref)
    floating.write(spm_to_register_flo)
    # Try to register via filename
    spm_reg2 = sirf.Reg.SPMRegistration()
    spm_reg2.set_reference_image_filename(spm_to_register_ref)
    spm_reg2.add_floating_image_filename(spm_to_register_flo)
    spm_reg2.add_floating_image_filename(spm_to_register_flo)
    spm_reg2.set_working_folder(spm_working_folder2)
    spm_reg2.set_working_folder_file_overwrite(True)
    spm_reg2.set_delete_temp_files(False)
    spm_reg2.process()
    for i in range(0, 2):
        spm_reg2.get_output(i).write(output_prefix + "spm_out_" + str(i))
        spm_reg2.get_displacement_field_forward(i).write(output_prefix + "spm_disp_fwd_" + str(i))
        spm_reg2.get_displacement_field_inverse(i).write(output_prefix + "spm_disp_inv_" + str(i))
        spm_reg2.get_deformation_field_forward(i).write(output_prefix + "spm_def_fwd_" + str(i))
        spm_reg2.get_deformation_field_inverse(i).write(output_prefix + "spm_def_inv_" + str(i))
        spm_reg2.get_transformation_matrix_forward(i).write(output_prefix + "spm_tm_fwd_" + str(i))
        spm_reg2.get_transformation_matrix_inverse(i).write(output_prefix + "spm_tm_inv_" + str(i))
    time.sleep(0.5)
    sys.stderr.write('\n# --------------------------------------------------------------------------------- #\n')
    sys.stderr.write('#                             Finished SPM test.\n')
    sys.stderr.write('# --------------------------------------------------------------------------------- #\n')
    time.sleep(0.5)