------------------------------------------------------------------------------
| 125 | |
| 126 | //------------------------------------------------------------------------------ |
| 127 | void vtkImageAlgorithm::CopyInputArrayAttributesToOutput(vtkInformation* vtkNotUsed(request), |
| 128 | vtkInformationVector** inputVector, vtkInformationVector* outputVector) |
| 129 | { |
| 130 | // for image data to image data |
| 131 | if (this->GetNumberOfInputPorts() && this->GetNumberOfOutputPorts()) |
| 132 | { |
| 133 | vtkInformation* inInfo = inputVector[0]->GetInformationObject(0); |
| 134 | // if the input is image data |
| 135 | if (vtkImageData::SafeDownCast(inInfo->Get(vtkDataObject::DATA_OBJECT()))) |
| 136 | { |
| 137 | vtkInformation* info = this->GetInputArrayFieldInformation(0, inputVector); |
| 138 | if (info) |
| 139 | { |
| 140 | int scalarType = info->Get(vtkDataObject::FIELD_ARRAY_TYPE()); |
| 141 | int numComp = info->Get(vtkDataObject::FIELD_NUMBER_OF_COMPONENTS()); |
| 142 | for (int i = 0; i < this->GetNumberOfOutputPorts(); ++i) |
| 143 | { |
| 144 | vtkInformation* outInfo = outputVector->GetInformationObject(i); |
| 145 | // if the output is image data |
| 146 | if (vtkImageData::SafeDownCast(outInfo->Get(vtkDataObject::DATA_OBJECT()))) |
| 147 | { |
| 148 | // copy scalar type and scalar number of components |
| 149 | vtkDataObject::SetPointDataActiveScalarInfo(outInfo, scalarType, numComp); |
| 150 | } |
| 151 | } |
| 152 | } |
| 153 | } |
| 154 | } |
| 155 | } |
| 156 | |
| 157 | //------------------------------------------------------------------------------ |
| 158 | int vtkImageAlgorithm::RequestInformation( |
no test coverage detected