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

Luis Ibanez luis.ibanez@kitware.com
Thu, 13 Mar 2003 12:40:20 -0500


Kent,

It is perfectly ok to fix the ImageIO type if you
want to predefine the file format that your application
is going to read.

This will lock the application to use only this particular
format. This in fact can be seen as a desirable safety
feature when you are in a clinical environment.

I agree with you in that the RegisterOneFactory is
moderately dangerous. It still leaves some room for
selecting the wrong file format.

The code that you posted with an explicit call to
SetImageIO() is just fine when you want to restrict
an application to use only this image file format.

When we shift design criteria from the toolkit level
to the final application level, the need for generality
decreases rapidly. The less flexibility you offer in a
medical applications the easiest is to verify safety in
its operation.

The FDA for example, would require to verify every possible
combinations of options in the execution of a software
system used in a medical device. In this framework, it is
clear that we want to minimize the number of options in a
final application in order to make manageable the testing
and verification process.



   Luis



-----------------------
Kent Williams wrote:
> I would contend that the application should bear some responsibility for 
> knowing what sorts of files it's going to import;   even an ad-hoc 
> 'RegisterOne' would be moderately dangerous with any file format not 
> associated with a file extension.  Given the heuristic tests in the GE file 
> readers, it wouldn't normally be a problem, but it nags at me.
> 
> The method I suggested means that you want to open files of a particular type, 
> and only those files.   RegisterOne institutes a rather lengthy fishing 
> expedition for the right file reader.
> 
> I guess it's really a case of it not being a perfect world -- not all file 
> formats have de facto standard file name extension, and not all file types 
> bother to have a meaningful magic number defined at the head of the file.
> You just have to muddle along.
> 
> On Wednesday 12 March 2003 09:53 pm, Hans Johnson wrote:
> 
>>Luis,
>>
>>Thanks for the comments.  I agree with the only use what you need
>>philosphy.  I also believe that the RegisterOne mechanism should work for
>>adding those less used file filters to the default file checking.  The
>>method that Kent outlined requires that you know what the file type is
>>before processing it, whereas RegisterOne method would allow multiple file
>>IO filters to be registered, and the file type be determined automatically
>>at runtime.
> 
> 
> _______________________________________________
> Insight-developers mailing list
> Insight-developers@public.kitware.com
> http://public.kitware.com/mailman/listinfo/insight-developers
>