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

Method ExecuteDataWithInformation

IO/MPIImage/vtkMPIImageReader.cxx:365–491  ·  view source on GitHub ↗

------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

363
364//------------------------------------------------------------------------------
365void vtkMPIImageReader::ExecuteDataWithInformation(vtkDataObject* output, vtkInformation* outInfo)
366{
367#ifdef VTK_USE_MPI_IO
368 vtkMPIController* MPIController = vtkMPIController::SafeDownCast(this->Controller);
369 if (!MPIController)
370 {
371 this->Superclass::ExecuteDataWithInformation(output, outInfo);
372 return;
373 }
374
375 vtkImageData* data = this->AllocateOutputData(output, outInfo);
376
377 if (!this->FileName && !this->FilePattern && !this->FileNames)
378 {
379 vtkErrorMacro("Either a valid FileName, FileNames, or FilePattern"
380 " must be specified.");
381 return;
382 }
383
384 // VTK stores images in traditional "right handed" coordinates. That is, the
385 // origin is in the lower left corner. Many images, especially those with RGB
386 // colors, have the origin in the upper right corner. In this case, we have
387 // to flip the y axis.
388 vtkTransform* saveTransform = this->Transform;
389 if (!this->FileLowerLeft)
390 {
391 vtkTransform* newTransform = vtkTransform::New();
392 if (this->Transform)
393 {
394 newTransform->Concatenate(this->Transform);
395 }
396 else
397 {
398 newTransform->Identity();
399 }
400 newTransform->Scale(1.0, -1.0, 1.0);
401 this->Transform = newTransform;
402 }
403
404 // Get information on data partition requested.
405 int inExtent[6];
406 vtkIdType inIncrements[3];
407 data->GetExtent(inExtent);
408 data->GetIncrements(inIncrements);
409 vtkDataArray* outputDataArray = data->GetPointData()->GetScalars();
410 vtkIdType numValues =
411 (outputDataArray->GetNumberOfComponents() * outputDataArray->GetNumberOfTuples());
412
413 outputDataArray->SetName(this->ScalarArrayName);
414
415 vtkDebugMacro("Reading extent: " << inExtent[0] << ", " << inExtent[1] << ", " << inExtent[2]
416 << ", " << inExtent[3] << ", " << inExtent[4] << ", "
417 << inExtent[5]);
418
419 // Respect the Transform.
420 int outExtent[6];
421 vtkIdType outIncrements[3];
422 this->ComputeInverseTransformedExtent(inExtent, outExtent);

Callers

nothing calls this directly

Calls 15

GetDataScalarTypeSizeMethod · 0.95
PartitionControllerMethod · 0.95
ReadSliceMethod · 0.95
TransformDataMethod · 0.95
GetIncrementsMethod · 0.80
GetScalarPointerMethod · 0.80
GetDataScalarTypeMethod · 0.80
DeleteMethod · 0.65
NewFunction · 0.50
absFunction · 0.50

Tested by

no test coverage detected