[Insight-developers] Plugin IO objects
Miller, James V (Research)
millerjv at crd.ge.com
Wed May 4 10:10:12 EDT 2005
I tracked down the issue of the plugins being loaded multiple times.
My version of ITK was built static. My new file format was built static. My plugin is of course a dynamic library.
The existing precompile application and my plugin ended up with separate ObjectFactory classes. The application loaded the plugins when the first object in the application was allocated. The plugin loaded the plugins a second time when the first object in the plugin was allocated.
This resulted in two ObjectFactories that were configured identically. This is probably not a problem. However, it would be better if the ITK application and any new file formats to be loaded dynamically are built share.
I update the Wiki page with a similar discussion.
Jim
-----Original Message-----
From: insight-developers-bounces at itk.org
[mailto:insight-developers-bounces at itk.org]On Behalf Of Miller, James V
(Research)
Sent: Monday, May 02, 2005 10:36 AM
To: Insight-developers (E-mail)
Subject: [Insight-developers] Plugin IO objects
On the TCON Friday, I brought up a proposed extension for providing dynamic loadable libraries for new file formats. The goal was to have a mechanism whereby a new image file format could be introduced to a pre-compiled application. This would avoid having to call RegisterFactory() within your application for IO formats that are not registered by default, or are not part of ITK, and it would avoid having to change the IO factories that are registered by default.
Bill Hoffman said this capability already exists in the ObjectFactories and a similar approach could be taken in ImageIOFactory. (For various reasons too complicated to describe here, ImageIOFactory is not derived from ObjectFactory.) It turns out, however, Bill was smarter when he wrote the dynamic ObjectFactory capability than he remembered himself being. The capability in ObjectFactory can be used directly without modification. This is largely due to the format specific IOFactories being subclasses on ObjectFactory.
I put together a Wiki page http://www.itk.org/Wiki/Plugin_IO_mechanisms that describes how to create a dynamic shared library that any existing ITK application will load as part of the default ObjectFactory mechanism, allow new file formats to be used by existing precompiled ITK applications.
There are few things that need to be worked out. It looks like the plugins are loaded multiple times. The Wiki page will be modified to reflect any changes that need to be made by people writing plugins.
Jim Miller
_____________________________________
Visualization & Computer Vision
GE Research
Bldg. KW, Room C218B
1 Research Circle, Schenectady NY 12309-1027
millerjv at reserch.ge.com <mailto:millerjv at reserch.ge.com>
(518) 387-4005, Dial Comm: 8*833-4005
Cell: (518) 505-7065, Fax: (518) 387-6981
_______________________________________________
Insight-developers mailing list
Insight-developers at itk.org
http://www.itk.org/mailman/listinfo/insight-developers
More information about the Insight-developers
mailing list