Hi Andreas, thanks for the answer!
I am trying to access the RenderWindow, but the function you mentioned returns a vtkRenderWindow* vector and not a mitk::RenderWindow* one, and those do not know anything about navigation controllers. Maybe through the StdMultiWidget? I keep on trying... Best, Miklos On Thu, Jul 28, 2011 at 10:52 AM, Fetzer, Andreas <[email protected]> wrote: > 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 ------------------------------------------------------------------------------ BlackBerry® DevCon Americas, Oct. 18-20, San Francisco, CA The must-attend event for mobile developers. Connect with experts. Get tools for creating Super Apps. See the latest technologies. Sessions, hands-on labs, demos & much more. Register early & save! http://p.sf.net/sfu/rim-blackberry-1 _______________________________________________ mitk-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/mitk-users
