Medical Imaging Interaction Toolkit  2016.11.0
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,
6 Division of Medical and Biological Informatics.
7 All rights reserved.
8 
9 This software is distributed WITHOUT ANY WARRANTY; without
10 even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 A PARTICULAR PURPOSE.
12 
13 See LICENSE.txt or http://www.mitk.org for details.
14 
15 ===================================================================*/
16 
18 
19 namespace mitk
20 {
22  bool correctTilt,
23  const GantryTiltInformation &tiltInfo,
25  CallbackCommand *command,
26  Image::Pointer preLoadedImageBlock)
27  {
28  switch (io->GetComponentType())
29  {
30  case DcmIoType::UCHAR:
31  return LoadDICOMByITK<itk::RGBPixel<unsigned char>>(
32  filenames, correctTilt, tiltInfo, io, command, preLoadedImageBlock);
33  case DcmIoType::CHAR:
34  return LoadDICOMByITK<itk::RGBPixel<char>>(filenames, correctTilt, tiltInfo, io, command, preLoadedImageBlock);
35  case DcmIoType::USHORT:
36  return LoadDICOMByITK<itk::RGBPixel<unsigned short>>(
37  filenames, correctTilt, tiltInfo, io, command, preLoadedImageBlock);
38  case DcmIoType::SHORT:
39  return LoadDICOMByITK<itk::RGBPixel<short>>(filenames, correctTilt, tiltInfo, io, command, preLoadedImageBlock);
40  case DcmIoType::UINT:
41  return LoadDICOMByITK<itk::RGBPixel<unsigned int>>(
42  filenames, correctTilt, tiltInfo, io, command, preLoadedImageBlock);
43  case DcmIoType::INT:
44  return LoadDICOMByITK<itk::RGBPixel<int>>(filenames, correctTilt, tiltInfo, io, command, preLoadedImageBlock);
45  case DcmIoType::ULONG:
46  return LoadDICOMByITK<itk::RGBPixel<long unsigned int>>(
47  filenames, correctTilt, tiltInfo, io, command, preLoadedImageBlock);
48  case DcmIoType::LONG:
49  return LoadDICOMByITK<itk::RGBPixel<long int>>(
50  filenames, correctTilt, tiltInfo, io, command, preLoadedImageBlock);
51  case DcmIoType::FLOAT:
52  return LoadDICOMByITK<itk::RGBPixel<float>>(filenames, correctTilt, tiltInfo, io, command, preLoadedImageBlock);
53  case DcmIoType::DOUBLE:
54  return LoadDICOMByITK<itk::RGBPixel<double>>(
55  filenames, correctTilt, tiltInfo, io, command, preLoadedImageBlock);
56  default:
57  MITK_ERROR << "Found unsupported DICOM scalar pixel type: (enum value) " << io->GetComponentType();
58  return nullptr;
59  }
60  }
61 
62 } // end namespace mitk
itk::SmartPointer< Self > Pointer
#define MITK_ERROR
Definition: mitkLogMacros.h:24
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.