Medical Imaging Interaction Toolkit  2018.4.99-f51274ea
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 (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 #ifndef DATACOLLECTIONFEATUREVECTORIMAGEITERATOR_H_
14 #define DATACOLLECTIONFEATUREVECTORIMAGEITERATOR_H_
15 #include <mitkDataCollection.h>
17 
18 #include "itkImage.h"
19 
20 namespace mitk
21 {
22 
23  /*
24  * Iterate over a data collection and return a vector image for all selected
25  * modalities.
26  * TODO SW: this class needs a module test urgently.
27  */
28  template <typename TDataType, int ImageDimension>
30  {
31 
32  public:
33  typedef itk::VectorImage<TDataType, ImageDimension> VectorImageType;
34  typedef typename VectorImageType::Pointer VectorImagePointerType;
35  typedef itk::ImageRegionIterator<VectorImageType> VectorImageIteratorType;
36 
37  DataCollectionVectorImageIterator(DataCollection::Pointer collection, std::vector<std::string> featureNames);
38 
39  void ToBegin();
40 
41  bool IsAtEnd();
42 
44 
46 
53  VectorImagePointerType GetVectorImage();
54 
55  void
56  AddImage(typename itk::Image<TDataType, ImageDimension>::Pointer image, std::string name);
57 
59  typedef typename std::vector< SingleImageIterator > DataCollectionSingleImageIterators;
60 
61  private:
62 
63  DataCollection::Pointer m_Collection;
64  DataCollectionSingleImageIterators m_FeatureIterators;
65  };
66 
67 } /* namespace mitk */
68 
69 
71 
72 #endif /* DATACOLLECTIONFEATUREVECTORIMAGEITERATOR_H_ */
itk::ImageRegionIterator< VectorImageType > VectorImageIteratorType
std::vector< SingleImageIterator > DataCollectionSingleImageIterators
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
mitk::Image::Pointer image
DataCollectionVectorImageIterator(DataCollection::Pointer collection, std::vector< std::string > featureNames)