[Insight-users] ImageIO or FILeReader or FIleWrite's problem,
Miller, James V (Research)
millerjv at crd . ge . com
Mon, 30 Jun 2003 16:56:01 -0400
If you put a try/catch around the writer->Update() call,
you can catch the exception and print out the debugging information.
An exception will be thrown if the file cannot be written to (i.e. the
directory is write protected, etc.)
> -----Original Message-----
> From: Shunming Fang [mailto:shunm_fang at yahoo . com]
> Sent: Monday, June 30, 2003 4:53 PM
> To: insight-users at itk . org
> Subject: [Insight-users] ImageIO or FILeReader or FIleWrite's problem,
>
>
> Hello, itk_users:
> Thank your guys about smartpointer problem, that
> problem seems to be solved in my itkWrapFilter
> program, but another problem happen when I test this
> program, there is a segmentation when
> writer->Update().my code is similar to the fallowing:
> in main(0 function, I do the following thing:
> itk::ImageIOBase::Pointer inputImageIO;
> itk::ImageIOBase::Pointer outputImageIO;
> then, according to input file format and output file
> format:
> inputImageIO = itk::SpecificImageIO::New();
> outputImageIO = itk::SpecificImageIO::New();
> .
> .
> reader->setImageIO(inputImageIO);
> writer->setImageIO(outputImageIO);
> .
> .
> outputImage = itkWrapFilters(reader->GetOutput());
> writer->SetInput(outputImage);
> writer->Update();
>
>
> I use ddd to debug it, the segmentation happen in
> writer->Update() when the input and output file format
> is the same, I wander may there are some problems in
> declaring both inout and output ImageIO, anybody have
> some idea how to fix it?
> Thanks
> Fang
>
> __________________________________
> Do you Yahoo!?
> SBC Yahoo! DSL - Now only $29.95 per month!
> http://sbc . yahoo . com
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk . org
> http://www . itk . org/mailman/listinfo/insight-users
>