[Insight-users] read an image from a file

Dženan Zukić dzenanz at gmail.com
Tue Jul 19 11:08:44 EDT 2011


Or you can configure ITK not to use DLLs, and avoid this issue altogether.

HTH

On Tue, Jul 19, 2011 at 16:51, John Drescher <drescherjm at gmail.com> wrote:

> On Tue, Jul 19, 2011 at 10:21 AM, JOJOW <jieqiong.wang17 at gmail.com> wrote:
> >    I compiled itk in  vs2008. There is a problem in the example of itk.
> The
> > code is
> > #include "itkImage.h"
> > #include "itkImageFileReader.h"
> > int main( int , char * argv[])
> > {
> > typedef unsigned char          PixelType;
> > const unsigned int             Dimension = 3;
> >
> > typedef itk::Image< PixelType, Dimension >   ImageType;
> > typedef itk::ImageFileReader< ImageType >  ReaderType;
> > ReaderType::Pointer reader = ReaderType::New();
> > const char * filename ="mprage_noface.nii";
> > reader->SetFileName( filename );
> > reader->Update();
> > ImageType::Pointer image = reader->GetOutput();
> >
> > return 0;
> > }
> >
> > If I choose release mode, the result is correct. But If I choose debug
> mode,
> > when the code run to reader->update(), there is an error:
> > Unhandled exception at 0x00ae7ca0 in *.exe: 0xC0000005: access conflict
> > occours when read  location 0xcccccccc
> >
> > I don't know what's wrong!
> >
>
> When you built ITK did you install it using the INSTALL target? If so
> that is your problem. The reason is you can not mix debug and release
> libraries in the same application. In visual studio Debug and Release
> have different incompatible memory heaps. So you must build all for
> Release or Debug and not mix the two.
>
> John
> _____________________________________
> 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.html
>
> 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-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20110719/20026b3e/attachment.htm>


More information about the Insight-users mailing list