Hi all,

In the "Image Navigator" the current axial slice number is shown and can be
adapted. I'm creating my own Plugin for MITK and would like to get the
total number of slices in the image, get the current axial slice number and
then change the axial slice number to a different one. I'm using the
default "Display" view to render the images. However I am unsure how to do
this. What I have tried is:

mitk::DataStorage::Pointer storage = this->GetDataStorage();
QmitkRenderWindow renderWindow;
renderWindow.GetRenderer();

  mitk::SliceNavigationController::Pointer sliceNaviController =
renderWindow->GetSliceNavigationController();
const unsigned int newSlice = 55;

if(sliceNaviController){
    mitk::Stepper::Pointer stepper = sliceNaviController->GetSlice();
    const unsigned int numberOfSlices = stepper->GetSteps();
    const unsigned int sliceNumber = stepper->GetPos();
    sliceNaviController->GetSlice()->SetPos(newSlice);
  }

First question is, how can I access the renderer for the Display? I suppose
it is not correct the way I have done above, since I get 0 for the
numberOfSlices. And could you give me feedback about accessing axial slice
numbers?

Thank you very much.
Best,
Andrea
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
mitk-users mailing list
mitk-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mitk-users

Reply via email to