[Insight-users] Problem with using itkImageFileWriter or itkImageFileReader after ITKv4 migration

Bc. Michal Srna michal at srna.info
Thu Apr 7 14:22:47 EDT 2011


Hello,

I have moved from ITK 3.20 to latest ITKv4 (from GIT) because I needed some
features of GDCM 2.0. I use ITK only for reading/writing DICOM and .tiff
images and some filtration routines.

It seems, that everything works well after migration except the part of
writing 3D volume to single .dcm file via itkImageFileWriter. My program
crashes, when performing this part of code located in
itkImageFileWriter.txx. It stops on line "throw e;"

  if ( m_ImageIO.IsNull() )
    {
    ImageFileWriterException e(__FILE__, __LINE__);
    std::ostringstream       msg;
    msg << " Could not create IO object for file "
        << m_FileName.c_str() << std::endl;
    msg << "  Tried to create one of the following:" << std::endl;
      {
      std::list< LightObject::Pointer > allobjects =
        ObjectFactoryBase::CreateAllInstance("itkImageIOBase");
      for ( std::list< LightObject::Pointer >::iterator i =
allobjects.begin();
            i != allobjects.end(); ++i )
        {
        ImageIOBase *io = dynamic_cast< ImageIOBase * >( i->GetPointer() );
        msg << "    " << io->GetNameOfClass() << std::endl;
        }
      }
    msg << "  You probably failed to set a file suffix, or" << std::endl;
    msg << "    set the suffix to an unsupported type." << std::endl;
    e.SetDescription( msg.str().c_str() );
    e.SetLocation(ITK_LOCATION);
    throw e;
    }

Don't know, where could be the problem, on ITK 3.20 it normally saved data
in 3D DICOM volume file.

I figured out, that very similar problem I get when reading .tiff files via
itkImageFileReader. When reading DICOM series via itkImageSeriesReader.h I
have no problems.

I compiled ITK in Debug mode in MVSC++ and I used CMake.

Thanks for any help!

-- 
S pozdravem Bc. Michal Srna

Fotografické portfolio:
http://michalsrna.cz
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20110407/44e2dcc3/attachment.htm>


More information about the Insight-users mailing list