Medical Imaging Interaction Toolkit  2016.11.0
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,
6 Division of Medical and Biological Informatics.
7 All rights reserved.
8 
9 This software is distributed WITHOUT ANY WARRANTY; without
10 even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 A PARTICULAR PURPOSE.
12 
13 See LICENSE.txt or http://www.mitk.org for details.
14 
15 ===================================================================*/
16 
18 
20 #include "mitkDICOMSortByTag.h"
22 
23 
27 {
29 
30  // all the things that split by tag in mitk::DicomSeriesReader
31  tagSorter->AddDistinguishingTag( DICOMTag(0x0020, 0x000e) ); // Series Instance UID
32  //tagSorter->AddDistinguishingTag( DICOMTag(0x0020, 0x0052) ); // Frame of Reference UID
33 
34  // a sorter...
36  mitk::SortByImagePositionPatient::New( // image position patient and image orientation
37  mitk::DICOMSortByTag::New( DICOMTag(0x0020, 0x0012), // aqcuisition number
38  mitk::DICOMSortByTag::New( DICOMTag(0x0008, 0x0032), // aqcuisition time
39  mitk::DICOMSortByTag::New( DICOMTag(0x0018, 0x1060), // trigger time
40  mitk::DICOMSortByTag::New( DICOMTag(0x0008, 0x0018) // SOP instance UID (last resort, not really meaningful but decides clearly)
41  ).GetPointer()
42  ).GetPointer()
43  ).GetPointer()
44  ).GetPointer()
45  ).GetPointer();
46  tagSorter->SetSortCriterion( sorting );
47  tagSorter->SetStrictSorting(false); // nothing did enforce constant distances before, there was just the EquiDistantBlocksSorter logic
48 
49  // define above sorting for this class
50  this->AddSortingElement( tagSorter );
51 
52  this->SetFixTiltByShearing(true); // that was configurable, default was true
53  this->SetToleratedOriginOffset(0.005); // was hard-coded
54  this->SetGroup3DandT(true); // that was configurable, default was true
55 
56  m_EquiDistantBlocksSorter->SetAcceptTwoSlicesGroups(false); // old reader did not accept that
57 
58  this->SetConfigurationLabel("2013 sorting logic");
59  this->SetConfigurationDescription("Sort by Image Position, then Acquisition Number, Time, Trigger time, group by 3D+t, group tilted images");
60 }
61 
65 {
66 }
67 
70 {
71 }
72 
76 {
77  if (this != &other)
78  {
80  }
81  return *this;
82 }
83 
84 bool
86 ::operator==(const DICOMFileReader& other) const
87 {
88  if (dynamic_cast<const Self*>(&other))
89  {
90  return true;
91  }
92  else
93  {
94  return false;
95  }
96 }
97 
98 
Sorting and grouping like mitk::DicomSeriesReader until 2013.
itk::SmartPointer< Self > Pointer
void SetConfigurationDescription(const std::string &)
One-sentence description of the reader's loading "strategy".
mitk::EquiDistantBlocksSorter::Pointer m_EquiDistantBlocksSorter
Representation of a DICOM tag.
Definition: mitkDICOMTag.h:37
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.
itk::SmartPointer< const Self > ConstPointer
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.
void SetToleratedOriginOffset(double millimeters=0.005) const
See Forced Configuration.
Interface for DICOM readers that produce mitk::Images.
virtual bool operator==(const DICOMFileReader &other) const override
static itkEventMacro(BoundingShapeInteractionEvent, itk::AnyEvent) class MITKBOUNDINGSHAPE_EXPORT BoundingShapeInteractor Pointer New()
Basic interaction methods for mitk::GeometryData.