Medical Imaging Interaction Toolkit  2018.4.99-f51274ea
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 (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 #include "mitkDICOMDatasetSorter.h"
14 
17 :itk::LightObject()
18 {
19 }
20 
23 {
24 }
25 
28 :itk::LightObject()
29 ,m_Outputs( other.m_Outputs )
30 {
31 }
32 
36 {
37  if (this != &other)
38  {
39  m_Input = other.m_Input;
40  m_Outputs = other.m_Outputs;
41  }
42  return *this;
43 }
44 
45 void
48 {
49  m_Input = datasets;
50 }
51 
54 ::GetInput() const
55 {
56  return m_Input;
57 }
58 
59 unsigned int
62 {
63  return m_Outputs.size();
64 }
65 
66 void
69 {
70  m_Outputs.clear();
71 }
72 
73 void
75 ::SetNumberOfOutputs(unsigned int numberOfOutputs)
76 {
77  m_Outputs.resize(numberOfOutputs);
78 }
79 
80 void
82 ::SetOutput(unsigned int index, const DICOMDatasetList& output)
83 {
84  if (index < m_Outputs.size())
85  {
86  m_Outputs[index] = output;
87  }
88  else
89  {
90  std::stringstream ss;
91  ss << "Index " << index << " out of range (" << m_Outputs.size() << " indices reserved)";
92  throw std::invalid_argument( ss.str() );
93  }
94 }
95 
98 ::GetOutput(unsigned int index) const
99 {
100  return const_cast<DICOMDatasetSorter*>(this)->GetOutput(index);
101 }
102 
105 ::GetOutput(unsigned int index)
106 {
107  if (index < m_Outputs.size())
108  {
109  return m_Outputs[index];
110  }
111  else
112  {
113  std::stringstream ss;
114  ss << "Index " << index << " out of range (" << m_Outputs.size() << " indices reserved)";
115  throw std::invalid_argument( ss.str() );
116  }
117 }
unsigned int GetNumberOfOutputs() const
Output of the sorting process.
The sorting/splitting building-block of DICOMITKSeriesGDCMReader.
void SetNumberOfOutputs(unsigned int numberOfOutputs)
const DICOMDatasetList & GetInput() const
Input for sorting.
const DICOMDatasetList & GetOutput(unsigned int index) const
Output of the sorting process.
void SetInput(DICOMDatasetList filenames)
Input for sorting.
void SetOutput(unsigned int index, const DICOMDatasetList &output)
DICOMDatasetSorter & operator=(const DICOMDatasetSorter &other)
std::vector< DICOMDatasetAccess * > DICOMDatasetList