<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7653.38">
<TITLE>RE: [Insight-users] How to calculate displacement from deformation field</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/plain format -->

<P><FONT SIZE=2>Thank you for your help pinpress. I tried to read it with float32 and now the numbers make sense. Just another question, is the unit of the displacement values here in millimeters or pixels? I need to calculate the strains from them. Thanks!<BR>
<BR>
Yufei<BR>
<BR>
<BR>
-----Original Message-----<BR>
From: insight-users-bounces@itk.org on behalf of pinpress<BR>
Sent: Tue 25.11.2008 15:12<BR>
To: insight-users@itk.org<BR>
Subject: Re: [Insight-users] How to calculate displacement from deformation field<BR>
<BR>
<BR>
Hi,<BR>
<BR>
I have used demons registration recently, but in my case, I have<BR>
M-by-N-by-P-by-3 double values of the displacement, that means 3<BR>
displacement values (e.g., vector) at each and every voxel.<BR>
<BR>
My wild guess: you read in the displacement file in Matlab as a sequence of<BR>
one-byte (e.g., uint8) integer, but you really should have read in the file<BR>
as a sequence of 4-byte double value. Then you will also get 3 displacement<BR>
values at each voxel, instead of 12.<BR>
<BR>
Also be cautious here, Matlab uses column major, whereas VTK files from ITK<BR>
are row major. So you need to switch the first two dimensions of the<BR>
deformation matrix in Matlab.<BR>
<BR>
<BR>
Li Yufei wrote:<BR>
&gt;<BR>
&gt; Hi all,<BR>
&gt;<BR>
&gt; I have been working with some deformation fields generated from my demons<BR>
&gt; registration. I am able to view the field in paraview with no problem.<BR>
&gt; What I really want is to quantify the displacement (max, min, average<BR>
&gt; displacement) and subsequently the strains.<BR>
&gt;<BR>
&gt; I tried to read the field to matlab and I found that for an image size of<BR>
&gt; 300*300*100, there are 300*300*100*12 elements in the field. so I guess<BR>
&gt; for each pixel, there are 12 numbers specifying the deformation. Can<BR>
&gt; someone tell me what are these 12 elements? or anyone has an idea how to<BR>
&gt; calculate the displacement? Thank you very much.<BR>
&gt;<BR>
&gt; Best regards<BR>
&gt;<BR>
&gt; Yufei<BR>
&gt;<BR>
<BR>
--<BR>
View this message in context: <A HREF="http://www.nabble.com/How-to-calculate-displacement-from-deformation-field-tp20677817p20681978.html">http://www.nabble.com/How-to-calculate-displacement-from-deformation-field-tp20677817p20681978.html</A><BR>
Sent from the ITK - Users mailing list archive at Nabble.com.<BR>
<BR>
_______________________________________________<BR>
Insight-users mailing list<BR>
Insight-users@itk.org<BR>
<A HREF="http://www.itk.org/mailman/listinfo/insight-users">http://www.itk.org/mailman/listinfo/insight-users</A><BR>
<BR>
<BR>
</FONT>
</P>


<p><span style="font-family:'Arial';font-size:10pt;">*****************************************************************</span></p>
<p><span style="font-family:'Arial';font-size:10pt;">This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This footnote also confirms that this email message has been swept by MIMEsweeper for content and by McAffee Webshield for the presence of computer viruses.</span></p>
<p><span style="font-family:'Arial';font-size:10pt;">*****************************************************************</span></p>
<p><span style="font-family:'Arial';font-size:10pt;">&nbsp;</span></p></BODY>
</HTML>