]> Creatis software - creaMaracasVisu.git/commitdiff
Changes in ReadAxisTree and AxeVolume.
authorRicardo Corredor <Ricardo.Corredor@creatis.insa-lyon.fr>
Wed, 18 Apr 2012 09:25:58 +0000 (09:25 +0000)
committerRicardo Corredor <Ricardo.Corredor@creatis.insa-lyon.fr>
Wed, 18 Apr 2012 09:25:58 +0000 (09:25 +0000)
bbtk/src/bbcreaMaracasVisuReadAxisTree3D.cxx
bbtk/src/bbmaracasvisuAxeVolume.cxx

index 058093dbbbd41fd3b65e3833965e7a26782cff32..4baa2ed603fa5a6420bdd92d316f5aab33c34703 100644 (file)
@@ -58,11 +58,29 @@ void ReadAxisTree3D::Process()
                        }       
                        numberOfLines++;                        
                }       
+
+               std::cout<<"18-04-2012 RaC ReadAxisTree3D::Process Erase last element in vectors."<<std::endl;
+               // TOFIX If it is not erased, the last element in every vector is a copy of the last column value
+               for( i=0 ;  i<bbGetInputDimension() ; i++)
+               {
+                       vecData=tlst[i];
+                       vecData->pop_back();
+               }
+               /* vecData=tlst[0];
+               std::cout<<"RaC last element 1:"<<vecData->at(numberOfLines-2)<<std::endl;
+               std::cout<<"RaC last element 1:"<<vecData->at(numberOfLines-1)<<std::endl;
+               vecData=tlst[1];
+               std::cout<<"RaC last element 2:"<<vecData->at(numberOfLines-2)<<std::endl;
+               std::cout<<"RaC last element 2:"<<vecData->at(numberOfLines-1)<<std::endl;
+               vecData=tlst[2];
+               std::cout<<"RaC last element 3:"<<vecData->at(numberOfLines-2)<<std::endl;
+               std::cout<<"RaC last element 3:"<<vecData->at(numberOfLines-1)<<std::endl; */
                fclose(ff1);
        } else {   // else ff1
                printf("bbcreaMaracasVisuReadAxisTree3D::Process  ...Error... reading file InputFileName_Points>%s", bbGetInputFileName().c_str() );
        } //ff1 
 
+
        i=1; if (i<=bbGetInputDimension()) { bbSetOutputlstData1( *(tlst[i-1]) ); }
        i=2; if (i<=bbGetInputDimension()) { bbSetOutputlstData2( *(tlst[i-1]) ); }
        i=3; if (i<=bbGetInputDimension()) { bbSetOutputlstData3( *(tlst[i-1]) ); }
index 1711efe09d9ef16a19ee44e2c28cf78e64cdcc10..67c84f33556123f4fdfa6321bf904833c9160052 100644 (file)
@@ -17,9 +17,9 @@ void AxeVolume::Process()
 
        int ext[6];
        bbGetInputIn()->GetExtent(ext);
-       int sizeX=ext[1]-ext[0];
-       int sizeY=ext[3]-ext[2];
-       int sizeZ=ext[5]-ext[4];
+       int sizeX=ext[1]-ext[0]+1;
+       int sizeY=ext[3]-ext[2]+1;
+       int sizeZ=ext[5]-ext[4]+1;
 
     double spc[3];
        bbGetInputIn()->GetSpacing(spc);
@@ -29,15 +29,20 @@ void AxeVolume::Process()
     invSpc[2] = 1/spc[2];
 
        mimage = vtkImageData::New();
-       mimage->SetDimensions(sizeX,sizeY,sizeZ);
-       mimage->SetOrigin(0,0,0);
-       mimage->SetExtent( 0 , sizeX-1 , 0 , sizeY-1 , 0, sizeZ-1 );
-       mimage->SetWholeExtent( 0 , sizeX-1 , 0 , sizeY-1 , 0, sizeZ-1 );
+       mimage->SetSpacing(bbGetInputIn()->GetSpacing());
+       mimage->SetDimensions(bbGetInputIn()->GetDimensions());
+       mimage->SetExtent(bbGetInputIn()->GetExtent());
+       mimage->SetOrigin(bbGetInputIn()->GetOrigin());
+       //mimage->SetDimensions(sizeX,sizeY,sizeZ);
+       //mimage->SetOrigin(0,0,0);
+       //mimage->SetExtent( 0 , sizeX-1 , 0 , sizeY-1 , 0, sizeZ-1 );
+       //mimage->SetWholeExtent( 0 , sizeX-1 , 0 , sizeY-1 , 0, sizeZ-1 );
        mimage->SetScalarTypeToUnsignedShort();
-       mimage->SetSpacing(spc);
+       //mimage->SetSpacing(spc);
        mimage->AllocateScalars();
 
 
+
        int i,j,k;
     int sizeLstPointR = bbGetInputlstPointR().size();
        int iAxe,sizeAxe=bbGetInputlstPointX().size();
@@ -55,7 +60,7 @@ void AxeVolume::Process()
                p++;
        }
 
-       for (iAxe=0 ; iAxe<sizeAxe; iAxe++)
+       for (iAxe=0 ; iAxe<sizeAxe-1; iAxe++)
         {
                if (sizeLstPointR<iAxe)
                {