[ITK-users] Error while reading Unknown Image Information

Matt McCormick matt.mccormick at kitware.com
Mon Mar 16 10:50:09 EDT 2015


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 at gmail.com> wrote:
> Hi All,
>
> I am trying to read information from different images using the Unknown
> Image Type Example
> (http://itk.org/Wiki/ITK/Examples/IO/ReadUnknownImageType) but I am getting
> an Access violation error. The three main lines of code (which compile
> without issues) I am using are:
>
> itk::ImageIOBase::Pointer imageIO =
> itk::ImageIOFactory::CreateImageIO(argv[3], itk::ImageIOFactory::ReadMode );
> imageIO->SetFileName(std::string(argv[3]));
> imageIO->ReadImageInformation();
>
> I am getting the error in the second line. I am using CMake to generate
> project files as described in the example so the include directories and
> libraries are all taken care of. I tried to read different files (.nii,
> .dcm, .png, .jpg) but all of them give the same error.
>
> Any suggestions regarding what I am doing wrong?
>
> Thanks in advance,
> Sarthak
>
> _____________________________________
> 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