This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision | ||
uvscada:gxs700 [2017/12/23 18:26] – mcmaster | uvscada:gxs700 [2017/12/31 19:19] – [Calibration] mcmaster | ||
---|---|---|---|
Line 16: | Line 16: | ||
^ Image ^ Vendor | ^ Image ^ Vendor | ||
- | | | Gendex | + | | | Gendex |
| | Gendex | | | Gendex | ||
| | Dexis | Platinum | | | Dexis | Platinum | ||
Line 59: | Line 59: | ||
This step tests the sensor without actually firing x-rays at it. This is also useful for calibrating sensor defects | This step tests the sensor without actually firing x-rays at it. This is also useful for calibrating sensor defects | ||
- | {{: | + | {{: |
- | - $ python gxs700/ | + | - $ python gxs700/ |
- Check which you got: | - Check which you got: | ||
* Waiting for image: expected response. | * Waiting for image: expected response. | ||
* " | * " | ||
- | - It should have written | + | - It should have written |
- | - Above will be very dark. Enhance contrast by doing histogram equalization: | + | - You should see an image roughly resembling |
- | - You should see an image roughly resembling the reference above. | + | |
====== X-ray capture ====== | ====== X-ray capture ====== | ||
Line 171: | Line 170: | ||
Takes raw, uncalibrated images. | Takes raw, uncalibrated images. | ||
- | That said, I'm not against coming up with an independent calibration scheme. | + | ===== cal.py flow ===== |
+ | |||
+ | Quick scheme to get rid of the worst artifacts | ||
+ | |||
+ | Basic idea: | ||
+ | - Capture a dark field frame (no x-ray) to get the lowest possible pixel value | ||
+ | - Capture a flat field frame (x-ray with no object) to get the highest possible pixel value | ||
+ | - Rescale images to range found above | ||
+ | |||
+ | Notes: | ||
+ | * Decoded images invert pixel values (per x-ray industry convention), so high and low are relative | ||
+ | * As of late 2017 capture.py now spits out a sensor .json file with each image. Hopefully the scanner will add this soon as well | ||
+ | * As of this writing no bad pixel replacement is done | ||
+ | |||
+ | |||
+ | ==== 1: Capture dark field ==== | ||
+ | |||
+ | First, | ||
+ | |||
+ | $ gxs700-capture -f -e | ||
+ | |||
+ | This should yield a raw picture that looks something like this: | ||
+ | |||
+ | {{: | ||
+ | |||
+ | And histogram equalized looks like this: | ||
+ | |||
+ | {{: | ||
+ | |||
+ | |||
+ | ==== 2: Capture flat field ==== | ||
+ | |||
+ | Now make sure the sensor and the x-ray head have the exact same position and settings you will use to take your actual image capture. Make sure there is nothing in the beam and do a standard capture | ||
+ | |||
+ | $ gxs700-capture -e | ||
+ | |||
+ | This produces a flat field image like this: | ||
+ | |||
+ | {{: | ||
+ | |||
+ | Which might look like this when histogram equalized: | ||
+ | |||
+ | {{: | ||
+ | |||
+ | For best results you should also let the sensor and x-ray head sit a while to warm up. I'm not sure how long matters, but maybe 10 minutes would be good | ||
+ | |||
+ | |||
+ | ==== 3: Capture data ==== | ||
+ | |||
+ | ie using capture.py or xray_plan_cli.py | ||
+ | |||
+ | Put your sample in and use the exact setup as the flat field to capture data. Don' | ||
+ | |||
+ | |||
+ | ==== 4: Correct images ==== | ||
+ | |||
+ | run something like | ||
+ | |||
+ | $ python cal.py df.png ff.png png cal | ||
+ | |||
+ | Where: | ||
+ | * df.png is your dark field capture | ||
+ | * ff.png is your flat field capture | ||
+ | * png is a directory with your images to be corrected | ||
+ | * cal is the output directory with corrected images | ||
+ | |||
+ | Here is a raw image as captured: | ||
+ | |||
+ | {{: | ||
+ | |||
+ | And with histogram equalization: | ||
+ | |||
+ | {{: | ||
+ | |||
+ | Now the corrected image: | ||
+ | |||
+ | {{: | ||
+ | |||
+ | And it with histogram equalization: | ||
+ | |||
+ | {{: | ||
====== Quality ====== | ====== Quality ====== |