Medical Imaging Interaction Toolkit  2018.4.99-c4b6bb11
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
52 
53  m_EquiDistantBlocksSorter->SetAcceptTwoSlicesGroups(false); // old reader did not accept that
54 
55  this->SetConfigurationLabel("2013 sorting logic");
56  this->SetConfigurationDescription("Sort by Image Position, then Acquisition Number, Time, Trigger time, group by 3D+t, group tilted images, condense blocks even if series does not match");
57 }
58 
62 {
63 }
64 
67 {
68 }
69 
73 {
74  if (this != &other)
75  {
77  }
78  return *this;
79 }
80 
81 bool
83 ::operator==(const DICOMFileReader& other) const
84 {
85  if (dynamic_cast<const Self*>(&other))
86  {
87  return true;
88  }
89  else
90  {
91  return false;
92  }
93 }
94 
95 
Sorting and grouping like mitk::DicomSeriesReader until 2013.
static Pointer New()
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.
virtual void OnlyCondenseSameSeriesOff()
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