Dear Pierre-Yves,
My apologies for coming back after so many months back to you; the priority of
the plugin functionalities I am developing have been re-ordered, and thus I am
only now working back on that issue.
Thank you very much for the indications.
However, I have an issue with making my plugin class inherit from the
mitk::IRenderWindowPartListener.
My compiler (VC 2010, 64bit) is complaining that it cannot instantiate abstract
class (error C2259).
I just modified my *.h from
class pluginClass : public QmitkAbstractView
to
class pluginClass: public QmitkAbstractView, public
mitk::IRenderWindowPartListener
and added #include <mitkIRenderWindowPartListener.h>
Any idea of why I get this error? I don’t see what is the problem, as similar
to the ‘ImageNavigator’ plugin.
Thank you for the support,
Best,
Hortense
Hortense KIRISLI
Research & Development Engineer
[AQUILAB Logo]
AQUILAB SAS
Parc Eurasanté - Lille Métropole
Biocentre A. Fleming - Bât.A
250 rue Salvador Allende
59120 Loos - France
Tel. +33 3 69 61 51 51
Fax +33 3 69 61 51 50
www.aquilab.com<http://www.aquilab.com/>
De : [email protected] [mailto:[email protected]] De la part de Pierre-Yves Menguy
Envoyé : vendredi 18 juillet 2014 18:06
À : Hortense KIRISLI
Cc : mitk-users [[email protected]]
Objet : Re: [mitk-users] Plugin event on slice navigator change
Hello Hortense,
To achieve that, I drew inspiration from MITK's "Image Navigator" plugin
(org.mitk.gui.qt.imagenavigator).
I made my plugin's class inherit from "mitk::IRenderWindowPartListener" (class
PluginClass : public QmitkAbstractView, public mitk::IRenderWindowPartListener)
To implement this interface you'll need to create both method stubs :
void RenderWindowPartDeactivated(mitk::IRenderWindowPart *);
void RenderWindowPartActivated(mitk::IRenderWindowPart *);
You'll also need a "Refetch()" slot (from Qt), which is the one to receive
"slice changed" event.
On "PartActivated", you'll set-up connections :
if ( !renderWindowPart )
return;
QmitkRenderWindow* renderWindow =
renderWindowPart->GetQmitkRenderWindow("axial");
if (!renderWindow)
return;
m_SNC = renderWindow->GetSliceNavigationController();
m_Adapter = new QmitkStepperAdapter(this,
m_SNC->GetSlice(),
"sliceNavigatorAxialFromSimpleExample"); // don't know if the name really
matters.
connect(m_Adapter, SIGNAL(Refetch()), this, SLOT(Refetch()));
On "PartDeactivated", you'll need to remove connections, delete objects, etc.
Fun part : it is inverted for the slice number. To find it, you had to dig
inside "QmitkSliderNavigatorWidget".
Resulting in :
unsigned int numSlice = m_Stepper->GetSteps()-1u-m_Stepper->GetPos();
Good luck,
Pierre-Yves Menguy.
On 18 July 2014 15:11, Hortense KIRISLI
<[email protected]<mailto:[email protected]>> wrote:
Hi all,
In a plugin, I have a method (taking the current slice index as input) that I
would like to be executed on change of slice.
I could not manage to understand how to do so, thus any hint on how I should
specify this connection/listener would be appreciated!
Best,
Hortense
----
Hortense KIRISLI, PhD
Research & Development Engineer
AQUILAB
Parc Eurasanté – Lille Métropole
Bâtiment Hermès
250 rue Salvador Allende
59120 Loos Les Lille - France
Tel. +33 3 69 61 51 65<tel:%2B33%203%2069%2061%2051%2065>
www.aquilab.com<http://www.aquilab.com>
[AQUILAB]
----
------------------------------------------------------------------------------
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck
Code Sight - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds
_______________________________________________
mitk-users mailing list
[email protected]<mailto:[email protected]>
https://lists.sourceforge.net/lists/listinfo/mitk-users
------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk
_______________________________________________
mitk-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mitk-users