<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/173650</link>
    <title>MATLAB Central Newsreader - transpose of interpn() operations</title>
    <description>Feed for thread: transpose of interpn() operations</description>
    <language>en-us</language>
    <copyright>&amp;copy;1994-2012 by MathWorks, Inc.</copyright>
    <webmaster>webmaster@mathworks.com</webmaster>
    <generator>MATLAB Central Newsreader</generator>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
    <ttl>60</ttl>
    <image>
      <title>MathWorks</title>
      <url>http://www.mathworks.com/images/membrane_icon.gif</url>
    </image>
    <item>
      <pubDate>Fri, 01 Aug 2008 20:54:02 -0400</pubDate>
      <title>transpose of interpn() operations</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/173650#446850</link>
      <author>Matt </author>
      <description>&lt;br&gt;
The operation&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;VI = INTERPN(X1,X2,X3,...,V,Y1,Y2,Y3,...)&lt;br&gt;
&lt;br&gt;
is a linear operation on the data V, meaning that there &lt;br&gt;
exists a  matrix A such that&lt;br&gt;
&lt;br&gt;
VI(:)=A*V(:)&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
In many applications, however, we need to be able to &lt;br&gt;
implement multiplication by the transpose &lt;br&gt;
&lt;br&gt;
VII=A'*VI&lt;br&gt;
&lt;br&gt;
Since A is typically gigantic, you do not of course want to &lt;br&gt;
compute A or A.' directly.&lt;br&gt;
&lt;br&gt;
Does anyone know if this transpose operation is implemented &lt;br&gt;
somewhere in a more or less optimized way?&lt;br&gt;
&lt;br&gt;
I know that one can do this with accumarray(SUBS,VAL), &lt;br&gt;
however, you then need to derive the SUBS data from the &lt;br&gt;
(Y1,Y2,Y3,...) coordinates which is a time-consuming and &lt;br&gt;
memory-consuming computation when implemented directly in &lt;br&gt;
MATLAB.&lt;br&gt;
&lt;br&gt;
I have the vague recollection that this was available &lt;br&gt;
somewhere in the library of image registration functions, &lt;br&gt;
but can't remember where. In any case, I would prefer to be &lt;br&gt;
able to do it without the image processing toolbox.</description>
    </item>
    <item>
      <pubDate>Fri, 01 Aug 2008 21:55:03 -0400</pubDate>
      <title>Re: transpose of interpn() operations</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/173650#446863</link>
      <author>Bruno Luong</author>
      <description>&quot;Matt &quot; &amp;lt;mjacobson.removethis@xorantech.com&amp;gt; wrote in&lt;br&gt;
message &amp;lt;g6vt59$k9o$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Does anyone know if this transpose operation is implemented &lt;br&gt;
&amp;gt; somewhere in a more or less optimized way?&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; I know that one can do this with accumarray(SUBS,VAL), &lt;br&gt;
&amp;gt; however, you then need to derive the SUBS data from the &lt;br&gt;
&amp;gt; (Y1,Y2,Y3,...) coordinates which is a time-consuming and &lt;br&gt;
&amp;gt; memory-consuming computation when implemented directly in &lt;br&gt;
&amp;gt; MATLAB.&lt;br&gt;
&amp;gt; &lt;br&gt;
&lt;br&gt;
Are you interested specifically in tensorial linear&lt;br&gt;
interpolaion (default) or a general interpolation, including&lt;br&gt;
spline?&lt;br&gt;
&lt;br&gt;
Bruno</description>
    </item>
    <item>
      <pubDate>Fri, 01 Aug 2008 23:11:02 -0400</pubDate>
      <title>Re: transpose of interpn() operations</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/173650#446872</link>
      <author>John D'Errico</author>
      <description>&quot;Matt &quot; &amp;lt;mjacobson.removethis@xorantech.com&amp;gt; wrote in message &lt;br&gt;
