3 # File : itkSTMS_ImageSequenceToTemporalSet_Spine.h
4 # ( C++ header file - STMS )
6 # Description : STMS lib that implements the STMS filter and clustering.
7 # This file is a part of the STMS Library project.
8 # ( https://www.creatis.insa-lyon.fr/site7/fr/realisations )
10 # [1] S. Mure, Grenier, T., Meier, S., Guttmann, R. G., et Benoit-Cattin, H.,
11 # « Unsupervised spatio-temporal filtering of image sequences. A mean-shift specification »,
12 # Pattern Recognition Letters, vol. 68, Part 1, p. 48 - 55, 2015.
14 # Copyright : Thomas GRENIER - Simon MURE
15 # ( https://www.creatis.insa-lyon.fr/~grenier/ )
18 # ( http://www.cecill.info/licences/Licence_CeCILL-C_V1-en.txt )
20 # This software is governed by the CeCILL license under French law and
21 # abiding by the rules of distribution of free software. You can use,
22 # modify and/ or redistribute the software under the terms of the CeCILL
23 # license as circulated by CEA, CNRS and INRIA at the following URL
24 # "http://www.cecill.info".
26 # As a counterpart to the access to the source code and rights to copy,
27 # modify and redistribute granted by the license, users are provided only
28 # with a limited warranty and the software's author, the holder of the
29 # economic rights, and the successive licensors have only limited
32 # In this respect, the user's attention is drawn to the risks associated
33 # with loading, using, modifying and/or developing or reproducing the
34 # software by the user in light of its specific status of free software,
35 # that may mean that it is complicated to manipulate, and that also
36 # therefore means that it is reserved for developers and experienced
37 # professionals having in-depth computer knowledge. Users are therefore
38 # encouraged to load and test the software's suitability as regards their
39 # requirements in conditions enabling the security of their systems and/or
40 # data to be ensured and, more generally, to use and operate it in the
41 # same conditions as regards security.
43 # The fact that you are presently reading this means that you have had
44 # knowledge of the CeCILL license and that you accept its terms.
47 /* Please don't forget to cite our work :
49 title = {Unsupervised spatio-temporal filtering of image sequences. A mean-shift specification},
50 journal = {Pattern Recognition Letters},
51 volume = {68, Part 1},
55 doi = {http://dx.doi.org/10.1016/j.patrec.2015.07.021},
56 url = {http://www.sciencedirect.com/science/article/pii/S0167865515002305},
57 author = {S. Mure and T Grenier and Meier, S. and Guttmann, R.G. and H. Benoit-Cattin}
60 #ifndef itkSTMS_ImageSequenceToTemporalSetSpine_h
61 #define itkSTMS_ImageSequenceToTemporalSetSpine_h
68 #include "itkSTMS_ArgumentsAnalysis_Spine.h"
69 #include "itkImageFileReader.h"
70 #include "itkImageRegionConstIteratorWithIndex.h"
71 #include "itkMinimumMaximumImageCalculator.h"
73 namespace itkSTMS_Spine
75 template < class ImageType, class MaskImageType >
76 class itkSTMS_ImageSequenceToTemporalSet
81 typedef itk::ImageFileReader< ImageType > ReaderType;
82 typedef typename ReaderType::Pointer ReaderPointer;
83 typedef itk::ImageFileReader< MaskImageType > MaskReaderType;
84 typedef typename MaskReaderType::Pointer MaskReaderPointer;
86 // Mask processing typedefs
87 typedef itk::MinimumMaximumImageCalculator< MaskImageType >
89 typedef typename MinMaxCalculatorType::Pointer MinMaxCalculatorPointer;
92 typedef itk::ImageRegionConstIteratorWithIndex< ImageType > IteratorType;
93 typedef itk::ImageRegionConstIteratorWithIndex< MaskImageType > MaskIteratorType;
95 // Sample set typedefs
96 typedef unsigned int IndexType;
97 typedef float SpatialType;
98 typedef typename ImageType::PixelType PixelType;
100 typedef typename ImageType::Pointer ImagePointer;
101 typedef typename ImageType::ConstPointer ImageConstPointer;
102 typedef typename ImageType::SizeType SizeType;
104 typedef std::vector< SpatialType > SpatialVectorType;
105 typedef std::vector< PixelType > RangeVectorType;
107 typedef std::vector< IndexType > IndexSampleSetType;
108 typedef std::vector< SpatialVectorType > SpatialSampleSetType;
109 typedef std::vector< RangeVectorType > RangeSampleSetType;
111 // Mask image typedefs
112 typedef typename MaskImageType::PixelType MaskPixelType;
113 typedef typename MaskImageType::Pointer MaskImagePointer;
114 typedef typename MaskImageType::ConstPointer MaskImageConstPointer;
117 itkSTMS_ImageSequenceToTemporalSet( itkSTMS_Spine::ParamsAnalysisOutputType* stmsParameters );
119 void GenerateDataSets();
121 inline IndexSampleSetType* GetIndexSet (){ return &indexSet; }
122 inline IndexSampleSetType* GetClassSet (){ return &classSet; }
123 inline IndexSampleSetType* GetMergingSet(){ return &mergingSet; }
124 inline IndexSampleSetType* GetWeightsSet(){ return &weightsSet; }
125 inline SpatialSampleSetType* GetSpatialSet(){ return &spatialSet; }
126 inline RangeSampleSetType* GetRangeSet (){ return &rangeSet; }
130 itkSTMS_Spine::ParamsAnalysisOutputType* stmsParameters;
132 IndexSampleSetType indexSet,
136 SpatialSampleSetType spatialSet;
137 RangeSampleSetType rangeSet;
139 MaskPixelType maskValue;
140 MaskImagePointer mask;
141 MaskReaderPointer mReader;
142 MinMaxCalculatorPointer MinMaxCalculator;
143 MaskIteratorType mIt;
145 }; // end of class itkSTMS_ImageSequenceToTemporalSet
146 } // end of namespace itkstms
148 #ifndef ITK_MANUAL_INSTANTIATION
149 #include "itkSTMS_ImageSequenceToTemporalSet_Spine.txx"