[Insight-users] Reading TIFFs with external libraries

Luis Ibanez luis.ibanez at kitware.com
Thu Sep 8 20:56:11 EDT 2005


Hi Brian,

You may want to try one of the following options


0) Are you linking with ITKIO.lib ?
    if so... that will explains why you get the itktiff
    libraries, since ITKIO depends by default on tiff.
    This is done in order to offer tiff as one of the
    fileformats that can be read by default.
    If you remove ITKIO.lib from your link line, the
    itktiff library should disapear too.


OR

1) Build ITK with ITK_USE_SYSTEM_TIFF
    and then point to the TIFF libraries from ImageMagick.


OR

2) Identify the symbols that are being mixed up between
    the ITK tiff library and the ImageMagick tiff library,
    then add those symbols to the name-mangling file:

            Insight/Utilities/tiff
                       itk_tiff_mangle.h

     we use this file in order to avoid collisions between
     the TIFF functions in itktiff and those that can come
     from other libraries that also provide TIFF, such as
     VTK or FLTK.


Please let us know if any of these options work for you.


    Thanks


      Luis



----------------
Brian Eastwood wrote:
> Hi All,
> 
> I have started using ImageMagick for reading images into my application 
> because it works for many tiff images that ITK's readers will not read.  
> So, loading data into an ITK pipeline consists of reading the image with 
> ImageMagick, copying the image data into a buffer, and sending that 
> buffer to an ITK importer.  So, I'm not using an ITK ImageReader.
> 
> I have come across a problem, however, in which the ITK tiff libraries 
> still appear in the image reading on certain projects.  This error only 
> occurs when reading tiff images.  Is there any way around this?  It 
> looks like I get a write access violation exception in memcpy.asm, 
> called from the ITK tiff library.  A stack trace is:
> 
>     msvcr71d.dll!memcpy(unsigned char * dst=0x00a10050, unsigned char * 
> src=0x00a0f080, unsigned long count=1552)  Line 171    Asm
>     ImageTracker.exe!itk__TIFFmemcpy(void * d=0x00a10050, void * const 
> s=0x00a0f080, long c=1552)  Line 272 + 0x11    C
>  >    ImageTracker.exe!DumpModeEncode(tiff * tif=0x0009b240, unsigned 
> char * pp=0x00a0f080, long cc=92718280, unsigned short s=45632)  Line 56 
> + 0x17    C
>     ImageTracker.exe!TIFFStartStrip(tiff * tif=0x00a10050, unsigned long 
> strip=458787)  Line 554 + 0x7    C
>     ImageTracker.exe!TIFFSeek(tiff * tif=0x00000184, unsigned long 
> row=28232436, unsigned short sample=0)  Line 69 + 0x7    C
>     ImageTracker.exe!TIFFReadScanline(tiff * tif=0x0009b240, void * 
> buf=0x0586c4c8, unsigned long row=0, unsigned short sample=0)  Line 101 
> + 0x13    C
>     ImageTracker.exe!ReadTIFFImage(const _ImageInfo * 
> image_info=0x009753c1, _ExceptionInfo * exception=0x026722b0)  Line 826 
> + 0xe    C
>     ImageTracker.exe!ReadImage(const _ImageInfo * image_info=0x00a10050, 
> _ExceptionInfo * exception=0x00a0f080)  Line 443 + 0xc    C
> 
> The first Insight code is tif_dumpmode.c (DumpModeEncode); up until that 
> point, the code is ImageMagick.  Any ideas?
> 
> Thanks,
> Brian
> 



More information about the Insight-users mailing list