Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
mitkDataCollectionVectorImageIterator.h
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 #ifndef DATACOLLECTIONFEATUREVECTORIMAGEITERATOR_H_
18 #define DATACOLLECTIONFEATUREVECTORIMAGEITERATOR_H_
19 #include <mitkDataCollection.h>
21 
22 #include "itkImage.h"
23 
24 namespace mitk
25 {
26 
27  /*
28  * Iterate over a data collection and return a vector image for all selected
29  * modalities.
30  * TODO SW: this class needs a module test urgently.
31  */
32  template <typename TDataType, int ImageDimension>
34  {
35 
36  public:
37  typedef itk::VectorImage<TDataType, ImageDimension> VectorImageType;
39  typedef itk::ImageRegionIterator<VectorImageType> VectorImageIteratorType;
40 
41  DataCollectionVectorImageIterator(DataCollection::Pointer collection, std::vector<std::string> featureNames);
42 
43  void ToBegin();
44 
45  bool IsAtEnd();
46 
48 
50 
57  VectorImagePointerType GetVectorImage();
58 
59  void
60  AddImage(typename itk::Image<TDataType, ImageDimension>::Pointer image, std::string name);
61 
63  typedef typename std::vector< SingleImageIterator > DataCollectionSingleImageIterators;
64 
65  private:
66 
67  DataCollection::Pointer m_Collection;
68  DataCollectionSingleImageIterators m_FeatureIterators;
69  };
70 
71 } /* namespace mitk */
72 
73 
75 
76 #endif /* DATACOLLECTIONFEATUREVECTORIMAGEITERATOR_H_ */
itk::ImageRegionIterator< VectorImageType > VectorImageIteratorType
std::vector< SingleImageIterator > DataCollectionSingleImageIterators
itk::SmartPointer< Self > Pointer
void AddImage(typename itk::Image< TDataType, ImageDimension >::Pointer image, std::string name)
DataCollection - Class to facilitate loading/accessing structured data.
itk::VectorImage< TDataType, ImageDimension > VectorImageType
mitk::DataCollectionSingleImageIterator< TDataType, ImageDimension > SingleImageIterator
DataCollectionVectorImageIterator(DataCollection::Pointer collection, std::vector< std::string > featureNames)