]> Creatis software - creaMaracasVisu.git/commitdiff
no message
authorEduardo Davila <Eduardo.Davila@creatis.insa-lyon.fr>
Fri, 22 Apr 2011 11:11:05 +0000 (11:11 +0000)
committerEduardo Davila <Eduardo.Davila@creatis.insa-lyon.fr>
Fri, 22 Apr 2011 11:11:05 +0000 (11:11 +0000)
bbtk/src/bbcreaMaracasVisuReadAxisTree3D.cxx
bbtk/src/bbmaracasvisuAxeVolume.cxx
bbtk/src/bbmaracasvisuDrawAxisTree3D.cxx

index 317c922ef2ada0f64d9009e3c68022a45710f120..058093dbbbd41fd3b65e3833965e7a26782cff32 100644 (file)
@@ -32,7 +32,8 @@ void ReadAxisTree3D::Process()
 //    * TYPE is the C++ type of the input/output
 //      (the one provided in the attribute 'type' of the tag 'input')
 
-
+       printf("EED ReadAxisTree3D::Process start \n");
+       
        std::vector< std::vector<std::string> * > tlst;
        
        int i;
@@ -71,6 +72,8 @@ void ReadAxisTree3D::Process()
        i=7; if (i<=bbGetInputDimension()) { bbSetOutputlstData7( *(tlst[i-1]) ); }
        i=8; if (i<=bbGetInputDimension()) { bbSetOutputlstData8( *(tlst[i-1]) ); }
        i=9; if (i<=bbGetInputDimension()) { bbSetOutputlstData9( *(tlst[i-1]) ); }
+
+       printf("EED ReadAxisTree3D::Process end \n");
        
 }
        
index db203c70a8771137b1e8267a18f7fec9446c1eac..de06d970df238d0f35f1fe881a3c8a659b0f969c 100644 (file)
@@ -7,6 +7,9 @@ BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaMaracasVisu,AxeVolume)
 BBTK_BLACK_BOX_IMPLEMENTATION(AxeVolume,bbtk::AtomicBlackBox);
 void AxeVolume::Process()
 {
+       
+       printf("EED AxeVolume::Process start \n");
+
        if ( mimage!=NULL )
        {
                mimage->Delete();
@@ -60,36 +63,45 @@ void AxeVolume::Process()
                px = bbGetInputlstPointX()[iAxe];
                py = bbGetInputlstPointY()[iAxe];
                pz = bbGetInputlstPointZ()[iAxe];
-                printf("AxeVolume::Process %d ->  %f, %f, %f\n",iAxe, px,py,pz);
+//              printf("AxeVolume::Process %d ->  %f, %f, %f\n",iAxe, px,py,pz);
                px1 = px - r;
                py1 = py - r;
                pz1 = pz - r;
                px2 = px + r;
                py2 = py + r;
                pz2 = pz + r;
+               rr=r*r; 
 
                for ( i=px1 ; i<=px2 ; i++ ) 
                {
+                       rx      =       i - px;
+                       rx      =       rx*rx;
                        for ( j=py1 ; j<py2 ; j++ ) 
                        {
+                               ry      =       j - py;
+                               ry      =       ry*ry;
                                for ( k=pz1 ; k<pz2 ; k++ ) 
                                {
                                        if ( (i>=0) && (i<sizeX) && (j>=0) && (j<sizeY) &&(k>=0) && (k<sizeZ) ){
-                                               rx      = i - px;
-                                               ry      = j - py;
-                                               rz      = k - pz;
-                                               rr      = rx*rx + ry*ry + rz*rz;
-                                               if ( rx*rx + ry*ry + rz*rz <= r*r )
+                                               p = (unsigned short*)mimage->GetScalarPointer (i, j, k);
+                                               if (*p==0)
                                                {
-                                                       p = (unsigned short*)mimage->GetScalarPointer (i, j, k);
-                                                       *p=255;
-                                               } 
+                                                       rz      =       k - pz;
+                                                       rz      =       rz*rz;
+                                                       if ( rx + ry + rz <= rr )
+                                                       {
+                                                               *p=255;
+                                                       } 
+                                               } // *p==0
                                        } // inside point
                                } //for k
                        } //for j
                } //for i
        } // for iAxe
     bbSetOutputOut( mimage ); 
+       
+       printf("EED AxeVolume::Process end \n");
+
 }
 
 
index 79e256866eec7bbcffb0488464e5df65a426310a..faf81320431d7b6555af197ca107417ed3465212 100644 (file)
@@ -44,7 +44,7 @@ void DrawAxisTree3D::DrawOneAxis(int iGeneral,int numPoints, int iAxis)
                        allPoints->InsertNextPoint( bbGetInputlstPointX()[i]*spc[0],  
                                                                                bbGetInputlstPointY()[i]*spc[1], 
                                                                                bbGetInputlstPointZ()[i]*spc[2] );
-                       printf("DrawAxisTree3D::DrawOneAxis point  %d -> %f, %f, %f \n", i,  bbGetInputlstPointX()[i], bbGetInputlstPointY()[i], bbGetInputlstPointZ()[i] );
+//                     printf("DrawAxisTree3D::DrawOneAxis point  %d -> %f, %f, %f \n", i,  bbGetInputlstPointX()[i], bbGetInputlstPointY()[i], bbGetInputlstPointZ()[i] );
                        allTopology->InsertCellPoint( i-iGeneral );
                } // rof
                polydata->SetPoints( allPoints );
@@ -62,9 +62,6 @@ void DrawAxisTree3D::DrawOneAxis(int iGeneral,int numPoints, int iAxis)
                        g = bbGetInputColour()[1+iAxis*3]; 
                        b = bbGetInputColour()[2+iAxis*3];
        } else {
-//                     r = bbGetInputColour()[0];
-//                     g = bbGetInputColour()[1]; 
-//                     b = bbGetInputColour()[2];
                        r = (rand() % 100) / 100.0;
                        g = (rand() % 100) / 100.0;
                        b = (rand() % 100) / 100.0;
@@ -88,6 +85,8 @@ void DrawAxisTree3D::DrawOneAxis(int iGeneral,int numPoints, int iAxis)
 
 void DrawAxisTree3D::Process()
 {
+       printf("EED DrawAxisTree3D::Process start \n");
+
         int iActor,sizeActors = vecVtkActors.size();
         for (iActor=0 ; iActor<sizeActors; iActor++)
         {
@@ -113,14 +112,16 @@ void DrawAxisTree3D::Process()
                DrawOneAxis(iGeneral,numPoints,iAxis);
                iGeneral = iGeneral+numPoints;
                
-               if ((iAxis % 1)==0)
-               {
-                       printf("EED  DrawAxisTree3D::Process  %d/%d\n", iAxis,sizeLstAxis );
-               }
+//             if ((iAxis % 1)==0)
+//             {
+//                     printf("EED  DrawAxisTree3D::Process  %d/%d\n", iAxis,sizeLstAxis );
+//             }
+               
        }
 
 
        bbSetOutputOutAxis( vecVtkActors[ bbGetInputiAxis() ] );
+       printf("EED DrawAxisTree3D::Process end \n");
 
 }