VMTK
Loading...
Searching...
No Matches
vtkvmtkImageBoxPainter.cxx File Reference
#include "vtkvmtkImageBoxPainter.h"
#include "vtkImageData.h"
#include "vtkObjectFactory.h"
#include "vtkVersion.h"
#include "vtkInformation.h"
#include "vtkStreamingDemandDrivenPipeline.h"
#include <cmath>
Include dependency graph for vtkvmtkImageBoxPainter.cxx:

Go to the source code of this file.

Functions

 vtkStandardNewMacro (vtkvmtkImageBoxPainter)
template<class IT>
void vtkvmtkImageBoxPainterExecute (vtkImageData *input, vtkImageData *output, IT *inPtr, IT *outPtr, int *boxExtent, IT paintValue)

Function Documentation

◆ vtkStandardNewMacro()

vtkStandardNewMacro ( vtkvmtkImageBoxPainter )

◆ vtkvmtkImageBoxPainterExecute()

template<class IT>
void vtkvmtkImageBoxPainterExecute ( vtkImageData * input,
vtkImageData * output,
IT * inPtr,
IT * outPtr,
int * boxExtent,
IT paintValue )

Definition at line 50 of file vtkvmtkImageBoxPainter.cxx.

54{
55 int dims[3];
56 input->GetDimensions(dims);
57 if (input->GetScalarType() != output->GetScalarType())
58 {
59 vtkGenericWarningMacro(<< "Execute: input ScalarType, " << input->GetScalarType()
60 << ", must match out ScalarType " << output->GetScalarType());
61 return;
62 }
63
64 int size = dims[0]*dims[1]*dims[2];
65
66 int ijk[3];
67 vtkIdType id;
68
69 for (int i=0; i<size; i++)
70 {
71 outPtr[i] = inPtr[i];
72 }
73
74 for (ijk[2]=boxExtent[4]; ijk[2]<=boxExtent[5]; ++ijk[2])
75 {
76 for (ijk[1]=boxExtent[2]; ijk[1]<=boxExtent[3]; ++ijk[1])
77 {
78 for (ijk[0]=boxExtent[0]; ijk[0]<=boxExtent[1]; ++ijk[0])
79 {
80 id = input->ComputePointId(ijk);
81 outPtr[id] = paintValue;
82 }
83 }
84 }
85}