[ITK-users] Error while reading Unknown Image Information

Matt McCormick matt.mccormick at kitware.com
Mon Mar 16 16:33:00 EDT 2015


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 at gmail.com> wrote:
> Hi Matt,
>
> Thanks for your reply.
>
> I have been using VS 2012. The thing is, the first statement works, so
> try{}catch{} isn't able to find anything. As soon as the program hits
> imageIO->SetFileName() statement, everything breaks. In the debugger mode,
> it throws the Access violation error and the imageIO is basically an
> uninitialized pointer (see image).
>
> <http://itk-insight-users.2283740.n2.nabble.com/file/n7587013/itk-imageIO_error.png>
>
> I have also tried with a raw image but I am getting the same error.
>
> Thanks,
> Sarthak
>
>
> Matt McCormick-2 wrote
>> Hi Sarthak,
>>
>> You may also find this example [1] informative.
>>
>> To investigate the access violation error, use try{}catch{} statements
>> as found in the examples (use it around your
>> imageIO->ReadImageInformation; statement). Also, run the code in a
>> debugger.
>>
>> Hope this helps,
>> Matt
>>
>>
>> [1]
>> http://itk.org/ITKExamples/src/IO/ImageBase/ReadUnknownImageType/Documentation.html?highlight=read
>>
>> On Mon, Mar 16, 2015 at 10:15 AM, Scapegoat Sarthak
>> <
>
>> scapegoat.sarthak@
>
>> > wrote:
>>> Hi All,
>> [snip!]
>>>
>> _____________________________________
>> 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-tp7587007p7587013.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


More information about the Insight-users mailing list