abria / TeraStitcher

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

2D stitching also supported (experimental) #5

Closed redcrow closed 8 years ago

redcrow commented 8 years ago

I have whole slide 40x brightfield images I was going to try to stitch together using Terastitcher and I came across the note that 2D stitching is experimental. What makes it experimental? Is there something I should watch out for?

Thanks Jim

abria commented 8 years ago

Hi Jim,

TeraStitcher has been originally designed for (very) large 3D images, which we have plenty of. Later on we enabled the 2D stitching option w/o changing too much in the code, but we have never tested it deeply, simply because we have never had (very) large 2D images.

Thus, we expect that bugs and/or limitations of our tool might manifest when 2D stitching is performed on such big images. Hence the name experimental: whoever wants to experiment, is welcomed. We will help in the process and/or fix potential bugs if needed, unless it's something related to software design, which is oriented to 3D images (e.g. memory saving strategy).

Thanks for your interest and please keep us informed using this thread.

Have a good stitching!

JimboMahoney commented 8 years ago

Hi Alessandro,

I cannot get 2D to work?

I receive an error "The stitched image has invalid Z-dimension (= 0)"

My import settings seem OK:

image

(Preview doesn't work - it generates a "Generic error occurred" error)

Merging seems OK, although the smaller resolutions seem to have rounded down to zero for Z - maybe that is the problem? I only have the largest selected though:

image

abria commented 8 years ago

Hi Jim,

there was a bug in the latest GUI version (but the stitching core was OK) which caused the "invalid z-dimension" error when launching the Merge step. Please download and try the new binary version 1.9.62.

From the last screenshot, it seems your image is too big for TeraStitcher (see estimated RAM usage > 277 GB in the Merge step). As I previously said, TeraStitcher was designed for big 3D images and it may have limitations when used for big 2D images.

Also, there is sth weird happening in TeraStitcher when looking your screenshots. Apart from the "Generic error" (which is most likely due to the 277 GB of RAM not available on your system), I see a negative tile overlap along X (first screenshot) and wrong output dimension (last screenshot) along X and Y (it's 269,740, but it should be at most 2,048 x 5 = 10,240). Perhaps your xml_import.xml contains some errors and/or the import phase did not work correctly.

abria commented 8 years ago

Another comment: it seems the (big) negative overlap is the major cause of all these issues. Your output image should be 10,240 x 10,240 at most, but the negative overlap of 64,875 (see screenshot 1) increases (a lot) the output image dimension. So my suggestion is to fix the overlap and then all the errors should disappear.

JimboMahoney commented 8 years ago

Thanks Alessandro - that fixed that problem. Because the images I'm working with don't have the XY stage coordinates easily available, I had to take an educated guess on them based on pixel size and magnification. I was using a factor of 100 or something wrong.

Having renamed my directories with what I believe are the stage coordinates, I seem to be getting further, but TeraStitcher seems to struggle at the merge step:

image

and creates the following directory structure with files inside:

image

Here is what the Import step now looks like:

image

Any ideas on what's going wrong?

Many thanks!

abria commented 8 years ago

From your screenshot, it seems the output folder (in the Merge step) is the same as the input folder. If this is the case, please choose an empty output folder in the Merge Step.

abria commented 8 years ago

BTW in case you still get this error, do not mind. At the end of the Merging step, TeraStitcher creates metadata for each saved resolution to allow TeraFly (Vaa3D's BigData visualization tool) import and visualize them. Perhaps the error happens when trying to import those empty resolution folders (the ones ending with "x0"), so you can just ignore that error. I will fix it in the next release.

JimboMahoney commented 8 years ago

Thanks Alessando - it was just giving an error because it cannot downsample the Z dimension, right?

Looks like I've got a nice stitch of my 2D dataset - thanks!

PS - one thing I notice is that memory usage is insane! This ~10k x 10k image sends TeraStitcher's peak memory usage to 10 GB! It only takes 8 seconds to stitch, so is this a memory leak? The entire image should only be about 200 MB.

abria commented 8 years ago

The RAM peak bug has been fixed in another Issue, so I can close this one.