<commit_before># append multiple displaced spheres into an RGB image.
catch {load vtktcl}

# Image pipeline

vtkImageWindow imgWin

vtkImageEllipsoidSource sphere1
sphere1 SetCenter 95 100 0
sphere1 SetRadius 70 70 70

vtkImageEllipsoidSource sphere2
sphere2 SetCenter 161 100 0
sphere2 SetRadius 70 70 70 

set logics "And Or Xor Nand Nor Not"
foreach operator $logics {
    vtkImageLogic logic${operator}
      logic${operator} SetInput1 [sphere1 GetOutput]
      logic${operator} SetInput2 [sphere2 GetOutput]
      logic${operator} SetOutputTrueValue 150
      logic${operator} SetOperationTo${operator}
    vtkImageMapper mapper${operator}
      mapper${operator} SetInput [logic${operator} GetOutput]
      mapper${operator} SetColorWindow 255
      mapper${operator} SetColorLevel 127.5
    vtkActor2D actor${operator}
      actor${operator} SetMapper mapper${operator}
    vtkImager imager${operator}
      imager${operator} AddActor2D actor${operator}
    imgWin AddImager imager${operator}
}

imagerAnd SetViewport 0 .5 .33 1
imagerOr SetViewport .33 .5 .66 1
imagerXor SetViewport .66 .5 1 1
imagerNand SetViewport 0 0 .33 .5
imagerNor SetViewport .33 0 .66 .5
imagerNot SetViewport .66 0 1 .5

imgWin SetSize 768 512
imgWin Render
imgWin SetFileName TestAllLogic.tcl.ppm
#imgWin SaveImageAsPPM

wm withdraw .
<commit_msg>ENH: Better ScalarType coverage for mapper and EllipsoidSource.<commit_after># append multiple displaced spheres into an RGB image.
catch {load vtktcl}

# Image pipeline

vtkImageWindow imgWin

set logics "And Or Xor Nand Nor Not"
set types "Float Double UnsignedInt UnsignedLong UnsignedShort UnsignedChar"
set i 0
foreach operator $logics {
    set ScalarType [lindex $types $i]

    vtkImageEllipsoidSource sphere1${operator}
      sphere1${operator} SetCenter 95 100 0
      sphere1${operator} SetRadius 70 70 70
      sphere1${operator} SetOutputScalarTypeTo${ScalarType}

    vtkImageEllipsoidSource sphere2${operator}
      sphere2${operator} SetCenter 161 100 0
      sphere2${operator} SetRadius 70 70 70 
      sphere2${operator} SetOutputScalarTypeTo${ScalarType}

    vtkImageLogic logic${operator}
      logic${operator} SetInput1 [sphere1${operator} GetOutput]
      logic${operator} SetInput2 [sphere2${operator} GetOutput]
      logic${operator} SetOutputTrueValue 150
      logic${operator} SetOperationTo${operator}
    vtkImageMapper mapper${operator}
      mapper${operator} SetInput [logic${operator} GetOutput]
      mapper${operator} SetColorWindow 255
      mapper${operator} SetColorLevel 127.5
    vtkActor2D actor${operator}
      actor${operator} SetMapper mapper${operator}
    vtkImager imager${operator}
      imager${operator} AddActor2D actor${operator}
    imgWin AddImager imager${operator}
    incr i
}

imagerAnd SetViewport 0 .5 .33 1
imagerOr SetViewport .33 .5 .66 1
imagerXor SetViewport .66 .5 1 1
imagerNand SetViewport 0 0 .33 .5
imagerNor SetViewport .33 0 .66 .5
imagerNot SetViewport .66 0 1 .5

imgWin SetSize 768 512
imgWin Render
imgWin SetFileName TestAllLogic.tcl.ppm
#imgWin SaveImageAsPPM

wm withdraw .

{'fraction_non_alphanumeric': 0.07376253639598836, 'fraction_numerical': 0.05596894208993853, 'mean_word_length': 4.368055555555555, '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': '6522929', 'n_tokens_mistral': 1109, 'n_tokens_neox': 964, 'n_words': 309}