]> Creatis software - bbtk.git/commitdiff
#3107 BBTK Bug New Normal - branch vtk7itk4 compilation with vtk7
authorEduardo DAVILA <davila@localhost.localdomain>
Wed, 30 Aug 2017 10:09:48 +0000 (12:09 +0200)
committerEduardo DAVILA <davila@localhost.localdomain>
Wed, 30 Aug 2017 10:09:48 +0000 (12:09 +0200)
packages/vtk/src/bbvtkAppendPolyData.xml
packages/vtk/src/bbvtkAutoCrop.cxx
packages/vtk/src/bbvtkAutoCrop.h
packages/vtk/src/bbvtkConeSource.xml

index 5ff9389bd00366b391a49e576f077d6597d51047..9dde44cee4ec895e87a932f25e0f2b14bb73a4ad 100644 (file)
   bbGetVtkObject()->SetInput(bbGetInputIn4());
   bbGetVtkObject()->SetInput(bbGetInputIn5());
 #else
-  bbGetVtkObject()->SetInputData(bbGetInputIn1());
-  bbGetVtkObject()->SetInputData(bbGetInputIn2());
-  bbGetVtkObject()->SetInputData(bbGetInputIn3());
-  bbGetVtkObject()->SetInputData(bbGetInputIn4());
-  bbGetVtkObject()->SetInputData(bbGetInputIn5());
+  bbGetVtkObject()->AddInputData(bbGetInputIn1());
+  bbGetVtkObject()->AddInputData(bbGetInputIn2());
+  bbGetVtkObject()->AddInputData(bbGetInputIn3());
+  bbGetVtkObject()->AddInputData(bbGetInputIn4());
+  bbGetVtkObject()->AddInputData(bbGetInputIn5());
 #endif
 
    
index 26d928e04905630fd6421513f4c31981d74f79d8..703366e55fe5068ac6b6e023bc5f1b2033a2f4d6 100644 (file)
@@ -57,7 +57,8 @@ void AutoCrop::Process()
        int i,j,k;
        int sizeX,sizeY,sizeZ;
 
-       if (bbGetInputIn()!=NULL){
+       if (bbGetInputIn()!=NULL)
+       {
                int ext[6];
 
 //EED 2017-01-01 Migration VTK7
@@ -71,35 +72,26 @@ void AutoCrop::Process()
 
                sizeX=ext[1]-ext[0]+1;
                sizeY=ext[3]-ext[2]+1;
-               sizeZ=ext[5]-ext[4]+1;
-               
+               sizeZ=ext[5]-ext[4]+1;          
                sizeX=(sizeX/2)*2;
                sizeY=(sizeY/2)*2;
-//             if (_newImage==NULL)
-//             {
-                       _newImage = vtkImageData::New();
-                       _newImage->Initialize();
-                       _newImage->SetSpacing( bbGetInputIn()->GetSpacing() );
-                       _newImage->SetDimensions(  sizeX,sizeY,sizeZ );
+               _newImage = vtkImageData::New();
+               _newImage->Initialize();
+               _newImage->SetSpacing( bbGetInputIn()->GetSpacing() );
+               _newImage->SetDimensions(  sizeX,sizeY,sizeZ );
 
 
 //EED 2017-01-01 Migration VTK7
 #if (VTK_MAJOR_VERSION <= 5) 
-                   _newImage->SetWholeExtent(0,sizeX-1,0,sizeY-1,0,sizeZ-1);
-                       _newImage->SetNumberOfScalarComponents( bbGetInputIn()->GetNumberOfScalarComponents() );
-                       _newImage->SetScalarType( bbGetInputIn()->GetScalarType() );
-                       _newImage->AllocateScalars();
+               _newImage->SetWholeExtent(0,sizeX-1,0,sizeY-1,0,sizeZ-1);
+               _newImage->SetNumberOfScalarComponents( bbGetInputIn()->GetNumberOfScalarComponents() );
+               _newImage->SetScalarType( bbGetInputIn()->GetScalarType() );
+               _newImage->AllocateScalars();
 #endif
 #if (VTK_MAJOR_VERSION >= 6) 
-                   _newImage->SetExtent(0,sizeX-1,0,sizeY-1,0,sizeZ-1);
-                       _newImage->AllocateScalars(bbGetInputIn()->GetScalarType(),1);
+               _newImage->SetExtent(0,sizeX-1,0,sizeY-1,0,sizeZ-1);
+               _newImage->AllocateScalars(bbGetInputIn()->GetScalarType(),1);
 #endif
-
-
-//             }
-       
-
-               
                for (i=0; i<sizeX; i++) 
                {
                         for (j=0; j<sizeY; j++)
@@ -110,12 +102,9 @@ void AutoCrop::Process()
                                        _newImage->SetScalarComponentFromDouble(i,j,k, 0, value );
                                } // for k
                        } // for j
-               } // for i
-                        
-       }// bbGetInputIn
-                        
+               } // for i                      
+       }// bbGetInputIn                         
    bbSetOutputOut(_newImage);
