//===== // 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) //===== #include "bbcreaVtkMagnitudVector.h" #include "bbcreaVtkPackage.h" #include "creaVtk_MACROS.h" #include namespace bbcreaVtk { BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaVtk,MagnitudVector) BBTK_BLACK_BOX_IMPLEMENTATION(MagnitudVector,bbtk::AtomicBlackBox); //===== // 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) //===== void MagnitudVector::Process() { // THE MAIN PROCESSING METHOD BODY // Here we simply set the input 'In' value to the output 'Out' // And print out the output value // INPUT/OUTPUT ACCESSORS ARE OF THE FORM : // void bbSet{Input|Output}NAME(const TYPE&) // const TYPE& bbGet{Input|Output}NAME() const // Where : // * NAME is the name of the input/output // (the one provided in the attribute 'name' of the tag 'input') // * TYPE is the C++ type of the input/output // (the one provided in the attribute 'type' of the tag 'input') // bbSetOutputOut( bbGetInputIn() ); // std::cout << "Output value = " <Delete(); } imageoutput = vtkImageData::New(); imageoutput->Initialize(); imageoutput->SetSpacing( bbGetInputvX()->GetSpacing() ); int dim[3]; int ext[6]; //EED 2017-01-01 Migration VTK7 #if (VTK_MAJOR_VERSION <= 5) bbGetInputvX()->GetWholeExtent(ext ); #endif #if (VTK_MAJOR_VERSION >= 6) bbGetInputvX()->GetExtent(ext ); #endif dim[0]=ext[1]-ext[0]+1; dim[1]=ext[3]-ext[2]+1; dim[2]=ext[5]-ext[4]+1; imageoutput->SetDimensions( dim[0], dim[1], dim[2] ); imageoutput->SetExtent( ext ); //EED 2017-01-01 Migration VTK7 #if (VTK_MAJOR_VERSION <= 5) imageoutput->SetWholeExtent( ext ); imageoutput->SetScalarType( VTK_DOUBLE ); imageoutput->AllocateScalars(); #endif #if (VTK_MAJOR_VERSION >= 6) imageoutput->AllocateScalars( VTK_DOUBLE,1 ); #endif DEF_POINTER_IMAGE_VTK_CREA(vvX,ssvX,pvX,stvX,bbGetInputvX() ) DEF_POINTER_IMAGE_VTK_CREA(vvY,ssvY,pvY,stvY,bbGetInputvY() ) DEF_POINTER_IMAGE_VTK_CREA(vvZ,ssvZ,pvZ,stvZ,bbGetInputvZ() ) DEF_POINTER_IMAGE_VTK_CREA(vOut,ssOut,pOut,stOut,imageoutput ) long int i, size=dim[0]*dim[1]*dim[2]; long int k1omp=(double)(size-1)*0.0; long int k2omp=(double)(size-1)*0.2; long int k3omp=(double)(size-1)*0.4; long int k4omp=(double)(size-1)*0.6; long int k5omp=(double)(size-1)*0.8; long int k6omp=(double)(size-1)*1.0; printf("EED MagnitudVector::Process (with openmp)\n"); #pragma omp parallel for for (i=0; i