Hi Marco,

> actually it is intended, but the implementation is improvable. 

I guessed the type of file, which can be written was hard-coded, as in 
CommonFunctionality::SaveSurface. But now I see the corresponding 
SaveImage function is implemented using object factories.

> CommonFunctionality::SaveBaseData asks the CoreObjectFactory for 
> available writer classes if the existing ones don't fit. The mechanism 
> for determining which class "fits" is based on file ending and the 
> actual class of the BaseData, determined by a dynamic_cast and for 
> images also on GetNameOfClass(). What kind of data do you want to save? 

I am mainly interested in saving mitk::Surface / meshes (but possibly a 
subclass in the future), e.g. as OBJ file.

> Is it a subclass of mitk::Surface or just another writer for 
> mitk::Surface? We can clean up the SaveSurface code if it does not work 
> as intended.

For the moment I will add code to write other file types directly in 
SaveSurface.

Thanks for the clarification
Bryn





> 
> For registering your input/output classes you could write a bundle 
> activator which gets executed when the bundle is loaded.
> 
> Best regards,
> 
> Marco
> 
> 
>>
>>
>>
> 
>>
>> Bryn Lloyd wrote:
>>> Hi,
>>>
>>> How can I add new writers or readers to MITK?
>>>
>>> I can imagine it would be simple to add a reader in the directory
>>> mitk/Core/Code/IO/. But then I start adding code to the main source tree
>>> of mitk instead of in my project.
>>>
>>> But how can add a writer/reader as a plugin, which will be found and
>>> loaded by my application (generated by the bundlegenerator)? Is there an
>>> example for such a case?
>>>
>>> Thanks
>>> Bryn
>>>
>>>
>>>
>>> ------------------------------------------------------------------------------
>>>  
>>>
>>> This SF.net email is sponsored by Sprint
>>> What will you do first with EVO, the first 4G phone?
>>> Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
>>> _______________________________________________
>>> mitk-users mailing list
>>> [email protected]
>>> https://lists.sourceforge.net/lists/listinfo/mitk-users
>>>
>>
>>
> 
> 


-- 
-------------------------------------------------
Dr. Bryn Lloyd
Computer Vision Laboratory
ETH Zürich, Sternwartstrasse 7, ETF C110
CH - 8092 Zürich, Switzerland
Tel: +41 44 63 26668
Fax: +41 44 63 21199
-------------------------------------------------

------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
mitk-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mitk-users

Reply via email to