]> Creatis software - creaMaracasVisu.git/commitdiff
Clean code
authoreduardo.davila@creatis.insa-lyon.fr <eduardo.davila@creatis.insa-lyon.fr>
Wed, 18 Sep 2024 15:04:31 +0000 (17:04 +0200)
committereduardo.davila@creatis.insa-lyon.fr <eduardo.davila@creatis.insa-lyon.fr>
Wed, 18 Sep 2024 15:04:31 +0000 (17:04 +0200)
bbtk/src/bbmaracasvisuImageChangeInformation.h
bbtk/src/bbmaracasvisuViewerNV.h
lib/maracasVisuLib/src/CutModule/kernel/CutModelData.cxx
lib/maracasVisuLib/src/CutModule/kernel/CutModelData.h

index ec7b9b18dfef1662788a1b85e3d60083767eb569..cde04df561e4fbbe24986f6d907680eacd9bdbb1 100644 (file)
@@ -55,7 +55,7 @@ private:
 BBTK_BEGIN_DESCRIBE_BLACK_BOX(ImageChangeInformation,bbtk::AtomicBlackBox);
 BBTK_NAME("ImageChangeInformation");
 BBTK_AUTHOR("eduardo.davila [at] creatis.insa-lyon.fr");
-BBTK_DESCRIPTION("vtkImageData change information. Translate extern to 0,0,0");
+BBTK_DESCRIPTION("(C++,JavaScript) vtkImageData change information. Translate extern to 0,0,0");
        BBTK_CATEGORY("filter");
        BBTK_INPUT(ImageChangeInformation,In,"Input image",vtkImageData*,"");
        BBTK_INPUT(ImageChangeInformation,NewSpacing,"New spacing of the image. 3 elements (default: the same spacing of the original image)", std::vector<double> ,"");
index 09db75a944fb612ec3b58972744fa5272b2c00c7..83248794703f8d329ae972d8980ab9e004fff15d 100644 (file)
@@ -117,7 +117,7 @@ private:
 BBTK_BEGIN_DESCRIBE_BLACK_BOX(ViewerNV,bbtk::WxBlackBox);
 BBTK_NAME("ViewerNV");
 BBTK_AUTHOR("eduardo.davila [at] creatis.insa-lyon.fr");
-BBTK_DESCRIPTION("(C++,Python) Viewer : N view configuration 2D and 3D");
+BBTK_DESCRIPTION("(C++,Python,JavaScript) Viewer : N view configuration 2D and 3D");
   BBTK_CATEGORY("viewer");
   BBTK_INPUT(ViewerNV,Title,"Title prepended to the text",std::string,"");
   BBTK_INPUT(ViewerNV,In,"Input image",vtkImageData*,"");
index 8d27a5c3e10bfb1900335d1b7729cfb27f24aff2..2851a1d34884fa867051c175f3be64e417114f26 100644 (file)
@@ -130,9 +130,9 @@ void CutModelData::setTransform(vtkImageData* img)
        }
 }
 
