Hi Miklos,
Sorry for the late answer.
If you want to access a certain slice you have to do that via the
SliceNavigationController (SNC) of a certain BaseRenderer.
You are currently using the SNC of the RenderingManager which just has
informations about the timestep (which is gobally the same for all
BaseRenderers)
The slicenumber on the other hand depends on the different RenderWindow. E.g.
if you want to get the selected slice of the transversal window you have to
access the SNC of the transversal BaseRenderer:
RenderWindow->GetRenderer()->GetSNC()->GetSlice()->GetPos() should work.
You could try to access a single RenderWindow by calling the
RenderingManager->GetAllRegisteredRenderWindows ()function.
Regards
Andreas
Von: Miklos Espak [mailto:[email protected]]
Gesendet: Montag, 27. Juni 2011 10:33
An: mitk-users
Betreff: [mitk-users] Query the selected slice and time step
Hi,
I added an action to the Data Manager view, from which I have to access the
selected slice and time step of the currently shown image.
The code is the following:
mitk::SliceNavigationController* timeNavigationController =
mitk::RenderingManager::GetInstance()->GetTimeNavigationController();
mitk::Stepper* timeStepper = timeNavigationController->GetTime();
unsigned timeStep = timeStepper->GetPos();
mitk::Stepper* sliceStepper = timeNavigationController->GetSlice();
unsigned slice = sliceStepper->GetPos();
MITK_INFO << "time position: " << timeStep << std::endl;
MITK_INFO << "slice position: " << slice << std::endl;
However, it does not work well. The returned time step is correct, but for the
slice I always get zero. Is this the intended behavior from the side of MITK?
If yes, what is the way of accessing the selected slice?
Thank you,
Miklos Espak
------------------------------------------------------------------------------
Got Input? Slashdot Needs You.
Take our quick survey online. Come on, we don't ask for help often.
Plus, you'll get a chance to win $100 to spend on ThinkGeek.
http://p.sf.net/sfu/slashdot-survey
_______________________________________________
mitk-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mitk-users