[Insight-users] Problem when running wiki example ITK/Examples/IO/ImageFileReader

Cory Quammen cquammen at cs.unc.edu
Sat Jun 4 15:34:33 EDT 2011


I found my error.

In my CMakeLists.txt file, I omitted

include( ${ITK_USE_FILE} )

Adding that fixes everything.

Cory

On Fri, Jun 3, 2011 at 11:46 AM, Cory Quammen <cquammen at cs.unc.edu> wrote:
> Bill,
>
> Thanks for trying it.
>
> Am I missing anything obvious?
>
> I've got ITK_AUTOLOAD_PATH set, and DYLD_LIBRARY_PATH set for good
> measure. Adding the library directory to PATH doesn't help.
>
> If I've got all the bases covered, I'll delve deeper to try to figure
> out why the libraries aren't loading.
>
> Thanks,
> Cory
>
> On Fri, Jun 3, 2011 at 11:42 AM, Bill Lorensen <bill.lorensen at gmail.com> wrote:
>> Works for me.
>>
>> Looks like none of the io factories are loaded.
>>
>> On Fri, Jun 3, 2011 at 11:15 AM, Cory Quammen <cquammen at cs.unc.edu> wrote:
>>> When running a slightly modified version of the example at
>>> http://www.itk.org/Wiki/ITK/Examples/IO/ImageFileReader as
>>>
>>> ./ImageFileReader
>>> /Users/cquammen/dev/packages/ITK/Testing/Data/Input/cthead1.bmp
>>>
>>> I get the error:
>>>
>>> terminate called after throwing an instance of 'itk::ImageFileReaderException'
>>>  what():  /Users/cquammen/dev/packages/ITK/Modules/IO/Base/include/itkImageFileReader.txx:144:
>>>  Could not create IO object for file
>>> /Users/cquammen/dev/packages/ITK/Testing/Data/Input/cthead1.bmp
>>>  Tried to create one of the following:
>>>  You probably failed to set a file suffix, or
>>>    set the suffix to an unsupported type.
>>>
>>>
>>>
>>> The exact code I am running is:
>>>
>>> #include "itkImage.h"
>>> #include "itkImageFileReader.h"
>>>
>>> //#include "QuickView.h"
>>>
>>> int main(int argc, char *argv[])
>>> {
>>>  if( argc < 2 )
>>>    {
>>>    std::cerr << "Usage: " << std::endl;
>>>    std::cerr << argv[0] << " inputImageFile" << std::endl;
>>>    return EXIT_FAILURE;
>>>    }
>>>
>>>  typedef itk::Image< double, 2 >         ImageType;
>>>  typedef itk::ImageFileReader<ImageType> ReaderType;
>>>
>>>  ReaderType::Pointer reader = ReaderType::New();
>>>  reader->SetFileName(argv[1]);
>>>  reader->Update();
>>>
>>>  //QuickView viewer;
>>>  //viewer.AddImage<ImageType>(reader->GetOutput());
>>>  //viewer.Visualize();
>>>
>>>  return EXIT_SUCCESS;
>>> }
>>>
>>>
>>>
>>> I am compiling the example against a recent git repository version of ITK:
>>>
>>> commit cd5aba8402fe36654fb457e23a3161fc2fd3a1eb
>>> Merge: 723e12d 213d010
>>> Author: Brad King <brad.king at kitware.com>
>>> Date:   Wed Jun 1 13:01:11 2011 -0400
>>>
>>> System: Mac OS X 10.6.6
>>> Compiler:
>>> i686-apple-darwin10-gcc-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5664)
>>> Copyright (C) 2007 Free Software Foundation, Inc.
>>> This is free software; see the source for copying conditions.  There is NO
>>> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
>>>
>>>
>>>
>>> I've compiled ITK with the following non-default options:
>>>
>>> BUILD_TESTING=OFF
>>> CMAKE_BUILD_TYPE=Debug
>>> ITK_BUILD_ALL_MODULES=ON
>>>
>>>
>>>
>>> I've set the following environment variables:
>>> ITK_AUTOLOAD_PATH="/Users/cquammen/dev/build/ITK-Git-IO-Test/lib/"
>>> DYLD_LIBRARY_PATH="/Users/cquammen/dev/build/ITK-Git-IO-Test/lib/"
>>>
>>>
>>>
>>> ls -1 $ITK_AUTOLOAD_PATH yields
>>>
>>> cmake
>>> libITK-BiasCorrection-4.0.a
>>> libITK-BioCell-4.0.a
>>> libITK-Blox-4.0.a
>>> libITK-Common-4.0.a
>>> libITK-Deprecated-4.0.a
>>> libITK-FEM-4.0.a
>>> libITK-FFT-4.0.a
>>> libITK-IO-BMP-4.0.a
>>> libITK-IO-Base-4.0.a
>>> libITK-IO-BioRad-4.0.a
>>> libITK-IO-GDCM-4.0.a
>>> libITK-IO-GE-4.0.a
>>> libITK-IO-GIPL-4.0.a
>>> libITK-IO-HDF5-4.0.a
>>> libITK-IO-IPL-4.0.a
>>> libITK-IO-JPEG-4.0.a
>>> libITK-IO-LSM-4.0.a
>>> libITK-IO-Meta-4.0.a
>>> libITK-IO-NIFTI-4.0.a
>>> libITK-IO-NRRD-4.0.a
>>> libITK-IO-PNG-4.0.a
>>> libITK-IO-Siemens-4.0.a
>>> libITK-IO-SpatialObjects-4.0.a
>>> libITK-IO-Stimulate-4.0.a
>>> libITK-IO-TIFF-4.0.a
>>> libITK-IO-VTK-4.0.a
>>> libITK-IO-XML-4.0.a
>>> libITK-KLMRegionGrowing-4.0.a
>>> libITK-Mesh-4.0.a
>>> libITK-Optimizers-4.0.a
>>> libITK-Path-4.0.a
>>> libITK-Polynomials-4.0.a
>>> libITK-QuadEdgeMesh-4.0.a
>>> libITK-Review-4.0.a
>>> libITK-SpatialObjects-4.0.a
>>> libITK-Statistics-4.0.a
>>> libITK-Transform-4.0.a
>>> libITK-VNLInstantiation-4.0.a
>>> libITK-VTK-4.0.a
>>> libITK-Watersheds-4.0.a
>>> libITKDICOMParser-4.0.a
>>> libITKEXPAT-4.0.a
>>> libITKMetaIO-4.0.a
>>> libITKNrrdIO-4.0.a
>>> libITKniftiio-4.0.a
>>> libITKznz-4.0.a
>>> libitkNetlibSlatec-4.0.a
>>> libitkgdcmCommon-4.0.a
>>> libitkgdcmDICT-4.0.a
>>> libitkgdcmDSED-4.0.a
>>> libitkgdcmIOD-4.0.a
>>> libitkgdcmMSFF-4.0.a
>>> libitkgdcmjpeg12-4.0.a
>>> libitkgdcmjpeg16-4.0.a
>>> libitkgdcmjpeg8-4.0.a
>>> libitkgdcmuuid-4.0.a
>>> libitkhdf5-4.0.a
>>> libitkhdf5_cpp-4.0.a
>>> libitkjpeg-4.0.a
>>> libitkopenjpeg-4.0.a
>>> libitkpng-4.0.a
>>> libitksys-4.0.a
>>> libitktestlib-4.0.a
>>> libitktiff-4.0.a
>>> libitkv3p_lsqr-4.0.a
>>> libitkv3p_netlib-4.0.a
>>> libitkvcl-4.0.a
>>> libitkvnl-4.0.a
>>> libitkvnl_algo-4.0.a
>>> libitkzlib-4.0.a
>>>
>>>
>>> This should be a piece of cake to get to run. What am I missing?
>>>
>>> By the way, in a different build of the same ITK source file with
>>> BUILD_TESTING on, ITK tests that read images work fine, so I am
>>> stymied.
>>>
>>> Cory
>>>
>>> --
>>> Cory Quammen
>>> Computer Integrated Systems for Microscopy and Manipulation (CISMM)
>>> Department of Computer Science
>>> University of North Carolina at Chapel Hill
>>> http://www.cs.unc.edu/~cquammen
>>> _____________________________________
>>> 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.html
>>>
>>> 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
>>>
>>
>
>
>
> --
> Cory Quammen
> Computer Integrated Systems for Microscopy and Manipulation (CISMM)
> Department of Computer Science
> University of North Carolina at Chapel Hill
> http://www.cs.unc.edu/~cquammen
>



-- 
Cory Quammen
Computer Integrated Systems for Microscopy and Manipulation (CISMM)
Department of Computer Science
University of North Carolina at Chapel Hill
http://www.cs.unc.edu/~cquammen


More information about the Insight-users mailing list