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

Kent Williams norman-k-williams@uiowa.edu
Wed, 12 Mar 2003 16:45:55 -0600


I've checked in some new Image File formats, each of which reads (but doe=
s not=20
write) files generated by GE brand MR scanners:  GE4ImageIO, GE5ImageIO a=
nd=20
GEAdwImageIO.

None of these file types have any associated file name extension, which m=
eans
it would be problematic to automatically register the file types. Each of=
 them=20
has a header-probing heuristic test, but unless someone thinks its a good=
=20
idea to add them to the automatically registered file types, I'll hold of=
f.

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 =3D itk::GEAdwImageIO::New();
ImageReaderType::Pointer imageReader =3D ImageReaderType::New() ;
imageReader->SetImageIO(io);
imageReader->SetFileName(inputFileName) ;

I haven't checked in any automated tests; I'm going to have to create=20
synthetic test data files, since up until now the ONLY way these files we=
re=20
created was by their respective scanners, and those files are way too big=
=2E
In the mean time if you have any files from those scanners, please tell m=
e if=20
you have problems loading them.

I have a very simple test program that will read in one of these scanner =
files=20
and write it out to the ITK-supported file format of your choice if this=20
would aid in your testing. Drop me a line if you'd like a copy.