Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
mitkDicomSeriesReader.h
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 
13 #ifndef mitkDicomSeriesReader_h
14 #define mitkDicomSeriesReader_h
15 
16 #include <mitkConfig.h>
17 #include <mitkDataNode.h>
18 
19 #include <itkGDCMImageIO.h>
20 
21 #include <itkCommand.h>
22 #include <itkImageSeriesReader.h>
23 
24 #ifdef NOMINMAX
25 #define DEF_NOMINMAX
26 #undef NOMINMAX
27 #endif
28 
29 #include <gdcmConfigure.h>
30 
31 #ifdef DEF_NOMINMAX
32 #ifndef NOMINMAX
33 #define NOMINMAX
34 #endif
35 #undef DEF_NOMINMAX
36 #endif
37 
38 #include <gdcmDataSet.h>
39 #include <gdcmScanner.h>
40 
41 namespace mitk
42 {
344  class Image;
345 
347  {
348  public:
352  typedef std::vector<std::string> StringContainer;
353 
359  typedef void (*UpdateCallBackMethod)(float);
360 
371  typedef enum {
377 
383  typedef enum {
388 
397  {
398  public:
401 
403  std::string GetImageBlockUID() const;
404 
406  std::string GetSeriesInstanceUID() const;
407 
409  std::string GetModality() const;
410 
412  std::string GetSOPClassUIDAsString() const;
413 
415  std::string GetSOPClassUID() const;
416 
419 
422 
428  bool PixelSpacingIsUnknown() const;
429 
432 
434  bool HasMultipleTimePoints() const;
435 
437  bool IsMultiFrameImage() const;
438 
441 
442  private:
443  friend class DicomSeriesReader;
444 
446 
447  void AddFile(const std::string &file);
448  void AddFiles(const StringContainer &files);
449 
450  void SetImageBlockUID(const std::string &uid);
451 
452  void SetSeriesInstanceUID(const std::string &uid);
453 
454  void SetModality(const std::string &modality);
455 
456  void SetNumberOfFrames(const std::string &);
457 
458  void SetSOPClassUID(const std::string &mediaStorageSOPClassUID);
459 
460  void SetHasGantryTiltCorrected(bool);
461 
462  void SetPixelSpacingInformation(const std::string &pixelSpacing, const std::string &imagerPixelSpacing);
463 
464  void SetHasMultipleTimePoints(bool);
465 
466  void GetDesiredMITKImagePixelSpacing(ScalarType &spacingX, ScalarType &spacingY) const;
467 
468  StringContainer m_Filenames;
469  std::string m_ImageBlockUID;
470  std::string m_SeriesInstanceUID;
471  std::string m_Modality;
472  std::string m_SOPClassUID;
473  bool m_HasGantryTiltCorrected;
474  std::string m_PixelSpacing;
475  std::string m_ImagerPixelSpacing;
476  bool m_HasMultipleTimePoints;
477  bool m_IsMultiFrameImage;
478  };
479 
481  typedef std::map<std::string, ImageBlockDescriptor> FileNamesGrouping;
482 
491  static std::string GetConfigurationString();
492 
499  static bool IsDicom(const std::string &filename);
500 
514  static FileNamesGrouping GetSeries(const std::string &dir,
515  bool groupImagesWithGantryTilt,
516  const StringContainer &restrictions = StringContainer());
517 
533  static StringContainer GetSeries(const std::string &dir,
534  const std::string &series_uid,
535  bool groupImagesWithGantryTilt,
536  const StringContainer &restrictions = StringContainer());
537 
562  bool sortTo3DPlust,
563  bool groupImagesWithGantryTilt,
564  const StringContainer &restrictions = StringContainer());
565 
580  bool groupImagesWithGantryTilt,
581  const StringContainer &restrictions = StringContainer());
582 
598  static DataNode::Pointer LoadDicomSeries(const StringContainer &filenames,
599  bool sort = true,
600  bool load4D = true,
601  bool correctGantryTilt = true,
602  UpdateCallBackMethod callback = nullptr,
603  itk::SmartPointer<Image> preLoadedImageBlock = nullptr);
604 
621  static bool LoadDicomSeries(const StringContainer &filenames,
622  DataNode &node,
623  bool sort = true,
624  bool load4D = true,
625  bool correctGantryTilt = true,
626  UpdateCallBackMethod callback = nullptr,
627  itk::SmartPointer<Image> preLoadedImageBlock = nullptr);
628 
629  protected:
642  {
643  public:
645 
651 
657 
663 
669  void AddFileToSortedBlock(const std::string &filename);
670 
676  void AddFileToUnsortedBlock(const std::string &filename);
677 
683  void AddFilesToUnsortedBlock(const StringContainer &filenames);
684 
691 
699 
700  protected:
703 
705  };
706 
719  {
720  public:
721  // two types to avoid any rounding errors
722  typedef itk::Point<double, 3> Point3Dd;
723  typedef itk::Vector<double, 3> Vector3Dd;
724 
729 
747  const Point3D &origin2,
748  const Vector3D &right,
749  const Vector3D &up,
750  unsigned int numberOfSlicesApart);
751 
757  bool IsSheared() const;
758 
768  bool IsRegularGantryTilt() const;
769 
774 
778  double GetRealZSpacing() const;
779 
786 
790  double GetTiltAngleInDegrees() const;
791 
792  protected:
796  Point3D projectPointOnLine(Point3Dd p, Point3Dd lineOrigin, Vector3Dd lineDirection);
797 
798  double m_ShiftUp;
799  double m_ShiftRight;
802  unsigned int m_NumberOfSlicesApart;
803  };
804 
806  typedef std::pair<StringContainer, StringContainer> TwoStringContainers;
807 
809  typedef std::map<std::string, std::string> TagToPropertyMapType;
810 
827  const StringContainer &files, bool groupsOfSimilarImages, const gdcm::Scanner::MappingType &tagValueMappings_);
828 
835  static std::string ConstCharStarToString(const char *s);
836 
845  static bool DICOMStringToSpacing(const std::string &s, ScalarType &spacingX, ScalarType &spacingY);
846 
857  static Point3D DICOMStringToPoint3D(const std::string &s, bool &successful);
858 
870  static void DICOMStringToOrientationVectors(const std::string &s, Vector3D &right, Vector3D &up, bool &successful);
871 
884  template <typename ImageType>
885  static typename ImageType::Pointer
886  InPlaceFixUpTiltedGeometry(ImageType *input, const GantryTiltInformation &tiltInfo);
887 
907  static StringContainer SortSeriesSlices(const StringContainer &unsortedFilenames);
908 
909  public:
918  static bool IsPhilips3DDicom(const std::string &filename);
919 
926  static std::string ReaderImplementationLevelToString(const ReaderImplementationLevel &enumValue);
927 
935 
936  protected:
944  static bool ReadPhilips3DDicom(const std::string &filename, itk::SmartPointer<Image> output_image);
945 
955  static std::string CreateMoreUniqueSeriesIdentifier(gdcm::Scanner::TagToValue &tagValueMap);
956 
964  static std::string CreateSeriesIdentifierPart(gdcm::Scanner::TagToValue &tagValueMap, const gdcm::Tag &tag);
965 
974  static std::string IDifyTagValue(const std::string &value);
975 
977  typedef itk::GDCMImageIO DcmIoType;
978 
985  class CallbackCommand : public itk::Command
986  {
987  public:
990 
992  void Execute(const itk::Object *caller, const itk::EventObject &) override
993  {
994  (*this->m_Callback)(static_cast<const itk::ProcessObject *>(caller)->GetProgress());
995  }
996 
998  void Execute(itk::Object *caller, const itk::EventObject &) override
999  {
1000  (*this->m_Callback)(static_cast<itk::ProcessObject *>(caller)->GetProgress());
1001  }
1002 
1003  protected:
1005  };
1006 
1013  static void FixSpacingInformation(Image *image, const ImageBlockDescriptor &imageBlockDescriptor);
1014 
1024  static void ScanForSliceInformation(const StringContainer &filenames, gdcm::Scanner &scanner);
1025 
1040  static void LoadDicom(const StringContainer &filenames,
1041  DataNode &node,
1042  bool sort,
1043  bool check_4d,
1044  bool correctTilt,
1045  UpdateCallBackMethod callback,
1046  itk::SmartPointer<Image> preLoadedImageBlock);
1047 
1059  template <typename PixelType>
1061  bool correctTilt,
1062  const GantryTiltInformation &tiltInfo,
1063  DcmIoType::Pointer &io,
1064  CallbackCommand *command,
1065  itk::SmartPointer<Image> preLoadedImageBlock);
1066 
1069  bool correctTilt,
1070  const GantryTiltInformation &tiltInfo,
1071  DcmIoType::Pointer &io,
1072  CallbackCommand *command,
1073  itk::SmartPointer<Image> preLoadedImageBlock);
1074 
1077  bool correctTilt,
1078  const GantryTiltInformation &tiltInfo,
1079  DcmIoType::Pointer &io,
1080  CallbackCommand *command,
1081  itk::SmartPointer<Image> preLoadedImageBlock);
1082 
1085  bool correctTilt,
1086  const GantryTiltInformation &tiltInfo,
1087  DcmIoType::Pointer &io,
1088  CallbackCommand *command,
1089  itk::SmartPointer<Image> preLoadedImageBlock);
1090 
1106  template <typename PixelType>
1107  static itk::SmartPointer<Image> LoadDICOMByITK4D(std::list<StringContainer> &imageBlocks,
1108  ImageBlockDescriptor imageBlockDescriptor,
1109  bool correctTilt,
1110  const GantryTiltInformation &tiltInfo,
1111  DcmIoType::Pointer &io,
1112  CallbackCommand *command,
1113  itk::SmartPointer<Image> preLoadedImageBlock);
1114 
1116  static itk::SmartPointer<Image> MultiplexLoadDICOMByITK4D(std::list<StringContainer> &imageBlocks,
1117  ImageBlockDescriptor imageBlockDescriptor,
1118  bool correctTilt,
1119  const GantryTiltInformation &tiltInfo,
1120  DcmIoType::Pointer &io,
1121  CallbackCommand *command,
1122  itk::SmartPointer<Image> preLoadedImageBlock);
1123 
1125  static itk::SmartPointer<Image> MultiplexLoadDICOMByITK4DScalar(std::list<StringContainer> &imageBlocks,
1126  ImageBlockDescriptor imageBlockDescriptor,
1127  bool correctTilt,
1128  const GantryTiltInformation &tiltInfo,
1129  DcmIoType::Pointer &io,
1130  CallbackCommand *command,
1131  itk::SmartPointer<Image> preLoadedImageBlock);
1132 
1134  static itk::SmartPointer<Image> MultiplexLoadDICOMByITK4DRGBPixel(std::list<StringContainer> &imageBlocks,
1135  ImageBlockDescriptor imageBlockDescriptor,
1136  bool correctTilt,
1137  const GantryTiltInformation &tiltInfo,
1138  DcmIoType::Pointer &io,
1139  CallbackCommand *command,
1140  itk::SmartPointer<Image> preLoadedImageBlock);
1141 
1162  static std::list<StringContainer> SortIntoBlocksFor3DplusT(const StringContainer &presortedFilenames,
1163  const gdcm::Scanner::MappingType &tagValueMappings_,
1164  bool sort,
1165  bool &canLoadAs4D);
1166 
1177  static bool GdcmSortFunction(const gdcm::DataSet &ds1, const gdcm::DataSet &ds2);
1178 
1194  const gdcm::Scanner::MappingType &tagValueMappings_,
1195  DcmIoType *io,
1196  const ImageBlockDescriptor &blockInfo,
1197  Image *image);
1198 
1210  static void CopyMetaDataToImageProperties(std::list<StringContainer> imageBlock,
1211  const gdcm::Scanner::MappingType &tagValueMappings_,
1212  DcmIoType *io,
1213  const ImageBlockDescriptor &blockInfo,
1214  Image *image);
1215 
1227  };
1228 }
1229 
1230 #endif
Central node class of the MITK data tree, associating a data object with properties and mappers.
Definition: mitkDataNode.h:72
ITK command adapter for progress callbacks.
void Execute(const itk::Object *caller, const itk::EventObject &) override
Execute the callback with the progress value from a const ITK process object.
UpdateCallBackMethod m_Callback
The wrapped progress callback.
void Execute(itk::Object *caller, const itk::EventObject &) override
Execute the callback with the progress value from an ITK process object.
CallbackCommand(UpdateCallBackMethod callback)
Construct with the given callback function pointer.
GantryTiltInformation(const Point3D &origin1, const Point3D &origin2, const Vector3D &right, const Vector3D &up, unsigned int numberOfSlicesApart)
THE constructor, which does all the calculations.
double GetRealZSpacing() const
The z / inter-slice spacing. Needed to correct ImageSeriesReader's result.
bool IsSheared() const
Whether the slices were sheared.
double GetTiltCorrectedAdditionalSize() const
The shift between first and last slice in mm.
double GetMatrixCoefficientForCorrectionInWorldCoordinates() const
The offset distance in Y direction for each slice in mm (describes the tilt result).
GantryTiltInformation()
Just so we can create empty instances for assigning results later.
Point3D projectPointOnLine(Point3Dd p, Point3Dd lineOrigin, Vector3Dd lineDirection)
Projection of point p onto line through lineOrigin in direction of lineDirection.
double GetTiltAngleInDegrees() const
Calculated tilt angle in degrees.
bool IsRegularGantryTilt() const
Whether the shearing is a gantry tilt or more complicated.
Return type of GetSeries, describes a logical group of DICOM files.
ReaderImplementationLevel GetReaderImplementationLevel() const
Get the confidence level of the reader for this block.
bool IsMultiFrameImage() const
Whether this block contains multi-frame image(s).
std::string GetImageBlockUID() const
Get a unique ID describing this block (enhanced Series Instance UID).
std::string GetSOPClassUID() const
Get the SOP Class UID as a DICOM UID string.
bool PixelSpacingRelatesToDetector() const
Whether mitk::Image spacing relates to the detector surface.
bool HasMultipleTimePoints() const
Whether this block contains multiple time points (3D+t).
bool HasGantryTiltCorrected() const
Whether the block contains a gantry tilt which will be corrected during loading.
std::string GetModality() const
Get the series modality (CT, MR, etc.).
std::string GetSeriesInstanceUID() const
Get the Series Instance UID.
std::string GetSOPClassUIDAsString() const
Get the SOP Class UID as a readable string (e.g., "Computed Tomography Image Storage").
PixelSpacingInterpretation GetPixelSpacingType() const
Get the interpretation of the mitk::Image pixel spacing.
bool PixelSpacingRelatesToPatient() const
Whether mitk::Image spacing relates to the patient.
bool PixelSpacingIsUnknown() const
Whether mitk::Image spacing origin is unknown.
StringContainer GetFilenames() const
Get the list of filenames in this group.
Return type of DicomSeriesReader::AnalyzeFileForITKImageSeriesReaderSpacingAssumption.
void AddFileToUnsortedBlock(const std::string &filename)
Add a file to the unsorted (remaining) block.
StringContainer m_UnsortedFiles
Files that could not be grouped.
StringContainer GetUnsortedFilenames()
Get the remaining files which could not be grouped.
void AddFileToSortedBlock(const std::string &filename)
Add a file to the sorted (grouped) block.
bool m_GantryTilt
Whether gantry tilt was detected.
void UndoPrematureGrouping()
Undo a premature grouping decision.
bool ContainsGantryTilt()
Whether the grouped result contains a gantry tilt.
void FlagGantryTilt()
Flag this result as containing a gantry tilt.
void AddFilesToUnsortedBlock(const StringContainer &filenames)
Add multiple files to the unsorted (remaining) block.
StringContainer m_GroupedFiles
Files that form a valid image block.
StringContainer GetBlockFilenames()
Get the grouped filenames (all with same origin-to-origin distance, no gaps).
static itk::SmartPointer< Image > LoadDICOMByITK(const StringContainer &, bool correctTilt, const GantryTiltInformation &tiltInfo, DcmIoType::Pointer &io, CallbackCommand *command, itk::SmartPointer< Image > preLoadedImageBlock)
Feed files into itk::ImageSeriesReader and retrieve a 3D MITK image.
static Point3D DICOMStringToPoint3D(const std::string &s, bool &successful)
Convert a DICOM string describing a 3D point to Point3D.
static std::string ConstCharStarToString(const char *s)
Safely convert a const char pointer to std::string.
std::vector< std::string > StringContainer
Container type for lists of DICOM filenames.
static std::string PixelSpacingInterpretationToString(const PixelSpacingInterpretation &enumValue)
Convert a PixelSpacingInterpretation enum value to a human-readable string.
PixelSpacingInterpretation
How the mitk::Image pixel spacing should be interpreted.
@ PixelSpacingInterpretation_SpacingInPatient
Distances are mm within a patient.
@ PixelSpacingInterpretation_SpacingUnknown
No spacing information is present; (1,1) is used as default.
@ PixelSpacingInterpretation_SpacingAtDetector
Distances are mm at detector surface.
static bool ReadPhilips3DDicom(const std::string &filename, itk::SmartPointer< Image > output_image)
Read a Philips 3D ultrasound DICOM file and load it into an mitk::Image.
static itk::SmartPointer< Image > MultiplexLoadDICOMByITK4D(std::list< StringContainer > &imageBlocks, ImageBlockDescriptor imageBlockDescriptor, bool correctTilt, const GantryTiltInformation &tiltInfo, DcmIoType::Pointer &io, CallbackCommand *command, itk::SmartPointer< Image > preLoadedImageBlock)
Pixel-type multiplexer for LoadDICOMByITK4D – dispatches to scalar or RGB variants.
static void FixSpacingInformation(Image *image, const ImageBlockDescriptor &imageBlockDescriptor)
Correct the pixel spacing of a loaded image based on the image block descriptor.
itk::GDCMImageIO DcmIoType
Typedef for the GDCM image IO class used internally.
static FileNamesGrouping GetSeries(const StringContainer &files, bool sortTo3DPlust, bool groupImagesWithGantryTilt, const StringContainer &restrictions=StringContainer())
PREFERRED version – scan and sort a list of DICOM files into loadable blocks.
static FileNamesGrouping GetSeries(const std::string &dir, bool groupImagesWithGantryTilt, const StringContainer &restrictions=StringContainer())
Find all series (and sub-series) in a particular directory.
static void DICOMStringToOrientationVectors(const std::string &s, Vector3D &right, Vector3D &up, bool &successful)
Convert a DICOM orientation string to two direction vectors.
static std::string IDifyTagValue(const std::string &value)
Sanitize a tag value string for use as part of a UID.
ReaderImplementationLevel
Describes how well the reader is tested for a certain file type (SOP Class).
@ ReaderImplementationLevel_Unsupported
Loader code is not working with this SOP Class.
@ ReaderImplementationLevel_PartlySupported
Loader code and tests are established for specific parts of a SOP Class.
@ ReaderImplementationLevel_Implemented
Loader code is implemented but not accompanied by tests.
@ ReaderImplementationLevel_Supported
Loader code and tests are established.
void(* UpdateCallBackMethod)(float)
Function pointer type for progress callbacks.
static void LoadDicom(const StringContainer &filenames, DataNode &node, bool sort, bool check_4d, bool correctTilt, UpdateCallBackMethod callback, itk::SmartPointer< Image > preLoadedImageBlock)
Perform the actual loading of a DICOM series.
static std::string CreateMoreUniqueSeriesIdentifier(gdcm::Scanner::TagToValue &tagValueMap)
Construct a UID that incorporates sorting criteria from GetSeries().
static std::string GetConfigurationString()
Provide the combination of preprocessor defines that was active during compilation.
static DataNode::Pointer LoadDicomSeries(const StringContainer &filenames, bool sort=true, bool load4D=true, bool correctGantryTilt=true, UpdateCallBackMethod callback=nullptr, itk::SmartPointer< Image > preLoadedImageBlock=nullptr)
Load a DICOM series into a new DataNode.
static itk::SmartPointer< Image > MultiplexLoadDICOMByITKScalar(const StringContainer &, bool correctTilt, const GantryTiltInformation &tiltInfo, DcmIoType::Pointer &io, CallbackCommand *command, itk::SmartPointer< Image > preLoadedImageBlock)
Scalar pixel type multiplexer for LoadDICOMByITK.
static bool LoadDicomSeries(const StringContainer &filenames, DataNode &node, bool sort=true, bool load4D=true, bool correctGantryTilt=true, UpdateCallBackMethod callback=nullptr, itk::SmartPointer< Image > preLoadedImageBlock=nullptr)
Load a DICOM series into an existing DataNode.
static bool GdcmSortFunction(const gdcm::DataSet &ds1, const gdcm::DataSet &ds2)
Spatial sorting comparator for GDCM 2 datasets.
std::map< std::string, std::string > TagToPropertyMapType
Map type from DICOM tag strings to MITK property name strings.
static std::string CreateSeriesIdentifierPart(gdcm::Scanner::TagToValue &tagValueMap, const gdcm::Tag &tag)
Extract a single tag value as a string for use in CreateMoreUniqueSeriesIdentifier().
static std::list< StringContainer > SortIntoBlocksFor3DplusT(const StringContainer &presortedFilenames, const gdcm::Scanner::MappingType &tagValueMappings_, bool sort, bool &canLoadAs4D)
Sort files into time step blocks for 3D+t image loading.
static bool IsPhilips3DDicom(const std::string &filename)
Check if a specific file is a Philips 3D ultrasound DICOM file.
static void CopyMetaDataToImageProperties(StringContainer filenames, const gdcm::Scanner::MappingType &tagValueMappings_, DcmIoType *io, const ImageBlockDescriptor &blockInfo, Image *image)
Copy DICOM tag information to the PropertyList of an mitk::Image (single block).
static std::string ReaderImplementationLevelToString(const ReaderImplementationLevel &enumValue)
Convert a ReaderImplementationLevel enum value to a human-readable string.
static itk::SmartPointer< Image > LoadDICOMByITK4D(std::list< StringContainer > &imageBlocks, ImageBlockDescriptor imageBlockDescriptor, bool correctTilt, const GantryTiltInformation &tiltInfo, DcmIoType::Pointer &io, CallbackCommand *command, itk::SmartPointer< Image > preLoadedImageBlock)
Feed files into itk::ImageSeriesReader for 3D+t loading.
static FileNamesGrouping GetSeries(const StringContainer &files, bool groupImagesWithGantryTilt, const StringContainer &restrictions=StringContainer())
Scan and sort DICOM files (without explicit 3D+t control).
static StringContainer GetSeries(const std::string &dir, const std::string &series_uid, bool groupImagesWithGantryTilt, const StringContainer &restrictions=StringContainer())
Find files belonging to a specific DICOM series in a directory.
static itk::SmartPointer< Image > MultiplexLoadDICOMByITK4DScalar(std::list< StringContainer > &imageBlocks, ImageBlockDescriptor imageBlockDescriptor, bool correctTilt, const GantryTiltInformation &tiltInfo, DcmIoType::Pointer &io, CallbackCommand *command, itk::SmartPointer< Image > preLoadedImageBlock)
Scalar pixel type multiplexer for LoadDICOMByITK4D.
static ImageType::Pointer InPlaceFixUpTiltedGeometry(ImageType *input, const GantryTiltInformation &tiltInfo)
Correct a tilted image geometry by resampling with a shear transformation.
static StringContainer SortSeriesSlices(const StringContainer &unsortedFilenames)
static itk::SmartPointer< Image > MultiplexLoadDICOMByITK4DRGBPixel(std::list< StringContainer > &imageBlocks, ImageBlockDescriptor imageBlockDescriptor, bool correctTilt, const GantryTiltInformation &tiltInfo, DcmIoType::Pointer &io, CallbackCommand *command, itk::SmartPointer< Image > preLoadedImageBlock)
RGB pixel type multiplexer for LoadDICOMByITK4D.
static const TagToPropertyMapType & GetDICOMTagsToMITKPropertyMap()
Get the mapping from DICOM tags to MITK property names.
static bool IsDicom(const std::string &filename)
Check if a specific file contains DICOM data.
std::pair< StringContainer, StringContainer > TwoStringContainers
Pair of string containers used for internal sorting operations.
static void CopyMetaDataToImageProperties(std::list< StringContainer > imageBlock, const gdcm::Scanner::MappingType &tagValueMappings_, DcmIoType *io, const ImageBlockDescriptor &blockInfo, Image *image)
Copy DICOM tag information to the PropertyList of an mitk::Image (4D blocks).
static void ScanForSliceInformation(const StringContainer &filenames, gdcm::Scanner &scanner)
Scan DICOM files for slice-relevant tag information.
static itk::SmartPointer< Image > MultiplexLoadDICOMByITKRGBPixel(const StringContainer &, bool correctTilt, const GantryTiltInformation &tiltInfo, DcmIoType::Pointer &io, CallbackCommand *command, itk::SmartPointer< Image > preLoadedImageBlock)
RGB pixel type multiplexer for LoadDICOMByITK.
std::map< std::string, ImageBlockDescriptor > FileNamesGrouping
Map type from enhanced UID strings to ImageBlockDescriptor instances.
static SliceGroupingAnalysisResult AnalyzeFileForITKImageSeriesReaderSpacingAssumption(const StringContainer &files, bool groupsOfSimilarImages, const gdcm::Scanner::MappingType &tagValueMappings_)
Ensure equal z-spacing for a group of files.
static bool DICOMStringToSpacing(const std::string &s, ScalarType &spacingX, ScalarType &spacingY)
Parse a DICOM spacing string into pixel spacing X and Y values.
static itk::SmartPointer< Image > MultiplexLoadDICOMByITK(const StringContainer &, bool correctTilt, const GantryTiltInformation &tiltInfo, DcmIoType::Pointer &io, CallbackCommand *command, itk::SmartPointer< Image > preLoadedImageBlock)
Pixel-type multiplexer for LoadDICOMByITK – dispatches to scalar or RGB variants.
Image class for storing multi-dimensional medical image data.
Definition: mitkImage.h:76
class ITK_EXPORT Image
Find image slices visible on a given plane.
double ScalarType
Scalar type used throughout MITK for geometric computations.