Image scaling… redo
I have had this issue where the images didn’t align correctly with the model. It turns out that only the first one(Z=0). Th answer is that the model varies in X,Y along the Z axis. The bounding box that is used to scale the image to the model must be recalculated for each image according to its position on the model. Don’t why I didn’t see this before.
The trick is to extract a slice from the model at the desired Z position. VTK does this very nicely. Then get the bounding box for the slice. This is what we will use to scale the image.
Below is a slice of the model(blue) mapped onto the model.

Using this new scaling process here are some results. Its clear that the images fit the model much better then before.






