Medical Imaging Interaction Toolkit  2018.4.99-389bf124
Medical Imaging Interaction Toolkit
mitkDICOMNullFileReader.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 
18 {
19 }
20 
23 {
24 }
25 
28 :DICOMFileReader(other)
29 {
30 }
31 
35 {
36  if (this != &other)
37  {
39  }
40  return *this;
41 }
42 
43 bool
45 ::operator==(const DICOMFileReader& other) const
46 {
47  return dynamic_cast<const Self*>(&other) != nullptr; // same class, we don't have members
48 }
49 void
51 ::InternalPrintConfiguration(std::ostream& os) const
52 {
53  os << "Nothing to configure" << std::endl;
54 }
55 
56 
57 void
60 {
61  this->ClearOutputs();
62 
63  StringList inputFilenames = this->GetInputFiles();
64  this->SetNumberOfOutputs( inputFilenames.size() );
65 
66  //generates one output for each input
67  unsigned int o = 0;
68  for (StringList::const_iterator inputIter = inputFilenames.begin();
69  inputIter != inputFilenames.end();
70  ++o, ++inputIter)
71  {
73  DICOMImageFrameList outputFrames;
74  outputFrames.push_back( DICOMImageFrameInfo::New(*inputIter) );
75 
76  block.SetImageFrameList( outputFrames );
77 
78  this->SetOutput( o, block );
79  }
80 }
81 
82 // void AllocateOutputImages();
83 
84 bool
87 {
88  // does nothing
89  return true;
90 }
91 
92 bool
94 ::CanHandleFile(const std::string& itkNotUsed(filename))
95 {
96  return true; // can handle all
97 }
static Pointer New()
void InternalPrintConfiguration(std::ostream &os) const override
Configuration description for human reader, to be implemented by sub-classes.
void SetNumberOfOutputs(unsigned int numberOfOutputs)
bool CanHandleFile(const std::string &filename) override
Indicate whether this reader can handle given file.
void SetOutput(unsigned int index, const DICOMImageBlockDescriptor &output)
const StringList & GetInputFiles() const
This input files.
void SetImageFrameList(const DICOMImageFrameList &framelist)
List of frames that constitute the mitk::Image (DICOMImageFrames)
std::vector< DICOMImageFrameInfo::Pointer > DICOMImageFrameList
Output descriptor for DICOMFileReader.
void AnalyzeInputFiles() override
Analyze input files.
std::vector< std::string > StringList
bool operator==(const DICOMFileReader &other) const override
DICOMFileReader & operator=(const DICOMFileReader &other)
Interface for DICOM readers that produce mitk::Images.
DICOMNullFileReader & operator=(const DICOMNullFileReader &other)