-void CutModelData::createActor(){      
-
-       _Mapper = vtkPolyDataMapper::New();     
+void CutModelData::createActor()
+{
+       _Mapper = vtkPolyDataMapper::New();
        _Actor  = vtkActor::New();
        _Actor->SetMapper(_Mapper);     
        _Actor->GetProperty()->SetColor(1, 0, 0);
@@ -154,9 +154,9 @@ void CutModelData::udapteActorDirection()
 
 void CutModelData::createShapes()
 {
-       _cubefigure = new CutModelFigureCube();
+       _cubefigure     = new CutModelFigureCube();
        _cylinderfigure = new CutModelFigureCylinder();
-       _spherefigure = new CutModelFigureSphere();
+       _spherefigure   = new CutModelFigureSphere();
 }
 
 // EED 2022-08-04      throw
@@ -317,21 +317,18 @@ void CutModelData::ExecuteCut( double* range, bool isinside, vtkImageData* copyi
                copyimage->GetExtent(ext);        
                for (xx=ext[0];xx<=ext[1]; xx++)
                {
-                           for (yy=ext[2];yy<=ext[3]; yy++)
+            for (yy=ext[2];yy<=ext[3]; yy++)
                        {
-                                   for (zz=ext[4];zz<=ext[5];zz++)
+                for (zz=ext[4];zz<=ext[5];zz++)
                                {
                                        inside=actualCuttingModel->IfPointInside(xx,yy,zz);
                                        if (  ((inside==true)&&(isinside==true)) || ((!inside==true)&&(!isinside)) )
                                        {
                                                pOrg=(unsigned short*)copyimage->GetScalarPointer (xx,yy,zz); 
-
                                                //std::cout<<"xx,yy,zz "<<xx<<","<<yy<<","<<zz<<" "<<*pOrg<<std::endl;
                                                if ((unsigned short)minvalue <=(*pOrg)&&(*pOrg)<=(unsigned short)maxvalue)
-                                               {       
-                                                       
+                                               {
                                                        *pOrg=(unsigned short)value;
-                                                       
                                                }                                       
                                        } // if inside
                                } // for zz
index 06042df9f8ad0347834aae5121df0600123b3ed5..dcbe685133acf0390664cc4b36dd6dc6d02607db 100644 (file)
@@ -40,9 +40,6 @@
 
 =========================================================================*/
 
-
-
-
 #ifndef __CutModelDataH__
 #define __CutModelDataH__
 
@@ -87,28 +84,22 @@ public:
        void ExecuteUnCut(  bool isinside, vtkImageData* image, vtkImageData* copyimage)throw( CutModelException);
        void setTransform(vtkTransform* transform,vtkImageData* img)throw( CutModelException);
 */
-       void changeOpacity(int opacity);
-       void ShowViewBox(bool check);
-       void ChangeShape(int selection);
-       vtkActor* getActor();
-       vtkPolyData* getPolyData();
-       void changeColor(double r,double g,double b);
-       void udapteActorDirection();
-       void ExecuteCut( double* range, bool isinside, vtkImageData* copyimage);
-       void ExecuteUnCut(  bool isinside, vtkImageData* image, vtkImageData* copyimage);
-       void setTransform(vtkTransform* transform,vtkImageData* img);
+       void            changeOpacity(int opacity);
+       void            ShowViewBox(bool check);
+       void            ChangeShape(int selection);
+       vtkActor*       getActor();
+       vtkPolyData*    getPolyData();
+       void            changeColor(double r,double g,double b);
+       void            udapteActorDirection();
+       void            ExecuteCut( double* range, bool isinside, vtkImageData* copyimage);
+       void            ExecuteUnCut(  bool isinside, vtkImageData* image, vtkImageData* copyimage);
+       void            setTransform(vtkTransform* transform,vtkImageData* img);
        
-       void RefreshViewBox();
-       vtkTransform* getCurrentMatrix(){
-               return currentmatrix;
-       }
-       int getCurrentShape(){
-               return _currentshape;
-       }
-       void setCurrentShape(int currentshape){
-               _currentshape = currentshape;
-       }
-private:       
+       void            RefreshViewBox();
+       vtkTransform* getCurrentMatrix(){ return currentmatrix; }
+       int getCurrentShape() {         return _currentshape;}
+       void setCurrentShape(int currentshape) {_currentshape = currentshape; }
+private:
 // EED 2022-08-04      
 //     void checkInvariant()throw( CutModelException);
 //     void setTransform(vtkImageData* img)throw( CutModelException);
@@ -129,9 +120,9 @@ private:
        vtkTransform                    *currentmatrix;
        vtkTransform                    *modeltransform;
        vtkTransform                    *inversModel;
-       CutModelFigure* getCurentCuttingModel();
-       vtkTransform*   getModelTransform(vtkImageData* copyimage);
-       vtkTransform*   getModelTransformInvers();
+       CutModelFigure*     getCurentCuttingModel();
+       vtkTransform*       getModelTransform(vtkImageData* copyimage);
+       vtkTransform*       getModelTransformInvers();
 };
 
 #endif