// bbSetOutputOut( bbGetInputIn() );
// std::cout << "Output value = " <<bbGetOutputOut() << std::endl;
- if (bbGetInputwxContourMainFrame()!=NULL)
+
+ if (bbGetInputPosition().size()==3 )
{
- if (bbGetInputPosition().size()==3 )
+ int x = bbGetInputPosition()[0];
+ int y = bbGetInputPosition()[1];
+ int z = bbGetInputPosition()[2];
+ if ((backX!=x) || (backY!=y) || (backZ!=z) ) // this prevent to finish contour before start :-)
{
- double slice;
- int x = bbGetInputPosition()[0];
- int y = bbGetInputPosition()[1];
- int z = bbGetInputPosition()[2];
- vtkImageData *img = bbGetInputwxContourMainFrame()->getImageData();
- int ext[6];
- img->GetExtent(ext);
- int dimY=ext[3]-ext[2]+1;
- if (bbGetInputDirection()==0)
- {
- slice = z;
- slice = round( slice/bbGetInputJump() ) * bbGetInputJump() + bbGetInputShift();
- bbGetInputwxContourMainFrame()->setConceptValue( "Axe Depth", slice );
- bbGetInputwxContourMainFrame()->SetXY(x,y);
- } // if Direction1
-
- if (bbGetInputDirection()==1)
+ if (bbGetInputwxContourMainFrame()!=NULL)
{
- slice = y;
- slice = round( slice/bbGetInputJump() ) * bbGetInputJump() + bbGetInputShift();
- bbGetInputwxContourMainFrame()->setConceptValue( "Axe Depth", slice );
- bbGetInputwxContourMainFrame()->SetXY(x,dimY-z-1);
- } // if Direction1
-
- if (bbGetInputDirection()==2)
- {
- slice = x;
- slice = round( slice/bbGetInputJump() ) * bbGetInputJump() + bbGetInputShift();
- bbGetInputwxContourMainFrame()->setConceptValue( "Axe Depth", slice );
- bbGetInputwxContourMainFrame()->SetXY(dimY-z-1,y);
- } // if Direction1
+ double slice;
+ vtkImageData *img = bbGetInputwxContourMainFrame()->getImageData();
+ int ext[6];
+ img->GetExtent(ext);
+ int dimY=ext[3]-ext[2]+1;
+ if (bbGetInputDirection()==0)
+ {
+ slice = z;
+ slice = round( slice/bbGetInputJump() ) * bbGetInputJump() + bbGetInputShift();
+ bbGetInputwxContourMainFrame()->setConceptValue( "Axe Depth", slice );
+ bbGetInputwxContourMainFrame()->SetXY(x,y);
+ } // if Direction1
+ if (bbGetInputDirection()==1)
+ {
+ slice = y;
+ slice = round( slice/bbGetInputJump() ) * bbGetInputJump() + bbGetInputShift();
+ bbGetInputwxContourMainFrame()->setConceptValue( "Axe Depth", slice );
+ bbGetInputwxContourMainFrame()->SetXY(x,dimY-z-1);
+ } // if Direction1
- bbGetInputwxContourMainFrame()->showAxis(true);
- bbGetInputwxContourMainFrame()->changeInstant();
- bbGetInputwxContourMainFrame()->RefreshInterface();
- }
- }
+ if (bbGetInputDirection()==2)
+ {
+ slice = x;
+ slice = round( slice/bbGetInputJump() ) * bbGetInputJump() + bbGetInputShift();
+ bbGetInputwxContourMainFrame()->setConceptValue( "Axe Depth", slice );
+ bbGetInputwxContourMainFrame()->SetXY(dimY-z-1,y);
+ } // if Direction1
+ bbGetInputwxContourMainFrame()->showAxis(true);
+ bbGetInputwxContourMainFrame()->changeInstant();
+ bbGetInputwxContourMainFrame()->RefreshInterface();
+ backX=x;
+ backY=y;
+ backZ=z;
+ } // if bbGetInputPosition
+ } // if bbGetInputwxContourMainFrame
+ } // if backX backY backZ
}
//=====
// SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX
// Here we initialize the input 'In' to 0
- bbSetInputDirection(0);
- bbSetInputJump(1);
- bbSetInputShift(0);
- bbSetInputwxContourMainFrame(NULL);
+ bbSetInputDirection(0);
+ bbSetInputJump(1);
+ bbSetInputShift(0);
+ bbSetInputwxContourMainFrame(NULL);
+
+ backX=-9999;
+ backY=-9999;
+ backZ=-9999;
}
//=====