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

Little Joy joy.king1989 at gmail.com
Wed Nov 21 20:25:37 EST 2012


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.


More information about the Insight-users mailing list