Home My Page Projects Code Snippets Project Openings diderot
Summary Activity Tracker Tasks SCM

SCM Repository

[diderot] Diff of /trunk/test/MIP/mip_opencl.c
ViewVC logotype

Diff of /trunk/test/MIP/mip_opencl.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 217, Tue Aug 3 19:31:08 2010 UTC revision 218, Tue Aug 3 19:40:56 2010 UTC
# Line 13  Line 13 
13    
14  #include <teem/nrrd.h>  #include <teem/nrrd.h>
15    
16  #define SIZE 200  #define SIZE 201
17    
18  /*typedef float vec3[3];  /*typedef float vec3[3];
19    
# Line 245  Line 245 
245  {  {
246          int index = 0, end = 1, arraySize = rowSize * rowSize;          int index = 0, end = 1, arraySize = rowSize * rowSize;
247    
248          for(index = 1000; index < 1256; index++)          for(index = 0; index < arraySize; index++)
249          {          {
250                  if(end == 16)                  if(end == rowSize)
251                  {                  {
252                          printf(" %.2f\n",matrix[index]);                          printf(" %.2f\n",matrix[index]);
253                          end = 1;                          end = 1;
# Line 281  Line 281 
281              transformMatrix[((size + 1) * (size)) + i ] = 0;              transformMatrix[((size + 1) * (size)) + i ] = 0;
282          }          }
283          transformMatrix[((size + 1) * (size)) + size ] = 1;          transformMatrix[((size + 1) * (size)) + size ] = 1;
284    
285    printMatrix (transformMatrix, 4);
286  }  }
287  Nrrd * loadNrrdFile(char * filename)  Nrrd * loadNrrdFile(char * filename)
288  {  {
# Line 409  Line 411 
411          //Load the transformMatrix          //Load the transformMatrix
412          loadTransformMatrix(nin,transformMatrix);          loadTransformMatrix(nin,transformMatrix);
413          invMatrix(transformMatrix,inverseMatrix);          invMatrix(transformMatrix,inverseMatrix);
414    printf("Inverse\n"); printMatrix(inverseMatrix, 4);
415    
416          err |= clEnqueueWriteBuffer(queue,imageData_mem,CL_TRUE,0,imageDataSize,          err |= clEnqueueWriteBuffer(queue,imageData_mem,CL_TRUE,0,imageDataSize,
417                                                                  nin->data ,0,NULL,NULL);                                                                  nin->data ,0,NULL,NULL);
# Line 474  Line 477 
477    
478          return CL_SUCCESS;          return CL_SUCCESS;
479  }  }
480    #define VOX1_Z
481  int main (int argc, char ** argv)  int main (int argc, char ** argv)
482  {  {
483          //Declaring and initializing input variables          //Declaring and initializing input variables
484          Nrrd * nin;          Nrrd * nin;
485    #ifdef TXS
486          char * dataFile = "txs.nrrd";          char * dataFile = "txs.nrrd";
487          cl_float4 eyeVector = {25,15,10};          cl_float4 eyeVector = {25,15,10, 1};
488          cl_float4 origVector = {8.83877,2.5911,7.65275};          cl_float4 origVector = {8.83877,2.5911,7.65275};
489          cl_float4 cVector = {-0.0151831,0.0278357,0};          cl_float4 cVector = {-0.0151831,0.0278357,0};
490          cl_float4 rVector = {0.0074887,0.00408474,-0.0305383};          cl_float4 rVector = {0.0074887,0.00408474,-0.0305383};
491    #endif
492    #ifdef VOX1_X
493            char * dataFile = "../../data/vox1.nrrd";
494            cl_float4 eyeVector = {-8,2,2, 1};
495            cl_float4 origVector = {0,3.4036,3.4036};
496            cl_float4 cVector = {0,-0.014036,0};
497            cl_float4 rVector = {0,0,-0.014036};
498    #endif
499    #ifdef VOX1_Y
500            char * dataFile = "../../data/vox1.nrrd";
501            cl_float4 eyeVector = {2,-8,2, 1};
502            cl_float4 origVector = {0.596402,0,3.4036, 1};
503            cl_float4 cVector = {0.014036,0,0};
504            cl_float4 rVector = {0,0,-0.014036};
505    #endif
506    #ifdef VOX1_Z
507            char * dataFile = "../../data/vox1-11.nrrd";
508            cl_float4 eyeVector = {2,2,-8, 1};
509            cl_float4 origVector = {3.4036,3.4036,0, 1};
510            cl_float4 cVector = {-0.014036,0,0,0};
511            cl_float4 rVector = {0,-0.014036,0};
512    #endif
513          float stepSize = 0.1;          float stepSize = 0.1;
514          float h1[] = {0.666667,0,-1,0.5};          float h1[] = {0.666667,0,-1,0.5};
515          float h2[] = {1.33333, -2, 1,-0.166667};          float h2[] = {1.33333, -2, 1,-0.166667};

Legend:
Removed from v.217  
changed lines
  Added in v.218

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0