The Reed-Xiaoli (RX) is considered as the benchmark algorithm in multidimensional anomaly detection (AD). However, the RX detector performance decreases when the statistical parameters estimation is poor. This could happen when the background is non-homogeneous or the noise independence assumption is not fulfilled. For a better performance, the statistical parameters are estimated locally using a sliding window approach. In this approach, called adaptive RX, a window is centered over the pixel under the test (PUT), so the background mean and covariance statistics are estimated using the data samples lying inside the window's spatial support, named the secondary data. Sometimes, a smaller guard window prevents those pixels close to the PUT to be used, in order to avoid the presence of outliers in the statistical estimation. The size of the window is chosen large enough to ensure the invertibility of the covariance matrix and small enough to justify both spatial and spectral homogeneity. We present here an alternative methodology to select the secondary data for a PUT by means of a binary partition tree (BPT) representation of the image. We test the proposed BPT-based adaptive hyperspectral RX AD algorithm using a real dataset provided by the Target Detection Blind Test project.