MICAM version 1.2
MICAM version 1.2
Introduction
Getting started
The Menu
Toolpanel
Measurements and Calibration
Miscellaneous
Example
Registration
Introduction
I started many years ago with micro photography when I was a schoolboy. My experiments were done in the darkroom, by removing the ocular and projecting the image of the objective right on the photo paper.
Of course the paper had to be developed immediately. I managed to make some photographs, but the microscope was more a toy and the darkroom equipment was very primitive. I got other interests and I forgot about microscopy and photography.
After many years I started with microscopy again. Times have changed, so I wanted to use a digital camera and a computer for photography.
I attached a webcam to my microscope. I removed the ocular of the microscope and the lens of the webcam (a ToUCam).
The lens was replaced by an adapter and an UV + IR blocking filter was placed in front of the adapter. This way no dust can enter the webcam.
Fortunately in my set-up the CCD came almost right in the focus of the objective.
In my opinion you get the best quality with this kind of set-up. Using the webcam with lens in front of an ocular produced pictures with red spots, because of reflections on the IR filter on the webcam lens.
The only disadvantage is the small area of the CCD, so this method is only appropriate for small objects.
There is a lot of capturing software available, but all had some drawbacks (technically, but also the price).
What I wanted is a program in which I only have to press a button to save the captured frame with a name that gives me some information about the picture (its a webcam, not a digital camera with EXIF and all kind of information stored in the picture). Furthermore I wanted to do some measuring on the picture so I could tell what dimensions the objects have without doing the same calculations over and over again.
At that moment I started programming my Microscope Image Capture And Measuring (MICAM) program. The result was a program that was very easy to use, so I think other users of microscopes with a webcam (or a digital eyepiece) attached can benefit of this program.
Index
Getting started with MICAM
When you run MICAM for the first time, the program doesn't know what kind of camera or webcam you are using and what kind of microscope you have. So before you run the program make sure the webcam is attached to the computer and does function with other software. Then start the program.
The program starts with the main window.
In the menu bar you now select the item 'Device' then choose 'Select Device'. In the Capture Driver Dialogue you see adrop down box you can select your webcam (forget about the Select a Microscope item for this moment) and click OK.
Then a window with a possibility to select the size of the life view will appear. Selct the size you want to use and click OK.
On the Preview Window Tab you should see the live picture of the webcam.
Now go to the Preferences menu item. Here you can select a lot of options. For this moment we ignore all possibilities and go to the tab 'Microscope'.
We haven't any microscope yet, so we click on 'Add Microscope' , enter a name and click OK. In the next window you have to enter a name for an objective. Choose 4 (if you have an objective with 4x magnification). Then we go to 'Add Objective' to add values for the other objectives: 10, 40, 100 e.g..
Then go back to the tab 'Image and Video' and select the directories where you want to save the images (frames) and movies (AVI's) . You can use the ellipsis buttons ... for that.
You can also choose the kind of file type you want to use for your images:
BMP is without losses, but gives you large files.
PNG uses some compression and is also loss less.
JPG normally isn't loss less and uses compression, so you will get the smaller images . I have chosen a jpg-format with minimal loss.
Furthermore you can choose between three kind of filenames. Select what suites you best.
When the Frame directory name contains a #-sign, the directory name will be used in the comment that is saved with every image you take:
The directory name is split into two parts. The part before the #-sign will be the "Location" comment, the part behind the # will become the second line (Coordinates).
So when you create a directory with name: "Netherlands #km 230-557" Every image will be saved with Location as 'Netherlands' and Coordinates as 'km 230-557'.
Click OK to confirm the changes you have made. When you close the program your settings will be saved and used again when you start a new session of the program. So the previous mentioned setting have to be done only once
The only thing you have to change then is the directory were you want to store your images
N.B.
I found out that many camera's (especially the cheaper ones) have somewhat buggy driver interfaces. For this reason you have to select a video device and video format manual at the start of the program.
In this way all tested camera's did function perfectly with MICAM.
Now you can start capturing images by just pressing the 'Snapshot' button.
Note that the information that is stored inside a file is displayed in the lower left corner for a few seconds.
When you use PNG or JPG as image format the information will be stored inside the image. When you use BMP the information will be stored in a separate file with the same name, but with the extension 'cmt'.
This is all you need to know for capturing images with MICAM. More things are possible as you can read in the next sections of this help file.
Index
The Menu
File
The number of items is different in the Preview Window and the Measurement Window:
- Open Image
Search for an image file on your hard disk and open this image in MICAM
- Save Image As
Save the image in the measurement window. You can use the suggested name or choose another one (only in the Measurement Window).
- Save Image with Options
Save the image with the possibility to select the name in a database (only in the Measurement Window)
- Exit
Closes the program and saves the current settings in 'micam.ini'.
Device
- Device
Selecting this menu item will open a small window in which you can choose the right webcam and/or video compressor
- Video Source Settings
Here you can make additional settings for your webcam (Brightness, Contrast etc.). The appearance of this window depends on the webcam.
- Video Format Settings
Here you can make also additional settings for your webcam (video size). The appearance of this window also depends on the webcam.
- Video Compression Settings
AVI files can be very large. With the right compression the movies can be 10 to 20 times smaller without much visible distortion.
Preferences
When you click this menu item a window with four tabs will open. Each tab allows you to make some settings that will adjust the program to your needs.
Those values will be saved when you close the session. The information will be in the file 'micam.ini' in the same directory as the program. In the following lines you will find a description of the possible entries:
- Image and Video
You can select in what directories the images will be stored. The default directory will be a subdirectory named 'Capture' in the program directory.
You can also choose the kind of file you want to use for your images:
BMP uses no compression and has no losses, but the file size is rather big.
PNG uses some compression but also has no losses, so the files will be a bit smaller.
JPG uses compression, but in principle is not loss less so you will get the smallest images (I have chosen a jpg compression factor with as less losses as possible).
For video you can select frame rate and maximum duration of the movie (when recording a video you can always stop the recording. This is only to make sure the recording is stopped in case you forgot you started recording).
You can choose for three possible filenames:
1. The name consist of the Date, Unique number and Objective (magnification). This will assure the filenames will always be unique and that you know what magnification you used.
2. The name consists of the Date and a Unique number.
3. Choose the name. The program will add an auto incremented number to the name (the same as most digital cameras do). Here also the magnification of the objective will be added to the filename.
The difference between option 1 and 2 is that the program (and the user) can always determine what objective was used (option 1).
When you save the image the information about the objective is stored inside the file (JPG and PNG) or in a separate file (BMP), so there is no need to put it in the filename.
The 'Date' mentioned above is the Sample Date. By default it is the current day, but sometimes you want to put the day when you took your samples in the comment or filename, so you have the opportunity to change the Sample Date on this tab of the preferences.
You can set the SnapImageSize to a size you like. Sometimes the object isn't very detailed and a lower resolution is good enough.
- Microscope
Maybe you have several microscopes and/or webcams. So you have to make calibration files for every combination. On this tab you can enter up to 16 microscope-webcam combinations.
First you have to give your combination a name with 'Add Microscope'. But you can also delete ones that are no longer necessary, or edit when the name seems not the right one.
Then you can add or delete objectives. The added objective will appear at the bottom of the list. To delete an objective you have to select it first and then press 'Delete Objective'.
Every Objective description has to start with a number (the magnification). You are allowed to add some comment, but it has to be separated from the magnification by a space. So you can add something like: '40 X NA 0.65'. The line starts with 40 followed by a space, so 40 will be taken as the magnification and the rest is just comment.
When you add more than six objectives the appearance of the microscope box in the toolpanel will change to a drop downbox.
When you select a microscope and objective, you can check the 'Set as default' check box, the program will always start with that microscopes settings.
Most of the time I use the 40x objective, but sometimes I switch to 10x. I tend to forget to change the settings, so when you make a snapshot you can issue a warning when you don't use the default objective
The Panel at the bottom left of this tab shows the current Device (=camera) and microscope/objective. You can save this combination (it will be stored in a separate file). When you have several camera's this feature makes things very easy. When you select another camera, all settings for this camera will be reloaded.
- Measuring and Tools
The settings are simple: only line width and colour can be chosen, but you can have different line widths and colours for the scale and the measurement lines.
You also can chooose for micrometer (um) or millimeter (mm) as measuring unit.
You can put a Label or a Copyright string on the picture (Tools menu). Here you can select the content of the copyright string and font of this string. N.B. when you put the text '(c)' in your text the copyright symbol will be dsiplayed.
The copyright font will also be used for the Label.
- Miscellaneous
Captured frame double sized
If you think you pictures are to small you can make them twice as large, by setting this option. The program interpolates between surrounding pixels.
Enable sound on Snapshot
When you take a snapshot of the preview window you can hear a camera sound. It is disabled by default.
Save comment for BMP images (in separate file)
The BMP files cannot store the comment inside the file, so a separate file is needed. If you don't like this option, you can uncheck this box.
Use MICAM without Video Device
Some people use MICAM with an ordinary camera. So they don't need the Preview Window. With this setting you can start in the Measuring Window.
Warnings
When you resize an image in the measurement window ALL measurements will be gone. Furthermore when you save the image it will be saved in this format.
General rule: First set the size of the image then perform the measurements and finally save the image.
Hardware triggered Snapshot
If you want to use external hardware to trigger a snapshot, you can use the serial port. When you computer doesn't have one you can buy a USB to serial cable and use that. Find out which COM-port you use and determine what input you want to use.
The current level on this input will be considered as the non-active level. If necessary you can use two outputs (DTR or RTS) to generate a reference level.
Measurement
- Clear
You can do many measurements in one photograph. When this becomes a bit messy, you can clean-up by issuing this command
- Insert Scale
In electron microscopy photographs you see those nice scales with a length of f.i. 10 um, so you know about the size of what you are looking at.
Once your system is calibrated you can insert a scale with a length of 10, 20, 50 or 100 um on the place of the mouse cursor. The finger is pointing at the place where the scale will start or ends, depending on where you want to place it.
- Edit Calibration Value
Sometimes you want to alter the calibration settings for an objective without going though the calibration process. Use this menu item to perform this action.
Tools
- Insert Label
In an input box you can enter a text to be placed in the picture, the same way as you do with a scale
- Insert Copyright
Place the copyright string in the picture, also in the same way as you do with a scale
- Search and Rename
This opens a new window. Here you can select a directory and (part of) the file name you are looking for.
A list with all filenames that match the searching criteria will be shown. You can step though this list with the Next Previous buttons (or ArrowUp, ArrowDown keys).
The scaled picture is displayed in the upper right part of this window.
Note the results of the selected directory and all its sub directories is displayed. So when you have a directory structure with many sub directories it is very easy to find all pictures of 'Closterium navicula' you have.
If you want to perform some actions on the image, you can push the 'Open in Micam' button to send the image to the measuring window.
If you want to rename the file, you can select a filename from a database of your choice. The program then suggests two possible filenames. Choose one of them (or edit the suggested name) and press the rename button.
This option is useful if you have files without a name but only a date (because you couldn't determine the subject). At a later moment you know the right name so with this utility you can easily change things.
- Select and Cut
Sometimes you are interested in a smaller part of a large image. With 'Select and Cut' you can select four area formats (640x480, 800x600, 1024x768 and 1280x960 pixels).
When you move the mouse over the image you see the selection rectangle following your mouse movements. When the selection area is on the right spot, press the left mouse button and the selection will be cut out.
Note that the original image is destroyed in this operation!
When during the selection process you decide NOT to cut a selection you can press the RIGHT mouse button to quit the selection process.
Help
- Help
Displays this Help-file
- About
Shows version information and how you can reach me
Index
The Tool panel
The appearance of the tool panel changes when you switch from Preview Window to Measurement Window.
The Preview Window
When you are in the Preview Window you have the following options:
Capture
- 'Snapshot' button
Captures a video frame (image, picture) and saves it to disk in the directory and with the filename you have chosen (see Preferences - Image and Video)
Normally no questions are asked, so you can concentrate on what you see through the microscope. When you save the captured frame as jpg the information stored inside the jpg-file will be shown for a few seconds in the lower left of the MICAM window.
Sometimes you want a warning when you forget to change the settings. In 'Preferences, Microscope' you can check the 'Warning on snapshot with non-default objective' to give you a warning when you use the non-default objective
When Sound on Snapshot is enabled in the 'Advanced' tab of 'Preferences', a wave file with the name 'Camera_snap.wav' will be played. You can use any WAV-file you like, as long as you rename it
- Save with Options
On save you can change the name of every single frame you capture. You even can add some comments that will be saved in the picture.
You can select the name from a database. This database is only a list of names (Take a look at the databases supplied, to get an idea of the structure of those databases if you want to use your own list). You also can add a date and magnification to the name. You can also choose for date + a number if you want. The program chooses a number so the filename will be unique in that directory
You can search for a name in the database of your choice. If this name isn't there, you can decide to use the name you typed in the search field as the name of the picture.
A list of recently used names is available, so you can pick a recent name without using the search facility.
The use of the Save Options dialog is made as easy as possible. At first use you might have to set some options, but lateron you only have to find the right name. When you hit the 'Save with Options' button, the dialog opens with the cursor in the 'Enter Search Text' field. Enter some characters of the name and all possible matches will be visible in the list in the upper right of the dialog window. When you see the name you were searching you can hit the TAB-key. The cursor goes to the list and with the cusror keys you can select the desired one. Then hit the Enter key and the proposed filename will be shown almost at the bottom of the dialog. With another hit on the enter key you can save the image.
When you want to use a recently used name you only have to hit the TAB-key twice, use the cursor keys to select the right name and hit Enter.
When you save a file you can even add a comment (top-left of the Save with Options window) to every single picture you save
By default the program save the Location (Name and Coordinates) and Sample Date in the comment. But you can switch this off and use your own comment
The program stores the microscope and camera information also in this comment, but is invisible for the user. (To see what information is stored save an image as BMP file. The information is stores in a file with the same name, but with the extension CMT. You can read this file with a program like Notepad.
- Fit to Window
When the preview window is to small or to large you can check this option
Send to Measurement Window
- To Measurement
A frame will be captured and copied to the Measurement Window. Now you can perform measurements on this frame.
Sometimes the captured image you send to the measurement window is a bit noisy. By averaging several frames you can have an image with less noise. When you enable 'Noise Reduction' you can select how many frames you want to average. When you hit the 'To Measurement' button the counter counts down until the right number of frames has been averaged. Then the result is shown
Note: This functions only when you use the 'To Measurement' button. The Snapshot and 'Save with Options' buttons capture only one frame
Capture AVI
- Start (Stop)
Click this button to start capturing an AVI movie. Click 'Stop' to stop capturing
When you click the Start button you have the option to change the default filename. When you press 'Cancel' the program uses the suggested name. Otherwise change the name and press OK
Note: This feature does not work correct with all camera's!
Micr.: NAME
- Objectives
Here you can select what objective you using. This information will be used when you save an image and when you do measurements on a picture. Of course this information is also needed when performing a calibration.
When the colour of the radio button is RED then you haven't done any calibration with this microscope yet. The program will warn you when you do try to make some measurements
After a calibration of an objective the caption will be BLACK. The program makes a guess about the calibration factor for the other objectives (I assume that when you calibrated the 10X objective, the 40X objective produces an image almost 4 times as large). Those names will be in GREEN. Here the program also warns you
When you loaded an image from file it is possible the picture was not made with MICAM and the microscope information could be wrong. The program warns you by displaying the caption of the objectives box in red.
When you have more than 6 objectives, the appearance will change from radio buttons to a drop down box, but all other properties will be the same.
The white box (at the bottom left) you see flashing when you make a snapshot is the Comment box. It shows the comment that is saved with the image.
The Measuring Window
The following descriptions refer to what you see when you select the Measurement Window
Measurement Picture
- Open Picture
Open an earlier captured or saved frame. Once you have opened a picture you can walk trough the opened directory with the PageUp and PageDown buttons on the keyboard
- Save Picture As
The program opens a Save Dialog so you can determine where to save your picture (with possibly a Scale and measurement marks)
- Save with Options
Now the save operation is as with the 'Save with Options' button from the Preview Window
The only difference is that you now also have the opportunity to rename the original file instead or to create a new file.
Calibration and Measurement
Only visible when the Measurement Window is visible.
- um /pixel
shows how many um (micrometer) or mm (millimeter) will be displayed per pixel.
- Calibrate
The next mouse action will be a calibration action.
- Action
Displays 'Measure' or 'Calibrate' during action with the mouse
When you measured a distance, the last measured distance appears in this box.
- Image Size
Here you can set the size of the measurement image. Note that when you save the measurement image this size will be used
Micr.: NAME
- Objectives
This is the same window as in the preview tab.
- The System Comment and User Comment Box
The white box you see at the bottom left is the System Comment box. When you open a file that was created with MICAM you can see additional information in this box:
Location: Two lines containing Name and Coordinates of the place where the sample came from
Sample Date: Date when the sample was taken (in Preferences you can change this date. By default the current day is used)
Microscope Info: Used microscope, objective and calibration value.
In the lower part of the commentbox you can enter additional information on the subject. With 'Save Picture As' (and using the suggested filename) you can store your comment in the picture.
The User Comment box can you use to enter your own comments to the image.
Index
Measurements and Calibration
To perform measurements you have to calibrate MICAM first.
Calibration
When you are calibrating it is useful to have an object under the microscope with some kind of calibrated scale on it (a ruler for the 4 X and 10 X objectives f.i.) When you go from one line to another on the ruler you know that the distance will be 1 mm = 1000 um. For the objectives with higher magnification you need some kind of object with a known length of about 50 to 200 um.
I assume you have an object with known dimensions under the microscope. When you have a clear view, press the 'To Measurement' button. Go to the 'Calibration and Measurement' window and check the 'Calibrate' box. In the image you go to the start of the known distance. Press the left mouse button and move to the other end of the known distance. Release the left mouse button.
A small window pops up were you can enter this known distance. This finishes the calibration for this particular objective. You will have to repeat this action for the other objectives to get an accurate calibration, but I found out that measurements on the other objectives will be rather good without that.
After a calibration of an objective the caption (text at the radio button) will be BLACK. The program makes a guess about the calibration factor for the other objectives (I assume that when you calibrated the 10X objective, the 40X objective produces an image almost 4 times as large). Those names will be in GREEN. Here the program also warns you.
When you loaded an image from file it is possible the picture was not made with MICAM and the microscope information could be wrong. The program warns you by displaying the caption of the objectives box in red.
Measuring
To perform a measurement you go with the mouse to the place where you want to start. Press the left mouse button and with the mouse button pressed go to the stop point.
A line will be drawn and the length (in um) will appear at the end of the line. This distance will also be displayed in the 'Calibration and Measurement' box.
Index
Miscellaneous
When you right-click a BMP, JPG or PNG file in Window Explorer, you can select "Send To" . The installer has put a link in the 'Send To' directory and now Windows allows you to select a program you want to use to open this kind of file. When you choose MICAM your image file will be opened with MICAM
When MICAM is open, you can also drag images from the windows explorer (or Picasa) to the measurement window of MICAM and drop it there
To demonstrate the use of Databases in MICAM I have added four databases:
Diatoms, Desmids, Paddestoelen (i.e. mushrooms in Dutch) and Mossen (Mosses). The latter two databases not only contain the scientific names, but also the Dutch names (in MICAM refered to as 'Local names').
You can use MICAM for other subjects by creating your own databasese. I hope the information you can get from the supplied ones will be sufficient for that purpose
Note: When you place your own databases in the Databases directory of MICAM, MICAM will recognize them and let you use them.
You can use Function keys to start the most used functions in MICAM. The following functions are implemented:
- F1 Snapshot
- F2 Snap with Options
- F3 To Measurement
- F5 Open Picture
- F6 Save Picture As
- F7 Save with Options
An example of the use of MICAM
Here I will give an example of how I use MICAM:
I study desmids in the northern part of the Netherlands. I collect water samples and try to determine what kind of desmid I see under the microscope. I often make a photo inventarisation, so others can verify the determination in a later stage. For this example I take a water sample from my garden pond at location (square kilometre area) km 236 - 559. A few days later I start the investigation of the sample under the microscope.
I start the MICAM program and select the webcam (eyepiece) I am using. In this stage I can change settings for contrast and brightness, but I already made these settings earlier and the program uses the earlier settings.
The camera I use is the default one so all settings for the microscope and camera are ready now (Go to Preferences --> Microscope to set the right microscope and camera settings if you haven't done that yet).
Now I go to Preferences and go to the directory where I save my photographs of desmids. I create a new directory with the name "Garden Pond #km236 - 559". Note that because of the #-sign the Location and Coordinates strings at the bottom are set in the proper way! In the box Default Filename I select the sample date (pull-down button) and select as default filename only the sample date and unique number (option number two). Finally I select JPG in the 'Save Image As' box.
Then I click OK. All preparations have been made now. Normally it will take 10 to 20 seconds to make all preparations.
Then I start searching the sample for interesting things, The real work!
When I find something I don't recognize but nevertheless is interesting I press the snapshot button. Without any questions a picture will be made
I use a trinocular microscope and I have to pull a shaft to change from the direct view to the binocular view of course. Maybe a small adjustment in focus has to be made, but that is all. On the computer screen I can focus very well. I sometimes set focus on different points in the object under study and make several photographs of the same object just by pushing the Snapshot button.
My main problem is that when I switch objectives, the program isn't aware of that. So I have to select the right objective in MICAM also. For this reason I have an option to issue a warning when you have selected another objective than the most used one (see Preferences --> Microscope). It doesn't prevent me from making errors, but at least I can prevent some of them.
When I see something I recognize, I use the 'Save with Options' button. Now I can select the right database (Desmids) and type a few characters of the name (in the box at the upper right I see all names that contain the selected characters. So when I see a 'Tetmemorus brebissonii var. brebissonii' I only have to type 'tet' in the Search field and only a few matching names are left. I then select the right one in the list with matching names and a proper filename will be shown in the Suggested Name box. Note that all other settings are taken from the preferences you made earlier, but if you want to change them you can do that. Clicking the 'Save with this name' button saves the photograph with the suggested name.
In a later stage I can go to the Measurement tab and reopen files. An object I couldn't determine the first time can be given a name now by using the 'Save with options' button in the same way as when I was capturing images.
The same operation can be performed with the 'Search and Rename' menu option. Renaming several files will be easier using that option.
I hope you enjoy working with MICAM as much as I do.
Registration of this software
Registration of this software is not necessary.
If you like this program then pay an amount of 10 euro via PayPal (to mvanwesten@home.nl) to continue the use this software.
Index