Medical Imaging Interaction Toolkit  2023.04.00
Medical Imaging Interaction Toolkit
mitkDataCollectionImageIterator.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 mitkDataCollectionImageIterator_h
15 #define mitkDataCollectionImageIterator_h
16 
17 #include <mitkImageCast.h>
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 typename ImageType::Pointer ImagePointerType;
35  typedef itk::ImageRegionIterator<ImageType> ImageIterator;
36 
37  DataCollectionImageIterator(DataCollection::Pointer collection, std::string imageName);
38 
39  void ToBegin();
40 
41  bool IsAtEnd();
42 
43  void operator++();
44 
45  // TODO refactor implementation
46  void operator++(int);
47 
48  TDataType GetVoxel();
49 
50  void SetVoxel(TDataType value);
51 
52  size_t GetIndex();
53  size_t GetImageIndex () { return m_ImageIndex;}
54 
55  std::string GetFilePrefix();
56 
57  void NextObject();
58 
60 
61  private:
62  DataCollectionImageIterator<TDataType, ImageDimension>* GetNextDataCollectionIterator(size_t start);
63 
64  // DATA
65  DataCollection::Pointer m_Collection;
66  std::string m_ImageName;
67 
68  bool m_IsAtEnd;
69  bool m_IteratingImages;
70  size_t m_CurrentIndex;
71  size_t m_ImageIndex;
72 
73  size_t m_CurrentElement;
74  DataCollectionImageIterator<TDataType, ImageDimension>* m_CurrentCollectionIterator;
75  ImageIterator m_CurrentIterator;
76  };
77 } // end namespace
78 
79 #include <Iterators/mitkDataCollectionImageIterator.cxx>
80 #endif
mitk::DataCollectionImageIterator::ImagePointerType
ImageType::Pointer ImagePointerType
Definition: mitkDataCollectionImageIterator.h:34
mitk::DataCollectionImageIterator::GetImageIterator
ImageIterator GetImageIterator()
mitkImageCast.h
mitk::DataCollectionImageIterator::IsAtEnd
bool IsAtEnd()
mitk::DataCollectionImageIterator::ImageType
itk::Image< TDataType, ImageDimension > ImageType
Definition: mitkDataCollectionImageIterator.h:33
mitk::DataCollectionImageIterator::GetIndex
size_t GetIndex()
itk::SmartPointer< Self >
mitk
DataCollection - Class to facilitate loading/accessing structured data.
Definition: RenderingTests.dox:1
mitk::DataCollectionImageIterator::ImageIterator
itk::ImageRegionIterator< ImageType > ImageIterator
Definition: mitkDataCollectionImageIterator.h:35
mitkDataCollection.h
mitk::DataCollectionImageIterator::GetFilePrefix
std::string GetFilePrefix()
mitk::DataCollectionImageIterator::GetImageIndex
size_t GetImageIndex()
Definition: mitkDataCollectionImageIterator.h:53
mitk::DataCollectionImageIterator::operator++
void operator++()
mitk::DataCollectionImageIterator::ToBegin
void ToBegin()
mitk::DataCollectionImageIterator::GetVoxel
TDataType GetVoxel()
mitk::DataCollectionImageIterator::SetVoxel
void SetVoxel(TDataType value)
mitk::DataCollectionImageIterator::DataCollectionImageIterator
DataCollectionImageIterator(DataCollection::Pointer collection, std::string imageName)
mitk::BaseData::Pointer
itk::SmartPointer< Self > Pointer
Definition: mitkBaseData.h:46
mitk::DataCollectionImageIterator::NextObject
void NextObject()
mitk::DataCollectionImageIterator
Definition: mitkDataCollectionImageIterator.h:30