How do you perform stacking

Here you can discuss topics such as focus stacking, stitching and other techniques that relate to the processing of micrographs.
Post Reply
Message
Author
User avatar
zzffnn
Posts: 3200
Joined: Sat Jun 20, 2015 3:57 am
Location: Houston, Texas, USA
Contact:

How do you perform stacking

#1 Post by zzffnn » Tue Feb 16, 2016 2:08 am

This thread is for members to discuss their procedures for stacking.

For example, what is your individual step depth for each objective?

What softwares do you use?

what is your general shooting/stacking procedure?

How do you avoid/reduce out-of-focus areas that may confuse stacking softwares?

Do you clean up single photos before stacking, or do you clean up after stacking?

Do you stack all photos together at one time,
or
do you separately stack some individual layers first, then stack all layers together?

Please also feel free to raise more discussion points and provide links to other online resources.

Thank you!
Last edited by zzffnn on Wed Jun 13, 2018 2:00 pm, edited 2 times in total.

User avatar
zzffnn
Posts: 3200
Joined: Sat Jun 20, 2015 3:57 am
Location: Houston, Texas, USA
Contact:

Re: How do you perform stacking

#2 Post by zzffnn » Tue Feb 16, 2016 2:14 am

I would especially appreciate 75RR's comment here. At least two other members here want to know how he did his high magnification stacking of that amoeba test.

Original discussion, along with brief descriptions by Rod , Kurt, John B and gekko, can be found here:

viewtopic.php?f=6&t=2479
Last edited by zzffnn on Wed Jun 13, 2018 2:00 pm, edited 1 time in total.

User avatar
Oliver
Posts: 187
Joined: Sat Oct 11, 2014 12:57 pm
Location: Austria
Contact:

Re: How do you perform stacking

#3 Post by Oliver » Tue Feb 16, 2016 11:27 am

What softwares do you use?
I like to use Picolay: http://www.picolay.de
what is your general shooting/stacking procedure?
1. Choose specimen, magnification, etc.
2. Set camera to automatic capture. The software that I use (ToupView) allows for automatic picture taking every 2 secconds. This reduces time.
3. I start taking pictures, starting well out of focus and then turning the fine focus knob a little every time. Picolay requires the first image to be the uppermost layer. The images can be reversed in the program.
4. I stop when the "other side" of the specimen (the bottom part) has been reached and when everything is well out of focus again.
How do you avoid/reduce out-of-focus areas that may confuse stacking softwares?
5. I open the pictures and then delete the first and last pictures which are totally out of focus. If some parts are still in focus, I leave the image. The software will then decide to only use the sharp parts.
Do you clean up single photos before stacking, or do you clean up after stacking?
No. Then you have to clean up all the pictures, otherwise you confuse the software. Lots of unnecessary work to clean up in advance, better to clean up the final stacked image.
Do you stack all photos together at one time,or do you separately stack some individual layers first, then stack all layers together?
The software stacks all at once, and then it will apply filters afterwards to the final stacked image. Therefore intermediate steps are not recommended as this might increase artifacts.

Procedure:
1. Press Ctrl-A to add images to the list (numbered)
2. Make sure that top most image is on top, or press Ctrl-O to reverse the list
3. Stack operations - stack with current parameters

Oliver.
Image Oliver Kim - http://www.microbehunter.com - Microscopes: Olympus CH40 - Olympus CH-A - Breukhoven BMS student microscope - Euromex stereo - uSCOPE MXII

User avatar
rnabholz
Posts: 3086
Joined: Thu Jan 08, 2015 10:11 pm
Location: Iowa USA
Contact:

Re: How do you perform stacking

#4 Post by rnabholz » Tue Feb 16, 2016 4:04 pm

Thanks for the lead on Picolay, I see a download in my future...

Now a general question about stacking algorithms.

My wholly unscientific woodshed logic approach was to assume that by providing more images with less focus change between each, that I was "helping" the software by reducing the decisions it has to make regarding what is good data and what is out of focus data to be discarded. That is, by comparing two adjacent images with a small focus difference, it could more readily identify real structure versus unfocused halo, and therefore toss the bad and keep the good more easily.

Do I have it all wrong? Are fewer images with a larger focus spread better? I would seem that approach would leave layers of interpolated data that might not be the best possible result.

??

User avatar
KurtM
Posts: 1749
Joined: Tue Jun 09, 2015 12:08 am
Location: League City, Texas
Contact:

Re: How do you perform stacking

#5 Post by KurtM » Tue Feb 16, 2016 4:12 pm

^^^ What he said.
Cheers,
Kurt Maurer
League City, Texas
email: ngc704(at)gmail(dot)com
https://www.flickr.com/photos/67904872@ ... 912223623/

