<html><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><META name="Author" content="Novell GroupWise WebAccess"></head><body style='font-family: Tahoma, sans-serif; font-size: 13px; '>Hi All,<br><br>I am trying to use ITK to register (non-rigidly) some mammographic images. I have downloaded and compiled version 4 of ITK, and it compiles fine (compiled 32 bit version on a Win 7 64 bit system, using Visual Studio 2008). I have been looking at the DeformableRegistration16 example, it runs fine when I pass it my two dicom file inputs and specify the outputs. I have not yet assessed the quality of the registration, but visually it looks reasonably close for a first try.<br><br>My problems began when I tried to incorporate this example into a simple dialog based MFC program. I learned quickly that unicode is a problem (once I could get a compiled program) so I switched to multi-byte characters, that took care of some issues I had using CStrings. I was first getting a compile error for the itkNewMacro( Self ); statement in the Command Observer classes:<br><br>error C2660: 'itk::LightObject::operator new' : function does not take 3 arguments<br><br>Not sure what to make of that, I don't see three arguments being passed in that Macro. So, I took out the Command Observers to see if I could get it to compile at least. Compilation finished, with only one warning:<br><br>1>c:\insighttoolkit-4.0.0\modules\io\imagebase\include\itkimagefilereader.hxx(440) : warning C4996: 'std::copy': Function call with parameters that may be unsafe - this call relies on the caller to check that the passed values are correct. To disable this warning, use -D_SCL_SECURE_NO_WARNINGS. See documentation on how to use Visual C++ 'Checked Iterators'<br>1> c:\program files (x86)\microsoft visual studio 9.0\vc\include\xutility(2550) : see declaration of 'std::copy'<br>1> c:\insighttoolkit-4.0.0\modules\io\imagebase\include\itkimagefilereader.hxx(353) : while compiling class template member function 'void itk::ImageFileReader<TOutputImage>::GenerateData(void)'<br>1> with<br>1> [<br>1> TOutputImage=ImageType<br>1> ]<br>1> c:\visual studio 2008\projects\registrationapp\registrationapp\registrationappdlg.cpp(327) : see reference to class template instantiation 'itk::ImageFileReader<TOutputImage>' being compiled<br>1> with<br>1> [<br>1> TOutputImage=ImageType<br>1> ]<br><br>The program would run, but would crash when the targetReader->Update(); was called for the first time. I stepped into that to try to see where the error was occuring. I saw that in itkImageFileReader.hxx the call to this->TestFileExistanceAndReadability(); executes without error, so it can see the file and open it. However, the call to m_ImageIO = ImageIOFactory::CreateImageIO(this->GetFileName().c_str(), ImageIOFactory::ReadMode); fails, which I'm guess may be related to the compiler errors and warning noted above. When I step into CreateImageIO, the second line is std::list< LightObject::Pointer > allobjects =<br> ObjectFactoryBase::CreateAllInstance("itkImageIOBase");. When this returns, allobjects is empty, which I'm guessing is a symptom of the problem. Following this statement, there is a loop to iterate through the items in allobjects, but none of the statements in the loop executes since allobjects is empty. I am using the exact same files as for the stand alone example, so I know that ITK can open these images.<br><br>I tried copying some of the preprocesser directives from the example (lots of ...._NO_DEPRECATE items there, thought that might be it) but there is no change in the behavior. The big difference I see is that the example uses standard C libraries and I am using MFC in a shared DLL.<br>Maybe I have some other compilation or link setting wrong in my application, can anyone offer any suggestions as to how to get around this? I have used ITK (and VTK) in an MFC app several years ago (earlier versions of everything) with no problems like this, so maybe there is something different in Visual Studio 2008 vs 2005? Thanks for any advice. <br><br>Kent Ogden<br><br><br><br/><div style='clear: both;'>********************************<br>Kent Ogden PhD<br>Associate Professor, Radiology<br>SUNY Upstate Medical University<br>750 E. Adams Street<br>Syracuse, NY 13210<br><br>email: ogdenk@upstate.edu <br>voice: (315) 464-5083<br>fax: (315) 464-2570<br>*********************************</div><br/></body></html>