&amp;lt;g6vt59$k9o$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; The operation&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt;   VI = INTERPN(X1,X2,X3,...,V,Y1,Y2,Y3,...)&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; is a linear operation on the data V, meaning that there &lt;br&gt;
&amp;gt; exists a  matrix A such that&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; VI(:)=A*V(:)&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; In many applications, however, we need to be able to &lt;br&gt;
&amp;gt; implement multiplication by the transpose &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; VII=A'*VI&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Since A is typically gigantic, you do not of course want to &lt;br&gt;
&amp;gt; compute A or A.' directly.&lt;br&gt;
&lt;br&gt;
Why not? Learn what a sparse matrix is,&lt;br&gt;
and you can write that matrix directly,&lt;br&gt;
then performing any such operations&lt;br&gt;
with ease.&lt;br&gt;
&lt;br&gt;
John</description>
    </item>
    <item>
      <pubDate>Mon, 04 Aug 2008 08:34:01 -0400</pubDate>
      <title>Re: transpose of interpn() operations</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/173650#447096</link>
      <author>Matt </author>
      <description>&amp;gt; Are you interested specifically in tensorial linear&lt;br&gt;
&amp;gt; interpolaion (default) or a general interpolation, &lt;br&gt;
including&lt;br&gt;
&amp;gt; spline?&lt;br&gt;
&amp;nbsp;&lt;br&gt;
I'd settle for tensorial linear. I wasn't too confident of &lt;br&gt;
even this being available.&lt;br&gt;
&lt;br&gt;
But I'd be even happier, of course, if higher order &lt;br&gt;
tensorial splines were available, too.  </description>
    </item>
    <item>
      <pubDate>Mon, 04 Aug 2008 08:47:02 -0400</pubDate>
      <title>Re: transpose of interpn() operations</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/173650#447098</link>
      <author>Bruno Luong</author>
      <description>&quot;Matt &quot; &amp;lt;mjacobson.removethis@xorantech.com&amp;gt; wrote in&lt;br&gt;
message &amp;lt;g76etp$1d5$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; Are you interested specifically in tensorial linear&lt;br&gt;
&amp;gt; &amp;gt; interpolaion (default) or a general interpolation, &lt;br&gt;
&amp;gt; including&lt;br&gt;
&amp;gt; &amp;gt; spline?&lt;br&gt;
&amp;gt;  &lt;br&gt;
&amp;gt; I'd settle for tensorial linear. I wasn't too confident of &lt;br&gt;
&amp;gt; even this being available.&lt;br&gt;
&lt;br&gt;
I don't know about availability, but you could of course&lt;br&gt;
program it with not much effort. Using sparse matrix as John&lt;br&gt;
suggest is also a convenient way to accomplish the task.&lt;br&gt;
&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; But I'd be even happier, of course, if higher order &lt;br&gt;
&amp;gt; tensorial splines were available, too.  &lt;br&gt;
&lt;br&gt;
However, sparse matrix trick wouldn't work here, the&lt;br&gt;
interpolation matrix is dense (elements are however larger&lt;br&gt;
on the diagonal band). It is possible to &quot;transpose&quot; the&lt;br&gt;
spline algorithm to compute its adjoint. Again, I have no&lt;br&gt;
idea if such tool exists.&lt;br&gt;
&lt;br&gt;
If you need any help to program the later, just let me know.&lt;br&gt;
&lt;br&gt;
Bruno</description>
    </item>
    <item>
      <pubDate>Mon, 04 Aug 2008 08:49:02 -0400</pubDate>
      <title>Re: transpose of interpn() operations</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/173650#447099</link>
      <author>Matt </author>
      <description>&lt;br&gt;
&amp;gt; Why not? Learn what a sparse matrix is,&lt;br&gt;
&amp;gt; and you can write that matrix directly,&lt;br&gt;
&amp;gt; then performing any such operations&lt;br&gt;
&amp;gt; with ease.&lt;br&gt;
&lt;br&gt;
Believe me, I'm no stranger to sparse matrices, but it &lt;br&gt;
won't do the trick. &lt;br&gt;
&lt;br&gt;
For the applications I work with, a typical size for V &lt;br&gt;
might be 400x400x300.&lt;br&gt;
&lt;br&gt;
Even if I stuck with tensorial linear interpolation, and &lt;br&gt;
even if sparse matrices supported single precision floats, &lt;br&gt;
the size of A would easily run to about 2GB and strain &lt;br&gt;
MATLAB's memory limits. On top of that, I would have to &lt;br&gt;
convert V to type double to perform the multiplication.&lt;br&gt;
&lt;br&gt;
Aside from memory issues, the time required to generate A &lt;br&gt;
is problematic. In typical applications, you may need to &lt;br&gt;
repeat these operations with several sets of interpolation &lt;br&gt;
coordinate data. This means you will have to regenerate A &lt;br&gt;
multiple times. &lt;br&gt;
&lt;br&gt;
Anyway, if I'm reaching for the moon, so be it. I'm just &lt;br&gt;
surprised that there hasn't been more interest in a coded &lt;br&gt;
routine for A.'. It seems to me like something that would &lt;br&gt;
often be needed. &lt;br&gt;
&amp;nbsp;</description>
    </item>
    <item>
      <pubDate>Mon, 04 Aug 2008 09:02:02 -0400</pubDate>
      <title>Re: transpose of interpn() operations</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/173650#447104</link>
      <author>Bruno Luong</author>
      <description>&quot;Matt &quot; &amp;lt;mjacobson.removethis@xorantech.com&amp;gt; wrote in&lt;br&gt;
message &amp;lt;g76fpu$7lt$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; For the applications I work with, a typical size for V &lt;br&gt;
&amp;gt; might be 400x400x300.&lt;br&gt;
&amp;gt; &lt;br&gt;
&lt;br&gt;
And what is the typical size of your VI Matt?&lt;br&gt;
&lt;br&gt;
Bruno</description>
    </item>
    <item>
      <pubDate>Mon, 04 Aug 2008 15:56:02 -0400</pubDate>
      <title>Re: transpose of interpn() operations</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/173650#447189</link>
      <author>Matt </author>
      <description>&quot;Bruno Luong&quot; &amp;lt;b.luong@fogale.findmycountry&amp;gt; wrote in &lt;br&gt;
message &amp;lt;g76gia$d07$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &quot;Matt &quot; &amp;lt;mjacobson.removethis@xorantech.com&amp;gt; wrote in&lt;br&gt;
&amp;gt; message &amp;lt;g76fpu$7lt$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; For the applications I work with, a typical size for V &lt;br&gt;
&amp;gt; &amp;gt; might be 400x400x300.&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; And what is the typical size of your VI Matt?&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Bruno&lt;br&gt;
&lt;br&gt;
In the cases I'm thinking of, you almost always have &lt;br&gt;
size(VI) equal to or comparable to size(V).&lt;br&gt;
&lt;br&gt;
Think, for example, of deforming a 3D image. You apply a &lt;br&gt;
geometric transformation to the original coordinates of the &lt;br&gt;
image samples, and then you need to interpolate/resample at &lt;br&gt;
all of the new locations.</description>
    </item>
    <item>
      <pubDate>Mon, 04 Aug 2008 16:13:01 -0400</pubDate>
      <title>Re: transpose of interpn() operations</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/173650#447191</link>
      <author>Matt </author>
      <description>&amp;gt; If you need any help to program the later, just let me &lt;br&gt;
know.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Bruno&lt;br&gt;
&lt;br&gt;
Thanks. I don't think it would be so bad to program, but it &lt;br&gt;
would have been great if someone else had already done it &lt;br&gt;
for me :)</description>
    </item>
    <item>
      <pubDate>Fri, 16 Sep 2011 10:21:11 -0400</pubDate>
      <title>Re: transpose of interpn() operations</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/173650#852451</link>
      <author>Aaronne </author>
      <description>Hi Matt, I am sorry to dig out this old message but have you found a solution for this 'Transpose' interpolation/transformation operation? &lt;br&gt;
&lt;br&gt;
Currently, I use your Bspline Matrix Interpolation; however, I really need a transpose operation of it. (Just to test the program, the efficiency could be considered later).&lt;br&gt;
&lt;br&gt;
Thanks a lot,&lt;br&gt;
Aaronne. </description>
    </item>
    <item>
      <pubDate>Fri, 16 Sep 2011 12:43:26 -0400</pubDate>
      <title>Re: transpose of interpn() operations</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/173650#852458</link>
      <author>John D'Errico</author>
      <description>&quot;Aaronne&quot; wrote in message &amp;lt;j4v7un$sbu$1@newscl01ah.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; Hi Matt, I am sorry to dig out this old message but have you found a solution for this 'Transpose' interpolation/transformation operation? &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Currently, I use your Bspline Matrix Interpolation; however, I really need a transpose operation of it. (Just to test the program, the efficiency could be considered later).&lt;br&gt;
