Hi Stefan,

that is a very nice problem description (especially the github link) :-)

Your meta-data looks fine in principle, but please see my comments below to avoid future problems.

The reason why your plugin fails to load is because mitkStandaloneDataStorage throws an exception at line 64, while your code in QmitkImageRegistrationView::CreateQtPartControl(QWidget*) is executed. The exception message is printed in the output, second line:


"Unable to create view ID org.mitk.views.imageregistration
Part initialization error: Node is already in DataStorage
- Check your shared library for unresolved symbols
- Check your class attribute in your plugin.xml file"
Check your manifest.cp file"


Set a breakpoint at mitkStandaloneDataStorage:64 and debug your program to find the offending line in your code.

My plugin.xml seems to be correct:
<?xml version="1.0" encoding="UTF-8"?>
<?BlueBerry version="0.1"?>
<plugin>
<extension point="org.blueberry.ui.views">
<view id="org.mitk.views.imageregistration"
          name="ImageRegistration"
          class="::QmitkImageRegistrationView"
          icon="resources/icon.xpm" />
</extension>

</plugin>


This is formally correct. However, your really should use your own reverse URL naming scheme for ids. "org.mitk.views.imageregistration" is not use by MITK right now (I just checked), but could be in the future. Always use something specific to your project, like "de.irma.views.imageregistration"!

I have a class called QmitkImageRegistrationView, too.
In my view's .cpp file it says const std::string QmitkImageRegistrationView::VIEW_ID = "org.mitk.views.imageregistration";

Actually, this variable is not used when loading your view class (since it is not yet loaded, we cannot access the variable...). It is used if you want to manipulate specific views and need the id (which you should not hard-code).

The file manifest.cpp uses POCO_EXPORT_CLASS(::QmitkImageRegistratinView), which matches my class.

Dependency walker can find every DLL apart from 2 non-critical windows 7 DLLs (error reporting DLL wer.dll for example, don't remember the other), after adding the DLL search paths. E.g.:

class MITKEXT_CORE_EXPORT BaseRegistration : public ImageToImageFilter

That macro isn't defined for me while building in Visual Studio C++ 2008. So I simply did
#include "mitkImageRegistrationMacros.h"
#ifndef MITKEXT_CORE_EXPORT
#define MITKEXT_CORE_EXPORT
#endif

Could that have broken anything? I've never seen this macro before either.

Never ever do that! It worked for you for now, but could lead to nasty errors later. The whole code seems to be copied from MITK itself, but if you are creating your own shared library (plugin), you must also use your own import/export macros. Otherwise, the import/export specifiers are getting mixed up when you start to use code from other MITK libraries (QmitkExt, modules, plugins, etc.).

In your plugin source tree, you have a file called "ImageregistrationDll.h". It properly declares import/export macros specifically for your plugin, so replace all occurences of MITKEXT_CORE_EXPORT with IMAGEREGISTRATION_EXPORT.


Thanks for your help!

Your are welcome,

Sascha
------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
mitk-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mitk-users

Reply via email to