<commit_before><commit_msg>ENH: Tcl version of the CurvatureFlowImageFilter example.<commit_after>#
#  Example on the use of the CurvatureFlowImageFilter
#

set reader [ itk::create ImageFileReaderUS2 ]
set writer [ itk::create ImageFileWriterUS2 ]

set inputCast  [ itk::create CastImageFilterUS2F2    ]
set outputCast [ itk::create RescaleIntensityImageFilterF2US2 ]

set filter [ itk::create CurvatureFlowImageFilterF2F2 ]

$inputCast  SetInput [ $reader     GetOutput ]
$filter     SetInput [ $inputCast  GetOutput ]
$outputCast SetInput [ $filter     GetOutput ]
$writer     SetInput [ $outputCast GetOutput ]


$reader SetFileName [lindex $argv 0]
$writer SetFileName [lindex $argv 1]


$outputCast SetOutputMinimum       0
$outputCast SetOutputMaximum   65535

set numberOfIterations [expr [lindex $argv 2]]
set timeStep           [expr [lindex $argv 3]]

$filter SetNumberOfIterations  $numberOfIterations
$filter SetTimeStep            $timeStep


$writer Update


{'fraction_non_alphanumeric': 0.07399794450154162, 'fraction_numerical': 0.018499486125385406, 'mean_word_length': 4.597701149425287, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '667214', 'n_tokens_mistral': 312, 'n_tokens_neox': 297, 'n_words': 86}