Login  Register

Re: Stitching problem

Posted by Majurski, Michael Paul (Fed) on Jul 17, 2017; 12:19pm
URL: http://imagej.273.s1.nabble.com/Stitching-problem-tp5019063p5019074.html

Just for the sake of completeness:

If you want to export the original image tiles from ZEN (something I have to do fairly often) you can select:
Processing > Method > Image Export
Parameters >
        File Type = Tiff
        Check "Original Data"
        Check "Define Subset" > Tiles > "Existing Tiles"
        Fill in "Export To"
        Check "Generate xml file"
And Finally select your input.

Hardly a concise workflow, but at least it exists.

~Michael


-----Original Message-----
From: ImageJ Interest Group [mailto:[hidden email]] On Behalf Of Ed Siefker
Sent: Friday, July 14, 2017 16:46
To: [hidden email]
Subject: Re: Stitching problem

Yes, I'm importing the .czi directly into ImageJ via the Grid/Collection dialogue.

I could delve into the metadata and write a script, but I thought the LOCI Bio-Formats importer was supposed to handle this. Checking the supported metadata fields for ZeissCZIReader, PlanePositionX and PlanePositionY are supported.

Strangely, when I examine the metadata produced by Bio-Formats I can't find these fields, or any other field that appears to hold position information for the tiles.  Since we know the position information is in the metadata, I think Bio-Formats is just failing to read it.

Fortunately, Zen fused my tiles when I exported them as OME-TIFF.
That raises further
questions (how would I even get individual tiles to have them stitched by an external tool?),
but nothing I need answered to do my work.   Thanks for the help.
-Ed

On Fri, Jul 14, 2017 at 2:59 PM, Majurski, Michael Paul (Fed) <[hidden email]> wrote:

> Are you trying to have Grid/Collection stitching load images from the CZI file? I had assumed that you exported the image from the CZI into tiff files with associated metadata.
>
> The CZI file does indeed have position metadata. If you expert the individual image tiles (unmodified) to tiffs, you can export metadata as well into an xml file. If I remember correctly, both the tiff header metadata and the xml metadata file contain the position information you need.
>
> One difficult was to get around this problem would be to export from the czi to tiff with the metadata xml file, write a parser script (in python or another language) to find the relevant position information and create a registered.tile.configuration.txt file which the Grid/Collection stitching plugin uses to store image positions.
>
> I don't know your experience level with scripting, but this is something I have done before (not with the zeiss metadata, but other similar formats).
>
>
> I have never gotten the positions from file portion of the Grid/Collection stitching plugin to work, and I have never tried handing it a full CZI file. It might not be able to find the position metadata that it needs from within the CZI file (even though it is there).
>
> ~Michael
>
>
> -----Original Message-----
> From: Ed Siefker [mailto:[hidden email]]
> Sent: Friday, July 14, 2017 15:46
> To: [hidden email]
> Subject: Re: Stitching problem
>
> All my tiles are stored in one big .czi file.  Since Zen can read this file and place the tiles appropriately, there must be position information in the metadata.  I'm not sure what you mean.
>
> On Fri, Jul 14, 2017 at 1:43 PM, Majurski, Michael Paul (Fed) <[hidden email]> wrote:
>> You might want to check the Grid/Collection documentation. I don't believe the "Positions from File" works like you are hoping it does.
>>
>> "
>> Positions from file: The approximate position of each tile is defined in an extra file or by the metadata.
>>
>> Defined by TileConfiguration: The next dialog will query for a tile configuration file that specifies the filenames as well as the approximate position of each tile in pixel coordinates. This is especially useful if the tiles are arranged in a way that is not covered by any of the other grid/snake options - or maybe also in z! You will find an example tile configuration file below. If you want to manually or automatically create such a file I suggest creating one using grid stitching (even if you do not have any image data) and changing it accordingly.
>>
>> Defined by meta data: Use this option if all tiles are stored in one big file that also contains the approximate stage positions in its meta data. When importing you will have the chance to further increase the overlap and define if the stage coordinates are calibrated or in pixel coordinates.
>> "
>> From: https://imagej.net/Image_Stitching#Grid.2FCollection_Stitching
>>
>>
>>
>> I don't believe that Grid/Collection stitching can assemble an stitched image from tiles unless all the tiles are stored in a single large tiff file.
>>
>> As for trouble shooting the Grid/Collection stitching plugin results I would start with the wiki (https://imagej.net/Image_Stitching ).
>>
>> If you have your grid parameter setup correct, there might be a few parameters (like regression threshold) that you can tweak to get improved stitched image results.
>>
>> Good luck,
>> ~Michael
>>
>> P.S. and as I always do when responding to stitching questions, I plug my own plugin:
>> About MIST page - https://pages.nist.gov/MIST/ Source Code -
>> https://github.com/usnistgov/MIST Wiki -
>> https://github.com/usnistgov/MIST/wiki
>> Paper - https://www.nature.com/articles/s41598-017-04567-y
>>
>> W.r.t. MIST once you setup the grid parameter correctly you can tell the tool to limit the possible translations between images to be plausible given your knowledge of your motorized stage. E.G. MIST will search a region around a specified overlap between tiles based on how much uncertainty exists in your mechanical stage.
>>
>>
>>
>> -----Original Message-----
>> From: Ed Siefker [mailto:[hidden email]]
>> Sent: Friday, July 14, 2017 14:18
>> To: [hidden email]
>> Subject: Stitching problem
>>
>> I take tiled images in Zeiss Zen.  I would like to move them to ImageJ for analysis.  I cannot get the stitching plugin to work for me.
>>
>> I'm using Grid/Collection stitching with Positions from file, and Defined by image metadata. When I use the simple stitching option in the Bio-Formats importer, it puts the tiles in the correct order.
>> So the positions and order in the .czi should be correct.
>>
>> If I allow ImageJ to compute the overlaps it finds none.
>>
>> If I stitch the file in Zen and tell the plugin to trust the coordinates in the file, it opens but puts a large gap between the tiles. e.g. a file with two tiles that are 968x728 becomes a fused image at 968x2176.
>>
>> I don't know how to troubleshoot this further.  Is there something I'm doing wrong?
>> -Ed
>>
>> --
>> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>>
>> --
>> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html