[Insight-developers] New file types added to Code/IO

Luis Ibanez luis.ibanez@kitware.com
Wed, 12 Mar 2003 18:13:50 -0500


Hi Kent,

If the files do not have any specific extension
we will not be able to pre-register their ImageIO
factories.

However the mechanism that you described is perfectly
valid. Just setting explicitly the ImageIO object
when the user is certain of the image type.

Without extension selectivity they cannot be in
the factory since they may end up accepting files
intended for other readers. Like it was happening
some time ago with Analyze.

-

It's great to see the family of ImageIO
objects growing !


Luis


---------------------------
Kent Williams wrote:
> I've checked in some new Image File formats, each of which reads (but does not 
> write) files generated by GE brand MR scanners:  GE4ImageIO, GE5ImageIO and 
> GEAdwImageIO.
> 
> None of these file types have any associated file name extension, which means
> it would be problematic to automatically register the file types. Each of them 
> has a header-probing heuristic test, but unless someone thinks its a good 
> idea to add them to the automatically registered file types, I'll hold off.
> 
> The following magic incantation works to open them.
> 
> typedef itk::Image<signed short, 3> ImageType ;
> typedef ImageType::Pointer ImagePointer ;
> typedef itk::ImageFileReader< ImageType > ImageReaderType ;
> itk::GEAdwImageIO::Pointer io = itk::GEAdwImageIO::New();
> ImageReaderType::Pointer imageReader = ImageReaderType::New() ;
> imageReader->SetImageIO(io);
> imageReader->SetFileName(inputFileName) ;
> 
> I haven't checked in any automated tests; I'm going to have to create 
> synthetic test data files, since up until now the ONLY way these files were 
> created was by their respective scanners, and those files are way too big.
> In the mean time if you have any files from those scanners, please tell me if 
> you have problems loading them.
> 
> I have a very simple test program that will read in one of these scanner files 
> and write it out to the ITK-supported file format of your choice if this 
> would aid in your testing. Drop me a line if you'd like a copy.
> 
> 
> _______________________________________________
> Insight-developers mailing list
> Insight-developers@public.kitware.com
> http://public.kitware.com/mailman/listinfo/insight-developers
>