Medical Imaging Interaction Toolkit  2023.04.00
Medical Imaging Interaction Toolkit
mitkDataCollectionSingleImageIterator.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 
14 #ifndef mitkDataCollectionSingleImageIterator_h
15 #define mitkDataCollectionSingleImageIterator_h
16 
17 
18 #include <mitkDataCollection.h>
19 #include <itkImageRegionIterator.h>
20 
27 namespace mitk
28 {
29  template <typename TDataType, int ImageDimension>
31  {
32  public:
33  typedef itk::Image<TDataType, ImageDimension> ImageType;
34  typedef itk::ImageRegionIterator<ImageType> ImageIterator;
35 
36  DataCollectionSingleImageIterator(mitk::DataCollection * collection, std::string imageName);
37 
38  void ToBegin();
39 
40  bool IsAtEnd();
41 
42  void operator++();
43 
44  // TODO refactor implementation
45  void operator++(int);
46 
47  size_t GetIndex();
48 
49  std::string GetFilePrefix();
50 
51  void NextObject();
52 
53  ImageType * GetImage();
54 
55  void AddImage(ImageType * image, std::string name);
56 
57  private:
58  // Variables
59  DataCollection * m_Collection;
60  std::string m_ImageName;
61  bool m_IsAtEnd;
62  bool m_IteratingImages;
63  size_t m_CurrentIndex;
64  size_t m_CurrentElement;
65  ImageType * m_Image;
66  DataCollectionSingleImageIterator<TDataType, ImageDimension>* m_CurrentSingleCollectionIterator;
67 
68  // Methods
69  DataCollectionSingleImageIterator<TDataType, ImageDimension>* GetNextDataCollectionIterator(size_t start);
70 
71  };
72 } // end namespace
73 
74 #include <Iterators/mitkDataCollectionSingleImageIterator.cxx>
75 #endif
mitk::DataCollectionSingleImageIterator::ImageType
itk::Image< TDataType, ImageDimension > ImageType
Definition: mitkDataCollectionSingleImageIterator.h:33
mitk::DataCollectionSingleImageIterator::GetIndex
size_t GetIndex()
mitk::DataCollectionSingleImageIterator::NextObject
void NextObject()
mitk::DataCollectionSingleImageIterator::ImageIterator
itk::ImageRegionIterator< ImageType > ImageIterator
Definition: mitkDataCollectionSingleImageIterator.h:34
mitk::DataCollectionSingleImageIterator::ToBegin
void ToBegin()
mitk::DataCollectionSingleImageIterator
Definition: mitkDataCollectionSingleImageIterator.h:30
mitk::DataCollectionSingleImageIterator::GetImage
ImageType * GetImage()
mitk::DataCollectionSingleImageIterator::GetFilePrefix
std::string GetFilePrefix()
mitk
DataCollection - Class to facilitate loading/accessing structured data.
Definition: RenderingTests.dox:1
mitkDataCollection.h
mitk::DataCollectionSingleImageIterator::IsAtEnd
bool IsAtEnd()
mitk::DataCollection
Definition: mitkDataCollection.h:54
mitk::DataCollectionSingleImageIterator::DataCollectionSingleImageIterator
DataCollectionSingleImageIterator(mitk::DataCollection *collection, std::string imageName)
mitk::DataCollectionSingleImageIterator::AddImage
void AddImage(ImageType *image, std::string name)
mitk::DataCollectionSingleImageIterator::operator++
void operator++()