[Insight-users] how to use itk::RegularExpressionSeriesFileNames

Darren Weber darren.weber.lists at gmail.com
Wed Jun 3 00:59:56 EDT 2009


The software guide and Examples/IO/ImageSeriesReadWrite2.cxx provide some
explanation of how to work with itk::RegularExpressionSeriesFileNames.

However, I have not been able to find information on how to specify the
regex and sort command line arguments for it.  The file name regex might be
compatible with grep or sed, or some other regex engine?  What is the sort
input, is it another regex?

What is the best way to debug the regex and sort inputs?  What is the
easiest way to get a std:cout list of the files after they are found and
sorted?

Thanks in advance,
Darren


PS,

Detailed Description Generate an ordered sequence of filenames that match a
regular expression.

This class generates an ordered sequence of files whose filenames match a
regular expression.  *[What is the regex library?]*  The file names are
sorted using a sub expression match selected by SubMatch.  *[What does this
mean?]* Regular expressions are a powerful, compact mechanism for parsing
strings. Expressions consist of the following metacharacters:

^ Matches at beginning of a line

$ Matches at end of a line

. Matches any single character

[ ] Matches any character(s) inside the brackets

[^ ] Matches any character(s) not inside the brackets


   - Matches any character in range on either side of a dash

 * Matches preceding pattern zero or more times

+ Matches preceding pattern one or more times

? Matches preceding pattern zero or once only

() Saves a matched expression and uses it in a later match

Note that more than one of these metacharacters can be used in a single
regular expression in order to create complex search patterns. For example,
the pattern [^ab1-9] says to match any character sequence that does not
begin with the characters "ab" followed by numbers in the series one through
nine.

Definition at line
72<file:///opt/local/share/InsightToolkit-3.12/doc/html/itkRegularExpressionSeriesFileNames_8h-source.html#l00072>of
file
itkRegularExpressionSeriesFileNames.h<file:///opt/local/share/InsightToolkit-3.12/doc/html/itkRegularExpressionSeriesFileNames_8h-source.html>
.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20090602/cafa7d46/attachment.htm>


More information about the Insight-users mailing list