Medical Imaging Interaction Toolkit  2024.06.99-60d9b802
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 txx but part of the interface.*/
23 class OFDateTime;
24 
25 namespace mitk
26 {
27 
29 {
30  public:
31 
34  static const DICOMTag TriggerTimeTag;
35 
36  typedef std::vector<std::string> StringContainer;
37  typedef std::list<StringContainer> StringContainerList;
38 
39  Image::Pointer Load( const StringContainer& filenames, bool correctTilt, const GantryTiltInformation& tiltInfo );
40  Image::Pointer Load3DnT( const StringContainerList& filenamesLists, bool correctTilt, const GantryTiltInformation& tiltInfo );
41 
42  static bool CanHandleFile(const std::string& filename);
43 
44  private:
45 
46  typedef std::vector<TimeBounds> TimeBoundsList;
47  typedef itk::FixedArray<OFDateTime,2> DateTimeBounds;
48 
49 
58  static bool ExtractDateTimeBoundsAndTriggerOfTimeStep( const StringContainer& filenamesOfTimeStep,
59  DateTimeBounds& bounds, TimeBounds& triggerBounds);
60 
61  /* Determine the time bounds in ms respective to the baselineDateTime for the passed
62  files. Additionally it regards the trigger time tag if set and acquisition date time
63  carries not enough information.
64  @param [in, out] usedTriggerBounds Variable used to communicate if preceding time bounds extractions
65  used the trigger time (true). If true is passed to the method, it will use always trigger time
66  to extract the next bounds. Default is false. After the method call is returning the variable indicates
67  the last call used trigger time or not to extract the time bounds.*/
68  static bool ExtractTimeBoundsOfTimeStep(const StringContainer& filenamesOfTimeStep,
69  TimeBounds& bounds,
70  const OFDateTime& baselineDateTime,
71  bool& usedTriggerBounds);
72 
79  static TimeBoundsList ExtractTimeBoundsOfTimeSteps (const StringContainerList& filenamesOfTimeSteps);
80 
84  static TimeGeometry::Pointer GenerateTimeGeometry(const BaseGeometry* templateGeometry, const TimeBoundsList& boundsList);
85 
86  template <typename ImageType>
87  typename ImageType::Pointer
88  FixUpTiltedGeometry( ImageType* input, const GantryTiltInformation& tiltInfo );
89 
90  template <typename PixelType, unsigned int TDim>
92  LoadDICOMByITK( const StringContainer& filenames,
93  bool correctTilt,
94  const GantryTiltInformation& tiltInfo,
95  itk::GDCMImageIO::Pointer& io);
96 
97  template<unsigned int TDim>
99  LoadByTypeDispatch(const StringContainer& filenames,
100  bool correctTilt,
101  const GantryTiltInformation& tiltInfo,
102  itk::GDCMImageIO::Pointer& io);
103 
104 
105  template <typename PixelType>
107  LoadDICOMByITK3DnT( const StringContainerList& filenames,
108  bool correctTilt,
109  const GantryTiltInformation& tiltInfo,
110  itk::GDCMImageIO::Pointer& io);
111 
112 
113 };
114 
115 }
116 
117 #endif
mitk::ITKDICOMSeriesReaderHelper::TriggerTimeTag
static const DICOMTag TriggerTimeTag
Definition: mitkITKDICOMSeriesReaderHelper.h:34
mitkImage.h
mitk::ITKDICOMSeriesReaderHelper::Load3DnT
Image::Pointer Load3DnT(const StringContainerList &filenamesLists, bool correctTilt, const GantryTiltInformation &tiltInfo)
mitk::ITKDICOMSeriesReaderHelper::AcquisitionDateTag
static const DICOMTag AcquisitionDateTag
Definition: mitkITKDICOMSeriesReaderHelper.h:32
itk::SmartPointer< Self >
mitk::ITKDICOMSeriesReaderHelper::StringContainer
std::vector< std::string > StringContainer
Definition: mitkITKDICOMSeriesReaderHelper.h:36
mitk::DICOMTag
Representation of a DICOM tag.
Definition: mitkDICOMTag.h:32
mitk::GantryTiltInformation
Gantry tilt analysis result.
Definition: mitkGantryTiltInformation.h:38
mitk
Find image slices visible on a given plane.
Definition: RenderingTests.dox:1
mitk::ITKDICOMSeriesReaderHelper::Load
Image::Pointer Load(const StringContainer &filenames, bool correctTilt, const GantryTiltInformation &tiltInfo)
mitk::ITKDICOMSeriesReaderHelper::StringContainerList
std::list< StringContainer > StringContainerList
Definition: mitkITKDICOMSeriesReaderHelper.h:37
mitkGantryTiltInformation.h
mitk::BaseGeometry
BaseGeometry Describes the geometry of a data object.
Definition: mitkBaseGeometry.h:94
mitk::ITKDICOMSeriesReaderHelper::CanHandleFile
static bool CanHandleFile(const std::string &filename)
mitkDICOMTag.h
mitk::ITKDICOMSeriesReaderHelper::AcquisitionTimeTag
static const DICOMTag AcquisitionTimeTag
Definition: mitkITKDICOMSeriesReaderHelper.h:33
mitk::TimeBounds
itk::FixedArray< ScalarType, 2 > TimeBounds
Standard typedef for time-bounds.
Definition: mitkBaseGeometry.h:44
mitk::ITKDICOMSeriesReaderHelper
Definition: mitkITKDICOMSeriesReaderHelper.h:28