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

Bill Lorensen bill.lorensen at gmail.com
Wed Jun 3 08:06:57 EDT 2009


The test Testing/Code/IO/itkRegularExpressionSeriesFileNamesTest.cxx
shows how to sort and print the results.

On Wed, Jun 3, 2009 at 12:59 AM, Darren Weber
<darren.weber.lists at gmail.com> wrote:
>
> 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 of file itkRegularExpressionSeriesFileNames.h.
>
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-users
>
>


More information about the Insight-users mailing list