]> Creatis software - bbtk.git/commitdiff
comment out useless std::cout
authorjean-pierre roux <jean-pierre.roux@creatis.insa-lyon.fr>
Thu, 6 May 2010 09:05:32 +0000 (09:05 +0000)
committerjean-pierre roux <jean-pierre.roux@creatis.insa-lyon.fr>
Thu, 6 May 2010 09:05:32 +0000 (09:05 +0000)
packages/vtk/src/bbvtkImagePlanes.cxx

index 92daa652fad7dca3429fe42ab4b561694f1e2eb4..30bfddb545904ad49559fcb5d439f1a3a6783132 100644 (file)
@@ -2,8 +2,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbvtkImagePlanes.cxx,v $
   Language:  C++
-  Date:      $Date: 2010/03/07 13:18:41 $
-  Version:   $Revision: 1.32 $
+  Date:      $Date: 2010/05/06 09:05:32 $
+  Version:   $Revision: 1.33 $
 =========================================================================*/
 
 /* ---------------------------------------------------------------------
@@ -92,7 +92,6 @@ namespace bbtk
 namespace bbvtk
 {
 
-
   //====================================================================
   // Add the specialized adaptors to the package
   typedef vtkImagePlaneWidget* I;
@@ -137,15 +136,13 @@ namespace bbvtk
  };
   //================================================================
 
-  //vtkCxxRevisionMacro(ImagePlanes::VtkCallbackType, "$Revision: 1.32 $");
+  //vtkCxxRevisionMacro(ImagePlanes::VtkCallbackType, "$Revision: 1.33 $");
 
   //================================================================
 
    BBTK_ADD_BLACK_BOX_TO_PACKAGE(vtk,ImagePlanes)
    BBTK_BLACK_BOX_IMPLEMENTATION(ImagePlanes,bbtk::AtomicBlackBox);
 
-       
-       
    void ImagePlanes::bbUserSetDefaultValues() 
    { 
      bbSetOutputPlaneX(0);
@@ -161,26 +158,23 @@ namespace bbvtk
      bbSetInputWindowLevel (vect);  
      mVtkCallback = 0;
 
-
-        std::vector<int> vectpoints;
+     std::vector<int> vectpoints;
 
      bbSetOutputPlane3Pts(0);
-        bbSetOutputImage3Pts(0);
-        bbSetInputPointsX(vectpoints);
-        bbSetInputPointsY(vectpoints);
-        bbSetInputPointsZ(vectpoints);
-
-        _imageReslicer = NULL;
-        image=NULL;
-        _transform =NULL;
-       _matrix =NULL;
+     bbSetOutputImage3Pts(0);
+     bbSetInputPointsX(vectpoints);
+     bbSetInputPointsY(vectpoints);
+     bbSetInputPointsZ(vectpoints);
+
+     _imageReslicer = NULL;
+     image          = NULL;
+     _transform     = NULL;
+     _matrix        = NULL;
    }
-   
 
        
    void ImagePlanes::bbUserInitializeProcessing() 
    {  
-
      /// CREATION DES WIDGETS
      if (bbGetOutputPlaneX() != 0) return;
        
@@ -191,24 +185,24 @@ namespace bbvtk
   
      // The 3 image plane widgets 
      vtkImagePlaneWidget* planeWidgetX = GetPlaneWidget('x', 1, 0, 0, picker);
-        vtkImagePlaneWidget* planeWidgetY = GetPlaneWidget('y', 1, 1, 0, picker);
+     vtkImagePlaneWidget* planeWidgetY = GetPlaneWidget('y', 1, 1, 0, picker);
      planeWidgetY->SetLookupTable(planeWidgetX->GetLookupTable());
 
      vtkImagePlaneWidget* planeWidgetZ = GetPlaneWidget('z', 0, 0, 1, picker);     
      planeWidgetZ->SetLookupTable(planeWidgetX->GetLookupTable());
 
-        vtkImagePlaneWidget* planeWidget3Pts = GetPlaneWidget('3', 0, 1, 1, picker);    
+     vtkImagePlaneWidget* planeWidget3Pts = GetPlaneWidget('3', 0, 1, 1, picker);       
      planeWidget3Pts->SetLookupTable(planeWidgetX->GetLookupTable());
 
      bbSetOutputPlaneX(planeWidgetX);
      bbSetOutputPlaneY(planeWidgetY);
      bbSetOutputPlaneZ(planeWidgetZ);
-        bbSetOutputPlane3Pts(planeWidget3Pts);  
+     bbSetOutputPlane3Pts(planeWidget3Pts);     
      bbSetOutputImageX(planeWidgetX->GetResliceOutput());
      bbSetOutputImageY(planeWidgetY->GetResliceOutput());
      bbSetOutputImageZ(planeWidgetZ->GetResliceOutput());
-        bbSetInputInteractor(0);
-        //bbSetOutputImage3Pts(planeWidget3Pts->GetResliceOutput());
+     bbSetInputInteractor(0);
+     //bbSetOutputImage3Pts(planeWidget3Pts->GetResliceOutput());
 
      picker->UnRegister(NULL);
      
@@ -227,12 +221,10 @@ namespace bbvtk
       {
 
        /*
-
          bbGetOutputPlaneX()->RemoveObserver(mVtkCallback);
          bbGetOutputPlaneY()->RemoveObserver(mVtkCallback);
          bbGetOutputPlaneZ()->RemoveObserver(mVtkCallback);
-       
-       
+
        bbGetOutputPlaneX()->Delete();
        bbGetOutputPlaneY()->Delete();
        bbGetOutputPlaneZ()->Delete();
@@ -241,24 +233,21 @@ namespace bbvtk
        //bbGetOutputPlaneX()->SetInput(NULL);
        //bbGetOutputPlaneY()->SetInput(NULL);
        //bbGetOutputPlaneZ()->SetInput(NULL);
-       
+
       }
-    
   }
   
 //---------------------------------------------------------------------  
-void ImagePlanes::Process()
-{
+  void ImagePlanes::Process()
+  {
        if (bbGetInputIn()!=0)
        {
-
                int xMin, xMax, yMin, yMax, zMin, zMax;
                bbGetInputIn()->GetExtent(xMin, xMax, yMin, yMax, zMin, zMax);
 
                if ( image != bbGetInputIn()){//bbGetInputStatus("In") != bbtk::UPTODATE ){
                        // Input image has changed : reinitialize planes
                        image = bbGetInputIn();                 
-                       
 
                        // Initial values : center of the volume (in real world, not in pixels!)
                        double xSpacing, ySpacing, zSpacing;
@@ -268,12 +257,10 @@ void ImagePlanes::Process()
                        bbGetOutputPlaneX()->SetPlaneOrientationToXAxes();       
                        bbGetOutputPlaneX()->SetSlicePosition((xMax+xMin)/2.*xSpacing);
 
-
                        //                 bbGetOutputPlaneX()->SetOrigin( 58*xSpacing , 80*ySpacing , 82*zSpacing );
                        //                 bbGetOutputPlaneX()->SetPoint1( 0*xSpacing, 146*ySpacing, 186*zSpacing);
                        //                 bbGetOutputPlaneX()->SetPoint2( 126*xSpacing, 146*ySpacing, 0*zSpacing);
 
-
                        bbGetOutputPlaneY()->SetInput(bbGetInputIn());
                        bbGetOutputPlaneY()->SetPlaneOrientationToYAxes();
                        bbGetOutputPlaneY()->SetSlicePosition((yMax+yMin)/2.*ySpacing);
@@ -290,12 +277,10 @@ void ImagePlanes::Process()
                        else 
                        {
                                double *range = image->GetScalarRange();
-                               bbGetOutputPlaneZ()->SetWindowLevel(range[1] - range[0],
-                                                               0.5*(range[1]+range[0]));
-                       }               
-
+                               bbGetOutputPlaneZ()->SetWindowLevel(range[1]-range[0],
+                                                              0.5*(range[1]+range[0]));
+                       }
                        updateInteractor();
-
           }
                        // UPDATE DES SORTIES 
                bbGetOutputPlaneX()->GetResliceOutput()->Update();
@@ -308,8 +293,8 @@ void ImagePlanes::Process()
 
                //std::cout<<pointsx.size()<<pointsy.size()<<pointsz.size()<<std::endl;
 
-               if(pointsx.size()==pointsy.size() && pointsx.size()==pointsz.size()&&pointsx.size()>=3){
-
+               if (pointsx.size()==pointsy.size() && pointsx.size()==pointsz.size()&&pointsx.size()>=3)
+               {
 
                        //Get the corresponding three points out of the vectors
                        double origin[3];
@@ -332,7 +317,7 @@ void ImagePlanes::Process()
                        double* crossp = getCrossProduct(vect1, vect2);
 
                        double *newx = getCrossProduct(vect2, crossp);
-                       
+
                        int ext[6],factor=0;
                        bbGetInputIn()->GetExtent(ext);
 
@@ -370,11 +355,8 @@ void ImagePlanes::Process()
                        _imageReslicer->GetOutput()->Update();
                        _imageReslicer->GetOutput()->UpdateInformation();
 
-                       
                        bbSetOutputImage3Pts(_imageReslicer->GetOutput());
 
-
-                        
                        _matrix->Identity();    
 
                        _matrix->SetElement(0,0,newx[0]*xSpacing);
@@ -390,19 +372,15 @@ void ImagePlanes::Process()
                        _matrix->SetElement(1,3,origin[1]*ySpacing);
                        _matrix->SetElement(2,3,origin[2]*zSpacing);
 
-                       
                        _transform->SetMatrix(_matrix);
 
                        //set the transformation out to be used by other bbBoxes
-                       bbSetOutputTransform3Pts((vtkLinearTransform*)_transform);
-
-
-                                               
-               }               
+                       bbSetOutputTransform3Pts((vtkLinearTransform*)_transform);                      
+               }       
        }
-}
+  }
        
-void ImagePlanes::updateInteractor(){
+  void ImagePlanes::updateInteractor(){
 
        vtkRenderWindowInteractor* interactor = bbGetInputInteractor();
 
@@ -416,25 +394,25 @@ void ImagePlanes::updateInteractor(){
                bbGetOutputPlane3Pts()->SetInteractor(interactor);
                bbGetOutputPlane3Pts()->EnabledOn();
        }
-}
+  }
        //-----------------------------------------------------------------     
-       void vtkImageDataPointerRelay::bbUserSetDefaultValues()
+  void vtkImageDataPointerRelay::bbUserSetDefaultValues()
        {
                
        }
        
        //-----------------------------------------------------------------     
-       void vtkImageDataPointerRelay::bbUserInitializeProcessing()
+  void vtkImageDataPointerRelay::bbUserInitializeProcessing()
        {
        }
        
        //-----------------------------------------------------------------     
-       void vtkImageDataPointerRelay::bbUserFinalizeProcessing()
+  void vtkImageDataPointerRelay::bbUserFinalizeProcessing()
        {
        }
        
-       vtkImagePlaneWidget* ImagePlanes::GetPlaneWidget(unsigned char activationkey, double r, double g, double b, vtkCellPicker* picker)
-       {
+  vtkImagePlaneWidget* ImagePlanes::GetPlaneWidget(unsigned char activationkey, double r, double g, double b, vtkCellPicker* picker)
+  {
                vtkProperty* prop1 = 0;         
                vtkImagePlaneWidget* planeWidget = 0;
 
@@ -446,9 +424,9 @@ void ImagePlanes::updateInteractor(){
                prop1->SetColor(r, g, b);
 
                return planeWidget;
-       }
+  }
 
-double* ImagePlanes::getCrossProduct(double* vect0,double* vect1){
+  double* ImagePlanes::getCrossProduct(double* vect0,double* vect1){
        double* vectCross;
        vectCross = new double[3];
        vectCross[0] = vect0[1]*vect1[2]-(vect0[2]*vect1[1]);
@@ -456,32 +434,27 @@ double* ImagePlanes::getCrossProduct(double* vect0,double* vect1){
        vectCross[2] = vect0[0]*vect1[1]-(vect0[1]*vect1[0]);
 
        return vectCross;
-}
+  }
 /**
 **     Returns the magnitud of the given vector
 **/
