help > Stitching together images stacks from different tissues sections
Showing 1-11 of 11 posts
Display:
Results per page:
Mar 24, 2021  09:03 PM | Shane Simo - Mcmaster
Stitching together images stacks from different tissues sections
Hi folks, I'm a neurobiologist and I study axons. I put tissue sections on slides and image them on a confocal microscope. I get image stacks from the confocal, but my axons don't nicely fit into one section. Sometimes I'll have to take an image stack from 3 different, but sequential tissue sections. This creates a problem because now I want to combine those image stacks and put them into registration, but there is little to no overlap between those image stacks for the computer to put them together in a program. Do you folks know of any method or software I can use to combine these stacks into one stack that matches? I've attached a summary of my problem to this as a PNG file. Note that the Z-dimension is really important here. I have experience with Image J (FIJI), Vaa3D, and I just downloaded a trial of DragonFly. In an ideal situation, I could put all of my image stacks on a "canvass" and translate them in all dimensions until (3D) until all three stacks are in registration. Does anyone have any advice for me?
Apr 1, 2021  12:04 PM | Yimin Wang
RE: Stitching together images stacks from different tissues sections
Originally posted by Shane Simo:
Hi folks, I'm a neurobiologist and I study axons. I put tissue sections on slides and image them on a confocal microscope. I get image stacks from the confocal, but my axons don't nicely fit into one section. Sometimes I'll have to take an image stack from 3 different, but sequential tissue sections. This creates a problem because now I want to combine those image stacks and put them into registration, but there is little to no overlap between those image stacks for the computer to put them together in a program. Do you folks know of any method or software I can use to combine these stacks into one stack that matches? I've attached a summary of my problem to this as a PNG file. Note that the Z-dimension is really important here. I have experience with Image J (FIJI), Vaa3D, and I just downloaded a trial of DragonFly. In an ideal situation, I could put all of my image stacks on a "canvass" and translate them in all dimensions until (3D) until all three stacks are in registration. Does anyone have any advice for me?
Hi Shane,

Let me try to understand your question better, so
1) you have several sequential image stacks (along the x or y direction)
2) you want to "manually" stitch them together
3) you would like to have the z direction well aligned, but the requirement for x and y alignment is not as high.

but, why don't you leave some overlap in the images and let certain program do the job automatically?

Apr 1, 2021  02:04 PM | Shane Simo - Mcmaster
RE: Stitching together images stacks from different tissues sections
Hello Yimin,
Thank you for taking the time to reply and understand my question. I label an axon in the brain and then I section the brain to put on microscope slides for confocal microscopy. But often, the axon I label is visible in different tissues sections. I then take different confocal stacks of different tissue sections that contain the same axon. Afterward, I have a problem of stitching together multiple stacks with no overlap. I don't have any overlap because the label is in different, adjacent tissue sections. 

I am looking for a strategy for aligning different stacks in a software program.
Thank you,

Shane
Originally posted by Yimin Wang:
Originally posted by Shane Simo:
Hi folks, I'm a neurobiologist and I study axons. I put tissue sections on slides and image them on a confocal microscope. I get image stacks from the confocal, but my axons don't nicely fit into one section. Sometimes I'll have to take an image stack from 3 different, but sequential tissue sections. This creates a problem because now I want to combine those image stacks and put them into registration, but there is little to no overlap between those image stacks for the computer to put them together in a program. Do you folks know of any method or software I can use to combine these stacks into one stack that matches? I've attached a summary of my problem to this as a PNG file. Note that the Z-dimension is really important here. I have experience with Image J (FIJI), Vaa3D, and I just downloaded a trial of DragonFly. In an ideal situation, I could put all of my image stacks on a "canvass" and translate them in all dimensions until (3D) until all three stacks are in registration. Does anyone have any advice for me?
Hi Shane,

Let me try to understand your question better, so
1) you have several sequential image stacks (along the x or y direction)
2) you want to "manually" stitch them together
3) you would like to have the z direction well aligned, but the requirement for x and y alignment is not as high.

but, why don't you leave some overlap in the images and let certain program do the job automatically?

Apr 1, 2021  03:04 PM | Yimin Wang
RE: Stitching together images stacks from different tissues sections
The reason why there is no overlap is that you physically cut the brain into smaller parts first, and then image them using confocal microscopy?
Apr 1, 2021  06:04 PM | Shane Simo - Mcmaster
RE: Stitching together images stacks from different tissues sections

