------------------------------------------------------------------------------ This method decomposes the gaussian and smooths along each axis.
| 320 | //------------------------------------------------------------------------------ |
| 321 | // This method decomposes the gaussian and smooths along each axis. |
| 322 | void vtkImageGaussianSmooth::ThreadedRequestData(vtkInformation* vtkNotUsed(request), |
| 323 | vtkInformationVector** inputVector, vtkInformationVector* outputVector, vtkImageData*** inData, |
| 324 | vtkImageData** outData, int outExt[6], int id) |
| 325 | { |
| 326 | int inExt[6]; |
| 327 | int target, count, total, cycle; |
| 328 | |
| 329 | // for feed back, determine line target to get 50 progress update |
| 330 | // update is called every target lines. Progress is computed from |
| 331 | // the number of pixels processed so far. |
| 332 | count = 0; |
| 333 | target = 0; |
| 334 | total = 0; |
| 335 | cycle = 0; |
| 336 | if (id == 0) |
| 337 | { |
| 338 | // determine the number of pixels. |
| 339 | total = this->Dimensionality * (outExt[1] - outExt[0] + 1) * (outExt[3] - outExt[2] + 1) * |
| 340 | (outExt[5] - outExt[4] + 1) * inData[0][0]->GetNumberOfScalarComponents(); |
| 341 | // pixels per update (50 updates) |
| 342 | target = total / 50; |
| 343 | } |
| 344 | |
| 345 | // this filter expects that input is the same type as output. |
| 346 | if (inData[0][0]->GetScalarType() != outData[0]->GetScalarType()) |
| 347 | { |
| 348 | vtkErrorMacro("Execute: input ScalarType, " << inData[0][0]->GetScalarType() |
| 349 | << ", must match out ScalarType " |
| 350 | << outData[0]->GetScalarType()); |
| 351 | return; |
| 352 | } |
| 353 | |
| 354 | // Decompose |
| 355 | vtkInformation* inInfo = inputVector[0]->GetInformationObject(0); |
| 356 | vtkInformation* outInfo = outputVector->GetInformationObject(0); |
| 357 | int wholeExt[6]; |
| 358 | inInfo->Get(vtkStreamingDemandDrivenPipeline::WHOLE_EXTENT(), wholeExt); |
| 359 | outInfo->Get(vtkStreamingDemandDrivenPipeline::UPDATE_EXTENT(), inExt); |
| 360 | this->InternalRequestUpdateExtent(inExt, wholeExt); |
| 361 | |
| 362 | switch (this->Dimensionality) |
| 363 | { |
| 364 | case 1: |
| 365 | this->ExecuteAxis( |
| 366 | 0, inData[0][0], inExt, outData[0], outExt, &cycle, target, &count, total, inInfo); |
| 367 | break; |
| 368 | case 2: |
| 369 | int tempExt[6]; |
| 370 | vtkImageData* tempData; |
| 371 | // compute intermediate extent |
| 372 | tempExt[0] = inExt[0]; |
| 373 | tempExt[1] = inExt[1]; |
| 374 | tempExt[2] = outExt[2]; |
| 375 | tempExt[3] = outExt[3]; |
| 376 | tempExt[4] = inExt[4]; |
| 377 | tempExt[5] = inExt[5]; |
| 378 | // create a temp data for intermediate results |
| 379 | tempData = vtkImageData::New(); |
nothing calls this directly
no test coverage detected