[Insight-users] Re: batch processing using itk
Gavin Baker
gavinb+xtk at cs.mu.OZ.AU
Mon Jul 4 23:56:53 EDT 2005
Hello Rex,
On Mon, Jul 04, 2005 at 12:35:09PM -0500, mrcheung at mdanderson.org wrote:
> Can anyone tell me how to run itk image segmentation and registration under
> batch model ie use the same itk programs to segment and register multiple
> series fo images? Is there itk templated classes available for this ?
> Thanks a lot, Rex
ITK doesn't impose any particular architecture on your application, so
there's nothing really special needed to run in batch mode. The simplest
solution is of course to write a console-based application (as many of the
examples are) to run batch mode. You can either provide your parameters via
the command line (if there's just a few), or in a parameter file (if there's
several).
(A batch mode could obviously be made to work in a GUI, it just takes a bit
more effort and thought in the design, so it doesn't assume any user
interaction, and has all its parameters specified up front.)
One of the examples in InsightApplications, written by Josh Cates, has a
class for parsing a parameter file. It is quite easy to incorporate into a
new program, and the param files are easy to hand edit. Have a look at:
InsightApplications/StreamedWatershedSegmentation/ParameterFileParser
The only consideration I can think of regarding running ITK in batch mode is
the fact that you may be reusing the pipeline if the same instance of your
program runs on multiple data sets. (If you invoke a separate instance for
each data set, this obviously isn't a problem.) In this case, you will need
to make sure you do refresh and reinitialise the pipeline appropriately
after each iteration. For example using UpdateLargestPossibleRegion() to
make sure the image metadata is re-read (since the size, spacing, etc may
change).
What sort of templated classes are you thinking of? ITK doesn't really
focus at this level, it's more an app design thing, best left to other
libraries, frameworks and OS-dependent issues. If there's something
generally useful though, the community could work on it together.
Regards,
:: Gavin
--
Gavin Baker Complex Systems Group
http://www.cs.mu.oz.au/~gavinb The University of Melbourne
More information about the Insight-users
mailing list