No subject


Tue Nov 26 13:19:16 EST 2013


image, I should probably be using the itk4 "displacementfieldtransform".

typedef itk::DisplacementFieldTransform<VectorComponentType, 3>
> DeformationFieldTransformType;
>

My main problem now is that I cannot seem to "connect" my mha file
containing the deformation field with the displacementFieldTransformType. I
probably need some type of basic "read DisplacementFieldTransform from
file" function, but so far I have not been able to make one.

Any ideas that might help? I realise that the bigger problem here is my own
lack of knowledge on the details of itk4, so please do not hesitate to
point me to as basic a source as necessary.
Gratefully
Yago Diez Donoso



Yago Diez Donoso (PhD)
Computer Vision and Robotics Group http://vicorob.udg.es/
E-mail: yago at eia.udg.es; yagodiezdonoso at gmail.com
Phone: (int. code) 34 972418013
University of Girona


On Wed, Dec 4, 2013 at 8:48 PM, brian avants <stnava at gmail.com> wrote:

> see line 142 here:
>
>
> https://github.com/stnava/ANTs/blob/d99d9c9e23ae17c116377a248cd370ddbd8c2=
599/Examples/antsApplyTransformsToPoints.cxx
>
> you can do the same thing in your application but note that the
> deformation field , when applied to a point , should be the inverse of th=
e
> deformation field applied to an image
>
> see my previous email regarding SyN and inverse warps.
>
>
> brian
>
>
>
>
> On Wed, Dec 4, 2013 at 2:33 PM, Yago Diez <yagodiezdonoso at gmail.com>wrote=
:
>
>> Hi everyone,
>>
>> I have a problem regarding itk deformation fields:
>>
>> Specifically, I want to know where a particular point ends up after
>> registration. Said registration has produced a deformation field. I have
>> already used this deformation field to deform the source image and produ=
ce
>> the output image for registration (this was done using itkWarpImageFilte=
r).
>>
>> My problem is that at this moment I only want to transform one point. Th=
e
>> obvious solution was to read the corresponding voxel in the deformation
>> field and add it to the point, but the problem is that the deformation
>> field is not "dense enough", so in most cases, the read deformation for =
a
>> point ends up being zero (see attached image for a screen capture of a 2=
D
>> slice of my 3D deformation field).
>>
>>  I have noticed how when I deform an image with itkWarpImageFilter, ther=
e
>> is an "extra" interpolation step which would avoid the problem I am havi=
ng,
>> but so far I have not been able to interpolate a deformation field. Any
>> ideas on how to do that?
>>
>> Thank you
>>
>>
>>
>>
>> Yago Diez Donoso (PhD)
>> Computer Vision and Robotics Group http://vicorob.udg.es/
>> E-mail: yago at eia.udg.es; yagodiezdonoso at gmail.com
>> Phone: (int. code) 34 972418013
>> University of Girona
>>
>> _____________________________________
>> 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
>>
>>
>

--001a11c2ca0cf963bd04ecf3b10d
Content-Type: text/html; charset=windows-1252
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div><div>First of all, thanks a lot for your answer and s=
orry I couldn&#39;t solve the problem on my own. I have been fighting for a=
 while with this but so far I have not had much success. At least I am now =
a bit more aware of how many things I don&#39;t know.<br>

</div><br></div>First of all, I realise what I want to do boils down to :<b=
r><br>typename CompositeTransformType::Pointer compositeTransform =3D Compo=
siteTransformType::New();<br>compositeTransform-&gt;AddTransform( deffield)=
;<br>

compositeTransform-&gt;TransformPoint( p0 );<br><div><br></div><div>The pro=
blem now is that <u>my deformation field is not recognised as a valid trans=
formation</u>.<br><br></div><div>My deformation field which is the output o=
f demons registration and it is stored in a file in mha format. I read it l=
ike this (as a vector image as used to be done in itk3):<br>

<br><blockquote style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb=
(204,204,204);padding-left:1ex" class=3D"gmail_quote">=A0typedef float=A0=
=A0=A0=A0=A0 PixelType;<br>=A0typedef=A0=A0 float VectorComponentType;<br><=
br>=A0 const=A0=A0 unsigned int=A0=A0=A0=A0=A0=A0=A0 Dimension =3D 3;<br>

