create_masked_array_numba#
- brainglobe_atlasapi.atlas_generation.volume_utils.create_masked_array_numba(flat_vol: ndarray, lut: ndarray, out: ndarray, mapping: Dict) None[source]#
Create a binary masked array from a flattened volumetric dataset.
Given a flattened 1D NumPy array representing a volumetric dataset, a lookup table (LUT), and a mapping dictionary, this function generates a binary array. The output array will have values of 1 where the flat_vol matches the LUT values based on the provided mapping, and 0 otherwise.
- Parameters:
flat_vol (np.ndarray) – The input 1D NumPy array representing the flattened volumetric dataset.
lut (np.ndarray) – The lookup table containing values to match against the flat_vol.
out (np.ndarray) – The output 1D NumPy array where the binary mask will be stored.
mapping (Dict) – A Numba typed dictionary mapping flat_vol values to indices in LUT.