InsightSoftwareConsortium/ITKMontage

Specification of TileConfiguration

lambdamoses opened this issue · 4 comments

Hi, I'm trying to use ITKMontage on my own dataset. I ran the Python example on one if the example datasets and it worked fine. I have a TileConfiguration file like this:

dim = 3

a0-f2-r0-c0-z0.tiff;;(33224.6082949309,7060.92165898618,0)
a0-f3-r0-c0-z0.tiff;;(33224.6082949309,8904.23963133641,0)
a0-f4-r0-c0-z0.tiff;;(33224.6082949309,10747.5576036866,0)
a0-f1-r0-c0-z0.tiff;;(35067.9262672811,10747.5576036866,0)
a0-f5-r0-c0-z0.tiff;;(33224.6082949309,12590.8755760369,0)
a0-f0-r0-c0-z0.tiff;;(35067.9262672811,12590.8755760369,0)
a0-f2-r0-c0-z1.tiff;;(33224.6082949309,7060.92165898618,1.5)
a0-f3-r0-c0-z1.tiff;;(33224.6082949309,8904.23963133641,1.5)
a0-f4-r0-c0-z1.tiff;;(33224.6082949309,10747.5576036866,1.5)
a0-f1-r0-c0-z1.tiff;;(35067.9262672811,10747.5576036866,1.5)
a0-f5-r0-c0-z1.tiff;;(33224.6082949309,12590.8755760369,1.5)
a0-f0-r0-c0-z1.tiff;;(35067.9262672811,12590.8755760369,1.5)

Then I tried to parse it:

stage_tiles = itk.TileConfiguration[3]()
stage_tiles.Parse("TileConfig.txt")

And got this error:

ITK ERROR: Axis sizes: [1, 1, 1], but we reached index 1. Violation along axis 0

I compared my TileConfiguration with those of the examples, and still have no idea what mine gets wrong. Can someone please explain what are the specifications of the TileConfiguration file?

The images here are not in a regular grid. I fill in with blank images to make a regular grid the TileConfiguration was parsed properly. But it would be nice to make this clear in the documentation and more informative error messages.

But it would be nice to make this clear in the documentation and more informative error messages.

Making a more informative error message is not that easy, given that the code deals with n-dimensional tile configurations. Making it clear in the documentation should be easy enough that you could do it. Do you mind creating a PR?

So I'll add some comments in the Python example. Would that be sufficient?

Adding the documentation wherever you expected to find it is good.