validate_reference_image_pixels#
- brainglobe_atlasapi.atlas_generation.validate_atlases.validate_reference_image_pixels(atlas: BrainGlobeAtlas)[source]#
Validate that the reference image was correctly rescaled.
This check aims to catch issues where a float64 reference image (e.g., from MRI) might have been incorrectly rescaled or cast to the target integer data type (e.g., REFERENCE_DTYPE), resulting in pixel values that are too low. It asserts that not all pixel values are below 128 (assuming 8-bit range).
- Parameters:
atlas (BrainGlobeAtlas) – The BrainGlobeAtlas object to validate.
- Returns:
True if the reference image’s pixel values appear to be correctly scaled.
- Return type:
bool
- Raises:
AssertionError – If all pixel values in the reference image are less than 128, suggesting incorrect scaling.