[ITK] [ITK-users] ImageIOFactory problem

Soren Christensen sorench at gmail.com
Sun Sep 27 15:06:37 EDT 2015


Hi,

 I gave problems getting  ImageIOFactory to return a valid pointer.


I am trying this:


    itk::ImageIOBase::Pointer imageIO =

            itk::ImageIOFactory::CreateImageIO(

               testfile, itk::ImageIOFactory::ReadMode);


    if( !imageIO )

    {

        std::cerr << "Could not CreateImageIO for: " <<
fn.toStdString().c_str() << std::endl;

        return 1;

    }



I get:

 Could not CreateImageIO for:  /tmp/itk1_014_000.mhd


I can open this file with ITK snap without issues.


When I do this:


    RegisteredObjectsContainerType registeredIOs =

      itk::ObjectFactoryBase::CreateAllInstance( "itkImageIOBase" );

              << registeredIOs.size()

              << " IO objects available to the ImageFileReader.\n" << std::endl;


I get:

16 IO objects available to the ImageFileReader.


I build with Qt/CMake


So what am I missing here?

Thanks in advance!

Soren
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/community/attachments/20150927/1167d6f6/attachment.html>
-------------- next part --------------
_____________________________________
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://public.kitware.com/mailman/listinfo/insight-users


More information about the Community mailing list