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

Method SetupOutputInformation

IO/Image/vtkDICOMImageReader.cxx:385–427  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

383
384//------------------------------------------------------------------------------
385void vtkDICOMImageReader::SetupOutputInformation(int num_slices)
386{
387 int width = this->AppHelper->GetWidth();
388 int height = this->AppHelper->GetHeight();
389 int bit_depth = this->AppHelper->GetBitsAllocated();
390 int num_comp = this->AppHelper->GetNumberOfComponents();
391
392 this->DataExtent[0] = 0;
393 this->DataExtent[1] = width - 1;
394 this->DataExtent[2] = 0;
395 this->DataExtent[3] = height - 1;
396 this->DataExtent[4] = 0;
397 this->DataExtent[5] = num_slices - 1;
398
399 bool isFloat = this->AppHelper->RescaledImageDataIsFloat();
400
401 bool sign = this->AppHelper->RescaledImageDataIsSigned();
402
403 if (isFloat)
404 {
405 this->SetDataScalarTypeToFloat();
406 }
407 else if (bit_depth <= 8)
408 {
409 this->SetDataScalarTypeToUnsignedChar();
410 }
411 else
412 {
413 if (sign)
414 {
415 this->SetDataScalarTypeToShort();
416 }
417 else
418 {
419 this->SetDataScalarTypeToUnsignedShort();
420 }
421 }
422 this->SetNumberOfScalarComponents(num_comp);
423
424 this->GetPixelSpacing();
425
426 this->vtkImageReader2::ExecuteInformation();
427}
428
429//------------------------------------------------------------------------------
430void vtkDICOMImageReader::SetDirectoryName(const char* dn)

Callers 1

ExecuteInformationMethod · 0.95

Calls 8

GetPixelSpacingMethod · 0.95
GetBitsAllocatedMethod · 0.80
GetWidthMethod · 0.45
GetHeightMethod · 0.45
GetNumberOfComponentsMethod · 0.45

Tested by

no test coverage detected