[Insight-users] AnalyzeImageIO can't work?

Czyhandsome 594125582 at qq.com
Fri Jan 4 00:57:06 EST 2013


Hi, Bill. I've just updated ITk to 4.3, but to find that class AnalyzeImageIO
can't work properly.
Here is my code:

//*************************Code*************************//
#include <itkImageFileReader.h>
#include <itkImageFileWriter.h>
#include <itkNiftiImageIO.h>

typedef itk::Image<float, 3> ImageType;
typedef itk::ImageFileReader<ImageType> ReaderType;
typedef itk::ImageFileWriter<ImageType> WriterType;

int main()
{
	ReaderType::Pointer reader = ReaderType::New();
	reader->SetFileName("C:\\Users\\dell\\Desktop\\Pictionary\\Basemap.img");
	
	itk::NiftiImageIO::Pointer imageIO = itk::NiftiImageIO::New();
	reader->SetImageIO(imageIO);

	WriterType::Pointer writer = WriterType::New();
	writer->SetInput(reader->GetOutput());

writer->SetFileName("C:\\Users\\dell\\Desktop\\Pictionary\\NewBasemap.img");
	writer->SetImageIO(imageIO);

	try
	{
		reader->Update();
		writer->Update();
	}
	catch(itk::ExceptionObject &err)
	{
		std::cerr << err << std::endl;
	}

	system("pause");
	return 0;
}
//*************************Code*************************//

This code worked very well last night, with visual studio 2008 and ITK-4.2.
But today, after changing to visual studio 2012 and ITK-4.3, this code can't
work, with the following error:

//**************Error**************//
error LNK2019: 无法解析的外部符号 "protected: __thiscall
itk::AnalyzeImageIO::AnalyzeImageIO(void)"
(??0AnalyzeImageIO at itk@@IAE at XZ),该符号在函数 "public: static class
itk::SmartPointer<class itk::AnalyzeImageIO> __cdecl
itk::AnalyzeImageIO::New(void)"
(?New at AnalyzeImageIO@itk@@SA?AV?$SmartPointer at VAnalyzeImageIO@itk@@@2 at XZ)
中被引用	F:\Czy_Program\ITK_Task\ITK_Task\PNGReadWrite.obj	ITK_Task

//**************Error**************//
Why does this happen?

FYI: The itkAnalyzeImageIO.h file is in folder
".\ITK\InsightToolkit-4.3.1\Modules\Compatibility\Deprecated\include". Does
this means that I must check "compatibility" on when CMAKE, otherwise I
can't use those old-version classes?

Looking forward to your reply.
Your sincerely
Cao Ziyu




--
View this message in context: http://itk-users.7.n7.nabble.com/AnalyzeImageIO-can-t-work-tp30469.html
Sent from the ITK - Users mailing list archive at Nabble.com.


More information about the Insight-users mailing list