User avatar
75RR
Posts: 8207
Joined: Sun Oct 12, 2014 2:34 am
Location: Estepona, Spain

Re: How do you perform stacking

#6 Post by 75RR » Tue Feb 16, 2016 4:26 pm

The important thing in my view, whether the steps are 2µm or 5µm, is that each step have areas that are clearly in focus and that you make sure to capture the salient points of the subject.
Zeiss Standard WL (somewhat fashion challenged) & Wild M8
Olympus E-P2 (Micro Four Thirds Camera)

User avatar
Oliver
Posts: 187
Joined: Sat Oct 11, 2014 12:57 pm
Location: Austria
Contact:

Re: How do you perform stacking

#7 Post by Oliver » Tue Feb 16, 2016 5:50 pm

was to assume that by providing more images with less focus change between each, that I was "helping" the software by reducing the decisions it has to make regarding what is good data and what is out of focus data to be discarded.
If you have a small step between the different images (less focus change), then the out of focus parts will essentially look the same, while the in-focus ones will change. If you make the steps too large, then the out of focus parts will also have elements in them that become sharp. The software compares 2 adjacent images and the total number of images is therefore not so relevant.

The issue is different when stitching (making panoramas), because the software then has to choose from more images to find the suitable one (if the images are not sorted). Here less images are easier.
The important thing in my view, whether the steps are 2µm or 5µm, is that each step have areas that are clearly in focus and that you make sure to capture the salient points of the subject.
Yes. There should not be "jumps" in focus. So if the depth of field is eg. x microns, then I would suggest that x/2 microns should be the focus steps. But I never used this calculation. I just forwarded the focus little by little.

Oliver.
Image Oliver Kim - http://www.microbehunter.com - Microscopes: Olympus CH40 - Olympus CH-A - Breukhoven BMS student microscope - Euromex stereo - uSCOPE MXII

User avatar
billben74
Posts: 1020
Joined: Sat Dec 26, 2015 10:33 pm
Location: Cambridge, UK

Re: How do you perform stacking

#8 Post by billben74 » Tue Feb 16, 2016 9:37 pm

Hi all. I use zerene stacker. Or sometimes imageJ.

I do the same sort of thing as other people have mentioned. I start from one end, normally the top but both of these bits of software don't mind which end you start.
Then I move down looking at my fine focus wheel so that I move a set amount. Apologies from the fairly newbee and I haven't yet worked out how much my standard move the wheel round till the next marked bit on the wheel lines up with the mark on the microscope is. But with x400 I do tend to need to do about 10 or so images.

In zerine stacker you load these into a project and there are 2 main algorithms. PMAX and DMAP. I have no idea about the maths going on. I find that PMAX generally gives the most "realistic" image with the image maintaining smooth gradations over the image.
PMAX
2016-02-07-22.41.39 ZSFishExex200BrightlyColoured PMaxCropSmall1024.jpg
2016-02-07-22.41.39 ZSFishExex200BrightlyColoured PMaxCropSmall1024.jpg (59.09 KiB) Viewed 17320 times
DMAP leads to a more discontinous but actually I think its colour representation seems better (and here I mean more accurate -> the x200 fish eye was very vivid).
2016-02-07-22.43.03 ZS StainedGlassEyeDMapCropSmall1024.jpg
2016-02-07-22.43.03 ZS StainedGlassEyeDMapCropSmall1024.jpg (71.65 KiB) Viewed 17320 times
You can (although I don't very often) retouch. You have a reference image and you can then air brush another image over a particular area of the image. You can do this with one of the origional (pre-stacked) images or between PMAX and DMAP.
It gets more complex. DMAP has thresholds. Effectively by increasing the threshold you can reduce halos. So you can do an extreme threshold DMAP which should eliminate halos but not actually use much image information.
So can retouch with this to try to remove halos.

I'm run out of concentration for a bit.
I'll come back to ImageJ ...
Last edited by billben74 on Wed Feb 17, 2016 3:05 pm, edited 1 time in total.

JimT
Posts: 3247
Joined: Fri Oct 24, 2014 1:57 pm

Re: How do you perform stacking

#9 Post by JimT » Tue Feb 16, 2016 11:44 pm

zzffnn and others, here is an experiment I did back in August comparing Picolay and CombineZP. Both are easy to use and both give good results. Based on the responses it looks like a tie :)

viewtopic.php?f=6&t=1494

I use CombineZP because that's what I started with and am most familiar with but sometimes I do combine two or three images from a bigger stack and then combine additional images with the first stack. Sometimes I combine all and then go to Photoshop and then add parts of individual images with layers and masks.

I shoot in RAW format and convert to Tiff images. During the conversion I do some general clean up but wait until after I combine the images for the serious processing.

As far as how many images to stack and how to tell I agree with Oliver, let your eyes be the guide.

