<commit_before>catch {load vtktcl}
if { [catch {set VTK_TCL $env(VTK_TCL)}] != 0} { set VTK_TCL "../../examplesTcl" }
if { [catch {set VTK_DATA $env(VTK_DATA)}] != 0} { set VTK_DATA "../../../vtkdata" }

# Derived from Cursor3D.  This script increases the coverage of the
# vtkImageInplaceFilter super class.


source vtkImageInclude.tcl

# global values
set CURSOR_X 20
set CURSOR_Y 20
set CURSOR_Z 20

set IMAGE_MAG_X 2
set IMAGE_MAG_Y 2
set IMAGE_MAG_Z 1



# pipeline stuff
vtkSLCReader reader
    reader SetFileName "$VTK_DATA/poship.slc"

# make the image a little biger
vtkImageMagnify magnify
  magnify SetInput [reader GetOutput]
  magnify SetMagnificationFactors $IMAGE_MAG_X $IMAGE_MAG_Y $IMAGE_MAG_Z
  magnify ReleaseDataFlagOn

# one filter that just passes the data trough
vtkImageCursor3D cursor1
cursor1 SetInput [magnify GetOutput]
cursor1 SetCursorPosition [expr $CURSOR_X * $IMAGE_MAG_X] \
    [expr $CURSOR_Y * $IMAGE_MAG_Y] [expr $CURSOR_Z * $IMAGE_MAG_Z]
cursor1 SetCursorValue 255
cursor1 SetCursorRadius [expr 50 * $IMAGE_MAG_X]
cursor1 BypassOn

# a second filter that does in place processing (magnify ReleaseDataFlagOn)
vtkImageCursor3D cursor2
cursor2 SetInput [magnify GetOutput]
cursor2 SetCursorPosition [expr $CURSOR_X * $IMAGE_MAG_X] \
    [expr $CURSOR_Y * $IMAGE_MAG_Y] [expr $CURSOR_Z * $IMAGE_MAG_Z]
cursor2 SetCursorValue 255
cursor2 SetCursorRadius [expr 50 * $IMAGE_MAG_X]
# stream to increase coverage of in place filter.
cursor2 SetInputMemoryLimit 1

# put thge two together in one image
vtkImageAppend append
append SetAppendAxis 0
append AddInput [cursor1 GetOutput]
append AddInput [cursor2 GetOutput]

vtkImageViewer viewer
viewer SetInput [append GetOutput]
viewer SetZSlice [expr $CURSOR_Z * $IMAGE_MAG_Z]
viewer SetColorWindow 200
viewer SetColorLevel 80
#viewer DebugOn
viewer Render

viewer SetPosition 50 50

#make interface
source WindowLevelInterface.tcl<commit_msg>Needed to remove dependence on Bypass<commit_after>catch {load vtktcl}
if { [catch {set VTK_TCL $env(VTK_TCL)}] != 0} { set VTK_TCL "../../examplesTcl" }
if { [catch {set VTK_DATA $env(VTK_DATA)}] != 0} { set VTK_DATA "../../../vtkdata" }

# Derived from Cursor3D.  This script increases the coverage of the
# vtkImageInplaceFilter super class.


source vtkImageInclude.tcl

# global values
set CURSOR_X 20
set CURSOR_Y 20
set CURSOR_Z 20

set IMAGE_MAG_X 2
set IMAGE_MAG_Y 2
set IMAGE_MAG_Z 1



# pipeline stuff
vtkSLCReader reader
    reader SetFileName "$VTK_DATA/poship.slc"

# make the image a little biger
vtkImageMagnify magnify1
  magnify1 SetInput [reader GetOutput]
  magnify1 SetMagnificationFactors $IMAGE_MAG_X $IMAGE_MAG_Y $IMAGE_MAG_Z
  magnify1 ReleaseDataFlagOn

vtkImageMagnify magnify2
  magnify2 SetInput [reader GetOutput]
  magnify2 SetMagnificationFactors $IMAGE_MAG_X $IMAGE_MAG_Y $IMAGE_MAG_Z
  magnify2 ReleaseDataFlagOn

# a filter that does in place processing (magnify ReleaseDataFlagOn)
vtkImageCursor3D cursor
cursor SetInput [magnify1 GetOutput]
cursor SetCursorPosition [expr $CURSOR_X * $IMAGE_MAG_X] \
    [expr $CURSOR_Y * $IMAGE_MAG_Y] [expr $CURSOR_Z * $IMAGE_MAG_Z]
cursor SetCursorValue 255
cursor SetCursorRadius [expr 50 * $IMAGE_MAG_X]
# stream to increase coverage of in place filter.

# put thge two together in one image
vtkImageAppend append
append SetAppendAxis 0
append AddInput [magnify2 GetOutput]
append AddInput [cursor GetOutput]

vtkImageViewer viewer
viewer SetInput [append GetOutput]
viewer SetZSlice [expr $CURSOR_Z * $IMAGE_MAG_Z]
viewer SetColorWindow 200
viewer SetColorLevel 80
#viewer DebugOn
viewer Render

viewer SetPosition 50 50

#make interface
source WindowLevelInterface.tcl
{'fraction_non_alphanumeric': 0.06763021543496046, 'fraction_numerical': 0.023725115898554677, 'mean_word_length': 5.446397188049209, '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': '7046723', 'n_tokens_mistral': 1359, 'n_tokens_neox': 1275, 'n_words': 402}