[ITK] [ITK-users] Error while reading Unknown Image Information

Matt McCormick matt.mccormick at kitware.com
Tue Mar 17 09:27:02 EDT 2015


Hi Sarthak,

It looks like a good improvement.

The ImageIO's classes for the different file formats must be
registered to the factory.  When using CMake to configure your
project, this is done automatically.  When not using CMake, it must be
done manually.  Are you using CMake to configure your project?

HTH,
Matt

On Tue, Mar 17, 2015 at 9:14 AM, scap3y <scapegoat.sarthak at gmail.com> wrote:
> Hi Matt,
>
> Thanks for your reply.
>
> I am checking for a null pointer like this:
>
> *if ( imageIO )
> {
>   imageIO->SetFileName(argv[3]);
>   imageIO->ReadImageInformation();
> }
> else
> {
>   std::cout <<"Could not read the input image information from '" << argv[3]
> << "'\n";
> } *
>
> And it is going into the "else" loop after the CreateImageIO step. What I am
> not able to understand is that why is this the case. Does CreateImageIO have
> restrictions? If so, what are they? I have tried reading 2D images in JPG,
> PNG, DCM, NII formats and 3D images in DCM and NII formats. It fails in all
> of them.
>
> Best,
> Sarthak
>
>
> Matt McCormick-2 wrote
>> Hi Sarthak,
>>
>> You will need to check that CreateImageIO does not generate a null
>> pointer.  If none of the registered ImageIO classes can read the given
>> file path, it will return a null pointer [1].
>>
>> HTH,
>> Matt
>>
>> [1]
>> http://itk.org/gitweb?p=ITK.git;a=blob;f=Modules/IO/ImageBase/src/itkImageIOFactory.cxx;h=638775873847ad8c4017a85f0992de9f4dee7161;hb=HEAD#l63
>>
>> On Mon, Mar 16, 2015 at 11:18 AM, scap3y <
>
>> scapegoat.sarthak@
>
>> > wrote:
>>> Hi Matt,
>>>
>>> Thanks for your reply.
>> [snip!]
>>> Follow this link to subscribe/unsubscribe:
>>> http://public.kitware.com/mailman/listinfo/insight-users
>> _____________________________________
>> 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://www.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://public.kitware.com/mailman/listinfo/insight-users
>
>
>
>
>
> --
> View this message in context: http://itk-insight-users.2283740.n2.nabble.com/ITK-users-Error-while-reading-Unknown-Image-Information-tp7587007p7587018.html
> Sent from the ITK Insight Users mailing list archive at Nabble.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://www.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://public.kitware.com/mailman/listinfo/insight-users
_____________________________________
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://www.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://public.kitware.com/mailman/listinfo/insight-users


More information about the Community mailing list