# composite transform not maked as modified when using SetParameters

**URL:** https://discourse.itk.org/t/composite-transform-not-maked-as-modified-when-using-setparameters/458
**Category:** Beginner Questions
**Created:** [November 27, 2017, 3:55pm UTC](https://discourse.itk.org/t/composite-transform-not-maked-as-modified-when-using-setparameters/458 "2017-11-27T15:55:44Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![asertyuio](https://discourse.itk.org/letter_avatar_proxy/v4/letter/a/e68b1a/32.png) [@asertyuio](https://discourse.itk.org/u/asertyuio)
#### Post date: [November 27, 2017, 3:55pm UTC](https://discourse.itk.org/t/composite-transform-not-maked-as-modified-when-using-setparameters/458/1 "2017-11-27T15:55:44Z")

</div>

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 ?  
Thanks,  
Yann

---

<div class="post-metadata">

### Author: ![tim-evain](https://discourse.itk.org/user_avatar/discourse.itk.org/tim-evain/32/220_2.png) [@tim-evain](https://discourse.itk.org/u/tim-evain)
#### Post date: [November 27, 2017, 4:15pm UTC](https://discourse.itk.org/t/composite-transform-not-maked-as-modified-when-using-setparameters/458/2 "2017-11-27T16:15:05Z")

</div>

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.

Tim

---

<div class="post-metadata">

### Author: ![asertyuio](https://discourse.itk.org/letter_avatar_proxy/v4/letter/a/e68b1a/32.png) [@asertyuio](https://discourse.itk.org/u/asertyuio)
#### Post date: [November 27, 2017, 4:35pm UTC](https://discourse.itk.org/t/composite-transform-not-maked-as-modified-when-using-setparameters/458/3 "2017-11-27T16:35:46Z")

</div>

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 :

> <https://github.com/InsightSoftwareConsortium/ITK/blob/d317254649f3b7819473ceaa0a18c48ed5f0156c/Modules/Core/Transform/include/itkSimilarity2DTransform.hxx#L87>

but not in `SetParameters()` of composite transform:

> <https://github.com/InsightSoftwareConsortium/ITK/blob/d317254649f3b7819473ceaa0a18c48ed5f0156c/Modules/Core/Transform/include/itkCompositeTransform.hxx#L759>

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

Yann

---

<div class="post-metadata">

### Author: ![fbudin](https://discourse.itk.org/user_avatar/discourse.itk.org/fbudin/32/14_2.png) [@fbudin](https://discourse.itk.org/u/fbudin)
#### Post date: [December 1, 2017, 2:06pm UTC](https://discourse.itk.org/t/composite-transform-not-maked-as-modified-when-using-setparameters/458/4 "2017-12-01T14:06:07Z")

</div>

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?

---

<div class="post-metadata">

### Author: ![asertyuio](https://discourse.itk.org/letter_avatar_proxy/v4/letter/a/e68b1a/32.png) [@asertyuio](https://discourse.itk.org/u/asertyuio)
#### Post date: [December 1, 2017, 3:03pm UTC](https://discourse.itk.org/t/composite-transform-not-maked-as-modified-when-using-setparameters/458/5 "2017-12-01T15:03:42Z")

</div>

Yep, I’ll do it 😉

---

<div class="post-metadata">

### Author: ![blowekamp](https://discourse.itk.org/user_avatar/discourse.itk.org/blowekamp/32/79_2.png) [@blowekamp](https://discourse.itk.org/u/blowekamp)
#### Post date: [December 1, 2017, 3:27pm UTC](https://discourse.itk.org/t/composite-transform-not-maked-as-modified-when-using-setparameters/458/6 "2017-12-01T15:27:18Z")

</div>

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.