Last and best advice is experiment.

JimT

einman
Posts: 1508
Joined: Tue Feb 24, 2015 1:03 am

Re: How do you perform stacking

#10 Post by einman » Wed Feb 17, 2016 1:58 am

I discussed the optimal number of images for stacking by utilizing the depth of focus for a specific objective combined with the known verical movement of the fine/coarse focus in an earlier post.

If the depth of focus of an objective is say 55 um then each step ideally should be about 55 um. Focusing in increments less than 55 um does not really buy you anything other than more images to be stacked. Focusing in increments larger than 55 um or more and you potentially lose out on some detail.

The DOF for objectives can often be found on their respective manufacturers websites.

It helps to know the increment of focus for your stand as well. For AO microscopes it is marked on the knobs with each division being indicated.

I know the DOF of nearly all my objectives and the incremental movement of the objective via the coarse/fine focus for each of my stands.

User avatar
billben74
Posts: 1020
Joined: Sat Dec 26, 2015 10:33 pm
Location: Cambridge, UK

Re: How do you perform stacking

#11 Post by billben74 » Fri Feb 19, 2016 8:42 pm

As mentioned I will just describe stacking in imageJ
ImageJ is, as far as I can accertain, what academics use to top level professional microscopy image analysis.
This is actually based on some real evidence: I have had a conversation with a senior scientist who is the wife of a friend of mine and the always knowledgable Helen from Brunel microscopes who said "its what all the students use" (and she I'm sure this meant Phd students).

It is free. Its java based and has a plugin architecture. It does everything. It can, for example count sperm and measure their properties (no I haven't done this! I've just noticed the section of the complex menu system where this feature resides).
I use it to measure things. One day I will use it to measure the speed of things.

I started using it to stack. Its actually not very good at this. I discovered a trial version of zerine stacker. Liked that and paid for a licence.
Some people use zerine stacker within imageJ ->so I'm guessing that imageJ people reaslise that imageJ isn't the best stacker.


ImageJ comes in different flavours. That is people have created installers for different sets of plugins. There are thousands of plugins.
Academics/masters/pHd students write these plugins.
I use Fiji flavour. Its designed for microscopy. You can do other image analysis with imageJ.

Anyway you can use it to stack.

You import your sequence.It can count so as long as you photos are sequenced it knows how to import.

You then find stack-->Zproject and then you have 6 options. Min, Max, Mean, Median, Sum, Std (standard deviation).
It then stackes based around these ideas.
The std option, I'm guessing is an academic tool, perhaps to do fluourescence microscopy (I'm am guessing here).
It does however sometimes give, artistically speaking, give quite interesting images. But they look nothing like what you see down the tubes.

Here is a 4 stack of some citric acid and saffarin o through crossed polariods done with the min stacking algorithm:
MIN_19_02_20161024Small.jpg
MIN_19_02_20161024Small.jpg (19.75 KiB) Viewed 17272 times
Here is the same done with max stacking algorithm
MAX_19_02_2016small1024.jpg
MAX_19_02_2016small1024.jpg (22.71 KiB) Viewed 17270 times
Here is the same with the "artistic" std algorithm
STD_19_02_2016Small1024.jpg
STD_19_02_2016Small1024.jpg (17.49 KiB) Viewed 17270 times
Here is one done with zerine stacker
2016-02-19-20.14.00citricAcidSaffarinx200SpikeofRed ZS Small1024PMax.jpg
2016-02-19-20.14.00citricAcidSaffarinx200SpikeofRed ZS Small1024PMax.jpg (23.11 KiB) Viewed 17270 times
The imageJ max one can occationally (well once actually) produce a really bright image which I like e.g. chloroplasts seen from a moss leaf but normally zerine stacker is a lot better.

User avatar
McConkey
Posts: 338
Joined: Fri Feb 19, 2016 4:33 am
Location: Alberta, Canada

Re: How do you perform stacking

#12 Post by McConkey » Fri Feb 19, 2016 9:19 pm

Would i be wrong in thinking that stacking programs used for astrophotography would work too?
Karl
AO21 with Canon M3

User avatar
zzffnn
Posts: 3200
Joined: Sat Jun 20, 2015 3:57 am
Location: Houston, Texas, USA
Contact:

Re: How do you perform stacking

#13 Post by zzffnn » Fri Feb 19, 2016 9:41 pm

I heard AutoStackkert 2 should work for microphotography. It can even do stack with moving cars.
Last edited by zzffnn on Wed Jun 13, 2018 2:01 pm, edited 1 time in total.

User avatar
75RR
Posts: 8207
Joined: Sun Oct 12, 2014 2:34 am
Location: Estepona, Spain

Re: How do you perform stacking