Hi again Yimin,
Yes, so I have signal from the same axon in different tissue sections. I can see roughly where one part of the axon in tissue section A1 is, and where it continues in section A2, though. Do you have any experience with this or know someone who does?
Thanks again,

Shane Simon

Originally posted by Yimin Wang:
The reason why there is no overlap is that you physically cut the brain into smaller parts first, and then image them using confocal microscopy?
Apr 2, 2021  09:04 AM | Yanyan Guo
RE: Stitching together images stacks from different tissues sections
Originally posted by Shane Simo:

Hi again Yimin,
Yes, so I have signal from the same axon in different tissue sections. I can see roughly where one part of the axon in tissue section A1 is, and where it continues in section A2, though. Do you have any experience with this or know someone who does?
Thanks again,

Shane Simon

Originally posted by Yimin Wang:
The reason why there is no overlap is that you physically cut the brain into smaller parts first, and then image them using confocal microscopy?
Hi Shane,

I have had the experience of stitching. I image the whole mouse brain on a light sheet microscope. 

I met the same problem that the corresponding Z planes of neighboring stacks are not matched. I think the reason is that there is a shift in Z direction for neighboring stacks due to the small perturbation of the instrument. My solution is to get resliced images in the center of overlapping area. Ideally, the two resliced images are exactly the same. You can calculate the shift in Z direction according to these two resliced images. When you stitch the image stacks, you can take the shift into account. I drew a simple model diagram for my solution.

I don't know if I explain the model clearly, but I hope my methods are helpful to you! If you have any questions, feel free to ask me.
Attachment: Model Diagram.jpg
Apr 3, 2021  07:04 PM | Shane Simo - Mcmaster
RE: Stitching together images stacks from different tissues sections
Hello Yanyan,
Thanks for the reply. And I agree that does seem to be a really good strategy to tackle that problem. My issue is that there is very little to no overlap between my stacks due to the signal being on different pieces of tissue. I need to figure out a strategy to combine stacks where signal continues into another tissue section. 

