]> Creatis software - clitk.git/blob - tools/clitkRelativePositionDataBaseBuilderGenericFilter.txx
Remove warnings
[clitk.git] / tools / clitkRelativePositionDataBaseBuilderGenericFilter.txx
1 /*=========================================================================
2   Program:   vv                     http://www.creatis.insa-lyon.fr/rio/vv
3
4   Authors belong to: 
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
8
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.
12
13   It is distributed under dual licence
14
15   - BSD        See included LICENSE.txt file
16   - CeCILL-B   http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
17   ===========================================================================**/
18
19 //--------------------------------------------------------------------
20 template<class ArgsInfoType>
21 clitk::RelativePositionDataBaseBuilderGenericFilter<ArgsInfoType>::
22 RelativePositionDataBaseBuilderGenericFilter():
23   ImageToImageGenericFilter<Self>("RelativePositionDataBaseBuilder")
24 {
25   // Default values
26   cmdline_parser_clitkRelativePositionDataBaseBuilder_init(&mArgsInfo);
27   InitializeImageType<3>();
28 }
29 //--------------------------------------------------------------------
30
31
32 //--------------------------------------------------------------------
33 template<class ArgsInfoType>
34 template<unsigned int Dim>
35 void clitk::RelativePositionDataBaseBuilderGenericFilter<ArgsInfoType>::
36 InitializeImageType() 
37 {  
38   ADD_IMAGE_TYPE(Dim, uchar);
39 }
40 //--------------------------------------------------------------------
41   
42
43 //--------------------------------------------------------------------
44 template<class ArgsInfoType>
45 void clitk::RelativePositionDataBaseBuilderGenericFilter<ArgsInfoType>::
46 SetArgsInfo(const ArgsInfoType & a) 
47 {
48   mArgsInfo=a;
49   SetIOVerbose(mArgsInfo.verbose_flag);
50   if (mArgsInfo.imagetypes_flag) this->PrintAvailableImageTypes();
51 }
52 //--------------------------------------------------------------------
53
54
55 //--------------------------------------------------------------------
56 // Update with the number of dimensions and the pixeltype
57 //--------------------------------------------------------------------
58 template<class ArgsInfoType>
59 template<class FilterType>
60 void clitk::RelativePositionDataBaseBuilderGenericFilter<ArgsInfoType>::
61 SetOptionsFromArgsInfoToFilter(FilterType * f) 
62 {
63   f->SetAFDBFilename(mArgsInfo.afdb_arg);
64   f->SetAFDBPath(mArgsInfo.afdb_path_arg);
65   f->SetNumberOfBins(mArgsInfo.bins_arg);
66   f->SetNumberOfAngles(mArgsInfo.nb_arg);
67   f->SetAreaLossTolerance(mArgsInfo.tol_arg);
68   f->SetSupportName(mArgsInfo.supportName_arg);
69   f->SetTargetName(mArgsInfo.targetName_arg);
70   for(unsigned int i=0; i<mArgsInfo.objectName_given; i++)
71     f->AddObjectName(mArgsInfo.objectName_arg[i]);  
72 }
73 //--------------------------------------------------------------------
74
75
76 //--------------------------------------------------------------------
77 // Update with the number of dimensions and the pixeltype
78 //--------------------------------------------------------------------
79 template<class ArgsInfoType>
80 template<class ImageType>
81 void clitk::RelativePositionDataBaseBuilderGenericFilter<ArgsInfoType>::
82 UpdateWithInputImageType() 
83
84   // Create filter
85   typedef clitk::RelativePositionDataBaseBuilderFilter<ImageType> FilterType;
86   typename FilterType::Pointer filter = FilterType::New();
87   
88   // Set global Options 
89   SetOptionsFromArgsInfoToFilter<FilterType>(filter);
90
91   // Go !
92   filter->Update();
93   
94   // Write/Save results
95   //  typename ImageType::Pointer output = filter->GetOutput();
96   //this->template SetNextOutput<ImageType>(output); 
97
98 }
99 //--------------------------------------------------------------------
100
101