VTK
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes
vtkSortFileNames Class Reference

Group and sort a set of filenames. More...

#include <vtkSortFileNames.h>

Inheritance diagram for vtkSortFileNames:
Inheritance graph
[legend]
Collaboration diagram for vtkSortFileNames:
Collaboration graph
[legend]

List of all members.

Public Types

typedef vtkObject Superclass

Public Member Functions

virtual int IsA (const char *type)
vtkSortFileNamesNewInstance () const
void PrintSelf (ostream &os, vtkIndent indent)
virtual vtkStringArrayGetFileNames ()
virtual int GetNumberOfGroups ()
virtual vtkStringArrayGetNthGroup (int i)
virtual void Update ()
virtual void SetGrouping (int)
virtual int GetGrouping ()
virtual void GroupingOn ()
virtual void GroupingOff ()
virtual void SetNumericSort (int)
virtual int GetNumericSort ()
virtual void NumericSortOn ()
virtual void NumericSortOff ()
virtual void SetIgnoreCase (int)
virtual int GetIgnoreCase ()
virtual void IgnoreCaseOn ()
virtual void IgnoreCaseOff ()
virtual void SetSkipDirectories (int)
virtual int GetSkipDirectories ()
virtual void SkipDirectoriesOn ()
virtual void SkipDirectoriesOff ()
void SetInputFileNames (vtkStringArray *input)
virtual vtkStringArrayGetInputFileNames ()

Static Public Member Functions

static int IsTypeOf (const char *type)
static vtkSortFileNamesSafeDownCast (vtkObjectBase *o)
static vtkSortFileNamesNew ()

Protected Member Functions

virtual vtkObjectBaseNewInstanceInternal () const
 vtkSortFileNames ()
 ~vtkSortFileNames ()
virtual void Execute ()
virtual void SortFileNames (vtkStringArray *input, vtkStringArray *output)
virtual void GroupFileNames (vtkStringArray *input, vtkStringArrayVector *output)

Protected Attributes

int NumericSort
int IgnoreCase
int Grouping
int SkipDirectories
vtkTimeStamp UpdateTime
vtkStringArrayInputFileNames
vtkStringArrayFileNames
vtkStringArrayVector * Groups

Detailed Description

Group and sort a set of filenames.

vtkSortFileNames will take a list of filenames (e.g. from a file load dialog) and sort them into one or more series. If the input list of filenames contains any directories, these can be removed before sorting using the SkipDirectories flag. This class should be used where information about the series groupings can be determined by the filenames, but it might not be successful in cases where the information about the series groupings is stored in the files themselves (e.g DICOM).

See also:
vtkImageReader2
Tests:
vtkSortFileNames (Tests)

Definition at line 46 of file vtkSortFileNames.h.


Member Typedef Documentation

Reimplemented from vtkObject.

Definition at line 50 of file vtkSortFileNames.h.


Constructor & Destructor Documentation


Member Function Documentation

static int vtkSortFileNames::IsTypeOf ( const char *  name) [static]

Return 1 if this class type is the same type of (or a subclass of) the named class. Returns 0 otherwise. This method works in combination with vtkTypeMacro found in vtkSetGet.h.

Reimplemented from vtkObject.

virtual int vtkSortFileNames::IsA ( const char *  name) [virtual]

Return 1 if this class is the same type of (or a subclass of) the named class. Returns 0 otherwise. This method works in combination with vtkTypeMacro found in vtkSetGet.h.

Reimplemented from vtkObject.

Reimplemented from vtkObject.

virtual vtkObjectBase* vtkSortFileNames::NewInstanceInternal ( ) const [protected, virtual]

Reimplemented from vtkObject.

Reimplemented from vtkObject.

void vtkSortFileNames::PrintSelf ( ostream &  os,
vtkIndent  indent 
) [virtual]

Methods invoked by print to print information about the object including superclasses. Typically not called by the user (use Print() instead) but used in the hierarchical print process to combine the output of several classes.

Reimplemented from vtkObject.

Create an object with Debug turned off, modified time initialized to zero, and reference counting on.

Reimplemented from vtkObject.

virtual void vtkSortFileNames::SetGrouping ( int  ) [virtual]

Sort the file names into groups, according to similarity in filename name and path. Files in different directories, or with different extensions, or which do not fit into the same numbered series will be placed into different groups. This is off by default.

virtual int vtkSortFileNames::GetGrouping ( ) [virtual]

Sort the file names into groups, according to similarity in filename name and path. Files in different directories, or with different extensions, or which do not fit into the same numbered series will be placed into different groups. This is off by default.

virtual void vtkSortFileNames::GroupingOn ( ) [virtual]

