On 06/29/2010 09:54 AM, Bryn Lloyd wrote: > answering my question myself, this does not seem to be intended. To add > a writer for a specific type of data (e.g. surface) I would have to add > the writer code in CommonFunctionality. > Hi Bryn,
actually it is intended, but the implementation is improvable. The 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? 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. > I guess a writer can be a plugin functionality like any other operation. > It will just not be integrated as nicely into the application (select > data in data manager, press Save as ... with a list of acceptable file > types). > > Cheers > 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 >> > > -- ---------------------------------------------------------------------- Dipl.-Inform. Med. Marco Nolden Deutsches Krebsforschungszentrum (German Cancer Research Center) Div. Medical & Biological Informatics Tel: (+49) 6221-42 2325 Im Neuenheimer Feld 280 Fax: (+49) 6221-42 2345 D-69120 Heidelberg eMail: [email protected] ------------------------------------------------------------------------------ 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
