[ITK Community] [Insight-developers] What triggers instantiation of all ImageIO libraries?

Bradley Lowekamp blowekamp at mail.nih.gov
Thu Nov 21 14:30:43 EST 2013


Kent,

If you explicitly don't use the implicit ITK auto registration by defining ITK_NO_IO_FACTORY_REGISTER_MANAGER to true[1], before including "ITK_USE_FILE" in cmake, your factories don't get registered.

Look for a files called itkImageIOFactoryRegisterManager.h  and itkTransformIOFactoryRegisterManager.h in a directory called ITKIOFactoryRegistration in build trees that use ITK.

These file are automatically generated based on the ITK IO modules turned on. Some times you can just copy that file and use it. Otherwise there is some funny cmake stuff will need to be done.

It also may be easiest to just call YourImageIOFactor::RegisterOnFactory(), if you just need a couple know one registered.


[1] https://github.com/SimpleITK/SimpleITK/blob/master/Code/BasicFilters/src/CMakeLists.txt#L11

On Nov 21, 2013, at 1:56 PM, "Williams, Norman K" <norman-k-williams at uiowa.edu> wrote:

> I'm in the process of using ITK in a C++ MEX Matlab extension.
> 
> I solved the linking issues, but I ran into an interesting problem:  When
> the MEX extension gets called, the ImageIOFactory instances have not yet
> been registered. Is there a function I need to call before I use ImageIO?
> 
> --
> Kent Williams norman-k-williams at uiowa.edu
> 
> 
> 
> 
> 
> 
> ________________________________
> Notice: This UI Health Care e-mail (including attachments) is covered by the Electronic Communications Privacy Act, 18 U.S.C. 2510-2521, is confidential and may be legally privileged.  If you are not the intended recipient, you are hereby notified that any retention, dissemination, distribution, or copying of this communication is strictly prohibited.  Please reply to the sender that you have received the message in error, then delete it.  Thank you.
> ________________________________
> _______________________________________________
> Powered by www.kitware.com
> 
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
> 
> Kitware offers ITK Training Courses, for more information visit:
> http://kitware.com/products/protraining.php
> 
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
> 
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-developers

_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html

Kitware offers ITK Training Courses, for more information visit:
http://kitware.com/products/protraining.php

Please keep messages on-topic and check the ITK FAQ at:
http://www.itk.org/Wiki/ITK_FAQ

Follow this link to subscribe/unsubscribe:
http://www.itk.org/mailman/listinfo/insight-developers



More information about the Community mailing list