Medical Imaging Interaction Toolkit  2018.4.99-12ad79a3
Medical Imaging Interaction Toolkit
mitkClassicDICOMSeriesReader.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 
16 #include "mitkDICOMSortByTag.h"
18 
19 
23 {
24  mitk::DICOMTagBasedSorter::Pointer tagSorter = mitk::DICOMTagBasedSorter::New();
25 
26  // all the things that split by tag in mitk::DicomSeriesReader
27  tagSorter->AddDistinguishingTag( DICOMTag(0x0020, 0x000e) ); // Series Instance UID
28  //tagSorter->AddDistinguishingTag( DICOMTag(0x0020, 0x0052) ); // Frame of Reference UID
29 
30  // a sorter...
31  mitk::DICOMSortCriterion::ConstPointer sorting =
32  mitk::SortByImagePositionPatient::New( // image position patient and image orientation
33  mitk::DICOMSortByTag::New( DICOMTag(0x0020, 0x0012), // aqcuisition number
34  mitk::DICOMSortByTag::New( DICOMTag(0x0008, 0x0032), // aqcuisition time
35  mitk::DICOMSortByTag::New( DICOMTag(0x0018, 0x1060), // trigger time
36  mitk::DICOMSortByTag::New( DICOMTag(0x0008, 0x0018) // SOP instance UID (last resort, not really meaningful but decides clearly)
37  ).GetPointer()
38  ).GetPointer()
39  ).GetPointer()
40  ).GetPointer()
41  ).GetPointer();
42  tagSorter->SetSortCriterion( sorting );
43  tagSorter->SetStrictSorting(false); // nothing did enforce constant distances before, there was just the EquiDistantBlocksSorter logic
44 
45  // define above sorting for this class
46  this->AddSortingElement( tagSorter );
47 
48  this->SetFixTiltByShearing(true); // that was configurable, default was true
49  this->SetToleratedOriginOffset(0.005); // was hard-coded
50  this->SetGroup3DandT(true); // that was configurable, default was true
51 
52  m_EquiDistantBlocksSorter->SetAcceptTwoSlicesGroups(false); // old reader did not accept that
53 
54  this->SetConfigurationLabel("2013 sorting logic");
55  this->SetConfigurationDescription("Sort by Image Position, then Acquisition Number, Time, Trigger time, group by 3D+t, group tilted images");
56 }
57 
61 {
62 }
63 
66 {
67 }
68 
72 {
73  if (this != &other)
74  {
76  }
77  return *this;
78 }
79 
80 bool
82 ::operator==(const DICOMFileReader& other) const
83 {
84  if (dynamic_cast<const Self*>(&other))
85  {
86  return true;
87  }
88  else
89  {
90  return false;
91  }
92 }
93 
94 
Sorting and grouping like mitk::DicomSeriesReader until 2013.
void SetConfigurationDescription(const std::string &)
One-sentence description of the reader&#39;s loading "strategy".
mitk::EquiDistantBlocksSorter::Pointer m_EquiDistantBlocksSorter
Representation of a DICOM tag.
Definition: mitkDICOMTag.h:32
void SetFixTiltByShearing(bool on)
Controls whether to "fix" tilted acquisitions by shearing the output (see Gantry tilt handling)...
ClassicDICOMSeriesReader & operator=(const ClassicDICOMSeriesReader &other)
void SetConfigurationLabel(const std::string &)
Short label/name to describe this reader.
void SetToleratedOriginOffset(double millimeters=0.005) const
See Forced Configuration.
void SetGroup3DandT(bool on)
Control whether 3D+t grouping shall actually be attempted.
ThreeDnTDICOMSeriesReader & operator=(const ThreeDnTDICOMSeriesReader &other)
Extends DICOMITKSeriesGDCMReader by sorting/grouping into 3D+t image blocks.
virtual void AddSortingElement(DICOMDatasetSorter *sorter, bool atFront=false)
Add an element to the sorting procedure described in Loading strategy.
Interface for DICOM readers that produce mitk::Images.
bool operator==(const DICOMFileReader &other) const override