Medical Imaging Interaction Toolkit  2018.4.99-389bf124
Medical Imaging Interaction Toolkit
mitkDicomSR_LoadDICOMRGBPixel.cpp
Go to the documentation of this file.
1 /*============================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
14 
15 namespace mitk
16 {
18  bool correctTilt,
19  const GantryTiltInformation &tiltInfo,
20  DcmIoType::Pointer &io,
21  CallbackCommand *command,
22  Image::Pointer preLoadedImageBlock)
23  {
24  switch (io->GetComponentType())
25  {
26  case DcmIoType::UCHAR:
27  return LoadDICOMByITK<itk::RGBPixel<unsigned char>>(
28  filenames, correctTilt, tiltInfo, io, command, preLoadedImageBlock);
29  case DcmIoType::CHAR:
30  return LoadDICOMByITK<itk::RGBPixel<char>>(filenames, correctTilt, tiltInfo, io, command, preLoadedImageBlock);
31  case DcmIoType::USHORT:
32  return LoadDICOMByITK<itk::RGBPixel<unsigned short>>(
33  filenames, correctTilt, tiltInfo, io, command, preLoadedImageBlock);
34  case DcmIoType::SHORT:
35  return LoadDICOMByITK<itk::RGBPixel<short>>(filenames, correctTilt, tiltInfo, io, command, preLoadedImageBlock);
36  case DcmIoType::UINT:
37  return LoadDICOMByITK<itk::RGBPixel<unsigned int>>(
38  filenames, correctTilt, tiltInfo, io, command, preLoadedImageBlock);
39  case DcmIoType::INT:
40  return LoadDICOMByITK<itk::RGBPixel<int>>(filenames, correctTilt, tiltInfo, io, command, preLoadedImageBlock);
41  case DcmIoType::ULONG:
42  return LoadDICOMByITK<itk::RGBPixel<long unsigned int>>(
43  filenames, correctTilt, tiltInfo, io, command, preLoadedImageBlock);
44  case DcmIoType::LONG:
45  return LoadDICOMByITK<itk::RGBPixel<long int>>(
46  filenames, correctTilt, tiltInfo, io, command, preLoadedImageBlock);
47  case DcmIoType::FLOAT:
48  return LoadDICOMByITK<itk::RGBPixel<float>>(filenames, correctTilt, tiltInfo, io, command, preLoadedImageBlock);
49  case DcmIoType::DOUBLE:
50  return LoadDICOMByITK<itk::RGBPixel<double>>(
51  filenames, correctTilt, tiltInfo, io, command, preLoadedImageBlock);
52  default:
53  MITK_ERROR << "Found unsupported DICOM scalar pixel type: (enum value) " << io->GetComponentType();
54  return nullptr;
55  }
56  }
57 
58 } // end namespace mitk
#define MITK_ERROR
Definition: mitkLogMacros.h:20
std::vector< std::string > StringContainer
Lists of filenames.
DataCollection - Class to facilitate loading/accessing structured data.
static itk::SmartPointer< Image > MultiplexLoadDICOMByITKRGBPixel(const StringContainer &, bool correctTilt, const GantryTiltInformation &tiltInfo, DcmIoType::Pointer &io, CallbackCommand *command, itk::SmartPointer< Image > preLoadedImageBlock)
Progress callback for DicomSeriesReader.