Edit: I wish I had access to a lightsheet microscope because then I wouldn't need to section my tissue!
Thank you,
Shane
Apr 3, 2021  08:04 PM | Shane Simo - Mcmaster
RE: Stitching together images stacks from different tissues sections
Hello both Yimin and Yanyan, 
I am sorry my explanation of my problem has not been great. I've attached a diagram of the problem to clear up any misunderstandings. Thanks again for helping me.
Thank you,
Shane
Attachment: Shane's problem.png
Apr 3, 2021  09:04 PM | bsuter - IST Austria
RE: Stitching together images stacks from different tissues sections
[To admin/postmaster: I sent this message on Thursday from my email client, and received an error message from the Mail Delivery System. Apparently it was not delivered to the list. I tried sending it again today, same error. I tried sending a short test message, same error. I am now trying to send this via the web interface at http://www.nitrc.org/forum/reply.php. Please check the logs and/or let me know what might be preventing me from participating via email directly.]

Hi Shane,
What you're doing (tracing across physical slice boundaries) was once common-place, but is perhaps less often done now that tissue clearing, two-photon imaging, and various other techniques allow for larger volumes to be imaged "en bloc". However, since some axons travel across very long distances, for axon tracing some degree of "stitching" may still be required.

1. Neurolucida software is traditionally used for exactly what you describe (reconstructing processes across multiple physical "z" sections aka tissue slices). It is expensive, but perhaps your institution already has a licensed seat.

2. Neuromantic is free software, no longer actively supported, but the last release (V1.7.5) runs fine. It lets you load multiple stacks, manually specify an offset in x y z for each stack, and save the configuration as a "tiled project". I think you can use it to achieve what you want. Typically it is used with several xy-tiled z-stacks, and so each stack has a large x and y offset, but only minor z offsets. In your case, if you have just two adjacent z-stacks, I imagine you would end up with minor x and y offsets, but the z offset of the second stack need to be set equal to the number of slices in the first stack (so that the second stack starts just "below" the first stack). I've tested this and it works fine for me. Use "File->Load" for the first stack, then "File->Load and add stack" for subsequent stacks, and a "Multistack Window" will open where you can type in xyz offsets for each stack. I don't think Neuromantic will let you save or export the aligned stacks as a single merged TIFF, so you would have to do your actual axon reconstruction within Neuromantic itself, but it's actually quite good for doing that and saves in the SWC standard.

3. Alternatively, to generate a single merged TIFF, you could open two adjacent stacks in ImageJ, concatenate them (Stacks->Tools->Concatenate) and then run StackReg. There might be enough similarity in the larger scale tissue structure (e.g. blood vessels) at the junction between stack boundaries, to achieve adequate alignment despite no physical overlap. Success will depend on how much tissue is lost during slicing, and how precise the axon "healing" needs to be at the transition.

4. If that approach does not work because StackReg can't align at the boundary of the first and second stack, perhaps this tedious ImageJ approach is worth trying: if you have tiled xy stacks from each section, first 2D-align and fuse them into a single stack per section. Then, for a pair of z-adjacent sections, open the last slice of the top stack and the first slice of the bottom stack as single images. Use "Image->Color->Merge channels" to create a 2-channel image with the top slice in green, the bottom slice in red. Using the line tool, click on a landmark in the green image, and drag until the endpoint of the line hits the same landmark in the red image (from below the tissue cut). "Measure" the line with CTRL-M. First, make sure the "Bounding Box" is shown in the Results table ("Analyse->Set measurements"). Repeat this for several landmarks. Then use Results->Summarize to calculate the average width and height of these landmark-connecting lines. The average height tells you the necessary y-shift, and the average width tells you the necessary x-shift. Open the bottom stack, make a rectangular selection, and use the "Edit->Selection->Specify" dialog to shift the rectangle in x and y according to the shifts found in the previous step. Duplicate the selection to get a new stack (slightly cropped in xy, but aligned), and add it to the bottom of the top stack (Stacks->Tools->Concatenate). If necessary, crop the top stack to the same xy dimensions before concatenating.

5. You might be able to use the CoordinateShift ImageJ plugin. It is designed for time series, so you would need to convert your z dimension to t first, and convert back from t to z in the end. In the video on the plugin page, you will see that it lets you translate one frame by dragging the mouse, to achieve alignment visually. There is a table that shows the x and y shifts for each frame. After finding an appropriate shift at the first slice of the second stack, you could update the table to have the same x and y shifts in all subsequent rows. I have no personal experience using this plugin. https://signaling.riken.jp/en/en-tools/i...

I think a plugin that allows for mouse-based or keyboard-based manual "nudging" of stacks in xyz would be useful. If anyone knows of one, please let us know.

Good luck,
Ben.
Apr 6, 2021  07:04 AM | Yanyan Guo
RE: Stitching together images stacks from different tissues sections
Hi both Shane and Ben,

Thank Shane for your clear description of the problem, and thank Ben for recommending so many stitching techniques that are very useful. And there is another stitching technique (TeraStitcher) both as plugin of the free software Vaa3D and standalone application. Use “Vaa3D -> Plug-In -> image_stitching -> terastitcher -> TeraStitcher” to get the TeraStitcher window.

TeraStitcher a free and fully automated 3D Stitching tool designed to match the special requirements coming out of teravoxel-sized tiled microscopy images that can stitch them in a reasonable time even on workstations with limited resources. The stitching process performs the following main steps: (i) find the relative position between each pair of adjacent stacks; (ii) find a globally optimal placement of stacks in the final image space; (iii) combine all stacks into a single 3D image and substitute overlapping regions with a blended version of them. In addition, the users can intervene manually by easily detecting and possibly correcting the abnormalities before the final image is produced to avoid some wrong computed alignments.

The input is two-level hierarchy of folder as the attachment that can solve your problem very well. For your problem, you can rename the 3 different stacks according to the naming rule.


If you want to know TeraStitcher more, you can refer to this link:
https://abria.github.io/TeraStitcher/

Good luck!
Jun 9, 2021  07:06 PM | Shane Simo - Mcmaster
RE: Stitching together images stacks from different tissues sections
Hello folks,

Thank you all, especially Ben, for the thoughtful comments. I just wanted to mention that I found a great workaround. There's this free software for academic researchers, called Dragonfly, that allows me to orient different stacks in 3D, and then stitch the images together. 

One problem that I'm having now is that I am unable to load the resultant RAW file into Vaa3D. I am unsure if this is a file type issue and that Vaa3D just simply cant load the RAW file type, or if the file is just too large (3.2GB). I have attached the error message to this reply. Each TIFF stack individually loads into Vaa3D, but when stitched together, the RAW file may exceed the Vaa3D's limit. 

What is the largest file size that I can use in Vaa3D? Can I ask for access to a version of Vaa3D that allows for larger file types?