[Insight-users] AnalyzeImageIO can't work?

Bill Lorensen bill.lorensen at gmail.com
Fri Jan 4 07:50:29 EST 2013


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 <594125582 at qq.com> 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


More information about the Insight-users mailing list