def replace_pixel_grid_in_off_component(component: Component, pixel_grid: PixelGrid, off_geometry: OFFGeometryNexus): """ Change the pixel grid that is currently stored in a Component. Used to see if everything behaves correctly even for pixel data with 'special' properties. :param component: The component to have its pixel data replaced. :param pixel_grid: The PixelGrid object. :param off_geometry: The OffGeometry. """ component.record_pixel_grid(pixel_grid) component.set_off_shape(off_geometry, pixel_data=pixel_grid)
def write_pixel_data_to_component(self, component: Component, pixel_data: PixelData): """ Writes the detector number/pixel grid data to a component. :param component: The component to modify. :param nx_class: The NXclass of the component. :param pixel_data: The pixel data. """ component.clear_pixel_data() if pixel_data is None or component.nx_class not in PIXEL_COMPONENT_TYPES: return if isinstance(pixel_data, PixelMapping): component.record_pixel_mapping(pixel_data) if isinstance(pixel_data, PixelGrid) and self.get_pixel_visibility_condition(): component.record_pixel_grid(pixel_data, self.unitsLineEdit.text())