Tissue clearing methods have boosted the microscopic observations of thick samples such as whole-mount mouse or zebrafish. Even with the best tissue clearing methods, specimens are not completely transparent and light attenuation increases with depth, reducing signal output and signal-to-noise ratio. In addition, since tissue clearing and microscopic acquisition techniques have become faster, automated image analysis is now an issue. In this context, mounting specimens at large scale often leads to imperfectly aligned or oriented samples, which makes relying on predefined, sample-independent parameters to correct signal attenuation impossible.Here, we propose a sample-dependent method for contrast correction. It relies on segmenting the sample, and estimating sample depth isosurfaces that serve as reference for the correction. We segment the brain white matter of zebrafish larvae. We show that this correction allows a better stitching of opposite sides of each larva, in order to image the entire larva with a high signal-to-noise ratio throughout. We also show that our proposed contrast correction method makes it possible to better recognize the deep structures of the brain by comparing manual vs. automated segmentations. This is expected to improve image observations and analyses in high-content methods where signal loss in the samples is significant.