-double ImagePlanes::getMagnitud(double* vect){
+  double ImagePlanes::getMagnitud(double* vect){
 
        double mag;
-
        mag = sqrt(pow(vect[0],2) + pow(vect[1],2) + pow(vect[2],2));
-
-       std::cout<<"mag "<<mag <<std::endl;
-
+       //std::cout<<"mag "<<mag <<std::endl;
        return mag;
-
-}
+  }
 /**
 **     returns the unitary vector of the given vector
 **     u = 1/|vect| . vect
 **/
-double* ImagePlanes::getNormal(double* vect){
+  double* ImagePlanes::getNormal(double* vect){
 
        double* vectnorm;
        double mag = getMagnitud(vect);
 
        vectnorm = new double[3];
-       
 
        if(mag!=0){
                vectnorm[0] = vect[0]/mag;
@@ -494,11 +467,9 @@ double* ImagePlanes::getNormal(double* vect){
        }
 
        return vectnorm;
+  }
 
-
-}
-
-double* ImagePlanes::makeVector(double podouble0[3], double podouble1[3]){
+  double* ImagePlanes::makeVector(double podouble0[3], double podouble1[3]){
        double *vect;
        vect = new double[3];
 
@@ -507,11 +478,8 @@ double* ImagePlanes::makeVector(double podouble0[3], double podouble1[3]){
        vect[2]= podouble1[2]-podouble0[2];
 
        return vect;
-
-}
+  }
        
 }//namespace bbtk
 
 #endif // _USE_VTK_
-
-