[Insight-users] Adding custom extension to MetaIO

Dženan Zukić dzenanz at gmail.com
Wed Aug 11 08:58:15 EDT 2010


Hi,

what is the proper way to add custom extension support to one of the
image io classes? Approximately what I need is something like:
itk::MetaIO.AddSupportedReadExtension('.xxx');
somewhere in my constructor. Images with .xxx extension would be
renamed .mha files.

Adding support for new image io class is done with:
itk::ObjectFactoryBase::RegisterFactory( MyImageIOFactory::New() );
//MyImageIO implemented

Wrong way to do this is to change the source code in
\InsightToolkit-3.20.0\Code\IO\itkMetaImageIO.cxx (add new extension
on line 50), because I would have to modify that same file each time
new version comes out.

Thanks,
Dženan


More information about the Insight-users mailing list