Sort the file names into groups, according to similarity in filename name and path. Files in different directories, or with different extensions, or which do not fit into the same numbered series will be placed into different groups. This is off by default.

virtual void vtkSortFileNames::GroupingOff ( ) [virtual]

Sort the file names into groups, according to similarity in filename name and path. Files in different directories, or with different extensions, or which do not fit into the same numbered series will be placed into different groups. This is off by default.

virtual void vtkSortFileNames::SetNumericSort ( int  ) [virtual]

Sort the files numerically, rather than lexicographically. For filenames that contain numbers, this means the order will be ["file8.dat", "file9.dat", "file10.dat"] instead of the usual alphabetic sorting order ["file10.dat" "file8.dat", "file9.dat"]. NumericSort is off by default.

virtual int vtkSortFileNames::GetNumericSort ( ) [virtual]

Sort the files numerically, rather than lexicographically. For filenames that contain numbers, this means the order will be ["file8.dat", "file9.dat", "file10.dat"] instead of the usual alphabetic sorting order ["file10.dat" "file8.dat", "file9.dat"]. NumericSort is off by default.

virtual void vtkSortFileNames::NumericSortOn ( ) [virtual]

Sort the files numerically, rather than lexicographically. For filenames that contain numbers, this means the order will be ["file8.dat", "file9.dat", "file10.dat"] instead of the usual alphabetic sorting order ["file10.dat" "file8.dat", "file9.dat"]. NumericSort is off by default.

virtual void vtkSortFileNames::NumericSortOff ( ) [virtual]

Sort the files numerically, rather than lexicographically. For filenames that contain numbers, this means the order will be ["file8.dat", "file9.dat", "file10.dat"] instead of the usual alphabetic sorting order ["file10.dat" "file8.dat", "file9.dat"]. NumericSort is off by default.

virtual void vtkSortFileNames::SetIgnoreCase ( int  ) [virtual]

Ignore case when sorting. This flag is honored by both the sorting and the grouping. This is off by default.

virtual int vtkSortFileNames::GetIgnoreCase ( ) [virtual]

Ignore case when sorting. This flag is honored by both the sorting and the grouping. This is off by default.

virtual void vtkSortFileNames::IgnoreCaseOn ( ) [virtual]

Ignore case when sorting. This flag is honored by both the sorting and the grouping. This is off by default.

virtual void vtkSortFileNames::IgnoreCaseOff ( ) [virtual]

Ignore case when sorting. This flag is honored by both the sorting and the grouping. This is off by default.

virtual void vtkSortFileNames::SetSkipDirectories ( int  ) [virtual]

Skip directories. If this flag is set, any input item that is a directory rather than a file will not be included in the output. This is off by default.

Skip directories. If this flag is set, any input item that is a directory rather than a file will not be included in the output. This is off by default.

virtual void vtkSortFileNames::SkipDirectoriesOn ( ) [virtual]

Skip directories. If this flag is set, any input item that is a directory rather than a file will not be included in the output. This is off by default.

virtual void vtkSortFileNames::SkipDirectoriesOff ( ) [virtual]

Skip directories. If this flag is set, any input item that is a directory rather than a file will not be included in the output. This is off by default.

Set a list of file names to group and sort.

Set a list of file names to group and sort.

Get the full list of sorted filenames.

Get the number of groups that the names were split into, if grouping is on. The filenames are automatically split into groups, where the filenames in each group will be identical except for their series numbers. If grouping is not on, this method will return zero.

Get the Nth group of file names. This method should only be used if grouping is on. If grouping is off, it will always return null.

virtual void vtkSortFileNames::Update ( ) [virtual]

Update the output filenames from the input filenames. This method is called automatically by GetFileNames() and GetNumberOfGroups() if the input names have changed.

virtual void vtkSortFileNames::Execute ( ) [protected, virtual]

Fill the output.

virtual void vtkSortFileNames::SortFileNames ( vtkStringArray input,
vtkStringArray output 
) [protected, virtual]

Sort the input string array, and append the results to the output.

virtual void vtkSortFileNames::GroupFileNames ( vtkStringArray input,
vtkStringArrayVector *  output 
) [protected, virtual]

Separate a string array into groups and append them to the output.


Member Data Documentation

Definition at line 120 of file vtkSortFileNames.h.

Definition at line 121 of file vtkSortFileNames.h.

Definition at line 122 of file vtkSortFileNames.h.

Definition at line 123 of file vtkSortFileNames.h.

Definition at line 125 of file vtkSortFileNames.h.

Definition at line 127 of file vtkSortFileNames.h.

Definition at line 128 of file vtkSortFileNames.h.

vtkStringArrayVector* vtkSortFileNames::Groups [protected]

Definition at line 129 of file vtkSortFileNames.h.


The documentation for this class was generated from the following file: