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: inconsistent metadata #68

Open vzickus opened 4 years ago

vzickus commented 4 years ago

I'm getting inconsistent metadata error when I try to stitch 2D data with a custom xml. I suspect it could be xml that's causing issues as it would give me an overlap in Y of 500 (should be zero), so I had to change V from 0 to 500 to get the overlap correctly.

I also tried playing around with forward and backward slashes (in case there's something weird with WinOS paths). Also changing folder structure (now I'm using the example structure, but still get this error). What metadata does terastitcher expect from a tiff file?

inconsistent_metadata
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE TeraStitcher SYSTEM "TeraStitcher.DTD">
<TeraStitcher volume_format="TiledXY|2Dseries" input_plugin="tiff2D">
    <stacks_dir value="C:\Users\vzick\Desktop\sum_slices_4M_convo\bottom_tiles" />
    <mdata_bin value="C:\Users\vzick\Desktop\sum_slices_4M_convo\bottom_tiles\mdata.bin" />
    <ref_sys ref1="1" ref2="2" ref3="3" />
    <voxel_dims V="1" H="1" D="1" />
    <origin V="0" H="0" D="0" />
    <mechanical_displacements V="500" H="980" />
    <dimensions stack_rows="1" stack_columns="2" stack_slices="1" />
    <STACKS>
        <Stack N_CHANS="1" N_BYTESxCHAN="1" ROW="0" COL="0" ABS_V="0" ABS_H="0" ABS_D="0" STITCHABLE="yes" DIR_NAME="072000\072000_151000" Z_RANGES="[0,1)" IMG_REGEX="">
            <NORTH_displacements />
            <EAST_displacements />
            <SOUTH_displacements />
            <WEST_displacements />
        </Stack>
        <Stack N_CHANS="1" N_BYTESxCHAN="1" ROW="0" COL="1" ABS_V="0" ABS_H="980" ABS_D="0" STITCHABLE="yes" DIR_NAME="072000\072000_154000" Z_RANGES="[0,1)" IMG_REGEX="">
            <NORTH_displacements />
            <EAST_displacements />
            <SOUTH_displacements />
            <WEST_displacements />
        </Stack>
    </STACKS>
</TeraStitcher>
iannellog commented 4 years ago

in the folder where are placed the data you should find a file named 'mdata.bin'. please send me (by mail as attachments, not by the wiki) the xml you are using and this mdata.bin file, so as I can check what is the exact problem afterwords try to delete (or move away) the data.bin file and repeat the import: it is likely that the inconsistency is between the xml and the mdata.bin file in general you it is better to delete this file before repeating the import if something goes wrong I hope this can help

Best

Giulio

Il giorno mer 1 apr 2020 alle ore 17:16 Vytas Zickus < notifications@github.com> ha scritto:

I'm getting inconsistent metadata error when I try to stitch 2D data with a custom xml. I suspect it could be xml that's causing issues as it would give me an overlap in Y of 500 (should be zero), so I had to change V from 0 to 500 to get the overlap correctly.

I also tried playing around with forward and backward slashes (in case there's something weird with WinOS paths). Also changing folder structure (now I'm using the example structure, but still get this error). What metadata does terastitcher expect from a tiff file?

[image: inconsistent_metadata] https://user-images.githubusercontent.com/6878017/78154052-b2caa300-7433-11ea-9deb-611bd42e5b02.png

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/abria/TeraStitcher/issues/68, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACDW7VTWGJXRDB37RUJYLC3RKNLC5ANCNFSM4LZBYTIA .

--


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


iannellog commented 4 years ago

I report below what I understand, please point out what I have interpreted wrong. 1) your dataset is a tile matrix with two tiles arranged one aside the other. The second tile is displaced of 980 pixel on the right (mechanical displacement is 980 um and pixel size is 1 um/pixel) 2) since your tile matrix has just one row, displacements along V is not meaningful (by the way, it should be set to the size of a tile along V in um) 3) from your mdata.bin I see that your tiles are 500 x 1024 pixels (height x width) which is coherent with data above 4) the weird thing is that the name of your folders do not adhere to our convention for a two-level hierarchy of folders; indeed if your tiles have width=1024 and horizontal displacement is 980 pixels, and your origin is 0,0, folders should be named 000000/000000_000000 and 000000/000000_009800 However, since attributes ABS_V and ABS_H are correct, if you use an externally generated xml (which is your case, correct?) this mismatch should not have effect.

Coming to your problem, the error is raised when TeraStitcher actually loads the images and checks that their metadata are coherent with information stored in the xml (metadata are the standard information present in all TIFF images: height, width, number of channels, number of bytes per channel, compression, etc). Since the tile size seem correct (your tiles are 500 x 1024 voxel, right?), the only possibility is that they have more than one channel and/or more than one byte per channel (the xml declares one channel and one byte per channel). Check if this guess is correct. If not, please send me your images (they are only two 2D images) and I will try to reproduce your setting.

vzickus commented 4 years ago

Thank you for your time. The size is correct, and the xml was manually generated ( I was playing with different settings of folder names, in case I misunderstood how it worked and just left he most recent setting from your examples). It is single channel.

However, the data is actually 9-bit (max value 510) but saved in a 32-bit tiff. I guess that is the problem.

iannellog commented 4 years ago

Yes, that is the problem. I have never dealt with images in this format and it is definitely not supported by our code. Could you please send me just one image? I could try to generalize our code so as it can deal with them: perhaps is not too difficult.

-- Giulio

Il giorno gio 2 apr 2020 alle ore 21:37 Vytas Zickus < notifications@github.com> ha scritto:

Thank you for your time. The size is correct, and the xml was manually generated ( I was playing with different settings of folder names, in case I misunderstood how it worked and just left he most recent setting from your examples). It is single channel.

However, the data is actually 9-bit (max value 510) but saved in a 32-bit tiff. I guess that is the problem.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/abria/TeraStitcher/issues/68#issuecomment-608063209, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACDW7VQN3OWTQGWUNDQBEGTRKTSORANCNFSM4LZBYTIA .

--


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