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

Andy Cedilnik Andy.Cedilnik at kitware.com
Thu Mar 14 10:45:33 EST 2002


>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) :))


Well, the author of the reader would decide what to put there.
Painful? So what...

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

Well, VTK is written in "english". If you say PrintSelf, it returns 
infromation in "english".
I guess PrintSelf is almost what I want, but it has lots of unnecessary 
information such as
modified time, pointer address, ...


>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.


Ok, what about readers that do not have bit depth? What about one that do 
not have
Taille and Profondeur? Or Velikost in Stevilo Bitov?
Huh, what about ones that do not have any?


>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 ?

Still, there should be a "universal" way of retrieving a plain text short 
message that describes
the file, for example:

vtkTIFFReader tiff
tiff SetFileName "smallliz.tif"
tiff UpdateInformation
puts [ tiff GetDescription ]

would result in:
TIFF Image 160x160x256 made with "HP IL v1.1" (old style JPEG compression)

Maybe some day we decide to put multilingual support in VTK, then we may
do this some more bizarre way, but until then, this would be so cool.

                         Andy




More information about the vtk-developers mailing list