[vtk-developers] Description of file you are about to read

Sebastien BARRE sebastien.barre at kitware.com
Thu Mar 14 10:24:44 EST 2002


At 3/14/2002 10:04 AM, Andy Cedilnik wrote:
>Hi all!
>
>When writing application that loads different data, it
>is a common thing to get some short description of this
>data. In several image viewers/editors, you can get
>things such as strings stored in images and so on.
>
>Recently some readers got CanReadFile method, which
>determines wether the file is the right format. I
>suggest adding a method which returns a description
>of a file as a string in plain English. This way
>application can report this information before
>trying to open the actual file or when the file
>is opened.

Practicaly, what kind of infos ? Size and bit depth ?
For medical images (DICOM), it would involve almost as a painful process a 
reading the image itself (i.e. browsing the data element tags, etc) :))

More seriously, who would decide the kind of "useful" infos returned by the 
reader ? And why in English ?

Since it's typically something aimed at better GUIs and user-application 
communication, I would suggest that the user (i.e. developper) could 
specify a kind of prinft-style format/mask/pattern to be used to return 
these infos (like the SetFilePattern of vtkImageReader).

For example:
SetFileInformationPattern("Size: %S, Bit depth: %D");
=> would return "Size: 512x512, Bit depth: 24b" as info (for example)

SetFileInformationPattern("Taille: %S, Profondeur: %D");
=> same in Axes of Evil language

SetFileInformationPattern("Patient Name: %N");
etc.

and maybe %R could be a special "rest" flag stating that any other relevant 
infos could be plugged here, depending on the image type.

SetFileInformationPattern("Patient Name: %N, %R");
=> would return "Patient Name: Berk Geveci, Disease: Muffin addiction, Sex: 
Male" as info (for example)

What do you think ?


--
Sebastien Barre




More information about the vtk-developers mailing list