[ITK-dev] Missing IO factories when building without cmake
Jim Miller
millerjv at gmail.com
Tue Apr 1 14:04:57 EDT 2014
Is there a way at build time whether we could whether an executable does not have any imageio factories linked in?
Jim
> On Apr 1, 2014, at 1:52 PM, Bill Lorensen <bill.lorensen at gmail.com> wrote:
>
> I was just trying to reduce the number of times this question comes up
> on the users list.
>
> I'll abandon the patch.
>
> On Tue, Apr 1, 2014 at 5:55 AM, Miller, James V (GE Global Research)
> <millerjv at ge.com> wrote:
>> I think Brad has the right theme here.
>>
>> The issue is not a "user error". It is not a runtime error caused by user not doing something correctly. For instance, it is not like the user forgot to give a filename an extension and therefore we couldn't figure out what format to use to write a file.
>>
>> Rather, the issue is a "build error". The developer created an executable that has no means to use the ITK IO factories.
>>
>> So it would be good to catch this at compile time rather than runtime.
>>
>> Jim
>>
>>
>>
>> -----Original Message-----
>> From: Insight-developers [mailto:insight-developers-bounces at itk.org] On Behalf Of Bradley Lowekamp
>> Sent: Tuesday, April 01, 2014 8:39 AM
>> To: Bill Lorensen
>> Cc: Insight Developers
>> Subject: Re: [ITK-dev] Missing IO factories when building without cmake
>>
>> Bill,
>>
>> I think including code in an exception message is a mistake. This information is clearly geared to some one developing an ITK program.
>>
>> I think it would be better to have a wiki page or a FAQ entry with what needs to be done to fix when there are no ImageIO factories registered. Then is exception message can just refer to that.
>>
>> Also there is the case when a developer using CMake did not correctly include the ITK_USE_FILE, we were getting a of those issues with ITK v4.0 first came out.
>>
>> Additionally, the user would have to register all the ImageIO, and TransformIO files. I have previously recommend copying the itkImageIOFactoryRegisterManager.h and the itkTransformIOFactoryRegisterManager.h files form the ITK build directory into the project to perform the factory registration.
>>
>> So my question, I thought some of the information was already in the WIKI some place? Anyone know where? Also the FAQ[1] looks unmaintained. Is this not a useful resource the community should help keep up to date? Is there a better location for this type of information?
>>
>> Brad
>>
>> [1] http://www.itk.org/Wiki/ITK/FAQ
>>
>>> On Mar 31, 2014, at 7:32 PM, Bill Lorensen <bill.lorensen at gmail.com> wrote:
>>>
>>> Folks,
>>>
>>> We have recently seen a couple of users who build their ITK apps
>>> without cmake. When they try to read or write images they get a
>>> message like this:
>>> Description: Could not create IO object for file foo.png Tried to
>>> create one of the following:
>>> You probably failed to set a file suffix, or
>>> set the suffix to an unsupported type.
>>>
>>> I submitted a gerrit patch:
>>> http://review.source.kitware.com/#/c/14909/
>>>
>>> to provide a better description of the exception:
>>>
>>> Description: Could not create IO object for writing file foo.img
>>> Tried to create one of the following:
>>> There are no registered IO factories. You probably built your project
>>> without using cmake You can register the IO factories you need with:
>>> #include "itkXXXImageIOFactory.h"
>>> itk::XXXImageIOFactory::RegisterOneFactory();
>>> where XXX is e.g. Nifti, PNG, Meta...
>>> #include "itkNiftImageIOFactory.h"
>>> itk::NiftiImageIOFactory::RegisterOneFactory();
>>> _______________________________________________
>>> 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
>
>
>
> --
> Unpaid intern in BillsBasement at noware dot com
> _______________________________________________
> 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 Insight-developers
mailing list