[Insight-users] 回复: AnalyzeImageIO can't work?
Czyhandsome
594125582 at qq.com
Fri Jan 4 07:57:26 EST 2013
Well, I didn't highlight the "ITKV3_COMPATIBILITY" option, that must be the main problem!
As to Visual Studio 2012, I did rebuild the ITK, with the compile "Visual Studio 11" chosed.
Here is the CMake Configuration Log:
//******************CMakeList.txt******************//
See in appendix file
//******************CMakeList.txt******************//
------------------ 原始邮件 ------------------
发件人: "Bill Lorensen-2 [via ITK - Users]"<ml-node+s7n30470h27 at n7.nabble.com>;
发送时间: 2013年1月4日(星期五) 晚上8:50
收件人: "Czyhandsome"<594125582 at qq.com>;
主题: Re: AnalyzeImageIO can't work?
To use the deprecated classes you must turn ITKV3_COMPATIBILITY:BOOL=ON.
But this was also true in itk 4.2.
Did start with a new itk build when you switched to VS 2012?
Can you show us your CMakeLists.txt file?
On Fri, Jan 4, 2013 at 12:57 AM, Czyhandsome <[hidden email]> wrote:
> 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.
> _____________________________________
> 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
_____________________________________
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
If you reply to this email, your message will be added to the discussion below:
http://itk-users.7.n7.nabble.com/AnalyzeImageIO-can-t-work-tp30469p30470.html
To unsubscribe from AnalyzeImageIO can't work?, click here.
NAML
CMakeLists.txt (34K) <http://itk-users.7.n7.nabble.com/attachment/30471/0/CMakeLists.txt>
--
View this message in context: http://itk-users.7.n7.nabble.com/AnalyzeImageIO-can-t-work-tp30471.html
Sent from the ITK - Users mailing list archive at Nabble.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20130104/57b5a1c7/attachment.htm>
More information about the Insight-users
mailing list