Medical Imaging Interaction Toolkit  2018.4.99-389bf124
Medical Imaging Interaction Toolkit
mitkDicomSR_LoadDICOMScalar.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<unsigned char>(filenames, correctTilt, tiltInfo, io, command, preLoadedImageBlock);
28  case DcmIoType::CHAR:
29  return LoadDICOMByITK<char>(filenames, correctTilt, tiltInfo, io, command, preLoadedImageBlock);
30  case DcmIoType::USHORT:
31  return LoadDICOMByITK<unsigned short>(filenames, correctTilt, tiltInfo, io, command, preLoadedImageBlock);
32  case DcmIoType::SHORT:
33  return LoadDICOMByITK<short>(filenames, correctTilt, tiltInfo, io, command, preLoadedImageBlock);
34  case DcmIoType::UINT:
35  return LoadDICOMByITK<unsigned int>(filenames, correctTilt, tiltInfo, io, command, preLoadedImageBlock);
36  case DcmIoType::INT:
37  return LoadDICOMByITK<int>(filenames, correctTilt, tiltInfo, io, command, preLoadedImageBlock);
38  case DcmIoType::ULONG:
39  return LoadDICOMByITK<long unsigned int>(filenames, correctTilt, tiltInfo, io, command, preLoadedImageBlock);
40  case DcmIoType::LONG:
41  return LoadDICOMByITK<long int>(filenames, correctTilt, tiltInfo, io, command, preLoadedImageBlock);
42  case DcmIoType::FLOAT:
43  return LoadDICOMByITK<float>(filenames, correctTilt, tiltInfo, io, command, preLoadedImageBlock);
44  case DcmIoType::DOUBLE:
45  return LoadDICOMByITK<double>(filenames, correctTilt, tiltInfo, io, command, preLoadedImageBlock);
46  default:
47  MITK_ERROR << "Found unsupported DICOM scalar pixel type: (enum value) " << io->GetComponentType();
48  return nullptr;
49  }
50  }
51 
52 } // end namespace mitk
53 
#define MITK_ERROR
Definition: mitkLogMacros.h:20
std::vector< std::string > StringContainer
Lists of filenames.
DataCollection - Class to facilitate loading/accessing structured data.
Progress callback for DicomSeriesReader.
static itk::SmartPointer< Image > MultiplexLoadDICOMByITKScalar(const StringContainer &, bool correctTilt, const GantryTiltInformation &tiltInfo, DcmIoType::Pointer &io, CallbackCommand *command, itk::SmartPointer< Image > preLoadedImageBlock)