File Name Generators: Difference between revisions

From KitwarePublic
Jump to navigationJump to search
No edit summary
 
Line 3: Line 3:
The processes of generating file names for readers and writers are quite distinct from one another, therefore I propose that there be a separate class for each.
The processes of generating file names for readers and writers are quite distinct from one another, therefore I propose that there be a separate class for each.


== Reader Generators ==
== Reader File Name Generators ==


Reader file name generators will generate file names based on the contents of a directory and a wildcard string, a regular expression, or an example file name.  The generator will do its best to sort the files that it finds in the directory, and to separate the files into distinct file series if there are multiple image series represented in the directory.
Reader file name generators will generate file names based on the contents of a directory and a wildcard string, a regular expression, or an example file name.  The generator will do its best to sort the files that it finds in the directory, and to separate the files into distinct file series if there are multiple image series represented in the directory.

Revision as of 05:41, 6 February 2006

The idea of a file name generator is that, given wildcard expression and a file directory, the generation of filenames should be automatic. Currently all file names in VTK must be set explicitly.

The processes of generating file names for readers and writers are quite distinct from one another, therefore I propose that there be a separate class for each.

Reader File Name Generators

Reader file name generators will generate file names based on the contents of a directory and a wildcard string, a regular expression, or an example file name. The generator will do its best to sort the files that it finds in the directory, and to separate the files into distinct file series if there are multiple image series represented in the directory.

  • class vtkReaderFileNameGenerator

Sorting and Grouping File Names

The sorting and grouping of file names into image series will be available separate from the vtkReaderFileNameGenerator. This is so that a list of files obtained from a file load dialog or through a drag-and-drop operation can be sorted.

  • class vtkGroupAndSortFileNames

Writer Generators

Generating files for a writer involves the use of a file name pattern based either on a printf-style format string or an example file name. Unlike generating names for a reader, no directory listing occurs. The number of files to be written is set according to the number of image slices.

  • class vtkWriterFileNameGenerator

DICOM and other medical formats

Because DICOM files contain series numbering information within the file itself, there should be a vtkDICOMReaderFileNameGenerator that specifically queries the files to obtain this information in order to properly sort the data.

Non-image data

The generators will work just as well for other kinds of data as they do for image data. For other data sets, the user will create a reader or writer for each file name in the list, rather than sending all of the file names to a single reader or writer.