&amp;gt; &lt;br&gt;
&lt;br&gt;
I should add that this is NOT a &quot;transpose&quot;, but an&lt;br&gt;
inverse operator. Transpose and inverse are only the&lt;br&gt;
same when the operator is of a specific orthogonal&lt;br&gt;
class.&lt;br&gt;
&lt;br&gt;
Next, interpn and its cousins are only locally linear.&lt;br&gt;
So while you may find an inverse, there may exist&lt;br&gt;
MANY inverses for any point. Worse, since interpn&lt;br&gt;
is an n --&amp;gt; 1 operator, there will be infinitely many&lt;br&gt;
such inverse points, an n-1 manifold of solutions.&lt;br&gt;
&lt;br&gt;
And finally, higher order spline interpolants will not&lt;br&gt;
be as simply inverted.&lt;br&gt;
&lt;br&gt;
John</description>
    </item>
    <item>
      <pubDate>Fri, 16 Sep 2011 14:07:29 -0400</pubDate>
      <title>Re: transpose of interpn() operations</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/173650#852462</link>
      <author>Matt J </author>
      <description>&quot;Aaronne&quot; wrote in message &amp;lt;j4v7un$sbu$1@newscl01ah.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; Hi Matt, I am sorry to dig out this old message but have you found a solution for this 'Transpose' interpolation/transformation operation? &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Currently, I use your Bspline Matrix Interpolation; however, I really need a transpose operation of it. (Just to test the program, the efficiency could be considered later).&lt;br&gt;
=========&lt;br&gt;
&lt;br&gt;
I have a MEX routine that does it for 2D bilinear interpolation, but nothing more general. Also, it's proprietary. Sorry.&lt;br&gt;
&lt;br&gt;
As I told you before, though, I don't think it would be too hard to modify any of the interpolation codes I've linked you to (e.g. the FEX) to do what you're looking for.</description>
    </item>
    <item>
      <pubDate>Fri, 16 Sep 2011 14:23:11 -0400</pubDate>
      <title>Re: transpose of interpn() operations</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/173650#852463</link>
      <author>Matt J </author>
      <description>&quot;John D'Errico&quot; &amp;lt;woodchips@rochester.rr.com&amp;gt; wrote in message &amp;lt;j4vg9e$scv$1@newscl01ah.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; I should add that this is NOT a &quot;transpose&quot;, but an&lt;br&gt;
&amp;gt; inverse operator. &lt;br&gt;
&lt;br&gt;
No, we are definitely talking about a transpose. Again the statement of the problem is this: the following function of V&lt;br&gt;
&lt;br&gt;
f(V) = INTERPN(X1,X2,X3,...,V,Y1,Y2,Y3,...)&lt;br&gt;
&lt;br&gt;
is equivalent to a matrix-vector multiplication&lt;br&gt;
&lt;br&gt;
z1=A*V(:)&lt;br&gt;
&lt;br&gt;
We would like a routine, preferably a highly optimized mex, that computes&lt;br&gt;
&lt;br&gt;
z2=A.'*z1&lt;br&gt;
&lt;br&gt;
We are NOT trying to recover V(:).</description>
    </item>
    <item>
      <pubDate>Fri, 16 Sep 2011 14:33:26 -0400</pubDate>
      <title>Re: transpose of interpn() operations</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/173650#852464</link>
      <author>Matt J </author>
      <description>&quot;Matt J&quot; wrote in message &amp;lt;j4vm4f$o46$1@newscl01ah.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; No, we are definitely talking about a transpose. Again the statement of the problem is this: the following function of V&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; f(V) = INTERPN(X1,X2,X3,...,V,Y1,Y2,Y3,...)&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; is equivalent to a matrix-vector multiplication&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; z1=A*V(:)&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; We would like a routine, preferably a highly optimized mex, that computes&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; z2=A.'*z1&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; We are NOT trying to recover V(:).&lt;br&gt;
=====================&lt;br&gt;
&lt;br&gt;
And, as per Aaronne's point, we would like to be able to do this for arbitrary interpolation kernels, e.g. cardinal B-splines of order 3, and not simply the kernels offered by INTERPN.</description>
    </item>
  </channel>
</rss>

