def METHOD_NAME(field_data):
    horizontal_spacing = field_data["horizontal_spacing"]
    vertical_spacing = field_data["vertical_spacing"]
    sub_sampling = field_data["sub_sampling"]
    chip_type = field_data["chip_type"]
    chip_name = chip_type
    chip_data = HWR.beamline.diffractometer.get_head_configuration().available[
        chip_name
    ]
    chip_width = (
        chip_data.calibration_data.top_right[0]
        - chip_data.calibration_data.top_left[0]
    )
    chip_height = (
        chip_data.calibration_data.bottom_left[1]
        - chip_data.calibration_data.top_left[1]
    )
    nb_samples_per_line = math.floor(
        chip_width / ((horizontal_spacing / 1000) * sub_sampling)
    )
    nb_lines = math.floor(chip_height / (vertical_spacing / 1000))
    num_images = math.floor((nb_samples_per_line * nb_lines) / 2) * 2
    new_data = {"num_images": num_images}
    return new_data