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

Initial slices spread all over #30

Closed alecrimi closed 6 years ago

alecrimi commented 6 years ago

First, I'd like to compliment you on your useful software.

I am having trouble as the software is properly stitching 2 series of tif images. However, for some strange reason the first 60 slices are spread every 11 slices in the stitched version. The initial images are properly distributed so the bug(if this is a bug) is happening during stitching. The data are the following: 2 series of tif images. Each file is 2048x2048 single channel. Each series is 352 images. voxel size: 6.5x6.5x10 um I am using as origin (40.836,0 I have no real reason but I have seen it in another example), which is leading me to two folders 408360 and 508360, resulting in a tile overlap 509(X), 0(Y).

As search region in the alignment step I am using 25(x)x25(y)x10(z) and overlap 509(x) and 50(y).

Any idea what is wrong? or how to fix this eventual bug? I show one of the resulting stitched images stitching

iannellog commented 6 years ago

2018-04-26 13:17 GMT+02:00 Alessandro Crimi notifications@github.com:

First, I'd like to compliment you on your useful software.

I am having trouble as the software is properly stitching 2 series of tif images. However, for some strange reason the first 60 slices are spread every 11 slices in the stitched version. The initial images are properly distributed so the bug(if this is a bug) is happening during stitching.

sorry, but I do not understand which is exactly your problem. What does it mean "the first 60 slices are spread every 11 slices in the stitched version"? Perhaps it is a problem of file names (see also comments below). Apart trying to explain more, could you please send me all the xml files generated by TeraStitcher and also the mdata.bin generated in the root directory of the dataset? Another question is: have you organized the dataset in the two-level hierarchy of directories and then imported in TeraStitcher or have you externally generated an xml import file? From your mail I understand that you have followed the first alternative. Is it right?

The data are the following:

2 series of tif images. Each file is 2048x2048 single channel. Each series is 352 images. voxel size: 6.5x6.5x10 um I am using as origin (40.836,0 I have no real reason but I have seen it in another example), which is leading me to two folders 408360 and 508360, resulting in a tile overlap 509(X), 0(Y)

if you import with TeraStitcher directly from the two-level hierarchy of directories and the nominal overlap between the two tiles are 509 pixels along X (that I understand is the horizontal dimension that we referto as "H") you should:

  • have a two level hierarchy of directories with:
  • one directory named 000000 at the first level
  • two directories named 000000_000000 and 000000_100035 at the second level (i.e. inside 000000)
  • a series of 352 images in each directory at the second level; the files should be named in such a way that they are lexicographically ordered according to their relative position (e.g. 000.tif, 001.tif, 002.tif, ... , 350.tif, 351.tif)

This way your origin will be 0,0,0.

I show one of the resulting stitched images

Is this image what you expect or it is somehow wrong? In the second case which is the problem? Another perhaps useful information is the final size of the stitched image (TeraStitcher should have created a folder named "RES(VVVVxHHHHxDDDD", which values are VVVV, HHHH, and DDDD?)

Let me know if this can help or send me more information.

Best.

-- Giulio


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


alecrimi commented 6 years ago

Thank you for the reply. XML files are generated automatically. I give screenshots and copy the files. layer1 layer2_left layer2_right

Files are accessible hers https://files.fm/u/xcx55ka4

The image is what it is expected but it shuold be the stictched slice 1 (as the two original unstitched images) but it ends up being at slice 11, other images are also misplaced after the stitching (though they are properly stitched).

Moreover, it is not clear to me why the second folder is 000000_100035. It has to do with the expeced horizontal overlap of 509

alecrimi commented 6 years ago

I have renamed the folder as you wrote:

and the results is the same. The only thing I have different is that I have named the files without the 0s at the beginning. Namely, 0.tif, 1.tif....10.tif... 99.tif, 100.tif....

iannellog commented 6 years ago

There not attached files to your previous mail, so I cannot check my hypothesis. However, I am pretty sure that the problem is precisely that you have named the files 0.tif, 1.tif, 2.tif, ... , 10.tif, ... What happens is that when TeraStitcher sorts the files to put them in the right sequence, files turn out to be sorted as follows:

-rw-r--r-- 1 iannello staff 90148 23 Apr 2014 0.tif

-rw-r--r-- 1 iannello staff 90148 23 Apr 2014 1.tif

-rw-r--r-- 1 iannello staff 90148 23 Apr 2014 10.tif

-rw-r--r-- 1 iannello staff 90148 23 Apr 2014 11.tif

-rw-r--r-- 1 iannello staff 90148 23 Apr 2014 12.tif

-rw-r--r-- 1 iannello staff 90148 23 Apr 2014 13.tif

-rw-r--r-- 1 iannello staff 90148 23 Apr 2014 14.tif

-rw-r--r-- 1 iannello staff 90148 23 Apr 2014 15.tif

-rw-r--r-- 1 iannello staff 90148 23 Apr 2014 16.tif

-rw-r--r-- 1 iannello staff 90148 23 Apr 2014 17.tif

-rw-r--r-- 1 iannello staff 90148 23 Apr 2014 18.tif

-rw-r--r-- 1 iannello staff 90148 23 Apr 2014 19.tif

-rw-r--r-- 1 iannello staff 90148 23 Apr 2014 2.tif

-rw-r--r-- 1 iannello staff 90148 23 Apr 2014 20.tif

-rw-r--r-- 1 iannello staff 90148 23 Apr 2014 21.tif

-rw-r--r-- 1 iannello staff 90148 23 Apr 2014 22.tif

-rw-r--r-- 1 iannello staff 90148 23 Apr 2014 23.tif

-rw-r--r-- 1 iannello staff 90148 23 Apr 2014 24.tif

-rw-r--r-- 1 iannello staff 90148 23 Apr 2014 25.tif

-rw-r--r-- 1 iannello staff 90148 23 Apr 2014 26.tif

-rw-r--r-- 1 iannello staff 90148 23 Apr 2014 27.tif

-rw-r--r-- 1 iannello staff 90148 23 Apr 2014 28.tif

-rw-r--r--@ 1 iannello staff 90148 23 Apr 2014 29.tif

......

You have to number the files using the same number of digits for all files (in your case, three digits), otherwise there is no way to reconstruct the right sequence (unless you give the tool an explicit list, which is unpractical).

Best.

-- Giulio

2018-04-27 14:29 GMT+02:00 Alessandro Crimi notifications@github.com:

I have renamed the folder as you wrote:

  • one directory named 000000 at the first level
  • two directories named 000000_000000 and 000000_100035 at the second level (i.e. inside 000000)

and the results is the same. The only thing I have different is that I have named the files without the 0s at the beginning. Namely, 0.tif, 1.tif....10.tif... 99.tif, 100.tif....

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/abria/TeraStitcher/issues/30#issuecomment-384955674, or mute the thread https://github.com/notifications/unsubscribe-auth/AIdv1snfNobMx-ZS3TgwzQdUo3M2qMaHks5tsw8zgaJpZM4Tk-5V .

--


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


alecrimi commented 6 years ago

Yes, I confirm that this was the problem, therefore no bug, just a detail to be taken into account