<br>=A0typedef itk::Vector&lt; PixelType, Dimension=A0 &gt; VectorPixelType=
;<br>=A0typedef itk::Image&lt; VectorPixelType, Dimension &gt; DeformationF=
ieldType;<br>=A0typedef itk::ImageFileReader&lt; DeformationFieldType &gt; =
ReaderType;<br>

<br>=A0ReaderType::Pointer reader =3D ReaderType::New();<br>=A0reader-&gt;S=
etFileName(argv[1]);<br>=A0reader-&gt;Update();<br>=A0DeformationFieldType:=
:Pointer deffield =3D reader-&gt;GetOutput();<br></blockquote></div><div><b=
r></div>

<div><br></div><div>When I try to add it to the composite transform, howeve=
r, I get the error:<br><br>/media/disc4/code/newTransformPoints.cxx:112:47:=
 error: no matching function for call to =91itk::CompositeTransform&lt;floa=
t, 3u&gt;::AddTransform(itk::Image&lt;itk::Vector&lt;float, 3u&gt;, 3u&gt;:=
:Pointer&amp;)=92<br>

/media/disc4/code/newTransformPoints.cxx:112:47: note: candidate is:<br>/us=
r/local/include/ITK-4.4/itkMultiTransform.h:145:16: note: void itk::MultiTr=
ansform&lt;TScalar, NDimensions, NSubDimensions&gt;::AddTransform(itk::Mult=
iTransform&lt;TScalar, NDimensions, NSubDimensions&gt;::TransformType*) [wi=
th TScalar =3D float, unsigned int NDimensions =3D 3u, unsigned int NSubDim=
ensions =3D 3u, itk::MultiTransform&lt;TScalar, NDimensions, NSubDimensions=
&gt;::TransformType =3D itk::Transform&lt;float, 3u, 3u&gt;]<br>

/usr/local/include/ITK-4.4/itkMultiTransform.h:145:16: note:=A0=A0 no known=
 conversion for argument 1 from =91itk::Image&lt;itk::Vector&lt;float, 3u&g=
t;, 3u&gt;::Pointer {aka itk::SmartPointer&lt;itk::Image&lt;itk::Vector&lt;=
float, 3u&gt;, 3u&gt; &gt;}=92 to =91itk::MultiTransform&lt;float, 3u, 3u&g=
t;::TransformType* {aka itk::Transform&lt;float, 3u, 3u&gt;*}=92<br>

<br><br></div><div>From what I understand, instead of reading my deformatio=
n field as a vector image, I should probably be using the itk4 &quot;displa=
cementfieldtransform&quot;. <br></div><div><br><blockquote style=3D"margin:=
0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" =
class=3D"gmail_quote">

typedef itk::DisplacementFieldTransform&lt;VectorComponentType, 3&gt;=A0 De=
formationFieldTransformType;<br></blockquote><br></div><div>My main problem=
 now is that I cannot seem to &quot;connect&quot; my mha file containing th=
e deformation field with the displacementFieldTransformType. I probably nee=
d some type of basic &quot;read DisplacementFieldTransform from file&quot; =
function, but so far I have not been able to make one.<br>

<br></div><div>Any ideas that might help? I realise that the bigger problem=
 here is my own lack of knowledge on the details of itk4, so please do not =
hesitate to point me to as basic a source as necessary.<br></div><div>
Gratefully<br></div><div>
Yago Diez Donoso<br></div><div><br></div><div><br></div><div class=3D"gmail=
_extra"><br clear=3D"all"><div><div dir=3D"ltr">Yago Diez Donoso (PhD)<br>C=
omputer Vision and Robotics Group <a href=3D"http://vicorob.udg.es/" target=
=3D"_blank">http://vicorob.udg.es/</a><br>

E-mail: <a href=3D"mailto:yago at eia.udg.es" target=3D"_blank">yago at eia.udg.e=
s</a>; <a href=3D"mailto:yagodiezdonoso at gmail.com" target=3D"_blank">yagodi=
ezdonoso at gmail.com</a><br>Phone: (int. code) 34 972418013<br>University of =
Girona </div>

</div>
<br><br><div class=3D"gmail_quote">On Wed, Dec 4, 2013 at 8:48 PM, brian av=
ants <span dir=3D"ltr">&lt;<a href=3D"mailto:stnava at gmail.com" target=3D"_b=
lank">stnava at gmail.com</a>&gt;</span> wrote:<br><blockquote class=3D"gmail_=
quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1=
ex">

