Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
uvscada:gxs700 [2017/12/02 06:42] – [Table] mcmasteruvscada:gxs700 [2017/12/31 19:19] – [Calibration] mcmaster
Line 16: Line 16:
  
 ^ Image  ^ Vendor  ^ Product                ^ Works?    ^ Notes                                                    ^ ^ Image  ^ Vendor  ^ Product                ^ Works?    ^ Notes                                                    ^
-|        | Gendex  | GXS700 small (type 1)  | Yes*      | Linux VM problematic from Windows VMWare and VirtualBox  |+|        | Gendex  | GXS700 small (type 1)  | Yes       | Linux VM problematic from Windows VMWare and VirtualBox  |
 |        | Gendex  | GXS700 large (type 2)  | Yes       | Primary device I develop for                             | |        | Gendex  | GXS700 large (type 2)  | Yes       | Primary device I develop for                             |
 |        | Dexis   | Platinum               | Probably  | Test failed but DUT was likely broken                    | |        | Dexis   | Platinum               | Probably  | Test failed but DUT was likely broken                    |
Line 30: Line 30:
     * Linux     * Linux
       * Tested on Ubuntu 12.04 x64, Ubuntu 16.04 x64       * Tested on Ubuntu 12.04 x64, Ubuntu 16.04 x64
-      * WARNING for VM users: only size 2 works  
-        * You must use native linux for size 1, see below 
     * USB port (duh)     * USB port (duh)
     * A supported sensor     * A supported sensor
Line 56: Line 54:
       * Optional: test sensor by forcing a capture       * Optional: test sensor by forcing a capture
  
-===== VM ===== 
- 
-TLDR: 2017-10-10 size 1 test results: 
-  * VMWare: transfers very slowly, yielding a corrupt image 
-  * VirtualBox: freezes the *host* 
- 
-So if you have a size 1 sensor, unfortunately you may need to use native Linux. 
- 
-Details: Size 1 sensors use USB interrupt transfers while size 2 sensors use USB bulk transfers. Unfortunately, interrupt transfers seem to be relatively poorly supported aside from HID (keyboard/mice). This may be partially due to them doing large interrupt transfers while HID does very small transfers.  
- 
-Parallels has not been tested. Would be interested in feedback. 
- 
-^ Size  ^ Machine           | USB controller                                           ^ OS                 | Virtualization  ^ Result  ^ By     ^ Notes                     ^ 
-| 1     | Lenovo Carbon X1  | Intel Sunrise Point-LP USB 3.0 xHCI Controller (rev 21)  | Ubuntu 14.04 x64   | Native          | Works   | JM                               | 
-| 1     | JM desktop        | Intel ICH10                                              | Windows 7 Pro x64  | VMWare          | Fail    | JM     | Slow capture / corrupted  | 
-| 1     | User1 desktop     | ?                                                        | Ubuntu 14.04 x64?  | VMWare          | Fail    | User1  | Slow capture / corrupted  | 
-| 1     | User1 desktop     | ?                                                        | Ubuntu 14.04 x64?  | Virtual Box     | Fail    | User1  | System freeze             | 
-| 1     | User1 desktop     | ?                                                        | Windows 7?         | Native          | Fail    | User1  | System freeze             | 
  
 ====== Force capture ====== ====== Force capture ======
Line 79: 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
  
-{{:uvscada:gxs700:force.jpg?300}}+{{:uvscada:gxs700:good.png?300}}
  
-    - $ python gxs700/capture.py -f+    - $ python gxs700/capture.py -f -e
     - Check which you got:     - Check which you got:
       * Waiting for image: expected response.  Continue below       * Waiting for image: expected response.  Continue below
       * "Exception: Failed to find a device": plugged in?  Did you run permission script?       * "Exception: Failed to find a device": plugged in?  Did you run permission script?
-    - It should have written capture_000.png and capture_000.bin to the current directory +    - It should have written capture_000_e.png to the current directory 
-    - Above will be very dark.  Enhance contrast by doing histogram equalization: python gxs700/decode.py -e capture_000.bin capture_000e.png +    - You should see an image roughly resembling the noise of the reference above.  If you do, your sensor probably works
-    - You should see an image roughly resembling the reference above.  If you do, your sensor probably works+
  
 ====== X-ray capture ====== ====== X-ray capture ======
Line 147: Line 126:
  
 See also: GXS700 general troubleshooting See also: GXS700 general troubleshooting
- 
  
 ====== Decoding ====== ====== Decoding ======
Line 192: Line 170:
 Takes raw, uncalibrated images.  I've been asked a few times if I could provide calibration files for the Windows driver or could even use their calibration files on my driver.  However, I'm not really interested in supporting their proprietary format. If someone submits a patch though I'll probably merge it in. Takes raw, uncalibrated images.  I've been asked a few times if I could provide calibration files for the Windows driver or could even use their calibration files on my driver.  However, I'm not really interested in supporting their proprietary format. If someone submits a patch though I'll probably merge it in.
  
-That saidI'm not against coming up with an independent calibration scheme.  I know how to take dark frames (see APIwhich is the key component Uncalibrated images have been generally good enough for me so haven'put work into this.  If you are interested though shoot me line.+===== 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 imageHopefully the scanner will add this soon as well 
 +  * As of this writing no bad pixel replacement is done 
 + 
 + 
 +==== 1: Capture dark field ==== 
 + 
 +First, take dark field capture using something like: 
 + 
 +  $ gxs700-capture -f -e 
 + 
 +This should yield a raw picture that looks something like this: 
 + 
 +{{:uvscada:gxs700:cal:df.jpg?300|}} 
 + 
 +And histogram equalized looks like this: 
 + 
 +{{:uvscada:gxs700:cal:dfe.jpg?300|}} 
 + 
 + 
 +==== 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 (and also firing the x-ray head)
 + 
 +  $ gxs700-capture -e 
 + 
 +This produces a flat field image like this: 
 + 
 +{{:uvscada:gxs700:cal:ff.jpg?300|}} 
 + 
 +Which might look like this when histogram equalized: 
 + 
 +{{:uvscada:gxs700:cal:ffe.jpg?300|}} 
 + 
 +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'move the sensor or x-ray head 
 + 
 + 
 +==== 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 directory with your images to be corrected 
 +  * cal is the output directory with corrected images 
 + 
 +Here is a raw image as captured: 
 + 
 +{{:uvscada:gxs700:cal:ex_raw.jpg?300|}} 
 + 
 +And with histogram equalization: 
 + 
 +{{:uvscada:gxs700:cal:ex_raw_e.jpg?300|}} 
 + 
 +Now the corrected image: 
 + 
 +{{:uvscada:gxs700:cal:ex_out.jpg?300|}} 
 + 
 +And it with histogram equalization: 
 + 
 +{{:uvscada:gxs700:cal:ex_out_e.jpg?300|}}
  
 ====== Quality ====== ====== Quality ======
 
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution 4.0 International
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki