(dimZImage==dimZMask))
{
long int i, size = dimXImage * dimYImage * dimZImage;
+ DEF_POINTER_IMAGE_VTK_CREA(vI,ssI,pI,stI, bbGetInputImage() );
+ DEF_POINTER_IMAGE_VTK_CREA(vM,ssM,pM,stM, bbGetInputMask() );
+ DEF_POINTER_IMAGE_VTK_CREA(vO,ssO,pO,stO, resultImage );
+
+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 ApplyMask::Process (with openmp)\n");
#pragma omp parallel for
for (i=0; i<size;i++)
{
- DEF_POINTER_IMAGE_VTK_CREA(vI,ssI,pI,stI, bbGetInputImage() );
- DEF_POINTER_IMAGE_VTK_CREA(vM,ssM,pM,stM, bbGetInputMask() );
- DEF_POINTER_IMAGE_VTK_CREA(vO,ssO,pO,stO, resultImage );
- GETVALUE2_VTK_CREA(vM,pM,stM,i);
+if ( (k1omp==i) || (k2omp==i) || (k3omp==i) ||
+ (k4omp==i) || (k5omp==i) || (k6omp==i) ) { printf(" %d%\n", (int)(((double)i/(double)(size-1))*100 )); }
+ double vItmpOMP;
+ double vMtmpOMP;
+ double vOtmpOMP;
+ GETVALUE2_VTK_CREA(vMtmpOMP,pM,stM,i);
if (bbGetInputType()==0) //Applay mask to new Image
{
- GETVALUE2_VTK_CREA(vI,pI,stI,i);
- if (vM!=bgToAnalice)
+ GETVALUE2_VTK_CREA(vItmpOMP,pI,stI,i);
+ if (vMtmpOMP!=bgToAnalice)
{
- vO = vI;
+ vOtmpOMP = vItmpOMP;
} else {
- vO = background;
+ vOtmpOMP = background;
} // if vM
- SETVALUE2_VTK_CREA(vO,pO,stO,i);
+ SETVALUE2_VTK_CREA(vOtmpOMP,pO,stO,i);
} // if Type==0
if (bbGetInputType()==1) //Modifiy the Input image with the Label value in Mask place
{
- if (vM!=bgToAnalice)
+ if (vMtmpOMP!=bgToAnalice)
{
- vO = bbGetInputLabel();
- SETVALUE2_VTK_CREA(vO,pO,stO,i);
+ vOtmpOMP = bbGetInputLabel();
+ SETVALUE2_VTK_CREA(vOtmpOMP,pO,stO,i);
}
} // if Type==1
if (bbGetInputType()==2) //Modifiy the Input image with the Mask value
{
- if (vM!=bgToAnalice)
+ if (vMtmpOMP!=bgToAnalice)
{
- vO = vM;
- SETVALUE2_VTK_CREA(vO,pO,stO,i);
+ vOtmpOMP = vMtmpOMP;
+ SETVALUE2_VTK_CREA(vOtmpOMP,pO,stO,i);
}
} // if Type==2
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];
-#pragma omp parallel for
+
+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<size; i++)
{
- GETVALUE2_VTK_CREA(vvX,pvX,stvX,i)
- GETVALUE2_VTK_CREA(vvY,pvY,stvY,i)
- GETVALUE2_VTK_CREA(vvZ,pvZ,stvZ,i)
- if ( (vvX==0) && (vvY==0) &&(vvZ==0) )
+if ( (k1omp==i) || (k2omp==i) || (k3omp==i) ||
+ (k4omp==i) || (k5omp==i) || (k6omp==i) ) { printf(" %d%\n", (int)(((double)i/(double)(size-1))*100 )); }
+ double vvXtmpOMP;
+ double vvYtmpOMP;
+ double vvZtmpOMP;
+ GETVALUE2_VTK_CREA(vvXtmpOMP,pvX,stvX,i)
+ GETVALUE2_VTK_CREA(vvYtmpOMP,pvY,stvY,i)
+ GETVALUE2_VTK_CREA(vvZtmpOMP,pvZ,stvZ,i)
+ if ( (vvXtmpOMP==0) && (vvYtmpOMP==0) &&(vvZtmpOMP==0) )
{
SETVALUE2_VTK_CREA( 0 ,pOut,stOut,i)
} else {
- SETVALUE2_VTK_CREA( sqrt(vvX*vvX + vvY*vvY + vvZ*vvZ),pOut,stOut,i)
+ SETVALUE2_VTK_CREA( sqrt(vvXtmpOMP*vvXtmpOMP + vvYtmpOMP*vvYtmpOMP + vvZtmpOMP*vvZtmpOMP) ,pOut,stOut,i)
} // if vvX vvY vvZ != 0
} // for i
//=====
void MultipleOperations::Process()
{
-printf("EED MultipleOperations::Process Start\n");
// THE MAIN PROCESSING METHOD BODY
// Here we simply set the input 'In' value to the output 'Out'
// And print out the output value
int dimXImage = extImage[1]-extImage[0]+1;
int dimYImage = extImage[3]-extImage[2]+1;
int dimZImage = extImage[5]-extImage[4]+1;
- int iLst,sizeLst= bbGetInputInLst().size();
if (bbGetOutputOut()!=NULL)
{
bbGetOutputOut()->Delete();
resultImage->SetDimensions( dimXImage, dimYImage, dimZImage );
resultImage->AllocateScalars( bbGetInputInLst()[0]->GetScalarType(),1 );
long int index,size=dimXImage*dimYImage*dimZImage;
+ DEF_POINTER_IMAGE_VTK_CREA(vOut,ssOut,pOut,stOut,resultImage )
if (bbGetInputType()==20)
{
- DEF_POINTER_IMAGE_VTK_CREA(vIn ,ssIn ,pIn ,stIn ,bbGetInputInLst()[0] )
- DEF_POINTER_IMAGE_VTK_CREA(vOut,ssOut,pOut,stOut,resultImage )
- double vInBack,acumDiff;
-// #pragma omp parallel for
+
+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 MultipleOperations::Process (with openmp)\n");
+#pragma omp parallel for
for (index=0;index<size;index++)
{
+if ( (k1omp==index) || (k2omp==index) || (k3omp==index) ||
+ (k4omp==index) || (k5omp==index) || (k6omp==index) ) { printf(" %d%\n", (int)(((double)index/(double)(size-1))*100 )); }
+
+ DEF_POINTER_IMAGE_VTK_CREA(vIn ,ssIn ,pIn ,stIn ,bbGetInputInLst()[0] )
+ int iLst,sizeLst= bbGetInputInLst().size();
+ double vInBack,acumDiff;
acumDiff=0;
for (iLst=0;iLst<sizeLst;iLst++) // volumes
{
} // if Type==20
bbSetOutputOut( resultImage );
} // if InLst size
-printf("EED MultipleOperations::Process End\n");
-
}
//=====
// 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)
BBTK_DESCRIPTION("No Description.");
BBTK_CATEGORY("empty");
BBTK_INPUT(MultipleOperations,InLst,"List input images ",std::vector<vtkImageData*>,"");
- BBTK_INPUT(MultipleOperations,Type,"(default 0) 0, 20 diff ",int,"");
+ BBTK_INPUT(MultipleOperations,Type,"(default 0) 0, 20 average-difference ",int,"");
BBTK_OUTPUT(MultipleOperations,Out,"Output image",vtkImageData*,"");
BBTK_END_DESCRIBE_BLACK_BOX(MultipleOperations);
//=====