====== Calibration – Generate Cal File ====== To calibrate images in Hoku, you first generate a calibration file for the folder of images, with [[advanced_level:statistics|Statistics]]. Then you read the images with calibration turned on; see [[advanced_level:calibration:read_calibrated_images|Read Calibrated Images]]. {{ :advanced_level:calibration:hoku_advanced_cal_1.png?100&nolink |ReadStack connected to Statistics}} **1. Read the images.** Use ReadStack to read all the images in the folder that you want to calibrate. Typically, these are images that contain a calibration target. Do **not** check the "calibration" flag in ReadStack. **2. Mark the target.** Display one of the images, and draw a window on the white calibration target; see [[basic_level:readimage:window_arguments|Window Arguments]]. {{ :advanced_level:calibration:hoku_advanced_cal_2.png?350&nolink |Drawing a window on the calibration target}} **3. Set up Statistics.** Enter the window into Statistics, and check its "calibration" and "verbose" flags. {{ :advanced_level:calibration:hoku_advanced_cal_3.png?400&nolink |The ReadStack dialog, with calibration unchecked}} {{ :advanced_level:calibration:hoku_advanced_cal_4.png?300&nolink |The Statistics dialog, with calibration and verbose checked}} **4. Run the job.** A window shows the statistics and asks whether you want to write out the calibration file. Say **yes**. The calibration file is written in the same folder as the images. Its name is the folder's name followed by ''.cal''. Any calibration file already there is overwritten. Calibration works only with single-band images.