<div dir=3D"ltr">see line 142 here:<div><br></div><div><a href=3D"https://g=
ithub.com/stnava/ANTs/blob/d99d9c9e23ae17c116377a248cd370ddbd8c2599/Example=
s/antsApplyTransformsToPoints.cxx" target=3D"_blank">https://github.com/stn=
ava/ANTs/blob/d99d9c9e23ae17c116377a248cd370ddbd8c2599/Examples/antsApplyTr=
ansformsToPoints.cxx</a><br>



</div><div><br></div><div>you can do the same thing in your application but=
 note that the deformation field , when applied to a point , should be the =
inverse of the deformation field applied to an image</div><div><br></div>



<div>see my previous email regarding SyN and inverse warps.</div></div><div=
 class=3D"gmail_extra"><br clear=3D"all"><div><div><br></div>brian<br><div>=
<br></div><div><br></div></div>
<br><br><div class=3D"gmail_quote"><div><div>On Wed, Dec 4, 2013 at 2:33 PM=
, Yago Diez <span dir=3D"ltr">&lt;<a href=3D"mailto:yagodiezdonoso at gmail.co=
m" target=3D"_blank">yagodiezdonoso at gmail.com</a>&gt;</span> wrote:<br>
</div></div><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;bo=
rder-left:1px #ccc solid;padding-left:1ex"><div><div>

<div dir=3D"ltr"><div><div><div><div>Hi everyone,<br><br></div>I have a pro=
blem regarding itk deformation fields:<br><br></div>Specifically, I want to=
 know where a particular point ends up after registration. Said registratio=
n has produced a deformation field. I have already used this deformation fi=
eld to deform the source image and produce the output image for registratio=
n (this was done using itkWarpImageFilter). <br>




<br></div>My problem is that at this moment I only want to transform one po=
int. The obvious solution was to read the corresponding voxel in the deform=
ation field and add it to the point, but the problem is that the deformatio=
n field is not &quot;dense enough&quot;, so in most cases, the read deforma=
tion for a point ends up being zero (see attached image for a screen captur=
e of a 2D slice of my 3D deformation field).<br>




<br>=A0I have noticed how when I deform an image with itkWarpImageFilter, t=
here is an &quot;extra&quot; interpolation step which would avoid the probl=
em I am having, but so far I have not been able to interpolate a deformatio=
n field. Any ideas on how to do that?<br>




<br></div>Thank you<br><div><br><br><div><div><div><div><br><br clear=3D"al=
l"><div><div dir=3D"ltr">Yago Diez Donoso (PhD)<br>Computer Vision and Robo=
tics Group <a href=3D"http://vicorob.udg.es/" target=3D"_blank">http://vico=
rob.udg.es/</a><br>




E-mail: <a href=3D"mailto:yago at eia.udg.es" target=3D"_blank">yago at eia.udg.e=
s</a>; <a href=3D"mailto:yagodiezdonoso at gmail.com" target=3D"_blank">yagodi=
ezdonoso at gmail.com</a><br>Phone: (int. code) 34 972418013<br>University of =
Girona </div>




</div>
</div></div></div></div></div></div>
<br></div></div>_____________________________________<br>
Powered by <a href=3D"http://www.kitware.com" target=3D"_blank">www.kitware=
.com</a><br>
<br>
Visit other Kitware open-source projects at<br>
<a href=3D"http://www.kitware.com/opensource/opensource.html" target=3D"_bl=
ank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Kitware offers ITK Training Courses, for more information visit:<br>
<a href=3D"http://www.kitware.com/products/protraining.php" target=3D"_blan=
k">http://www.kitware.com/products/protraining.php</a><br>
<br>
Please keep messages on-topic and check the ITK FAQ at:<br>
<a href=3D"http://www.itk.org/Wiki/ITK_FAQ" target=3D"_blank">http://www.it=
k.org/Wiki/ITK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href=3D"http://www.itk.org/mailman/listinfo/insight-users" target=3D"_bl=
ank">http://www.itk.org/mailman/listinfo/insight-users</a><br>
<br></blockquote></div><br></div>
</blockquote></div><br></div></div>

--001a11c2ca0cf963bd04ecf3b10d--


More information about the Insight-users mailing list