#14 Post by 75RR » Sat Feb 20, 2016 12:59 pm

Have been asked to comment on my Testate Amoeba photograph: viewtopic.php?f=6&t=2464

I would like to say first that the mindbogglingly large number of photographs came about by inadvertent happenstance. This image is the second attempt to photograph the same Testate Amoeba: viewtopic.php?f=6&t=2453 which I had kept in a Slide Mailer over the course of a couple of days as I attempted to improve the image.

This image had some slight out of focus areas that I was attempting to overcome in my second attempt.

The jump in magnification from 40x to 63x is quite large, so while I was able to fit the Testate Amoeba in one frame with the 40x, I had to use 6 with the 63x in order to allow a sufficient overlap of at least 30% for the stitching software to work.
It is always a nervous moment when one activates the stitching button and awaits those few seconds while the program ponders our efforts and we receive either a thumbs up or thumbs down.

Having decided that the out of focus areas in the first attempt were due to inadvertently skipping over a section, I resolved to ignore my usual method which involves choosing which areas to focus on and creating a continuous patchwork of focused images, and just try to take the smallest steps possible.
The fine focus markings on the Zeiss Standard are of 5µm, though it is possible if one has a steady hand to move the dial halfway between the markings. That is what I tried to do anyway.

The result was quite a lot of images, over 450, as once I had started I felt obliged to continue, but that was the sum for all 4 photographs - the first one which is composed of 6 overlapping images is a mere 228. Needless to say I will not be stacking that closely again!

Each section was stacked in Photoshop and then stitched in Photoshop as well. The stacking and stitching functions in Photoshop are rather limited and consist of a couple of buttons. The Photoshop version I have is CS4, which I have had for several years, it predates my interest in microscopy.
I have been told and believe it to be true, that dedicated stacking software is superior. However in my case, since I struggle under the burden of owning a Mac I do not have access to free software and so far I feel that the $100+ price for the commercial versions is better spent on an objective or two.
Last edited by 75RR on Mon Feb 22, 2016 10:59 am, edited 1 time in total.
Zeiss Standard WL (somewhat fashion challenged) & Wild M8
Olympus E-P2 (Micro Four Thirds Camera)

User avatar
zzffnn
Posts: 3200
Joined: Sat Jun 20, 2015 3:57 am
Location: Houston, Texas, USA
Contact:

Re: How do you perform stacking

#15 Post by zzffnn » Sat Feb 20, 2016 1:12 pm

Thank you all for your kind comments! I find them very helpful!
Last edited by zzffnn on Wed Jun 13, 2018 2:01 pm, edited 1 time in total.

User avatar
McConkey
Posts: 338
Joined: Fri Feb 19, 2016 4:33 am
Location: Alberta, Canada

Re: How do you perform stacking

#16 Post by McConkey » Sat Feb 20, 2016 1:24 pm

75RR - Incredible images! The detail is amazing. As I am new to all of this forgive what might seem like dumb and obvious questions!

What was the exposure time for each frame for an image like this? For this kind of work can you take different exposure lengths and combine them to make an HDR image of the subject?
Karl
AO21 with Canon M3

User avatar
75RR
Posts: 8207
Joined: Sun Oct 12, 2014 2:34 am
Location: Estepona, Spain

Re: How do you perform stacking

#17 Post by 75RR » Sat Feb 20, 2016 1:45 pm

Thanks McConkey,

Had to look up HDR!

Link: http://www.digitaltrends.com/how-to/wha ... otography/
What was the exposure time for each frame for an image like this?
Do not recall the exposure time, nothing overly long. Did not vary any setting apart from the focus from one image to another.
There was a bit of post processing of course in order to get the most out of the image.
Zeiss Standard WL (somewhat fashion challenged) & Wild M8
Olympus E-P2 (Micro Four Thirds Camera)

User avatar
zzffnn
Posts: 3200
Joined: Sat Jun 20, 2015 3:57 am
Location: Houston, Texas, USA
Contact:

Re: How do you perform stacking

#18 Post by zzffnn » Sat Feb 20, 2016 2:56 pm

Microscopy stack is usual focus depth (layer) stack. This is because microscope optics can usually only provide good resolution alone, or good depth alone, but not both at the same time.

HDR, or exposure stack, can be done, but is not as useful as it is in astrophotography or landscape photography.
Last edited by zzffnn on Wed Jun 13, 2018 2:01 pm, edited 1 time in total.

User avatar
McConkey
Posts: 338
Joined: Fri Feb 19, 2016 4:33 am
Location: Alberta, Canada

Re: How do you perform stacking

#19 Post by McConkey » Sat Feb 20, 2016 3:10 pm

Good to know! Appreciate the info! I'm really looking forward to getting into this!
Karl
AO21 with Canon M3

Post Reply