<html><head><style type='text/css'>p { margin: 0; }</style></head><body><div style='font-family: Times New Roman; font-size: 12pt; color: #000000'>It should be A(i,j) and not A[i,j].<br><br>http://www.itk.org/Doxygen320/html/classitk_1_1Matrix.html#a36a2d0bf5ced1f359da76358506e0948<br><br>Vincent<br><br><hr id="zwchr"><blockquote style="border-left:2px solid rgb(16, 16, 255);margin-left:5px;padding-left:5px;"><b>From: </b>"Sergio Vera" <sergio.vera@alma3d.com><br><b>To: </b>"David Soto" <sotin1985@gmail.com><br><b>Cc: </b>insight-users@itk.org<br><b>Sent: </b>Tuesday, 7 June, 2011 1:15:14 PM<br><b>Subject: </b>Re: [Insight-users] help with code<br><br><div>Hi</div>Unless I'm missing some strange operator overloading, should lines 18 and 20 be something like A[i][j] instead of A[i,j]?<div><br></div><div>regards<br><div><br></div><div><br><div class="gmail_quote">On Tue, Jun 7, 2011 at 12:37 PM, David Soto <span dir="ltr"><<a href="mailto:sotin1985@gmail.com" target="_blank">sotin1985@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hi I have some problems with the next code: <br><br>typedef T InputPixelType;<br> typedef float OutputPixelType; <br>
typedef itk::Image< InputPixelType, 3 > InputImageType;<br> typedef itk::Image< OutputPixelType, 3 > OutputImageType;<br>
<br>InputImageType::PointType lpsPoint;<br> InputImageType::IndexType indexArtery;<br><br> lpsPoint[0] = artery[0]; <br> lpsPoint[1] = artery[1];<br> lpsPoint[2] = artery[2]; <br><br>vnl_matrix<double> A(26,26);<br>
<br> for ( int i = 0 ; i < imageVector.size() ; i++ )<br> {<br> <br> for (int i=0; i<26; i++)<br> {<br> for(int j=0; j<26; j++)<br> {<br> if (i<=j) {<br>
<br> A[i,j]=(4*(imageVector[i-j]->GetPixel(indexArtery))+(imageVector[i-j-1]->GetPixel(indexArtery))+(imageVector[i-j+1]->GetPixel(indexArtery)))/6; <br> }<br> else A[i,j]=0;<br>
<br> }<br> }<br><br>in imageVector I previously put 26 diferents CT volums. <br><br>And when I go to compile it, I get some mistakes,in the line number 18 (bucle if... A[i,j]=...) they say It's not possible make the conversion 'InputPixelType' to 'double*' , 'int' to 'double* , 'OutputPixelType' to 'double*' and 'unsigned long' to 'double*'<br>
<br>And another mistake in the line number 20 (else A[i,j]=0;) that say: the left operator must be value L<br><br>I hope anyone could help me, thank you so much<br>
<br>_____________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at<br>
<a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Kitware offers ITK Training Courses, for more information visit:<br>
<a href="http://www.kitware.com/products/protraining.html" target="_blank">http://www.kitware.com/products/protraining.html</a><br>
<br>
Please keep messages on-topic and check the ITK FAQ at:<br>
<a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br>Sergio Vera<br><br> Alma IT Systems<br> C/ Vilana, 4B, 4º 1ª<br> 08022 Barcelona<br> T. (+34) 932 380 592<br> <a href="http://www.alma3d.com" target="_blank">www.alma3d.com</a><br>
</div></div>
<br>_____________________________________<br>Powered by www.kitware.com<br><br>Visit other Kitware open-source projects at<br>http://www.kitware.com/opensource/opensource.html<br><br>Kitware offers ITK Training Courses, for more information visit:<br>http://www.kitware.com/products/protraining.html<br><br>Please keep messages on-topic and check the ITK FAQ at:<br>http://www.itk.org/Wiki/ITK_FAQ<br><br>Follow this link to subscribe/unsubscribe:<br>http://www.itk.org/mailman/listinfo/insight-users<br></blockquote><br></div></body></html>