PICOLAY Tips and Tricks (Engl.) | Tipps und Tricks (Deutsch) Short reference (Engl.) | Kurzreferenz (Deutsch) Version 2015-09-09 #### How to ... take a focus stack of images add images to the list start the stacking procedure find perfect stacking parameters align an image stack browse an image stack at constant position and size display an image stack as slide show generate an animated GIF file generate mpo files handle very large images resize images crop images rename images change the file format of images delete selected images from disk change image parameters like brightness, contrast, sharpness etc. paint on an image sharpen or blur details clone (= copy areas) within an image clone areas of original images into the stacked result write text on images draw a scale bar average images add or subtract images from one another insert intermediate images betweeen the images of a stack perform colour-based stacking harmonise image brightness in your stack set the white balance of one or all images in your stack set a smooth background (flat field) by removal of disturbing items from your stack divide RGB values of images by those of the first image in the list generate a depth map of your stack set correct 3D parameters generate 3D hologram views to display hidden structural details generate 3D images from depth map and stacked image perform stacking in multiple subfolders with a single click perform video-stacking How to take a focus stack of images Mount your camera in a way that allows for taking pictures in a stable position. A camera without a clapping mirror (e.g. Canon Live view mode) is recommended. As a rule set the resolution of your camera to twice the height and width of what you would like to present finally. That means often you will not need the full resolution of you camera. Set the ASA value of your camera to the lowest possible value (100 or 200) to reduce noise. Open the aperture of your camera lens and (with a microscope) the condensor to have a low depth of focus. Take pictures from top to bottom (from close to far) with small focus steps, so that every structure appears sharp in at least two images. If you took picture from far to close, you can turn the stack top-down later before you analyse it with PICOLAY (Image list | Reverse order of images). Take pictures moving the specimen camera closer to the camera or vice versa, but not by turning the focus wheel. The latter might cause distortions by the lens. For macro- and close-up images provide a homogeneous mild illumination (e.g. by using a diffuser), avoid wandering shadows and light peaks. Take care that the image filenames are alphabetically correlated to the focus layer. A typical error is having a list like this: img1, img2, img3.... img9, img10, img11. This will be alphabetically ordered as: img1, img10, img11, img2, img3... To prevent this rename the files (inserting '0') to img01, img02, img03. If your stack was taken through a binocular stereo loupe, or the camera or specimen was moving, use the alignment routine of PICOLAY. List of topics How to add images to the list Select File | Add images or press Ctrl-A. Select the folder with your image stack. (You should copy a single stack to each folder, only.) Then press Ctrl-A again to select all files, or click on the first image, keep the shift-key pressed, and click on the last image of a stack. By pressing the Ctrl-key and clicking on single images you can select or unselect them. After clicking on 'Open' the selected images will be added to the listbox and sorted alphabetically. The first image will be shown in the left image window. The added images are marked as indicated by [X]. To unmark or mark an image, double-click on its name in the listbox. Only marked images will be included in further image processing. Under File | Image list there are several options to change all marks, remove files from the list, rename, or delete files. List of topics How to start the stacking procedure First select the images to be stacked via 'File | Add images' (or Ctrl-A). The simplest way of starting the stacking procedure is pressing Ctrl-F1. Alternatively, you can use 'Stack operations | Set stacking parameters | Go'. This will start the routine applying the current parameters. A little window indicating the progress (= number of images processed) will show up. Finally, the generated stacked image and the corresponding depth map will be saved in the same folder as the image stack, and will be added to the image list (unmarked). The new filenames start with 'py' and contain the parameters used like 'pysharp_min1_en.jpg' or 'pymapsharp_min1_en.jpg', 'min1' indicating that the stacking routine applied a minimum contrast of 1, and 'en' indicating that the automatic image enhancement was used. List of topics How to find perfect stacking parameters There are several adjustable parameters you can use to obtain the perfect stacking result. Here they are shortly explained. Select Stacking operations | Set stacking parameters or press F2 to open the panel. Minimum contrast is a noise reduction filter. It prevents that any noise in your stack will be considered as a structure. Increase the value so that all real structures are recognised and noise goes to the background (indicated by a grey colour in the depth map). When you click on Go, the new result will show up within a second without requiring a new run of the stacking routine. Narrow or widen patches shows up only when the minimum contrast is set to values >1. Negative values of this parameter melt off the edges of the coloured patches in your depth map and generate a more crispy appearance of the structures, while positive values will enlarge the patches and cause smoother transitions into the background areas. Check it out to see the consequences within a second... Filter size describes the structure detection method. Generally, PICOLAY detects structures by analysing gradients between neighbouring pixels. The smart filter will analyse both the close neighbours of a pixel to detect fine structures, and more remote pixels to detect large structures, and finally mix the results automatically. You can select a fixed small, medium or large filter and see the results within a second. Applying the cloning routine will enable you to produce your own mixture of the different results if you want. Prefer high or low frames enables you to influence the visibility of hidden structures in your specimen. This is sometimes helpful when you have multi-layered structures. Preference of high structure will reduce the visibility of lower frames, while preference of low structures will increase it. If you change this parameter a new stacking routine will be required to see the result. An alternative method to improve the presentation of multi-layered specimen is Hologram-stacking Auto-align images is required under certain conditions, in order to move corresponding structures to the same position in your images. Select this function only when necessary as it takes time and might lower the quality of your result if done with well-aligned stacks. Get more information here. Auto-enhance will slidely increase sharpness, contrast and colour saturation of your stacking result. Test 4 param. sets will apply four different parameter sets for the stacking routine, and thus help you to find the perfect parameters... List of topics How to align an image stack Reasons making it necessary to align the images of your stack are Specimen has moved. The camera has been mounted shaky or rotating. Image stack was taken through a binocular loupe, where the focus is moved not in line with the optical path. There are three parameters that can be changed by the alignment routine: Displacement in x- and y direction. This function is always switched on. Object size. This is required mainly for macro- and close-up images, where structures might be sharp at different focus levels, while they approch to the objective lens. This function is routinely switched on, but should be turned off (under Options) for microphotographs (>6.3x objectives). Rotation. If your camera or specimen was rotating while you took the stack, activate this function under Options. The alignment routine starts in the middle of your stack and corrects the alignment going to the top and later going to the bottom of your stack. New files named 'xy..." will be generated, stored on the disc and shown in your image list. List of topics How to browse an image stack at constant position and size After adding, the selected files are shown in the listbox and the first image is displayed. To display another image just click on its name. You can zoom in and out ([+] and [-] on the image window. As indicated by the '[X]' at the left, the images are marked. To unmark or mark an image, double-click its name. Only marked images will be regarded during stack operations. Note: All pictures should have the same dimensions (width and height). You can reverse the order under 'Image list' depending on whether you started with the uppermost or lowermost layer. PICOLAY assumes that the first images shows the uppermost layer and requires the image names in the corresponding alphabetical order. PICOLAY will not change the original files. However, automatically generated files will overwrite older versions. Next time you start PICOLAY the last image directory will be remembered. Most images are at full resolution bigger than your screen. While normally image viewers show the upper left corner of an new image or resize it to fit the screen, PICOLAY will keep a selected position a full size when you click through the marked image list or display the list as slide show. Thus, you can watch how details of a specimen are represented in your stack. List of topics How to display an image stack as slide show Just add images to the list, and press Image list | Start slide show or use the F12-key. Stop the show by pressing F12 again or clicking into an image. Please set unter Options | Slide show features how long (in millisec) each image should be displayed, and whether at the end of the list the show should run backwards or start again with the first image. To generate a single file from your show use the function Image list | Generate animated gif image. List of topics How to generate an animated GIF file Marked images of your list (resp. the slide show) can be transformed to an animated gif image by selecting Image list | Generate animated GIF image or by pressing or Ctrl-G. Before doing this set unter Options | Slide show features how long (in millisec) each image shall be displayed, and whether at the end of the list the show should run backwards or jump to the first image. You are asked for a name of the gif file, which is saved in the current folder. List of topics How to generate mpo files MPO (multi-picture object) files are containers harbouring the left and right view of a 3D object. This file format is used by several image processing programs and 3D TVs. To generate them, first produce the left and right view as jpg files using the [R]+[L] mode on the PICOLAY 3D display panel. Take care that these files are the first marked images in your image list. Then select Image List | Generate MPO file, enter a name and click on Go. The MPO file will be saved in you current folder. List of topics How to handle very large images The PICOLAY stacking routine might have problems with very large images (bigger than 6000 x 4000 pixels), giving an 'Out of memory' error even with computers having sufficient RAM. To avoid this problem you might either resize your images or crop the relevant part prior to stacking them. Please regard that for stacking a higher number of images (layers) is often more relevant than the number of pixels per image. List of topics How to resize images Marked images of your list can be resized by means of the Enhance function on the left image window. Activation of the 'Apply to all marked images' feature may be used to transform a whole list of images. List of topics How to crop images To crop images and cut off superfluous edges, draw a rectangle into the image. Then select Edit | Crop selection (for a single image) or Edit | Crop all marked images for a set of images. PICOLAY will generate new files named 'clipy..' (+ original name). The file format of these can be set under Options | Save as. List of topics How to rename images To rename images, add them to your list and take care that they are marked. Then select Image list | Rename marked files or press Ctrl-N. Type the characters to be overwritten in the left and the new characters in the right text field and Go. List of topics How to change the file format of images To change the file format of images, select the new format under Options | Save as. Add the images to your list and select Enhance on the image window. On the new panel you might disable all changes or activate some, and select Apply to all marked images if you want and click on Go. List of topics How to delete selected images from disk CAUTION: PICOLAY deletes files completely, and does not keep them in the bin! Files in the list generated by PICOLAY, whose names are beginning with 'py...' can be deleted by pressing Ctrl-X or Image list | Delete all py-files, resp. Delete marked py-files. To delete other image files, mark them in your list, select Image list | Delete all marked files and confirm the irreversible deletion. List of topics How to change image parameters like brightness, contrast, sharpness etc. PICOLAY allows for changing many image parameters using the Enhance function on the image window. A new panel opens that allows to adjust about 20 parameters. Check your settings clicking on Test until you see the perfect result. Then click on Apply, eventually using the option Apply to all marked images. List of topics How to paint on an image The mouse tool can have different functions to be used on the left image window. Select [Mouse=] Paintbrush. Adjust Brush width and select the colour either by clicking with the RIGHT mouse button into the image or typing in the RGB values. There is an Undo function for one step only. You may save intermediate or final steps with a new name or Overwrite the current image (name indicated on the panel). List of topics How to sharpen or blur details Select [Mouse=] Sharpen or [Mouse=] Blur and adjust Brush width. There is an Undo function for one step only. You may Save intermediate or final steps with a new name or Overwrite the current image (name indicated on the panel). List of topics How to clone (= copy areas) within an image Select [Mouse tool=] | Clone within image, set Brush width, RIGHT-click into the image to define the target area and then LEFT-click to define the source area. Now move the mouse with the left button pressed down to clone from source to target area. There is an Undo function for one step. You may save intermediate or final steps with a new name or Overwrite the current image (name indicated on the panel). List of topics How to clone areas of original images into the stacked result Select [Mouse tool=]Edit | Clone to result image and set Brush width. Now move the mouse with the left button pressed down to clone from source to target image. Using the Synopsis feature (on top of the right image) helps to display the same areas on both images. There is an Undo function for one step. If you save the image it will get a new name with 'clone...'. If you use this function on a stacked image the map will be cloned as well, thus keeping the layer from which the source pixels are derived. You should not use the 'Auto-enhance' function for the stacking routine, when you want to clone from original to the stacked image, as the stacked image will not match the originals perfectly. List of topics How to write text on images Select [Mouse tool=] Insert text, choose a character font, size and colour. Define whether writing should be horizontal or vertical, and type in the text to be inserted. Then click on the left image to place the text on it. There is an Undo function for one step. Finally, you save the image with a new name 'py...'. You may also write on all marked images, if you check the corresponding box. List of topics How to draw a scale bar Select [Mouse tool=] Draw scale bar, define Width and Length of the bar and choose a colour then click on the left image to place the bar on it. There is an Undo function for one step. Finally, you save the image with a new name 'py...'. You may also write on all marked images, if you check the corresponding box. List of topics How to average images Use Stack operations | Average marked images or F4 to average images. A new file 'pymean...' is generated and added to the list. List of topics How to add or subtract images from one another Take care that the image to be added or subtracted from the others is the first marked image in the list. Then use Stack operations | Add or subtract 1st image or F9 to start the routine. New files 'py..' (+ old name) are generated and added to the list. List of topics How to insert intermediate images betweeen the images of a stack Use Stack operations | Insert intermediate images or F5 for this purpose. The new files generated will have an additional 'i' in their names. Please regard that it is better to have more original images in your stack than using this routine, which might give a smoother stacking result but does not contribute any new information. List of topics How to perform colour-based stacking A colour-based stack analysis might be helpful, if you want to localize structures showing a certain target colour (e.g., a fluorescent dye) in your stack. Use Stack operations | Colour-based stacking or F3 for this purpose. The target colour is selected by clicking with the RIGHT mouse button into the image window or be entering the RGB values. Using black or white as target colours can be helpful to detect the darkest and brightest structures, or to get rid of halos in phase contrast images etc. List of topics How to harmonise image brightness in your stack To compensate brightness variations in your image stack use Stack operations | Auto-adjust brightness or F7. New files 'by..' (+ old name) are generated and added to the list. List of topics How to set the white balance of one or all images in your stack To correct the white balance of marked images in your stack use Stack operations | Set white balance or F8. Define the target colour (the one that should be changed to grey/white) by clicking with the RIGHT mouse button into the image. New files 'py..' (+ old name) are generated and added to the list. List of topics How to set a smooth background (flat field) by removal of disturbing items from your stack If you have hot spots on your camera chip, dirt in your optical pathway or a disturbing brightness gradient affecting all images of your stack, this can be corrected by the PICOLAY flat-field correction. First, take a picture above and/or below the level where anything of your specimen is sharp. You might also average these unsharp images. Then take care that the unsharp image is marked as the first image in the list and use Stack operations | Set background/flat-field or F10. Define the target background colour by clicking with the RIGHT mouse button into the image and Go. New files 'py...' (+ old name) are generated and added to the list. List of topics How to divide RGB values of images by those of the first image in the list To do this use Stack operations | Divide by 1st image or F11 and Go. New files 'div..' (+ old name) are generated and added to the list. List of topics How to generate a depth map of your stack A depth map is automatically generated during the stacking routine. It is saved as 'pymap...' (+ applied parameters information) in your list. The depth map shows colours from yellow (top) over green (middle) to blue (bottom). Grey indicates areas without detected structures and no depth localisation. The map can be used to produce rotations or stereoscopic 3D images. The depth map does not contain information about the absolute height or thickness of the specimen. This parameter (length of Z axis) has to be defined when you generate a 3D view. List of topics How to set correct 3D parameters When you have defined a sharp image and a depth map (e.g., simply by performing the stacking procedure) you click on 3D view on the right result image to get a new panel with the 3D parameters. At the same time the depth map is displayed. Here a short summary of the adjustable parameters and their effects: Length of Z axis (% of image height). This parameter defines how flat or thick your specimen is. You don't enter a value in µm or mm, but compare it to the height (or Y axis) of your image. Imagine you have a bullet-shaped specimen, and your images keep the same edge distance at all sides (top, down, left, right), then '100' (%) would be the right value. With a lower value the bullet would look like a lens, with a higher value it would look like an upright-positioned egg. Of course it is possible to calculate the correct value, when you now the diameters and focus distances of your stack. However, one can find reasonable values easily just by trying until the specimen looks natural. Enlarge pixels. Normally you'll have thousands of pixels in x- and y-direction, but only 20 to 200 layers (pixels in z-direction). To avoid fissures caused by this reason and to get a smooth surface pixels can be enlarged in z-direction. Perspective. By using this parameter you can let closer parts of your specimen appear larger than more remote parts. It might be surprising, but you don't need this for 3D images, it's just a special effect. Projection based on depth map. This is the normal 3D visualisation. Any pixel of your deep-focus image will have a defined z-position, showing the pixel with the highest sharpness score in the stack. Hologram stacking. If you have a transparent multi-layered specimen (often in light-microscopic stacks) there might be structures in different layers that will be hidden with the depth-map based method. Then you could try the 'hologram' method, which displays not the sharpest pixel only, but any pixel exceeding a sharpness threshold that you have to define. When you then let the specimen rotate internal or backside structures will become visible. Images to be generated PICOLAY offers a whole suite of possibilities for 3D visualisation or rotation. Stereo means that two different images are generated that differ slightly by the viewing angle of your eyes. If you switch this off, you'll get single images, which still can be rotating or rocking and give a 3D impression. Actually, many people don't see 3D with both eyes by have learnt to analyse image variations due to slight head movements as indicators for distances and 3D structures. Viewing angle. We are looking at objects in front of our heads with crossed eyes. For close objects we have a larger viewing angle than for distant ones. Correspondingly, one should set a large viewing angle (4 or 5°) for stereoscopic images on your computer screen, while a small angle (2 to 2.5°) is correct for distant video projectors. Relief. This function allows for adding a shadow (light coming from top left) that increases the 3D effect. Distance. By means of this parameter one can let appear a 3D object in front of or behind the screen. A value of 0 places the middle of the stack on the screen level. Negative values will move the object into the front of the screen, while positive values let it appear behind it. Red-cyan causes the presentation of yor specimen as anaglyph. The left-eye image is shown in red while the right-eye image is cyan (= blue + green channel). You'll need suited glasses to see the 3D effect. And some colour changes might be caused by the filters. [RLR] and [LRL] will generate a panel with three images side by side. This can be looked at with crossed or parallel eyes, and shows both a convex and concave stereoscopic view of the specimen. [R] + [L] will generate two separate images with the right- and left-eye view. These images can be used for different purposes. If Synopsis is activated (on the left image) and the [R] and [L] images are loaded into the left and rigth window, one can zoom into the images and get a stereoscopic view with crossed of parallel eyes. Furthermore, the images might be used for the production of mpo files. Rocking gif will generate an animated gif image switching between the left- and right-eye view. [RL], [LR] or [RL]/[LR] will generate further combinations of the the left- and right-eye view. These allow for parallel- or crossed-eye stereoscopic visualisation. If you choose [LR] or [RL] you can also generate left- and right-view on top of each other, as well as interlaced or jps images, which might be required for some 3D TVs etc. Background. Here one can define whether areas without structures (grey map areas having less than the minimum score applied during stacking) should be shown as an average of all images or set to a uniform colour. The colour can be selected by clicking with the RIGHT mouse button into the image on the left side or by typing in the RGB value. Using a uniform colour is helpful to let the specimen appear freely rotating in space. 3D rotation parameters. Rotation can be performed with single images or with any kind of stereoscopic views. X, Y, Z defines the angles of rotation. Stepwise rotation allows for generation of rotating specimen images. Rotation is possible around any axis. Step defines the angle progress (a real number). Repeats defines how many steps will be calculated. List of topics How to generate a 3D hologram view to display hidden structural details The stacking procedure detects the sharpest structure in a focus stack, ignoring other details with lower score. The latter will be lost in the resulting image. With mono-layered specimen this is no problem. With multi-layered object, that often occur in microscopic analyses, you loose valuable information. To overcome this issue, PICOLAY allows for performing the so-called 'hologram stacking'. For this you define a minimum score value for the details to be displayed. Furthermore, it is usually recommended to rotate the object virtually so that the fine structures are not hidden underneath the maximum score pixels. Finally the stack has to be analysed again to generate the 'hologram'. Check Hologram stacking on the PICOLAY 3D display panel. Define Filter radius and Minimum contrast for the detection of any structures in the stack. It is also possible to Export the layers detected by this method, e.g. for using them on a 3D printer... Hologram stacking can also be performed searching for a Target colour instead of sharp structures. This method can be helpful for analysing the distribution of dyes in a focus stack. Hologram stacking is started by clicking on Go. List of topics How to generate 3D images from depth map and stacked image One can generate 3D images from a previously saved image + the corresponding depth map. Add any sharp image and the corresponding depth map to the list. Take care that both of them have the same size and show the same position. Click on the map and copy it to the depth map image: Edit | Copy to depth map, similarly with the sharp image: Edit | Copy to result window. Now click on '3D view' on the (right) result window and set the required parameters and display mode. List of topics How to perform stacking in multiple subfolders with a single click First, make sure that you have set suitable stacking parameters. Then select File | Stack images in subfolders. Use Change folder to find the folder above the image folders you want to analyse. Select all folders by Toggle marks or select single ones by double-clicking on them. Press Go and wait... If you have checked the corresponding button, the computer will be turned off automatically when the job is finished. List of topics How to perform video-stacking How can you do focus stacking on a (slowly) moving amoeba or a snail? Many cameras produce high-resolution videos that can be used to perform video-stacking on the macro- or micro-scale. This technique can also be used for still objects, as it gives very fine focus steps. Mount your camera in a fixed position. Illumination should be sufficient for 1/60 sec exposure time. Now take short videos, while you either turn the focus ring of your camera or move the specimen over the whole depth range within 3 to 5 seconds seconds. The next step is extraction of the frames from the video. This can be done by freeware like xmedia recode and virtualdub. Finally, select the frames covering the specimen depth and perform the stacking routine. List of topics