------------------------------------------------------------------------------
| 383 | |
| 384 | //------------------------------------------------------------------------------ |
| 385 | void 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 | //------------------------------------------------------------------------------ |
| 430 | void vtkDICOMImageReader::SetDirectoryName(const char* dn) |
no test coverage detected