Normalize
The last data preparation step is normalizing the images. In many cases alignment procedures perform better when each input section has 0.0 mean and 1.0 variance. It is best to perform normalization using statistics from the whole image, as normalizing each chunk independently can produce significant border artifacts. This is one of the reasons of why normalization is performed during data preparation instead of being performed during alignment.
Ideally, non-tissue pixels such image defects and plastic would be excluded from statistics calculation.
For this reason, corgie noramlize command takes in an arbitrary number of mask layers as input:
corgie normalize \
--src_layer_spec '{
"path": "'${CORGIE_WALKTHROUGH_PATH}'/img/unaligned",
"name": "img"
}' \
--src_layer_spec '{
"path":"'${CORGIE_WALKTHROUGH_PATH}'/mask/fold_mask",
"type": "mask",
"name": "fold_mask"
}' \
--src_layer_spec '{
"path":"'${CORGIE_WALKTHROUGH_PATH}'/img/unaligned",
"args": {"binarization": ["eq", 0.0]},
"type": "mask",
"name": "black_mask"
}' \
--dst_folder ${CORGIE_WALKTHROUGH_PATH} \
--stats_mip 7 --mip_start 6 --mip_end 8 \
--start_coord "150000, 150000, 17000" \
--end_coord "200000, 200000, 17010" \
--chunk_xy 1024 \
--suffix norm
This command will normalize the the image layer, while excluding any pixels that belong to folds and excluding any 0-valued pixels, as indicated by a
mask obtained by applying binarization: ["eq", 0,0] to the source image. The output will be written to ${CORGIE_WALKTHROUGH_PATH}/img/img_{suffix}, where --suffix=norm by default.
Reference expected output can be visualized in the Unaligned Cutout Normalized Image the following Neuroglancer Link.
To learn more about normalize command, please refer to normalize command documentation.