[Insight-users] file reader
Gwenaël Guillard
gwenael.guillard@enst-bretagne.fr
Mon, 13 Jan 2003 17:07:14 +0100
--------------BA6FC48D30AEC5758CAB326B
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
Luis,
The message is
Access violation - no RITI data!
Thanks
Gwenael
Luis Ibanez a écrit :
> Hi Gwenael
>
> Please print out the expression returned by the exception.
>
> This will let you know what kind of problem prevents the
> file from being read.
>
> Your try/catch exception should look like
>
> try
> {
> Load( filename );
> }
> catch( itk::ExceptionObject & ecp )
> {
> std::cerr << "Exception caught" << std::endl;
> std::cerr << ecp << std::endl;
> }
> catch(...)
> {
> std::cerr << "Unknown exception caught !" << std::endl;
> }
>
> Also, note that you no longer need to create the
> MetaImageIO object nor set it to the reader. Now the
> image filename extension is used to figure out what
> kind of ImageIO object to use. As long as you use
> ".mha" or ".mhd" the reader will be able to find its
> way.
>
> Creating the MetaImageIO is only needed if you want
> to select specific options of this format.
>
> Please let us know what you find in the error message
> of the exception.
>
> Thanks
>
> Luis
>
> ------------------------------------------
>
> Gwenaël Guillard wrote:
>
> > Hi,
> >
> > Thank you for your answer. You are right, the Update( ) is after but the
> > problem is still there. It seems that the Update( ) method send an
> > exception
> > The code is
> >
> >
> > In the main method
> >
> >
> > try
> > {
> > Load( filename );
> > }
> > catch( ... )
> > {
> > fl_message("Problem reading the files");
> > }
> >
> >
> > In Load( ) Method
> >
> >
> > VolumeReaderType::Pointer Reader = VolumeReaderType::New();
> >
> > itk::MetaImageIO::Pointer metaImageIO = itk::MetaImageIO::New();
> > Reader->SetImageIO( metaImageIO );
> >
> > Reader->SetFileName( filename );
> > printf("avant GetOutput\n");
> >
> > PixelType width, height;
> > width =
> > Reader->GetOutput()->GetLargestPossibleRegion().GetSize()[0];
> > height =
> > Reader->GetOutput()->GetLargestPossibleRegion().GetSize()[1];
> >
> > Reader->Update();
> > printf("after Update()\n");
> >
> >
> > It never writes "after Update()" but it shows the alert message. I'm
> > able to get width and height (0 for both because the update is not done
> > yet as you said). So the problem is when the update is called. I try my
> > data on gaussianFilter and there wasn't any problem.
> >
> > Gwenael
> >
> >
--
-----------------------------------------------------------
Gwenael Guillard
Doctorant
Departement Image et Traitement de l'Information (ITI)
LAboratoire de Traitement de l'Information Medicale (LATIM) - INSERM ERM 0102
ENST Bretagne
Technopole Brest Iroise
BP 832 - 29285 Brest Cedex
Tel : 02 29 00 13 01
email : gwenael.guillard@enst-bretagne.fr, g.guillard@ieee.org
--------------BA6FC48D30AEC5758CAB326B
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
Luis,
<p>The message is
<br> Access violation - no RITI data!
<p>Thanks
<p>Gwenael
<br>
<br>
<br>
<p>Luis Ibanez a écrit :
<blockquote TYPE=CITE>Hi Gwenael
<p>Please print out the expression returned by the exception.
<p>This will let you know what kind of problem prevents the
<br>file from being read.
<p>Your try/catch exception should look like
<p> try
<br> {
<br> Load( filename );
<br> }
<br> catch( itk::ExceptionObject & ecp )
<br> {
<br> std::cerr << "Exception caught" << std::endl;
<br> std::cerr << ecp << std::endl;
<br> }
<br> catch(...)
<br> {
<br> std::cerr << "Unknown exception caught !" <<
std::endl;
<br> }
<p>Also, note that you no longer need to create the
<br>MetaImageIO object nor set it to the reader. Now the
<br>image filename extension is used to figure out what
<br>kind of ImageIO object to use. As long as you use
<br>".mha" or ".mhd" the reader will be able to find its
<br>way.
<p>Creating the MetaImageIO is only needed if you want
<br>to select specific options of this format.
<p>Please let us know what you find in the error message
<br>of the exception.
<p> Thanks
<p> Luis
<p>------------------------------------------
<p>Gwenaël Guillard wrote:
<p>> Hi,
<br>>
<br>> Thank you for your answer. You are right, the Update( ) is after
but the
<br>> problem is still there. It seems that the Update( ) method send an
<br>> exception
<br>> The code is
<br>>
<br>>
<br>> In the main method
<br>>
<br>>
<br>> try
<br>> {
<br>>
Load( filename );
<br>> }
<br>> catch(
... )
<br>> {
<br>>
fl_message("Problem reading the files");
<br>> }
<br>>
<br>>
<br>> In Load( ) Method
<br>>
<br>>
<br>> VolumeReaderType::Pointer
Reader = VolumeReaderType::New();
<br>>
<br>> itk::MetaImageIO::Pointer
metaImageIO = itk::MetaImageIO::New();
<br>> Reader->SetImageIO(
metaImageIO );
<br>>
<br>> Reader->SetFileName(
filename );
<br>> printf("avant
GetOutput\n");
<br>>
<br>> PixelType
width, height;
<br>> width
=
<br>> Reader->GetOutput()->GetLargestPossibleRegion().GetSize()[0];
<br>> height
=
<br>> Reader->GetOutput()->GetLargestPossibleRegion().GetSize()[1];
<br>>
<br>> Reader->Update();
<br>> printf("after
Update()\n");
<br>>
<br>>
<br>> It never writes "after Update()" but it shows the alert message.
I'm
<br>> able to get width and height (0 for both because the update
is not done
<br>> yet as you said). So the problem is when the update is called. I
try my
<br>> data on gaussianFilter and there wasn't any problem.
<br>>
<br>> Gwenael
<br>>
<br>></blockquote>
<pre>--
-----------------------------------------------------------
Gwenael Guillard
Doctorant
Departement Image et Traitement de l'Information (ITI)
LAboratoire de Traitement de l'Information Medicale (LATIM) - INSERM ERM 0102
ENST Bretagne
Technopole Brest Iroise
BP 832 - 29285 Brest Cedex
Tel : 02 29 00 13 01
email : gwenael.guillard@enst-bretagne.fr, g.guillard@ieee.org</pre>
</html>
--------------BA6FC48D30AEC5758CAB326B--