[Insight-users] ImageReader problem when ImageIO is set

Mathieu Malaterre mathieu.malaterre at gmail.com
Mon Jun 4 03:15:18 EDT 2007


Hi Tomáš,

  Could you please send me (privately) a copy of this problematic
DICOM file ? BTW can you specify the system you are using (OS,
compiler version...).

Thanks
-Mathieu

On 6/3/07, Tomáš Kazmar <Tomash.Kazmar at seznam.cz> wrote:
> Hi,
>
>   I need to read a dicom image using a ImageFileReader with imageIO set
> to an instance of GDCMImageIO. The problem is that when the image is
> corrupted the process just dies (due to a segfault in ImageFileReader::Update()).
> IMHO, this is not a correct behavior which could be something like throwing
> an exception. Does anyone know how to solve this?
>
>
> Regards,
> Tomas
>
>
> Here is a minimal example to reproduce the error:
>
> #include <itkImage.h>
> #include <itkImageFileReader.h>
> #include <itkGDCMImageIO.h>
>
> typedef unsigned char PixelIOType;
> typedef itk::Image<PixelIOType, 3>       ImageType;
> typedef itk::GDCMImageIO                 ImageIOType;
> typedef itk::ImageFileReader<ImageType>  ReaderType;
>
> int main(int argc, char* argv[])
> {
>     ReaderType::Pointer reader = ReaderType::New();
>     reader->SetFileName("corrupted_dicom_file");
>     ImageIOType::Pointer dicomIO = ImageIOType::New();
>     reader->SetImageIO(dicomIO);
>
>     try {
>         reader->Update();
>     } catch (itk::ExceptionObject &ex) {
>         std::cout << ex << std::endl;
>         return EXIT_FAILURE;
>     }
>
>     return EXIT_SUCCESS;
> }
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
>


-- 
Mathieu


More information about the Insight-users mailing list