[Insight-users] help with code

David Soto sotin1985 at gmail.com
Tue Jun 7 06:37:13 EDT 2011


Hi I have some problems with the next code:

typedef    T       InputPixelType;
  typedef    float       OutputPixelType;
  typedef itk::Image< InputPixelType,  3 >   InputImageType;
  typedef itk::Image< OutputPixelType,  3 >   OutputImageType;

InputImageType::PointType lpsPoint;
        InputImageType::IndexType indexArtery;

        lpsPoint[0] = artery[0];
        lpsPoint[1] = artery[1];
        lpsPoint[2] = artery[2];

vnl_matrix<double> A(26,26);

        for ( int i = 0 ; i < imageVector.size() ; i++ )
        {

            for (int i=0; i<26; i++)
         {
            for(int j=0; j<26; j++)
            {
                if (i<=j) {


A[i,j]=(4*(imageVector[i-j]->GetPixel(indexArtery))+(imageVector[i-j-1]->GetPixel(indexArtery))+(imageVector[i-j+1]->GetPixel(indexArtery)))/6;

                }
                else A[i,j]=0;

            }
         }

in imageVector I previously put 26 diferents CT volums.

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*'

And another mistake in the line number 20 (else A[i,j]=0;) that say: the
left operator must be value L

I hope anyone could help me, thank you so much
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20110607/78fc8b6d/attachment.htm>


More information about the Insight-users mailing list