ITK  4.9.0
Insight Segmentation and Registration Toolkit
itkAnalyzeObjectMap.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3 Program: Insight Segmentation & Registration Toolkit
4 Module: $RCSfile: itkNiftiImageIO.cxx,v $
5 Language: C++
6 Date: $Date: 2007/07/27 18:00:56 $
7 Version: $Revision: 1.37 $
8 
9 Copyright (c) Insight Software Consortium. All rights reserved.
10 See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
11 
12 This software is distributed WITHOUT ANY WARRANTY; without even
13 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14 PURPOSE. See the above copyright notices for more information.
15 
16 =========================================================================*/
17 #ifndef itkAnalyzeObjectMap_h
18 #define itkAnalyzeObjectMap_h
19 
20 #include <stdio.h>
21 #include <string>
22 #include <vector>
23 #include "itkAnalyzeObjectEntry.h"
24 #include "itkObject.h"
25 #include <itkMetaDataDictionary.h>
26 #include "itkMetaDataObject.h"
28 
29 const char *const ANALYZE_OBJECT_LABEL_MAP_ENTRY_ARRAY = "ANALYZE_OBJECT_LABEL_MAP_ENTRY_ARRAY";
33 const int VERSION1 = 880102;
34 const int VERSION2 = 880801;
35 const int VERSION3 = 890102;
36 static const int VERSION4 = 900302;
37 static const int VERSION5 = 910402;
38 static const int VERSION6 = 910926;
39 static const int VERSION7 = 20050829;
40 
41 namespace itk
42 {
43 
44 typedef std::vector<AnalyzeObjectEntry::Pointer> AnalyzeObjectEntryArrayType;
45 template <class TImage = itk::Image<unsigned char, 4>, class TRGBImage = itk::Image<itk::RGBPixel<unsigned char>, 4> >
46 
52 class AnalyzeObjectMap : public TImage
53 {
54 public:
55 
57  typedef AnalyzeObjectMap Self;
58  typedef TImage Superclass;
59  typedef SmartPointer<Self> Pointer;
60  typedef SmartPointer<const Self> ConstPointer;
61 
62  typedef TImage ImageType;
63  typedef itk::AnalyzeObjectMap<TImage> ObjectMapType;
64 
65  typedef typename TImage::PixelType PixelType;
66 
68  itkNewMacro(Self);
69 
71  itkTypeMacro(AnalyzeObjectMap, TImage );
72 
78  AnalyzeObjectMap & operator=( const AnalyzeObjectMap & rhs );
79 
85  AnalyzeObjectEntryArrayType * GetAnalyzeObjectEntryArrayPointer();
86 
92  itkSetMacro(NumberOfObjects, int);
93  itkGetConstMacro(NumberOfObjects, int);
95 
107  typename itk::AnalyzeObjectMap<TImage>::Pointer PickOneEntry(const int numberOfEntry = -1);
108 
118  typename TRGBImage::Pointer ObjectMapToRGBImage();
119 
127  void AddObjectEntryBasedOnImagePixel(ImageType *Image, const int value = -1, const std::string ObjectName = "",
128  const int Red = 0, const int Green = 0, const int Blue = 0);
129 
135  void AddAnalyzeObjectEntry(const std::string ObjectName = "");
136 
145  void DeleteAnalyzeObjectEntry(const std::string ObjectName = "");
146 
154  int FindObjectEntry(const std::string ObjectName = "");
155 
162  void PlaceObjectMapEntriesIntoMetaData();
163 
169  AnalyzeObjectEntry::Pointer GetObjectEntry( const int index );
170 
176  const AnalyzeObjectEntry::Pointer GetObjectEntry( const int index ) const;
177 
185  void ImageToObjectMap(ImageType *image);
186 
187 protected:
191  AnalyzeObjectMap( void );
192 
196  virtual ~AnalyzeObjectMap( void );
197 
202  AnalyzeObjectMap( const AnalyzeObjectMap & /* rhs */ ); /*Explicitly not allowed*/
203 
204  void PrintSelf(std::ostream& os, Indent indent) const;
205 
206 private:
208  int m_NumberOfObjects;
209 
SmartPointer< Self > Pointer
std::vector< AnalyzeObjectEntry::Pointer > AnalyzeObjectEntryArrayType
static const int VERSION4
const char *const ANALYZE_OBJECT_LABEL_MAP_ENTRY_ARRAY
static const int VERSION5
static const int VERSION7
const int VERSION2
const int VERSION1
static const int VERSION6
const int VERSION3