Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
mitkDICOMDatasetSorter.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 
17 #include "mitkDICOMDatasetSorter.h"
18 
21 :itk::LightObject()
22 {
23 }
24 
27 {
28 }
29 
32 :itk::LightObject()
33 ,m_Outputs( other.m_Outputs )
34 {
35 }
36 
40 {
41  if (this != &other)
42  {
43  m_Input = other.m_Input;
44  m_Outputs = other.m_Outputs;
45  }
46  return *this;
47 }
48 
49 void
52 {
53  m_Input = datasets;
54 }
55 
58 ::GetInput() const
59 {
60  return m_Input;
61 }
62 
63 unsigned int
66 {
67  return m_Outputs.size();
68 }
69 
70 void
73 {
74  m_Outputs.clear();
75 }
76 
77 void
79 ::SetNumberOfOutputs(unsigned int numberOfOutputs)
80 {
81  m_Outputs.resize(numberOfOutputs);
82 }
83 
84 void
86 ::SetOutput(unsigned int index, const DICOMDatasetList& output)
87 {
88  if (index < m_Outputs.size())
89  {
90  m_Outputs[index] = output;
91  }
92  else
93  {
94  std::stringstream ss;
95  ss << "Index " << index << " out of range (" << m_Outputs.size() << " indices reserved)";
96  throw std::invalid_argument( ss.str() );
97  }
98 }
99 
102 ::GetOutput(unsigned int index) const
103 {
104  return const_cast<DICOMDatasetSorter*>(this)->GetOutput(index);
105 }
106 
109 ::GetOutput(unsigned int index)
110 {
111  if (index < m_Outputs.size())
112  {
113  return m_Outputs[index];
114  }
115  else
116  {
117  std::stringstream ss;
118  ss << "Index " << index << " out of range (" << m_Outputs.size() << " indices reserved)";
119  throw std::invalid_argument( ss.str() );
120  }
121 }
const DICOMDatasetList & GetInput() const
Input for sorting.
The sorting/splitting building-block of DICOMITKSeriesGDCMReader.
const DICOMDatasetList & GetOutput(unsigned int index) const
Output of the sorting process.
void SetNumberOfOutputs(unsigned int numberOfOutputs)
void SetInput(DICOMDatasetList filenames)
Input for sorting.
void SetOutput(unsigned int index, const DICOMDatasetList &output)
DICOMDatasetSorter & operator=(const DICOMDatasetSorter &other)
std::vector< DICOMDatasetAccess * > DICOMDatasetList
unsigned int GetNumberOfOutputs() const
Output of the sorting process.