Closed bogovicj closed 4 years ago
In response to @imagejan 's comments above, I put some work toward simplifying (Invertible)RealTransformSequence
s when possible.
Here's the work:
https://github.com/bogovicj/imglib2-realtransform/commit/5e553f7b9eb6056d76bf7f8fc5ec1125461f0c3e
What I did
1) Check if any transform that is added is the identity (with isIdentity
), and don't add it if it is
2) "unpack" any sequences that are added to a sequence.
3) Check if a transform that is added can be pre-concatenated to the transform preceding it, and if so, do it
(1) and (2) make sense to me.
(3) may be taking things to far, but is nice for optimization, I think. To make (3) thread-safe, it will be necessary to add copies of transforms rather than the originals (since they could be modified).
With @axtimwalde , decided against having the sequence itself do the simplifying. Rather it will isIdentity
will only return true if every element of the sequence isIdentity
.
New PR incoming...
see #24