[Insight-users] [ITK Community] ITKV4 combine affine transform with displacement field to output displacement field
Matt McCormick
matt.mccormick at kitware.com
Thu Jan 30 09:10:04 EST 2014
Hi Emma,
Instead of creating a DisplacementField, writing the
CompositeTransform directly would preserve more information. It would
need to be verified, but the ".mat" or ".h5" formats instead of ".txt"
may need to be used when writing the transform to file.
Hope this helps,
Matt
On Wed, Jan 29, 2014 at 5:56 AM, Emma Saunders
<emmasaunders123 at gmail.com> wrote:
> Hi Matt, thanks for your help.
>
> To do this I must therefore load my displacement field as a transform and
> use
>
> CompositeTransform->AddTransform(affine);
> CompositeTransform->AddTransform(DisplacementFieldTransform);
>
> How can I then write this out as a deformation field?
>
>
> Would you then suggest using #include
> "itkTransformToDisplacementFieldSource.h" ?
>
> Thanks
>
> Emma
>
>
>
> On Tue, Jan 28, 2014 at 8:11 PM, Matt McCormick <matt.mccormick at kitware.com>
> wrote:
>>
>> Hi Emma,
>>
>> In ITKv4, there is a much nicer way of doing this with the
>> CompositeTransform [1]. Load the AffineTransform and
>> DisplacementFieldTransform and add them to a CompositeTransform with
>> AddTransform() [2].
>>
>> Hope this helps,
>> Matt
>>
>> [1] http://www.itk.org/Doxygen/html/classitk_1_1CompositeTransform.html
>>
>> [2]http://www.itk.org/Doxygen/html/classitk_1_1MultiTransform.html#a698cf2434061a797bca49ed32a46cab9
>>
>> On Tue, Jan 28, 2014 at 3:02 PM, Emma Saunders
>> <emmasaunders123 at gmail.com> wrote:
>> > Hi all,
>> >
>> > I have an affine transform as a .txt file and a deformation field as
>> > .mha.
>> > I would like to find a composite transform of each.
>> >
>> > At the moment I convert the affine to a deformation field using
>> > "itkTransformToDisplacementFieldSource.h"
>> >
>> > and then compose it with the displacement field using:
>> >
>> > "itkComposeDisplacementFieldsImageFilter.h"
>> >
>> > Is there a more succinct way to do this in the new framework>
>> >
>> > Many thanks
>> >
>> > Emma
>> >
>> >
>> > _____________________________________
>> > Powered by www.kitware.com
>> >
>> > Visit other Kitware open-source projects at
>> > http://www.kitware.com/opensource/opensource.html
>> >
>> > Kitware offers ITK Training Courses, for more information visit:
>> > http://www.kitware.com/products/protraining.php
>> >
>> > Please keep messages on-topic and check the ITK FAQ at:
>> > http://www.itk.org/Wiki/ITK_FAQ
>> >
>> > Follow this link to subscribe/unsubscribe:
>> > http://www.itk.org/mailman/listinfo/insight-users
>> >
>> > _______________________________________________
>> > Community mailing list
>> > Community at itk.org
>> > http://public.kitware.com/cgi-bin/mailman/listinfo/community
>> >
>
>
More information about the Insight-users
mailing list