MCPcopy Create free account
hub / github.com/Kitware/VTK / ThreadedRequestData

Method ThreadedRequestData

Imaging/General/vtkImageVariance3D.cxx:259–295  ·  view source on GitHub ↗

------------------------------------------------------------------------------ This method contains the first switch statement that calls the correct templated function for the input and output Data types. It handles image boundaries, so the image does not shrink.

Source from the content-addressed store, hash-verified

257// templated function for the input and output Data types.
258// It handles image boundaries, so the image does not shrink.
259void vtkImageVariance3D::ThreadedRequestData(vtkInformation* vtkNotUsed(request),
260 vtkInformationVector** inputVector, vtkInformationVector* vtkNotUsed(outputVector),
261 vtkImageData*** inData, vtkImageData** outData, int outExt[6], int id)
262{
263 int inExt[6], wholeExt[6];
264 vtkInformation* inInfo = inputVector[0]->GetInformationObject(0);
265 inInfo->Get(vtkStreamingDemandDrivenPipeline::WHOLE_EXTENT(), wholeExt);
266 this->InternalRequestUpdateExtent(inExt, outExt, wholeExt);
267 void* inPtr = inData[0][0]->GetScalarPointerForExtent(inExt);
268 void* outPtr = outData[0]->GetScalarPointerForExtent(outExt);
269 vtkImageData* mask;
270
271 // Error checking on mask
272 mask = this->Ellipse->GetOutput();
273 if (mask->GetScalarType() != VTK_UNSIGNED_CHAR)
274 {
275 vtkErrorMacro(<< "Execute: mask has wrong scalar type");
276 return;
277 }
278
279 // this filter expects the output to be float
280 if (outData[0]->GetScalarType() != VTK_FLOAT)
281 {
282 vtkErrorMacro(<< "Execute: output ScalarType, "
283 << vtkImageScalarTypeNameMacro(outData[0]->GetScalarType()) << " must be float");
284 return;
285 }
286
287 switch (inData[0][0]->GetScalarType())
288 {
289 vtkTemplateMacro(vtkImageVariance3DExecute(this, mask, inData[0][0],
290 static_cast<VTK_TT*>(inPtr), outData[0], outExt, static_cast<float*>(outPtr), id, inInfo));
291 default:
292 vtkErrorMacro(<< "Execute: Unknown ScalarType");
293 return;
294 }
295}
296
297//------------------------------------------------------------------------------
298int vtkImageVariance3D::RequestData(

Callers

nothing calls this directly

Calls 8

GetInformationObjectMethod · 0.80
GetMethod · 0.45
GetOutputMethod · 0.45
GetScalarTypeMethod · 0.45

Tested by

no test coverage detected