Thank you, that did the trick.
Interestingly, I now also see something similar in the updated version of “Julia by example”. Seems I have missed this before.
For others trying to replicate @nilshg’s solution: Make sure the first command is using CoordinateTransformations
. CoordianteTransforms doesn’t seem to exist at all.
EDIT:
I meanwhile figured that there is a problem in this solution: The types are wrong.
The above solution generates an AffineMap with type Int64
. However, we need
AffineMap{RotMatrix{2,Float64,4},StaticArrays.SArray{Tuple{2},Float64,1,2}}
. If I want to assign a variable of this type to the Int64-type array, I get a “cannot convert”-error.
My current workaround is to call the registering command from my previous thread once, thereby generating the correct type for the AffineMap (stored in a variable called tfm
). I then modified the above solution to this: tfm_array = [tfm for _ in 1:size(inputimg,3)]
. This generates an array of the correct type. I then loop through my stack and fill the array.