-               
 }
 //===== 
 // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
index 1af72e3c08fa77ab08893e144e5a0646449fca2d..12f80efdcec8083a9d5456b792576eda25424eb2 100644 (file)
@@ -62,10 +62,10 @@ class bbvtk_EXPORT AutoCrop
 BBTK_BEGIN_DESCRIBE_BLACK_BOX(AutoCrop,bbtk::AtomicBlackBox);
        BBTK_NAME("AutoCrop");
        BBTK_AUTHOR("Info-Dev");
-       BBTK_DESCRIPTION("Automatique cropping of the image");
+       BBTK_DESCRIPTION("Automatique cropping of the image, (See also ImageBoundaries)");
        BBTK_CATEGORY("Filter");
        BBTK_INPUT(AutoCrop,In,"Input image",vtkImageData*,"");
-       BBTK_INPUT(AutoCrop,Type,"Type of cropping   (default 0)  0=power of two dimensions",int,"");
+       BBTK_INPUT(AutoCrop,Type,"Type of cropping   (default 0)  0=power of two dimensions X and Y",int,"");
        BBTK_OUTPUT(AutoCrop,Out,"Output image",vtkImageData*,"");
 BBTK_END_DESCRIBE_BLACK_BOX(AutoCrop);
 //===== 
index 84cc3d1767f160a8e6fc278c3d45dbbd1a48e855..c789e172c87083486e33867d513a29a5ff40d7f8 100644 (file)
 <vtkobject>vtkConeSource</vtkobject>
 
 <output name="Out"       type="vtkPolyData*" special="vtk output"    description="Output Cone"/>
-<input name="Radius"     type="double"       special="vtk parameter" description="Cone Radius"/>
-<input name="Resolution" type="int"          special="vtk parameter" description="Cone Resolution"/>
-<input name="CenterX"    type="double" description="Center X coord"/>
-<input name="CenterY"    type="double" description="Center Y coord"/>
-<input name="CenterZ"    type="double" description="Center Z coord"/>
-<input name="DirectionX" type="double" description="X Direction"/>
-<input name="DirectionY" type="double" description="Y Direction"/>
-<input name="DirectionZ" type="double" description="Z Direction"/>
+<input name="Radius"     type="double"       special="vtk parameter" description="Cone Radius (default 1)"/>
+<input name="Height"     type="double"       special="vtk parameter" description="Cone height (default 1)"/>
+<input name="Resolution" type="int"          special="vtk parameter" description="Cone Resolution (default 10)"/>
+<input name="CenterX"    type="double" description="Center X coord (default 0)"/>
+<input name="CenterY"    type="double" description="Center Y coord (default 0)"/>
+<input name="CenterZ"    type="double" description="Center Z coord (default 0)"/>
+<input name="DirectionX" type="double" description="X Direction (default 0)"/>
+<input name="DirectionY" type="double" description="Y Direction (default 0)"/>
+<input name="DirectionZ" type="double" description="Z Direction (default 1)"/>
 
 <process>
 <PRE>
 bbGetVtkObject()->SetCenter(bbGetInputCenterX(), 
                            bbGetInputCenterY(), 
                            bbGetInputCenterZ());
-
 bbGetVtkObject()->SetDirection(bbGetInputDirectionX(), 
                                bbGetInputDirectionY(),
-                               bbGetInputDirectionZ());
-                    
+                               bbGetInputDirectionZ());                    
 bbGetVtkObject()->SetResolution(bbGetInputResolution());
 bbGetVtkObject()->SetRadius((double)bbGetInputRadius());
+bbGetVtkObject()->SetHeight((double)bbGetInputHeight());
 bbGetVtkObject()->Update();
 </PRE>
 </process>
 
+<defaultValues>
+<PRE>
+  bbSetInputRadius( 1 );
+  bbSetInputHeight( 1 );
+  bbSetInputResolution( 10 );
+  bbSetInputCenterX( 0 );
+  bbSetInputCenterY( 0 );
+  bbSetInputCenterZ( 0 );
+  bbSetInputDirectionX( 0 );
+  bbSetInputDirectionY( 0 );
+  bbSetInputDirectionZ( 1 );
+</PRE>
+</defaultValues>   
+
+
+
 
 </blackbox>