[Insight-users] Error:vtkImageImport (049D0AE8)

Bill Lorensen bill.lorensen at gmail.com
Wed Nov 21 20:30:02 EST 2012


I'll bet you are not using cmake to configure your project.

Why not?

On Wed, Nov 21, 2012 at 8:25 PM, Little Joy <joy.king1989 at gmail.com> wrote:
> Hi, everyone.
> I'm a a fresh user in VTK and ITK. I am trying to build ITK 4.2.1 , InApp
> 4.2.0, VTK 5.10.1 with cmake 2.8.10 and Visual Studio 2008 under 32-bit
> Windows XP. I test it with the following code and it build successfully.
> Unfortunately it generated a executable error like this:
>
> ERROR: In ..\..\VTK5.10.1\Imaging\vtkImageImport.cxx, line 337
> vtkImageImport (049D0AE8): Calling UpdateInformationCallback:
> d:\i_vtkitk\itk\package\include\itk-4.2\itkimagefilereader.hxx:143:
>  Could not create IO object for file
> D:\I_VtkItk\ITK\InsightToolkit-4.2.1\Wrapping\images\ThresholdSegmentationLevelSetWhiteMatterTest.png.md5
>   Tried to create one of the following:
>   You probably failed to set a file suffix, or
>     set the suffix to an unsupported type.
>
> Here is my test code:
>
> #include "stdafx.h"
> #include "itkImage.h"
> #include "itkImageFileReader.h"
> #include "itkImageToVTKImageFilter.h"
> #include "vtkImageViewer.h"
> #include "vtkRenderWindowInteractor.h"
> #include "vtkImageActor.h"
> #include "vtkRenderer.h"
> #include "vtkRenderWindow.h"
> #include <iostream>
>
> using namespace std;
>
>
> int _tmain(int argc, _TCHAR* argv[])
> {
>         typedef itk::Image<unsigned short,2> ImageType;
>         typedef itk::ImageFileReader<ImageType> ReaderType;// 文件读取器
>         typedef itk::ImageToVTKImageFilter<ImageType> ConnectorType;// VTK与ITK链接器
>
>         ReaderType::Pointer reader= ReaderType::New();
>         ConnectorType::Pointer connector= ConnectorType::New();
>
> reader->SetFileName("D:\\I_VtkItk\\ITK\\InsightToolkit-4.2.1\\Wrapping\\images\\ThresholdSegmentationLevelSetWhiteMatterTest.png.md5");
>         connector->SetInput(reader->GetOutput());
>
>         vtkImageActor *actor = vtkImageActor::New();
>         actor->SetInput(connector->GetOutput());
>         vtkRenderer * ren = vtkRenderer::New();
>         ren->AddActor(actor);
>         vtkRenderWindow *renWin = vtkRenderWindow::New();
>         renWin->AddRenderer(ren);
>
>         vtkImageViewer* viewer= vtkImageViewer::New();
>         // 绘制窗口交互器
>         vtkRenderWindowInteractor*
> renderWindowInteractor=vtkRenderWindowInteractor::New();
>         viewer->SetInput( connector->GetOutput() );
>         viewer->SetupInteractor( renderWindowInteractor);
>         viewer->SetColorWindow( 255);
>         viewer->SetColorLevel( 128);
>         viewer->Render();
>         renderWindowInteractor->Initialize();
>         renderWindowInteractor->Start();
>
>         return 0;
> }
>
> I really have no idea why this happened what I should do. Could anyone help
> me?
>
>
>
>
>
> --
> View this message in context: http://itk-insight-users.2283740.n2.nabble.com/Error-vtkImageImport-049D0AE8-tp7581715.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://www.itk.org/mailman/listinfo/insight-users



-- 
Unpaid intern in BillsBasement at noware dot com


More information about the Insight-users mailing list