[Insight-users] itk::fem::MaterialLinearElasticity::Read

Luis Ibanez luis . ibanez at kitware . com
Thu, 22 May 2003 10:50:06 -0400


Hi Lara,

Does the program 'aborts' ?

In that case you may be facing an uncaught exception.
It will be helpful to put the Read in between a
try/catch block like

try
{
   ..Read..
}
catch( itk::ExceptionObject & ee )
{
    std::cerr << "Exception caught " << std::endl;
    std::cerr << ee << std::endl;
}
catch( ... )
{
    std::cerr << "Unknown exception caught" << std::endl;
}


The printed message may provide enough information
to figure out the real source of the problem.


In what platform are you running  ?
Could you run in a debugger ?


Please let us know what you find.


   Luis



---------------------------------------
Lara Vigneron wrote:
> Hi Luis,
> 
> Thank you for your suggestion. I try to open the file with your code 
> lines but
> it doesn't seem to change anything...
> 
> Do you think to some other reason my program aborts?
> 
> Thank you,
> 
> Lara
>  
>  
> 
> Luis Ibanez wrote:
> 
>> Hi Lara,
>>
>> Is there any reason for opening the file
>> in the way you are doing now ?
>>
>> A far simpler way may be the following:
>>
>>     std::ifstream  inFile;
>>     inFile.open( matfilename1.c_str() );
>>
>>     if( inFile.fail() ) return -1;
>>
>> and then
>>
>>     mat_1->Read( inFile ,(void*) NULL);
>>
>>     inFile.close();
>>
>> The NULL seems to be ok, since the
>> MaterialLinearElasticity doesn't use
>> this argument in the Read() method.
>>
>> Regards,
>>
>>    Luis
>>  
>>
> -- 
> Lara VIGNERON
> 
> Signal Processing Group
> 
> University of Liege
> Institut Montefiore
> Sart-Tilman, Batiment B28
> B-4000 Liege
> BELGIUM
> 
> Tel: +32-(0)4-366.26.42
> Fax: +32-(0)4-366.29.84
> Lara . Vigneron at ulg . ac . be
> 
>