composite transform not maked as modified when using SetParameters

Dear all,

I have a small and maybe silly question. I noticed that when I was changing manually the parameter of the last transform in a composite transform, the composite transform was not marked as modified. For example, after using SetParameters(), I have to call the ->Modified() function to force a resampling filter to rerun.

Is that the expected behavior ?

As far as I remember, this was always the case.
Modifying parameters will trigger a Modified() on the transform, but not on the filter linking it (the transform doesn’t know which object reference it).
So the filter Update() will see no modification. You have to call Modified() by yourself on the filter.


What I mean, is that if I use SetParameter() on a “normal” transform, calling update() makes it rerun itself. However, it is not in the case for composite transform.

In the sources, I see that SetParameters() call this->Modified() for the similarity transform for example :

but not in SetParameters() of composite transform:

But no big deal, I just noticed that, find it weird, so I just tell it instead of burying it !


1 Like

It indeed seem that it is missing in this filter. All the other transforms that I looked at did implement the update. Would you be willing to submit a patch to correct this issue?

1 Like

Yep, I’ll do it :wink:

1 Like

This might have been an intentional design with the ITKv4 registration framework.Nick might know for certain.

It might also be expected that the MTime returned by the Composite transform is the most recent of itself AND all transforms it holds. So if one transform in the composition is directly modified then the Composite transform would reflect that it has been modified.