- bbGetInputwxContourMainFrame()->setConceptValue( "Axe Depth", y );
- bbGetInputwxContourMainFrame()->SetXY(x,dimY-z-1);
- } // if Direction1
-
- if (bbGetInputDirection()==2)
- {
- bbGetInputwxContourMainFrame()->setConceptValue( "Axe Depth", x );
- bbGetInputwxContourMainFrame()->SetXY(dimY-z-1,y);
- } // if Direction1
-
-
- bbGetInputwxContourMainFrame()->showAxis(true);
- bbGetInputwxContourMainFrame()->changeInstant();
- bbGetInputwxContourMainFrame()->RefreshInterface();
- }
- }
+ 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
+
+ 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