[Insight-developers] Custom header format

Dženan Zukić dzenanz at gmail.com
Fri May 15 04:10:18 EDT 2009


Hi all!

I need to work with a custom 3D image file format. Format is very
simple, and I have started implementing it.

I copied itkNrrdImageIO.cxx, and accompanying header and factory
files, renamed everything to from Nrrd to Dat (including the supported
extension). I also added these files to CMakeLists.txt in Code\IO
folder. I have put something like:

  std::ofstream debug("D:\\debug.txt");
  debug<<"ReadImageInformation()";
  debug.close();

in every function in itkDatImageIO.cxx, but this never gets executed.
When executed without debugging I get error:

This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.

When executed with debugging I get:

Unhandled exception at 0x7c812afb in MyProgram.exe: Microsoft C++
exception: itk::ImageFileReaderException at memory location
0x013af020..

That is a line 164 "InterlockedIncrement(&m_ReferenceCount);" in
itkLightObject.cxx

Where else do I have to "register" my new image format?

Thanks for help,
Dženan Zukić


More information about the Insight-developers mailing list