abria / TeraStitcher

A tool for fast automatic 3D-stitching of teravoxel-sized microscopy images
http://abria.github.io/TeraStitcher/
Other
78 stars 32 forks source link

Help with organization of files and giving TeraSitcher the correct parameters #13

Closed puifais closed 7 years ago

puifais commented 7 years ago

Hello,

I am looking for help with the organization of my files and how to give TeraStitcher GUI the correct parameters. The images I'm testing this on has 1 row, 2 columns, and 5 slices each. (I made a little drawing so it's easy to understand)

fullsizerender

I renamed the files so that I end up with a folder called "rootIm". Inside this folder, there is 1 folder called "000001". Inside this folder, there are 2 more folders called "000001_000001" and "000001_000002." Please see attached drawing.

fullsizerender 1

And inside this folder, I renamed the files (see pic).

fullsizerender 2

I selected tiff2D and TiledXY|2D series option

terastitcher selection

and generated the preview slice but the result is backward (i.e. left and right are switched). I also notice that the resulting image size is 1300x1300 instead of 1300-pixel in y and 2470-pixel in x since the overlap is 10%.

switched

Here are the full left image:

full left

And the full right image:

full right

What am I doing wrong? I also guessed that perhaps I needed to tell TeraStitcher that my overlap is only 10% which is 130 pixels. But the "Tile overlap (voxels):" under the Importing tab did not allow me to edit the value.

Here are other information about the images: 1300x1300 pixels x pixel = 1.01 um y pixel = 1.01 um z step = 4.64 um 8-bit gray scale, 1 color

pawlowska commented 7 years ago

my understanding is that the folder names have to reflect starting XY positions, like here: https://github.com/abria/TeraStitcher/wiki/Supported-volume-formats#two-level-hierarchy-of-folders

so basically, the first folder can be called 000000, and then, if you moved the stage by 1234 micrometers, the second is named 012340 and the third 024680.

puifais commented 7 years ago

Thank you! I renamed the files as you suggested and got the orientation and overlap correctly now.

correct orientation

When I got to the aligning step, I clicked start without changing any options and this is the error I receive:

aligning error

If I change the Number of slices per layer to 5 since I only have 5 slices total in this test image, this is the error I receive. Note, I did not change any Advanced options. I just clicked it to show you guys the settings.

aligning error5

Why is this?

(Thank you so much for your help. I'll do a write-up summary when this all works so that it'll help other people learning how to use this stitcher!)

pawlowska commented 7 years ago

Ok, this is harder, but: I think the "number of slices per layer" doesn't matter (it will matter when you have more slices, for defining how big the sub-z-stacks should be), but try changing the search region size, where it says "20(Z)", to a smaller number. If this doesn't help, we need the experts: @abria or @iannellog :)

BTW: if this is indeed the error, is it possible to make the error more clear, or to automatically limit the search region?

puifais commented 7 years ago

Unfortunately 20 is the minimum allowed in X, Y, and Z. May be I should try this with 30 slices instead of 5 slices? I'll go try it out and let you know. Meanwhile, if @abria or @iannellog has suggestions, please let me know!

iannellog commented 7 years ago

Sorry for the delay, but yesterday I was out of office.

First, although the GUI is easier to use, it does not allow you to use all the options available. It also introduces some checks that limit the range of some parameters. This is because we cannot maintain at the moment the GUI. If you could use the command line version of TeraStitcher I you can probably solve your problems. If you have only a few slices along z, it is useless to search alignment along z (too little information available) hence you can set the search space along z to 0 (command line option --sD=0).

Of course you should use the last release from the GitHub site because we are continously develop the tool and I need to be sure that you are using the last version to understand possible bugs.

Consider also that I have developed also a python script that simplifies the import step when the raw unstitiched image is not saved in a folder hierarchy. If you has to stitch many images with TeraStitcher you could perhaps be interested in this possibility.

Best.

-- Giulio

2017-03-16 20:34 GMT+01:00 Puifai Santisakultarm notifications@github.com:

Unfortunately 20 is the minimum allowed in X, Y, and Z. May be I should try this with 30 slices instead of 5 slices? I'll go try it out and let you know. Meanwhile, if @abria https://github.com/abria or @iannellog https://github.com/iannellog has suggestions, please let me know!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/abria/TeraStitcher/issues/13#issuecomment-287167358, or mute the thread https://github.com/notifications/unsubscribe-auth/AIdv1o8UKx1Mtlp6JEYpi4VdApoZ_br1ks5rmY6qgaJpZM4MedUI .

--


Giulio Iannello Preside della Facolta' Dipartimentale di Ingegneria Universita' Campus Bio-Medico di Roma v. Alvaro del Portillo, 21 00128 Roma, Italy

Tel: +39-06-22541-9602 E-mail: g.iannello@unicampus.it Fax: +39-06-22541-9609 URL: https://scholar.google.it/citations?user=L-UJxIgAAAAJ


pawlowska commented 7 years ago

@puifais I am able to decrease Z search region (and start the alignment) in version 1.9.63 to 10 without problem.

temp

abria commented 7 years ago

