InsightSoftwareConsortium/ITKMontage

Interpretation of Results

Closed this issue · 5 comments

Hello,

I've been running a rather large job with ITKMontage to compare results with MIST. I have a project that consists of a grid of 111 x 100 images, each image of size 2048x1768 pixels. I've been using the example simple montage as a guide to construct my tests. My input tile configuration file looks something like this:

dim = 2


000000000.png;;(0, 0)
000000001.png;;(2048, 0)
000000002.png;;(4096, 0)
000000003.png;;(6144, 0)
000000004.png;;(8192, 0)
000000005.png;;(10240, 0)
000000006.png;;(12288, 0)
000000007.png;;(14336, 0)
000000008.png;;(16384, 0)
000000009.png;;(18432, 0)
000000010.png;;(20480, 0)

...
...

After running the example project, I get transforms that look this:

# Tile coordinates are in index space, not physical space
dim = 2

000000000.png;;(-1.1430411541368812e-4, -2.9046592317172326e-5)
000000001.png;;(8490.54443359375, 4492.78369140625)
000000002.png;;(10344.12060546875, 4495.728515625)
000000003.png;;(12217.26708984375, 4496.33056640625)
000000004.png;;(14068.64013671875, 4495.5009765625)
000000005.png;;(15916.68994140625, 4496.5107421875)
000000006.png;;(17802.0654296875, 4497.1669921875)
000000007.png;;(19660.4853515625, 4496.1328125)
000000008.png;;(21509.7421875, 4496.07763671875)
000000009.png;;(23381.02197265625, 4496.79150390625)
000000010.png;;(25227.82958984375, 4497.455078125)
...
...

Does this seem like a reasonable output? I interpret the TileConfiguration.registered.txt as the new top left coordinates for each image is that correct? I'm a bit skeptical of these results because (8490..., 4492) seems very different than (2048, 0) in the original file.

Has something gone horribly wrong, or are these reasonable results to get? I would just look at the resulting image, but such an image would be massive, and it crashes the program anyway.

Thanks for any feedback!

What is the spacing of your images? If it is one physical unit (mm/um/nm) per pixel, then your input configuration has no tile overlap. Scratch that - tile coordinates are in index space, so your input does not have any overlap. That probably causes non-sensical results: tiles with empty/black space between them. You need to know the approximate overlap of your tiles, and indicate that in your coordinates. With 10% overlap it would be something like:

dim = 2

000000000.png;;(0, 0)
000000001.png;;(1843.2, 0)
000000002.png;;(3686.4, 0)
000000003.png;;(5529.6, 0)
000000004.png;;(7372.8, 0)
...

@dzenanz ok, thank you. I believe you are right about the 10% overlap. I will give that a shot. Would the expectation then be that the resulting TileConfiguration.registered.txt should be close to the original values? I wouldn't expect more than a few pixels in shift.

@dzenanz with the 10% overlap, it appears that I'm able to get my results much faster and also the pixels seem to be shift less:

TileConfiguration.txt TileConfiguration.registered.txt
000000000.png;;(0.00, 0.00) 000000000.png;;(-1.9390194211155176e-4, 3.5291477106511593e-3)
000000001.png;;(1843.20, 0.00) 000000001.png;;(1858.9028741836548, 5.7245965003967285)
000000002.png;;(3686.40, 0.00) 000000002.png;;(3712.77699508667, 8.809530258178711)
000000003.png;;(5529.60, 0.00) 000000003.png;;(5586.154328918457, 9.660355567932129)

That sounds about right. Do note that your overlap might be 12%, or 8%, or 9%, or 15%. You should try a few of these to see whether they produce different results - they probably will. You should really examine the stitched output. To examine the montage, you don't have to use the whole thing. Maybe use just the first 3 rows, or first 3 columns, or top-left 5x5. That should give you a glimpse into how well it is working.

If the issue is not resolved, reopen or create a new issue.