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://oncora1.lyon.fnclcc.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 "itkConstSliceIterator.h"
24 #include "itkImageRegionIteratorWithIndex.h"
26 //--------------------------------------------------------------------
27 int main(int argc, char * argv[])
31 GGO(clitkMinMaxMask, args_info);
34 typedef short PixelType;
35 static const int Dim=3;
36 typedef itk::Image<PixelType, Dim> ImageType;
38 ImageType::Pointer input1;
39 ImageType::Pointer input2;
40 input1 = clitk::readImage<ImageType>(args_info.input1_arg, false);
41 input2 = clitk::readImage<ImageType>(args_info.input2_arg, false);
43 typedef itk::ImageRegionIteratorWithIndex<ImageType> IteratorType;
44 IteratorType it = IteratorType(input1, input1->GetLargestPossibleRegion());
46 ImageType::IndexType first1=it.GetIndex();
47 ImageType::IndexType last1=it.GetIndex();
48 bool firstFound = false;
49 while (!it.IsAtEnd()) {
53 first1 = it.GetIndex();
58 last1 = it.GetIndex();
64 // typedef itk::ImageRegionIteratorWithIndex<ImageType> IteratorType;
65 it = IteratorType(input2, input2->GetLargestPossibleRegion());
67 ImageType::IndexType first2=it.GetIndex();
68 ImageType::IndexType last2=it.GetIndex();
70 while (!it.IsAtEnd()) {
74 first2 = it.GetIndex();
79 last2 = it.GetIndex();
85 std::cout << " --i1 " << first1[2] << " --f1 " << last1[2]
86 << " --i2 " << first2[2] << " --f2 " << last2[2] << std::endl;
89 } // This is the end, my friend
90 //--------------------------------------------------------------------