The latest error "images in stack have not the same dimensions" may be a more serious concern. Do all your image files have the same X and Y dimensions, in each stack?

abria commented 7 years ago

Following what @iannellog said, I made available for you the latest (untested) GUI version v1.9.67, which allows you to set the Search Region to 0 along Z. Please try this one and let us know.

https://www.dropbox.com/s/zkcm0dkb4i51e3b/TeraStitcher-Qt5-standalone-1.9.67-win64.exe?dl=1

puifais commented 7 years ago

@abria, yes all the image files have the same X and Y dimensions as well as Z steps. I will try out the latest GUI version. I'm also writing a little python script to reorganize files into acceptable format for TeraStitcher. Not done yet but I'll finish it soon. Any ideas on why it'd think that the files are of different dimensions?

@iannellog, I'm trying to come up with a simple solution for the people who use the Salk's Biophotonics core and it'd be a lot easier for the majority of the users here who may not even know what command line is. My plan is to make a simple instructions available to all users who acquire light sheet images (e.g. which orientations to acquire, export the image with the exact same options every time, run the script to change file organization, then use TeraStitch). Or at least that's the plan for now :)

iannellog commented 7 years ago

Puifai, I try to deal with your problems one at the time.

  1. I understand that you succeeded in importing your simple dataset (1x2 tiles, 5 slices per tile). Could you please send me the .xml file generated after this first step just to check if there are inconsistencies?
  2. Even though you set the z search region to 0 in the advanced options of 'aligning' step, you get the error message 'images in stack have not the same dimensions', Is this correct? Have you no more the message 'the search region is too big'? Please confirm me that this is the situation.
  3. Assuming that the above assumptions are correct, if you get the error message 'images in stack have not the same dimensions', this means that when TeraStitcher open the files in the folder corresponding to a given tile, it reads values for width and height that are not consistent with the ones of previously read slices. If you are sure that your images have all the same width and height, the problem could be caused by other (possibly hidden) files that are in the same directory. In particular this can happen under Windows. Check if there are spurious files in your second level directories and delete them before running TeraStitcher. If the problem persists, send me the binary file 'mdata.bin' that should have been created in the root directory by step 1 of TeraStitcher.

Let me know if this helps. Once you get to stitch one image, I will send you more information about alternative ways to import datasets that are not in the format expected by TeraStitcher.

Best.

-- Giulio

2017-03-18 3:45 GMT+01:00 Puifai Santisakultarm notifications@github.com:

@abria https://github.com/abria, yes all the image files have the same X and Y dimensions as well as Z steps. I will try out the latest GUI version. I'm also writing a little python script to reorganize files into acceptable format for TeraStitcher. Not done yet but I'll finish it soon. Any ideas on why it'd think that the files are of different dimensions?

@iannellog https://github.com/iannellog, I'm trying to come up with a simple solution for the people who use the Salk's Biophotonics core and it'd be a lot easier for the majority of the users here who may not even know what command line is. My plan is to make a simple instructions available to all users who acquire light sheet images (e.g. which orientations to acquire, export the image with the exact same options every time, run the script to change file organization, then use TeraStitch). Or at least that's the plan for now :)

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/abria/TeraStitcher/issues/13#issuecomment-287511149, or mute the thread https://github.com/notifications/unsubscribe-auth/AIdv1grXm-8oi29UidvE0liRJiu-oOMcks5rm0U4gaJpZM4MedUI .

--


Giulio Iannello Preside della Facolta' Dipartimentale di Ingegneria Universita' Campus Bio-Medico di Roma v. Alvaro del Portillo, 21 00128 Roma, Italy

Tel: +39-06-22541-9602 E-mail: g.iannello@unicampus.it Fax: +39-06-22541-9609 URL: https://scholar.google.it/citations?user=L-UJxIgAAAAJ


pawlowska commented 7 years ago

@abria I installed the 1.9.67 version on my machine (Win7), but unfortunately it doesn't even start. I get the unspecific Windows error message "the program stopped working".

abria commented 7 years ago

Please re-download the installer from the same LINK. Now it should work. I have also added some more details in the images in stack have not the same dimensions error. In case it occurs, it will also print the expected vs. the actual image dimensions.

pawlowska commented 7 years ago

@abria works now and smaller search region also works, see screenshot. If @puifais can confirm that, then I suppose you can include the new version in the download section. przechwytywanie

puifais commented 7 years ago

It works! I redownloaded 1.9.67 and it stitched the files just fine after decreasing the search region to 5x5x5 voxels! Thank you. I checked the resulting image and it looks pretty good. There is a slight mismatch and I wonder if I did something wrong. I left all parameters to default settings this time with the exception of the search region. Here are my raw data and xml file from the importing step in case you have suggestions. I traveling for a workshop this week but will do a little write-up and share it when I get back in case it's helpful to others who want to use this algorithm. Thank you so much!

puifais commented 7 years ago

Also, in case it's helpful to anyone, here's a script I wrote to reorganize and rename files acquired with Zeiss Lightsheet Z.1. Here's the instruction. I hope it's easy to understand. I'll be updating these as issues arise :)