X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=tools%2FclitkRelativePositionAnalyzerGenericFilter.txx;fp=tools%2FclitkRelativePositionAnalyzerGenericFilter.txx;h=4225c43b608153e072a1491ac6a2de682cef00c8;hb=938c4491f8ef70565b124a7eeb4f9e69b1b9baba;hp=0000000000000000000000000000000000000000;hpb=d61af23ffdc64b4ca42c242bdd8a364151c042c4;p=clitk.git diff --git a/tools/clitkRelativePositionAnalyzerGenericFilter.txx b/tools/clitkRelativePositionAnalyzerGenericFilter.txx new file mode 100644 index 0000000..4225c43 --- /dev/null +++ b/tools/clitkRelativePositionAnalyzerGenericFilter.txx @@ -0,0 +1,103 @@ +/*========================================================================= + Program: vv http://www.creatis.insa-lyon.fr/rio/vv + + Authors belong to: + - University of LYON http://www.universite-lyon.fr/ + - Léon Bérard cancer center http://www.centreleonberard.fr + - CREATIS CNRS laboratory http://www.creatis.insa-lyon.fr + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the copyright notices for more information. + + It is distributed under dual licence + + - BSD See included LICENSE.txt file + - CeCILL-B http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html + ===========================================================================**/ + +//-------------------------------------------------------------------- +template +clitk::RelativePositionAnalyzerGenericFilter:: +RelativePositionAnalyzerGenericFilter(): + ImageToImageGenericFilter("RelativePositionAnalyzer") +{ + // Default values + cmdline_parser_clitkRelativePositionAnalyzer_init(&mArgsInfo); + InitializeImageType<3>(); +} +//-------------------------------------------------------------------- + + +//-------------------------------------------------------------------- +template +template +void clitk::RelativePositionAnalyzerGenericFilter:: +InitializeImageType() +{ + ADD_IMAGE_TYPE(Dim, uchar); +} +//-------------------------------------------------------------------- + + +//-------------------------------------------------------------------- +template +void clitk::RelativePositionAnalyzerGenericFilter:: +SetArgsInfo(const ArgsInfoType & a) +{ + mArgsInfo=a; + SetIOVerbose(mArgsInfo.verbose_flag); + if (mArgsInfo.imagetypes_flag) this->PrintAvailableImageTypes(); + if (mArgsInfo.support_given) AddInputFilename(mArgsInfo.support_arg); + if (mArgsInfo.object_given) AddInputFilename(mArgsInfo.object_arg); + if (mArgsInfo.target_given) AddInputFilename(mArgsInfo.target_arg); + if (mArgsInfo.output_given) AddOutputFilename(mArgsInfo.output_arg); +} +//-------------------------------------------------------------------- + + +//-------------------------------------------------------------------- +// Update with the number of dimensions and the pixeltype +//-------------------------------------------------------------------- +template +template +void clitk::RelativePositionAnalyzerGenericFilter:: +SetOptionsFromArgsInfoToFilter(FilterType * f) +{ + +} + +//-------------------------------------------------------------------- +// Update with the number of dimensions and the pixeltype +//-------------------------------------------------------------------- +template +template +void clitk::RelativePositionAnalyzerGenericFilter:: +UpdateWithInputImageType() +{ + // Reading input + typename ImageType::Pointer support = this->template GetInput(0); + typename ImageType::Pointer object = this->template GetInput(1); + typename ImageType::Pointer target = this->template GetInput(2); + + // Create filter + typedef clitk::RelativePositionAnalyzerFilter FilterType; + typename FilterType::Pointer filter = FilterType::New(); + + // Set global Options + filter->SetInputSupport(support); + filter->SetInputObject(object); + filter->SetInputTarget(target); + SetOptionsFromArgsInfoToFilter(filter); + + // Go ! + filter->Update(); + + // Write/Save results + // typename ImageType::Pointer output = filter->GetOutput(); + //this->template SetNextOutput(output); + +} +//-------------------------------------------------------------------- + +