[Insight-users] installation problem with Borland compiler

Luis Ibanez luis.ibanez at kitware.com
Sun Sep 17 14:08:02 EDT 2006


Hi Jean-Francois,

Thanks for posting your code.

This is an intriguing problem.


The fact that it works fine for you when you call Write()
and it doesn't when you call Update() is troublesome,
because the implementation of Update() is in


              Insight/Code/IO
                  itkImageFileWriter.h


in lines 143-144:


            virtual void Update()
                      {this->Write();}


So there is no reason for Write() and Update() to
behave differently.


It rather leads to suspect that the compilation
of the code with Borland has not been done
consistently.  For example, you may have had
a first build of ITK, then updated the source
tree, and only partially rebuild the toolkit.


We build ITK nightly and continuously (hourly during
daytime) with the Borland compiler and have not seen
this problem before. That make us suspect that it is
a matter of a configuration or a build problem in your
local installation.


The only thing that I could suggest at this point is
that you *delete* the binary directory of ITK and
rebuild it from scratch.


If the problem persist after rebuilding ITK, then
we will have to ask for your help to trace it with
a debugger.


If you rebuild ITK with Examples OFF and Testing OFF,
it should only take about 20 minutes to complete the
build. Also, please don't use SHARED libraries, that
may also be a source of problems.


Please let us know how it goes after your rebuild ITK.



     Thanks


        Luis



----------------------------
Jean-Francois goudou wrote:
> Hi Luis,
> 
> 
> Here is the code of the last test I made :
> 
> *************************************************************
> #include <iostream>
> #include "itkPNGImageIO.h"
> #include "itkImageFileReader.h"
> #include "itkImageFileWriter.h"
> #include "itkImage.h"
> 
> int main( int argc, char * argv[] )
> {
>  if( argc < 3 )
>    {
>    std::cerr << "Usage: " << std::endl;
>    std::cerr << argv[0] << " inputImageFile  outputImageFile " << 
> std::endl;
>    return EXIT_FAILURE;
>    }
> 
>  typedef unsigned char                              PixelType;
>  const   unsigned int                            Dimension = 2;
>  typedef itk::Image< PixelType, Dimension > ImageType;
> 
>  itk::PNGImageIO::Pointer io;
>  io = itk::PNGImageIO::New();
> 
>  typedef itk::ImageFileReader< ImageType >  ReaderType;
>  ReaderType::Pointer reader = ReaderType::New();
>  reader->SetFileName( argv[1]  );
>  reader->SetImageIO(io);
>  reader->Update();
> 
> 
>  typedef itk::ImageFileWriter< ImageType >  WriterType;
>  WriterType::Pointer writer = WriterType::New();
>  writer->SetFileName( argv[2] );
> 
>  ImageType::Pointer img = reader->GetOutput();
>  writer->SetImageIO(io);
> 
>  try
>   {
>      writer->Update();
>   }
>  catch(...)
>   {
>   std::cout << "Erreur 1" << std::endl;
>   }
> 
>  //writer->SetInput( img );
>  //try
>  // {
>  //    writer->Update();
>  // }
>  //catch(...)
>  // {
>  // std::cout << "Erreur 2" << std::endl;
>  // }
>  return EXIT_SUCCESS;
> }
> ******************************************************
> 
> The message I receive is :
> Erreur 1
> 
> When I use the other try-catch part, with writer->SetInput(img), I 
> receive the message :
> Erreur 2
> 
> in the code ItkPNGImageIOTest, the last command is :
> writer->Write() instead of writer->Update();
> and it works properly.
> 
> Therefore my conclusions :
> * The exceptions are well handled
> * writer->update() doesn't work properly.
> 
> Can you give me some further tests on writer->update ?
> 
> Thank you !
> Jeff
> 
> 
> 
> 




More information about the Insight-users mailing list