Re-factor CustomMethod template components for optional parameter

Before the template required the parameter field to be defined. This
is now optional. The code has been refactored to perform an index
based iteration.

Change-Id: I7f012ef0d468f124ef0a3cd37ed1ebe771ff1ddd
Add GetNumberOfLabels as custom method

Change-Id: Ifb2974f8a5655c3334aa425aa64188c248fc5660
Merge topic 'SIMPLEITK-490_Uset1functionForLabelStatisticsImageFilter' into next

5a4ed112 Add GetNumberOfLabels as custom method
bbf3cb5c Re-factor CustomMethod template components for optional parameter