Hi,

could you try applying the patch as it is and check if the patched 
imagenavigator plug-in "works"?

Also, what MITK version are you using again?

- Sascha

On 12/08/2013 06:15 PM, Miguel Nunes wrote:
> Hello Sascha,
>
> I have created a new plugin and tried to do the basics of adding the xml 
> resources, but without success.
>
> Maybe it only works in plugins directly connected to MITK. My plugin is in 
> new MITK project that uses my base MITK build as an external MITK.
>
> Is it possible that MITK gets lots somehow by having this structure?
>   
> Best,
> Miguel
>   
> On Friday, December 6, 2013 16:15 CET, Sascha Zelzer 
> <[email protected]> wrote:
>   
>> On 12/05/2013 05:17 PM, Miguel Nunes wrote:
>>> Thanks for going through all that work Sascha.
>>>
>>> My resources vector has size zero, but a name is printed which is the same 
>>> I pass on the line: US_INITIALIZE_MODULE("My Module", "org_proj_plugin")
>> Maybe something is not right in your CMake files then. Looks like the
>> generated resource .cpp file was not compiled into the plug-in's shared
>> library.
>>
>>> I wonder if you could send us your own plugin, sascha, in zip file, so we 
>>> can compare, build and run locally.
>> I attached a patch file where I just added some code to the image
>> navigator plug-in for testing purposes.
>>
>> Best,
>> Sascha
>>
>>> Kind regards,
>>> Miguel
>>>    
>>>    
>>> On Thursday, December 5, 2013 16:23 CET, Sascha Zelzer 
>>> <[email protected]> wrote:
>>>    
>>>> Guys, I just tried it myself and added some interaction xml files to a
>>>> plug-in and instantiate a mitk::DataInteractor and loaded the plug-ins
>>>> xml files. Everything worked okay so far.
>>>>
>>>> @Sebastian I noticed the your config xml file was written differently in
>>>> the files.cmake file and your C++ code.
>>>>
>>>>
>>>> You can list all embedded resources of your plug-in by doing something
>>>> like this:
>>>>
>>>> us::Module* module = us::GetModuleContext()->GetModule();
>>>> std::vector<us::ModuleResource> resources = module->FindResources("/", 
>>>> "*", true);
>>>> for (std::vector<us::ModuleResource>::iterator iter = resources.begin(); 
>>>> iter != resources.end(); ++iter)
>>>> {
>>>>      MITK_INFO << "[" << module->GetName() << "] resource: " << 
>>>> iter->GetResourcePath();
>>>> }
>>>>
>>>>
>>>> - Sascha
>>>>
>>>> On 12/05/2013 03:21 PM, Miguel Nunes wrote:
>>>>> yes, I confirm.
>>>>>
>>>>> Also, on the plugin's ..._resources.cpp fie I can see the xml were found 
>>>>> and generated:
>>>>>
>>>>> static const unsigned char us_resource_data[] = {
>>>>>      // D:\src\* PATH * \resources\Interactions\StatemachineVrvis.xml
>>>>>      0x0,0x0,0x0,0x90,
>>>>>      
>>>>> 0x0,0x0,0x0,0xdd,0x55,0x8f,0x4d,0xa,0x2,0x31,0xc,0x85,0xf7,0x9e,0x22,0xe4,
>>>>>      0x2,0x73,0x81,...,
>>>>>      
>>>>>        // D:\src\ 
>>>>> *PATH*\resources\Interactions\StatemachineVrvisConfig.xml
>>>>>      0x0,0x0,0x0,0xbf,
>>>>>      
>>>>> 0x0,0x0,0x1,0x9c,0x95,0x91,0x41,0xe,0x82,0x40,0xc,0x45,0xf7,0x9e,0xa2,0xb2,
>>>>>      0x27,0x5c,...
>>>>>      
>>>>> };
>>>>>     
>>>>>     
>>>>> On Thursday, December 5, 2013 15:12 CET, Sebastian Ordas 
>>>>> <[email protected]> wrote:
>>>>>     
>>>>>> yes, just like this:
>>>>>>
>>>>>> void QmitkMultiLabelSegmentationView::InitializeListeners()
>>>>>> {
>>>>>>       if (m_Interactor.IsNull())
>>>>>>       {
>>>>>>         us::ModuleContext* moduleContext = us::GetModuleContext();
>>>>>>         m_Interactor = mitk::SegmentationInteractor::New();
>>>>>>         m_Interactor->LoadStateMachine( "SegmentationInteraction.xml",
>>>>>> moduleContext->GetModule());
>>>>>>         m_Interactor->SetEventConfig ( "SegmentationConfig.xml",
>>>>>> moduleContext->GetModule());
>>>>>> us::GetModuleContext()->RegisterService<mitk::InteractionEventObserver>(
>>>>>> m_Interactor.GetPointer(), us::ServiceProperties() );
>>>>>>       }
>>>>>> }
>>>>>>
>>>>>> On 05/12/2013 11:10 a.m., Sascha Zelzer wrote:
>>>>>>> Just to make sure: Did you call LoadStateMachine("...xml",
>>>>>>> GetModuleContext()->GetModule()) using the second argument to provide
>>>>>>> the module instance which contains the embedded xml file?
>>>>>>>
>>>>>>> On 12/05/2013 02:38 PM, Miguel Nunes wrote:
>>>>>>>> Sebastian,
>>>>>>>>
>>>>>>>> I just tested my plugin and I continue without success. The same
>>>>>>>> Error remains in the MITK plugin tab says:
>>>>>>>> "   Part initialization error:
>>>>>>>> D:\src\MITK2013.09.0\Core\Code\Interactions\mitkStateMachineContainer.cpp:73:
>>>>>>>> Resource not valid. State machine pattern not
>>>>>>>> found:StatemachineVrvis.xml "
>>>>>>>>        Do you have any new stuff on this issue?
>>>>>>>>
>>>>>>>> On Thursday, December 5, 2013 13:37 CET, "Miguel Nunes"
>>>>>>>> <[email protected]> wrote:
>>>>>>>>> Hi Sebastian,
>>>>>>>>>
>>>>>>>>> Sorry for taking so long to reply but out of nowhere Poco stopped
>>>>>>>>> working and I am re-buidling the whole MITK framework from scratch,
>>>>>>>>> which takes some hours as u know.
>>>>>>>>>
>>>>>>>>> Comparing my code to yours, I can only say we have exactly the same
>>>>>>>>> thing from all points from 1 to 4, except in dont have the line
>>>>>>>>> Q_EXPORT_PLUGIN2(..., mitk::PluginActivator)
>>>>>>>>>
>>>>>>>>> And since MITK is not ready yet in my machine I cannot test with
>>>>>>>>> this extra line.
>>>>>>>>>
>>>>>>>>> As soon as I am ready, I will email the list.
>>>>>>>>> Best,
>>>>>>>>> Miguel
>>>>>>>>>      On Thursday, December 5, 2013 13:21 CET, Sebastian Ordas
>>>>>>>>> <[email protected]> wrote:
>>>>>>>>>> Hi Miguel,
>>>>>>>>>>
>>>>>>>>>> Are you still stuck on loading the xml files from your plugin?
>>>>>>>>>> Let me know if you have tried the suggestion below. It did not work
>>>>>>>>>> for me
>>>>>>>>>>
>>>>>>>>>> best regards,
>>>>>>>>>> sebastian
>>>>>>>>>>
>>>>>>>>>> On 04/12/2013 02:29 p.m., Sascha Zelzer wrote:
>>>>>>>>>>> Hi,
>>>>>>>>>>>
>>>>>>>>>>> in
>>>>>>>>>>>
>>>>>>>>>>> m_Interactor->LoadStateMachine( "SegmentationInteraction.xml");
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> you are not specifying a module as the second argument. It will
>>>>>>>>>>> default to the "Mitk" module for searching the XML file, which of
>>>>>>>>>>> course doesn't contain it. Use
>>>>>>>>>>>
>>>>>>>>>>> m_Interactor->LoadStateMachine( "SegmentationInteraction.xml",
>>>>>>>>>>> GetModuleContext()->GetModule());
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> instead. The same goes for the SetEventConfig() method call. I agree
>>>>>>>>>>> that the documentation is lacking and the API could be improved...
>>>>>>>>>>>
>>>>>>>>>>> Best,
>>>>>>>>>>>
>>>>>>>>>>> Sascha
>>>>>>>>>> ------------------------------------------------------------------------------
>>>>>>>>>>
>>>>>>>>>> Sponsored by Intel(R) XDK
>>>>>>>>>> Develop, test and display web and hybrid apps with a single code 
>>>>>>>>>> base.
>>>>>>>>>> Download it for free now!
>>>>>>>>>> http://pubads.g.doubleclick.net/gampad/clk?id=111408631&iu=/4140/ostg.clktrk
>>>>>>>>>>
>>>>>>>>>> _______________________________________________
>>>>>>>>>> mitk-users mailing list
>>>>>>>>>> [email protected]
>>>>>>>>>> https://lists.sourceforge.net/lists/listinfo/mitk-users
>>>>>>>>>      --
>>>>>>>>> VRVis Zentrum fuer Virtual Reality und Visualisierung
>>>>>>>>> Forschungs-GmbH                  FN: 195369h, HG Wien
>>>>>>>>> Donau-City-Strasse 1              +43(0)1 20501 30100
>>>>>>>>> A-1220 Wien, Austria        web:<http://www.vrvis.at>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> ------------------------------------------------------------------------------
>>>>>>>>>
>>>>>>>>> Sponsored by Intel(R) XDK
>>>>>>>>> Develop, test and display web and hybrid apps with a single code base.
>>>>>>>>> Download it for free now!
>>>>>>>>> http://pubads.g.doubleclick.net/gampad/clk?id=111408631&iu=/4140/ostg.clktrk
>>>>>>>>>
>>>>>>>>> _______________________________________________
>>>>>>>>> mitk-users mailing list
>>>>>>>>> [email protected]
>>>>>>>>> https://lists.sourceforge.net/lists/listinfo/mitk-users
>>>>>     
>>>    
>   


------------------------------------------------------------------------------
Sponsored by Intel(R) XDK 
Develop, test and display web and hybrid apps with a single code base.
Download it for free now!
http://pubads.g.doubleclick.net/gampad/clk?id=111408631&iu=/4140/ostg.clktrk
_______________________________________________
mitk-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mitk-users

Reply via email to