1 /*=========================================================================
2 Program: vv http://www.creatis.insa-lyon.fr/rio/vv
5 - University of LYON http://www.universite-lyon.fr/
6 - Léon Bérard cancer center http://www.centreleonberard.fr
7 - CREATIS CNRS laboratory http://www.creatis.insa-lyon.fr
9 This software is distributed WITHOUT ANY WARRANTY; without even
10 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11 PURPOSE. See the copyright notices for more information.
13 It is distributed under dual licence
15 - BSD See included LICENSE.txt file
16 - CeCILL-B http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
17 ===========================================================================**/
20 #include "clitkMinMaxMask_ggo.h"
22 #include "clitkImageCommon.h"
23 #include "clitkCommon.h"
24 #include "itkConstSliceIterator.h"
25 #include "itkImageRegionIteratorWithIndex.h"
27 //--------------------------------------------------------------------
28 int main(int argc, char * argv[])
32 GGO(clitkMinMaxMask, args_info);
35 typedef short PixelType;
36 static const int Dim=3;
37 typedef itk::Image<PixelType, Dim> ImageType;
39 ImageType::Pointer input1;
40 ImageType::Pointer input2;
41 input1 = clitk::readImage<ImageType>(args_info.input1_arg, false);
42 input2 = clitk::readImage<ImageType>(args_info.input2_arg, false);
44 typedef itk::ImageRegionIteratorWithIndex<ImageType> IteratorType;
45 IteratorType it = IteratorType(input1, input1->GetLargestPossibleRegion());
47 ImageType::IndexType first1=it.GetIndex();
48 ImageType::IndexType last1=it.GetIndex();
49 bool firstFound = false;
50 while (!it.IsAtEnd()) {
54 first1 = it.GetIndex();
59 last1 = it.GetIndex();
65 // typedef itk::ImageRegionIteratorWithIndex<ImageType> IteratorType;
66 it = IteratorType(input2, input2->GetLargestPossibleRegion());
68 ImageType::IndexType first2=it.GetIndex();
69 ImageType::IndexType last2=it.GetIndex();
71 while (!it.IsAtEnd()) {
75 first2 = it.GetIndex();
80 last2 = it.GetIndex();
86 std::cout << " --i1 " << first1[2] << " --f1 " << last1[2]
87 << " --i2 " << first2[2] << " --f2 " << last2[2] << std::endl;
90 } // This is the end, my friend
91 //--------------------------------------------------------------------