|
|
|
This project uses the XSane scanner control software.
First, let's get the obvious question out of the way: why the silly name, or what does the silly name mean?
TWAIN is a standard software interface used for communication between software applications and imaging devices such as digital cameras and scanners. The TWAIN project dates from 1992 when several companies from the imaging industry attempted to standardize the communication protocols. Standard protocols are a good thing — hardware and software can be counted on to work together. The name TWAIN isn't an acronym, they just prefer to spell it all upper case. It's a reference to the opening line of Kipling's poem "The Battle of East and West", "Oh, East is East, and West is West, and never the twain shall meet", and the difficulty at the time of connecting imaging hardware and computers.
Then a later software project took the name SANE, an acronym for Scanner Access Now Easy. Yes, it's meant to reference the name TWAIN, although it uses a rather different programming model.
SANE is just the application programming interface, a collection of tools and software libraries that allow developers to write powerful software, but it isn't really a user application itself. The XSane project has built a nice graphical user interface, based on SANE and originally using the X graphical environment used on pretty much everything that isn't Windows. And if you want to know why "X" is the name of the graphical environment, you'll have to ask the people at MIT who invented X and made it open source and very popular.
This background doesn't really matter here, beyond calming any worries about XSane being a bizarre name. If you really want to know the background, go see the web sites for the SANE, XSane, and X projects.
If you don't yet have XSane installed on your system, do so now. There are pre-built binaries available for various types of Unix (Linux, BSD, etc) and even Windows. For MacOS X it seems to be available here. See my page on package management to see how to add it to Unix.
We need to look at the main control window for XSane. This is where you do everything except direct the scanner to make a preview scan and select the area to be scanned.
But first, what if you start XSane and it immediately reports an error about no scanning device being available, and then exits? That means that you don't have a scanning device attached! Make sure that your scanner's USB cable is attached, and make sure that the scanner has power. Many scanners, like the HP ScanJet 2200c, have no power button and no power indicator. There's no indication that it has power, just see if XSane finds it.
You could see if the scanner is detected as a connected USB device. On Linux:
% lsusb Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 001 Device 004: ID 05e3:0760 Genesys Logic, Inc. USB 2.0 Card Reader/Writer Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 002 Device 002: ID 046d:c404 Logitech, Inc. TrackMan Wheel Bus 002 Device 004: ID 03f0:0605 Hewlett-Packard ScanJet 2200c Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 003 Device 002: ID 051d:0002 American Power Conversion Uninterruptible Power Supply Bus 003 Device 003: ID 045e:00db Microsoft Corp. Natural Ergonomic Keyboard 4000 V1.0 Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Or, on BSD Unix, on a laptop with just the scanner and a camera plugged in:
% usbdevs addr 1: EHCI root hub, SiS addr 2: USB PTP Camera, Fuji Photo Film addr 1: OHCI root hub, SiS addr 1: OHCI root hub, SiS addr 2: HP ScanJet 2200C, Hewlett-Packard
XSane main control window.
But, the simplest thing is to simply verify that the scanner is powered up and the USB cable is connected.
We need to look at the main control window for XSane. We need to go through the functions of many of the controls in this window.
In the menus at the top of the main window, these are the important things to know or to check:
We just made sure that "tool tips" were turned on. If you hover the mouse over an item (move the pointer so it points to the item, then don't click but leave the mouse motionless), a reminder will appear.
At right is another copy of that main window. Let's go through the controls on the top half. I will name most of the controls for how they appear in their tool tips, but generally this goes left to right down the rows:
XSane main control window.
As for that source medium, you may notice that there are choices for slides and for a variety of negatives. I have read that those are pre-defined adjustments to the brightness and color sensitivity curves, and you can create your own and add it to the choices by specifying the correction curves in a personal configuration file.
I could have solved the problem of adjusting the scanner sensitivity for backlit X-ray films that way, but I found a way of accomplishing this that is easier for me to describe and for you to do.
Let's finish examining the XSane control interface. Here's that same window again:
XSane main control window.
The preview window when you have just started XSane in greyscale mode.
At right is the other important window, the preview window, as it appears when you first start XSane. We have already set it to greyscale mode, so you see the XSane logo without the colors.
So, I'll set up the scan. I'll place a 4-film sleeve on the glass and then block off the rest of the glass with opaque material.
Next, I'll click the Acqure preview button.
The Cancel preview button would be active during the preview, I could use it to quickly end a preview I realized wasn't going to work.
A preview scan of one 4-film sleeve.
Here is the result of that preview scan. A little light has leaked under some of the opaque blocking material, but not very much.
See those dotted white lines? They define the area that will be scanned. We want full control over that, so we de-selected automatic adjustment of the scanning area in an earlier step. Right now XSane is ready to scan the entire area, although most of it is blocked off.
The preview scan has been cropped.
Click and drag the dotted boundaries, by their sides or corners. Limit the scan area to just what you need to capture.
Remember that we are scanning at 400 ppi, and so a 4-film sleeve about 9.5 by 11 centimeters in size, or about 3.75 by 4.4 inches, will result in an image with dimensions of 1500 by 1760 pixels, far larger than what fits on a typical display!
That's fine. We want to capture good data. Whoever receives the images can decide what they want to do with them.
At the same time, don't crop out areas that you want! We are making an archival copy, presumably this is our last chance to capture the data.
You may have noticed that I selected the paper or plastic tab at the top of the sleeve. This is a real patient's sleeve and I have covered all the written information with completely opaque electrical tape. However, for most of the sleeves I have experimented with, the written information can be captured in these scans! That is good news for helping to organize the images, and letting you double-check one last time that you are giving patient Jones the scans for patient Jones, and not those of patient Smith!
The advanced options — leave these alone.
You may see extra features in the Advanced options window. See the Analog front end settings available in the example at right. Will you see these? It depends on the type of flatbed scanner you use. If they are supported by that scanner, as they are by the HP ScanJet 2200c, they will appear.
However, I found that these aren't really helpful. Yes, you can adjust the gain and DC offset of the three color channel amplifiers here. But those amplifiers get very noisy with higher gain. Leave those at -1 or 0 or whatever their default settings are. We will handle the brightness issue with gamma correction.
Just ignore this panel if you see it!
Now you're finally ready to put it all together and scan some films!
|
These pages are specifically about scanning dental X-ray film, but the system and procedures shown here should apply with slight modification to the scanning of many types of film. There are multiple pages. Read them in order, or jump ahead: |
|
|
|
|||||||||
|
|||||||||
|
| © Bob Cromwell Feb 2012. Created with /bin/vi and ImageMagick, hosted on OpenBSD with Apache. Root password available here, privacy policy here. |