Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
mitkITKDICOMSeriesReaderHelper.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 mitkITKDICOMSeriesReaderHelper_h
14 #define mitkITKDICOMSeriesReaderHelper_h
15 
16 #include <mitkImage.h>
18 #include <mitkDICOMTag.h>
19 
20 #include <itkGDCMImageIO.h>
21 
22 /* Forward deceleration of an DCMTK class. Used in the tpp but part of the interface.*/
23 class OFDateTime;
24 
25 namespace mitk
26 {
27 
39 {
40  public:
41 
44  static const DICOMTag TriggerTimeTag;
45 
47  typedef std::vector<std::string> StringContainer;
49  typedef std::list<StringContainer> StringContainerList;
50 
58  Image::Pointer Load( const StringContainer& filenames, bool correctTilt, const GantryTiltInformation& tiltInfo );
59 
67  Image::Pointer Load3DnT( const StringContainerList& filenamesLists, bool correctTilt, const GantryTiltInformation& tiltInfo );
68 
74  static bool CanHandleFile(const std::string& filename);
75 
76  private:
77 
78  typedef std::vector<TimeBounds> TimeBoundsList;
79  typedef itk::FixedArray<OFDateTime,2> DateTimeBounds;
80 
81 
91  static bool ExtractDateTimeBoundsAndTriggerOfTimeStep( const StringContainer& filenamesOfTimeStep,
92  DateTimeBounds& bounds, TimeBounds& triggerBounds);
93 
104  static bool ExtractTimeBoundsOfTimeStep(const StringContainer& filenamesOfTimeStep,
105  TimeBounds& bounds,
106  const OFDateTime& baselineDateTime,
107  bool& usedTriggerBounds);
108 
115  static TimeBoundsList ExtractTimeBoundsOfTimeSteps (const StringContainerList& filenamesOfTimeSteps);
116 
120  static TimeGeometry::Pointer GenerateTimeGeometry(const BaseGeometry* templateGeometry, const TimeBoundsList& boundsList);
121 
122  template <typename ImageType>
123  typename ImageType::Pointer
124  FixUpTiltedGeometry( ImageType* input, const GantryTiltInformation& tiltInfo );
125 
126  template <typename PixelType, unsigned int TDim>
127  Image::Pointer
128  LoadDICOMByITK( const StringContainer& filenames,
129  bool correctTilt,
130  const GantryTiltInformation& tiltInfo,
131  itk::GDCMImageIO::Pointer& io);
132 
133  template<unsigned int TDim>
134  mitk::Image::Pointer
135  LoadByTypeDispatch(const StringContainer& filenames,
136  bool correctTilt,
137  const GantryTiltInformation& tiltInfo,
138  itk::GDCMImageIO::Pointer& io);
139 
140 
141  template <typename PixelType>
142  Image::Pointer
143  LoadDICOMByITK3DnT( const StringContainerList& filenames,
144  bool correctTilt,
145  const GantryTiltInformation& tiltInfo,
146  itk::GDCMImageIO::Pointer& io);
147 
148 
149 };
150 
151 }
152 
153 #endif
Abstract base class describing the geometry of a data object.
Representation of a DICOM tag.
Definition: mitkDICOMTag.h:33
Gantry tilt analysis result.
Helper class that uses ITK's ImageSeriesReader to load DICOM images.
std::vector< std::string > StringContainer
A list of file path strings for a single 3D volume.
static const DICOMTag AcquisitionTimeTag
DICOM tag (0008,0032) Acquisition Time.
Image::Pointer Load(const StringContainer &filenames, bool correctTilt, const GantryTiltInformation &tiltInfo)
Load a single 3D DICOM image from the given files.
static bool CanHandleFile(const std::string &filename)
Check if the given file can be handled by this reader (i.e. is readable by GDCM).
std::list< StringContainer > StringContainerList
A list of StringContainer instances, one per time step (for 3D+t loading).
static const DICOMTag TriggerTimeTag
DICOM tag (0018,1060) Trigger Time.
static const DICOMTag AcquisitionDateTag
DICOM tag (0008,0022) Acquisition Date.
Image::Pointer Load3DnT(const StringContainerList &filenamesLists, bool correctTilt, const GantryTiltInformation &tiltInfo)
Load a 3D+t DICOM image from multiple time step file lists.
Find image slices visible on a given plane.
itk::FixedArray< ScalarType, 2 > TimeBounds
Fixed-size array holding a pair of time bound values [min, max] in milliseconds.